Messing around with notification action to start

This commit is contained in:
shamoon
2024-10-23 10:17:19 -07:00
parent cc93bc41df
commit c4d59e0e77
9 changed files with 264 additions and 2 deletions

View File

@@ -322,6 +322,17 @@
</div>
</div>
}
@case (WorkflowActionType.Notification) {
<div class="row">
<div class="col">
<pngx-input-text i18n-title title="Notification subject" formControlName="notification_subject" [error]="error?.actions?.[i]?.notification_subject"></pngx-input-text>
<pngx-input-text i18n-title title="Notification body" formControlName="notification_body" [error]="error?.actions?.[i]?.notification_body"></pngx-input-text>
<pngx-input-text i18n-title title="Notification emails" formControlName="notification_destination_emails" [error]="error?.actions?.[i]?.notification_destination_emails"></pngx-input-text>
<pngx-input-text i18n-title title="Notification url" formControlName="notification_destination_url" [error]="error?.actions?.[i]?.notification_destination_url"></pngx-input-text>
<pngx-input-switch i18n-title title="Notification include document" formControlName="notification_include_document"></pngx-input-switch>
</div>
</div>
}
}
</div>
</ng-template>

View File

@@ -96,6 +96,10 @@ export const WORKFLOW_ACTION_OPTIONS = [
id: WorkflowActionType.Removal,
name: $localize`Removal`,
},
{
id: WorkflowActionType.Notification,
name: $localize`Notification`,
},
]
const TRIGGER_MATCHING_ALGORITHMS = MATCHING_ALGORITHMS.filter(
@@ -402,6 +406,17 @@ export class WorkflowEditDialogComponent
remove_all_custom_fields: new FormControl(
action.remove_all_custom_fields
),
notification_subject: new FormControl(action.notification_subject),
notification_body: new FormControl(action.notification_body),
notification_destination_emails: new FormControl(
action.notification_destination_emails
),
notification_destination_url: new FormControl(
action.notification_destination_url
),
notification_include_document: new FormControl(
action.notification_include_document
),
}),
{ emitEvent }
)
@@ -503,6 +518,11 @@ export class WorkflowEditDialogComponent
remove_all_permissions: false,
remove_custom_fields: [],
remove_all_custom_fields: false,
notification_subject: null,
notification_body: null,
notification_destination_emails: null,
notification_destination_url: null,
notification_include_document: null,
}
this.object.actions.push(action)
this.createActionField(action)

View File

@@ -3,6 +3,7 @@ import { ObjectWithId } from './object-with-id'
export enum WorkflowActionType {
Assignment = 1,
Removal = 2,
Notification = 3,
}
export interface WorkflowAction extends ObjectWithId {
type: WorkflowActionType
@@ -62,4 +63,14 @@ export interface WorkflowAction extends ObjectWithId {
remove_custom_fields?: number[] // [CustomField.id]
remove_all_custom_fields?: boolean
notification_subject?: string
notification_body?: string
notification_destination_emails?: string
notification_destination_url?: string
notification_include_document?: boolean
}