</context-group>
<context-group purpose="location">
<context context-type="sourcefile">src/app/components/manage/workflows/workflows.component.ts</context>
- <context context-type="linenumber">131</context>
+ <context context-type="linenumber">137</context>
</context-group>
</trans-unit>
<trans-unit id="1980187861066369604" datatype="html">
</context-group>
<context-group purpose="location">
<context context-type="sourcefile">src/app/components/manage/workflows/workflows.component.ts</context>
- <context context-type="linenumber">133</context>
+ <context context-type="linenumber">139</context>
</context-group>
</trans-unit>
<trans-unit id="857903183180440990" datatype="html">
<source>Confirm delete workflow</source>
<context-group purpose="location">
<context context-type="sourcefile">src/app/components/manage/workflows/workflows.component.ts</context>
- <context context-type="linenumber">129</context>
+ <context context-type="linenumber">135</context>
</context-group>
</trans-unit>
<trans-unit id="6874008462443189248" datatype="html">
<source>This operation will permanently delete this workflow.</source>
<context-group purpose="location">
<context context-type="sourcefile">src/app/components/manage/workflows/workflows.component.ts</context>
- <context context-type="linenumber">130</context>
+ <context context-type="linenumber">136</context>
</context-group>
</trans-unit>
<trans-unit id="1848226135059921165" datatype="html">
<source>Deleted workflow</source>
<context-group purpose="location">
<context context-type="sourcefile">src/app/components/manage/workflows/workflows.component.ts</context>
- <context context-type="linenumber">139</context>
+ <context context-type="linenumber">145</context>
</context-group>
</trans-unit>
<trans-unit id="3177411222429626224" datatype="html">
<source>Error deleting workflow.</source>
<context-group purpose="location">
<context context-type="sourcefile">src/app/components/manage/workflows/workflows.component.ts</context>
- <context context-type="linenumber">144</context>
+ <context context-type="linenumber">150</context>
</context-group>
</trans-unit>
<trans-unit id="5459159218551862653" datatype="html">
<source>Enabled workflow</source>
<context-group purpose="location">
<context context-type="sourcefile">src/app/components/manage/workflows/workflows.component.ts</context>
- <context context-type="linenumber">155</context>
+ <context context-type="linenumber">161</context>
</context-group>
</trans-unit>
<trans-unit id="6035681056091592756" datatype="html">
<source>Disabled workflow</source>
<context-group purpose="location">
<context context-type="sourcefile">src/app/components/manage/workflows/workflows.component.ts</context>
- <context context-type="linenumber">156</context>
+ <context context-type="linenumber">162</context>
</context-group>
</trans-unit>
<trans-unit id="1376040678213338380" datatype="html">
<source>Error toggling workflow.</source>
<context-group purpose="location">
<context context-type="sourcefile">src/app/components/manage/workflows/workflows.component.ts</context>
- <context context-type="linenumber">162</context>
+ <context context-type="linenumber">168</context>
</context-group>
</trans-unit>
<trans-unit id="2649252321173430744" datatype="html">
expect(editDialog.dialogMode).toEqual(EditDialogMode.CREATE)
})
+ it('should null ids on copy', () => {
+ const workflow = {
+ id: 1,
+ name: 'Workflow 1',
+ order: 1,
+ enabled: true,
+ triggers: [
+ {
+ id: 1,
+ type: WorkflowTriggerType.Consumption,
+ sources: [DocumentSource.ConsumeFolder],
+ filter_filename: '*',
+ },
+ ],
+ actions: [
+ {
+ id: 1,
+ type: WorkflowActionType.Email,
+ email: {
+ id: 1,
+ subject: 'foo',
+ body: 'bar',
+ to: 'baz',
+ include_document: true,
+ },
+ },
+ {
+ id: 2,
+ type: WorkflowActionType.Webhook,
+ webhook: {
+ id: 2,
+ url: 'foo',
+ use_params: false,
+ params: {},
+ body: 'bar',
+ headers: {},
+ include_document: true,
+ },
+ },
+ ],
+ }
+ let modal: NgbModalRef
+ modalService.activeInstances.subscribe((m) => (modal = m[m.length - 1]))
+ component.copyWorkflow(workflow)
+ expect(modal).not.toBeUndefined()
+ const editDialog = modal.componentInstance as WorkflowEditDialogComponent
+ expect(editDialog.object.id).toBeNull()
+ expect(editDialog.object.triggers[0].id).toBeNull()
+ expect(editDialog.object.actions[0].id).toBeNull()
+ })
+
it('should support delete, show notification on error / success', () => {
let modal: NgbModalRef
modalService.activeInstances.subscribe((m) => (modal = m[m.length - 1]))