A community-supported supercharged document management system: scan, index and archive all your documents
Python aiangulararchivingdjangodmsdocument-managementdocument-management-systemllmmachine-learningocroptical-character-recognitionpdf
Fix: prevent workflow passwords field type error (#13552)
shamoon47727de11673
diff --git a/src-ui/src/app/components/common/edit-dialog/workflow-edit-dialog/workflow-edit-dialog.component.spec.ts b/src-ui/src/app/components/common/edit-dialog/workflow-edit-dialog/workflow-edit-dialog.component.spec.tsindex cddfc32ee..bc7be5fad 100644--- a/src-ui/src/app/components/common/edit-dialog/workflow-edit-dialog/workflow-edit-dialog.component.spec.ts+++ b/src-ui/src/app/components/common/edit-dialog/workflow-edit-dialog/workflow-edit-dialog.component.spec.ts@@ -1019,4 +1019,28 @@ describe('WorkflowEditDialogComponent', () => {'pass3',])})++ it('should parse passwords again when retrying a failed save', () => {+ component.object = {+ name: 'Workflow with blank Passwords',+ id: 1,+ order: null,+ enabled: true,+ triggers: [],+ actions: [+ {+ id: 1,+ type: WorkflowActionType.PasswordRemoval,+ passwords: [],+ },+ ],+ }+ component.ngOnInit()++ component.save()+ component.objectForm.get('order').setValue(1)++ expect(() => component.save()).not.toThrow()+ expect(component.objectForm.get('actions').value[0].passwords).toEqual([])+ })})diff --git a/src-ui/src/app/components/common/edit-dialog/workflow-edit-dialog/workflow-edit-dialog.component.ts b/src-ui/src/app/components/common/edit-dialog/workflow-edit-dialog/workflow-edit-dialog.component.tsindex ccc07bcc5..8e8dd6ef7 100644--- a/src-ui/src/app/components/common/edit-dialog/workflow-edit-dialog/workflow-edit-dialog.component.ts+++ b/src-ui/src/app/components/common/edit-dialog/workflow-edit-dialog/workflow-edit-dialog.component.ts@@ -1207,9 +1207,8 @@ export class WorkflowEditDialogComponentreturn passwords.join('\n')}- private parsePasswords(value: string = ''): string[] {- return value- .split(/[\n,]+/)+ private parsePasswords(value: string | string[] = ''): string[] {+ return (Array.isArray(value) ? value : value.split(/[\n,]+/)).map((entry) => entry.trim()).filter((entry) => entry.length > 0)}