Browse Source

Fix for new step.

pull/380/head
Sebastian Stehle 7 years ago
parent
commit
95c3716e3d
  1. 13
      src/Squidex/app/features/settings/pages/workflows/workflows-page.component.ts

13
src/Squidex/app/features/settings/pages/workflows/workflows-page.component.ts

@ -25,8 +25,6 @@ import {
templateUrl: './workflows-page.component.html'
})
export class WorkflowsPageComponent implements OnInit {
private maxSteps = 1;
public workflow: WorkflowDto;
constructor(
@ -57,9 +55,16 @@ export class WorkflowsPageComponent implements OnInit {
}
public addStep() {
this.workflow = this.workflow.setStep(`Step${this.maxSteps}`, { color: MathHelper.randomColor() });
let index = this.workflow.steps.length;
for (let i = index; ;i++) {
const name = `Step${i}`;
this.maxSteps++;
if (!this.workflow.getStep(name)) {
this.workflow = this.workflow.setStep(name, { color: MathHelper.randomColor() });
return;
}
}
}
public setInitial(step: WorkflowStep) {

Loading…
Cancel
Save