Skip to content

Commit

Permalink
fix: remove auto create blueprint when creating project
Browse files Browse the repository at this point in the history
  • Loading branch information
mintsweet committed May 13, 2024
1 parent d7807f9 commit e26b55d
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 27 deletions.
2 changes: 1 addition & 1 deletion config-ui/src/api/blueprint/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ export const create = (data: any) =>

export const remove = (id: ID) => request(`/blueprints/${id}`, { method: 'delete' });

export const update = (id: ID, data: IBlueprint) => request(`/blueprints/${id}`, { method: 'patch', data });
export const update = (id: ID, data: Partial<IBlueprint>) => request(`/blueprints/${id}`, { method: 'patch', data });

export const pipelines = (id: ID) => request(`/blueprints/${id}/pipelines`);

Expand Down
15 changes: 4 additions & 11 deletions config-ui/src/routes/onboard/step-3.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ export const Step3 = () => {
const [success] = await operator(
async () => {
// 1. create a new project
await API.project.create({
const { blueprint } = await API.project.create({
name: projectName,
description: '',
metrics: [
Expand All @@ -69,18 +69,11 @@ export const Step3 = () => {
],
});

// 2. add a data scope to the connection
// 2. add data scopes to the connection
await API.scope.batch(plugin, connectionId, { data: scopes.map((it) => it.data) });

// 3. create a new blueprint
const blueprint = await API.blueprint.create({
name: `${projectName}-Blueprint`,
projectName,
mode: IBPMode.NORMAL,
enable: true,
cronConfig: presets[0],
isManual: false,
skipOnFail: true,
// 3. add data scopes to the blueprint
await API.blueprint.update(blueprint.id, {
timeAfter: formatTime(dayjs().subtract(14, 'day').startOf('day').toDate(), 'YYYY-MM-DD[T]HH:mm:ssZ'),
connections: [
{
Expand Down
18 changes: 3 additions & 15 deletions config-ui/src/routes/project/home/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -85,8 +85,8 @@ export const ProjectHomePage = () => {
}

const [success] = await operator(
async () => {
await API.project.create({
async () =>
API.project.create({
name,
description: '',
metrics: [
Expand All @@ -96,19 +96,7 @@ export const ProjectHomePage = () => {
enable: enableDora,
},
],
});
return API.blueprint.create({
name: `${name}-Blueprint`,
projectName: name,
mode: IBPMode.NORMAL,
enable: true,
cronConfig: presets[0],
isManual: false,
skipOnFail: true,
timeAfter: formatTime(dayjs().subtract(6, 'month').startOf('day').toDate(), 'YYYY-MM-DD[T]HH:mm:ssZ'),
connections: [],
});
},
}),
{
setOperating: setSaving,
},
Expand Down

0 comments on commit e26b55d

Please sign in to comment.