Commit 5acafeab by Ali Arshad

CR fix for messages duplicate code.

Fixed sorting issue.
parent 30b6d65e
......@@ -164,12 +164,14 @@ export class EditWorkflowTemplateComponent extends BaseComponent implements OnIn
}
reOrderStages(): void {
this.workflow.WorkFlowStages = this.utilsService.sort(this.workflow.WorkFlowStages, ['SortOrder'], [-1]);
this.workflow.WorkFlowStages = this.utilsService.sort(this.workflow.WorkFlowStages, ['SortOrder'], [1]);
this.filterStages();
}
reOrderSteps(): void {
this.workflow.WorkFlowStages = this.utilsService.sort(this.workflow.WorkFlowStages, ['SortOrder'], [-1]);
this.workflow.WorkFlowStages.forEach(stage => {
stage.Steps = this.utilsService.sort(stage.Steps, ['SortOrder'], [1]);
});
}
isGeneric(stage: WorkflowStageModel): boolean {
......@@ -509,7 +511,6 @@ export class EditWorkflowTemplateComponent extends BaseComponent implements OnIn
this.utilsService.addObjsToJSONByObjectID(this.updatedObjs, stage.WorkFlowMessages);
this.utilsService.addObjsToJSONByObjectID(this.updatedObjs, stage.Steps);
});
this.reOrderStages();
......@@ -531,7 +532,7 @@ export class EditWorkflowTemplateComponent extends BaseComponent implements OnIn
saveWorkflowTemplate(saveCopy = false): void {
this.utilsService.clearErrorMessages();
const service = `svc/${saveCopy ? SERVICES.SAVE_MESSAGE_AS_COPY : SERVICES.SAVE}`;
const service = `svc/${saveCopy ? SERVICES.SAVE_WORKFLOW_AS_COPY : SERVICES.SAVE}`;
if (this.form.invalid) {
this.utilsService.showAllErrorMessages();
......
......@@ -14,6 +14,7 @@ export const SERVICES = {
MESSAGE_TEMPLATES: 'MessageTemplates',
WORKFLOW_TEMPLATES: 'WorkFlowTemplates',
SAVE_MESSAGE_AS_COPY: 'SaveMessageAsCopy',
SAVE_WORKFLOW_AS_COPY: 'SaveWorkflowAsCopy',
SAVE: 'Save'
};
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment