@unifylib/ui-lib 1.0.3 → 1.1.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/ng-package.json +7 -7
- package/package.json +14 -12
- package/src/lib/base-model/SearchStrConfig.ts +12 -12
- package/src/lib/base-model/api-response.ts +23 -23
- package/src/lib/base-model/audit-log-entry.ts +7 -7
- package/src/lib/base-model/button-action-settings.ts +29 -25
- package/src/lib/base-model/column-def.model.ts +34 -34
- package/src/lib/base-model/do-action-request.ts +11 -11
- package/src/lib/base-model/feature-item.ts +9 -0
- package/src/lib/base-model/field-action.ts +7 -7
- package/src/lib/base-model/field-filter.model.ts +7 -14
- package/src/lib/base-model/field-info.ts +102 -98
- package/src/lib/base-model/field-predicate.model.ts +7 -7
- package/src/lib/base-model/filter-request.ts +27 -27
- package/src/lib/base-model/filter.model.ts +49 -49
- package/src/lib/base-model/get-items-list.ts +24 -24
- package/src/lib/base-model/index.ts +11 -11
- package/src/lib/base-model/items-total.model.ts +12 -0
- package/src/lib/base-model/line-item.model.ts +18 -0
- package/src/lib/base-model/lookupItem.ts +21 -21
- package/src/lib/base-model/null-snackmessage.ts +9 -9
- package/src/lib/base-model/page-info.ts +54 -51
- package/src/lib/base-model/report-request.model.ts +33 -33
- package/src/lib/base-model/response-envelop.model.ts +15 -15
- package/src/lib/base-model/snack-message.model.ts +14 -14
- package/src/lib/base-model/snackmessage-interface.ts +7 -7
- package/src/lib/base-model/table-column.interface.ts +29 -29
- package/src/lib/base-model/table-page-user-action.interface.ts +33 -33
- package/src/lib/base-model/workflow/workflow-steps.model.ts +9 -9
- package/src/lib/base-model/workflow/workflow.model.ts +52 -52
- package/src/lib/components/action-comment/action-comment.component.css +52 -0
- package/src/lib/components/action-comment/action-comment.component.html +47 -0
- package/src/lib/components/{rejection-comment → action-comment}/action-comment.component.spec.ts +23 -23
- package/src/lib/components/{rejection-comment → action-comment}/action-comment.component.ts +102 -86
- package/src/lib/components/action-confirmation/action-confirmation.component.css +46 -34
- package/src/lib/components/action-confirmation/action-confirmation.component.html +32 -18
- package/src/lib/components/action-confirmation/action-confirmation.component.spec.ts +23 -23
- package/src/lib/components/action-confirmation/action-confirmation.component.ts +58 -58
- package/src/lib/components/activity-report-form/activity-report-form.component.html +110 -109
- package/src/lib/components/activity-report-form/activity-report-form.component.scss +69 -0
- package/src/lib/components/activity-report-form/activity-report-form.component.spec.ts +25 -25
- package/src/lib/components/activity-report-form/activity-report-form.component.ts +616 -605
- package/src/lib/components/advanced-filter/field-filter/field-filter.component.html +8 -0
- package/src/lib/components/advanced-filter/field-filter/field-filter.component.scss +0 -0
- package/src/lib/components/advanced-filter/field-filter/field-filter.component.spec.ts +25 -0
- package/src/lib/components/advanced-filter/field-filter/field-filter.component.ts +55 -0
- package/src/lib/components/advanced-filter/filter-builder/filter-builder.component.html +36 -0
- package/src/lib/components/advanced-filter/filter-builder/filter-builder.component.scss +130 -0
- package/src/lib/components/advanced-filter/filter-builder/filter-builder.component.spec.ts +25 -0
- package/src/lib/components/advanced-filter/filter-builder/filter-builder.component.ts +186 -0
- package/src/lib/components/audit-log-details-dialog/audit-log-details-dialog.component.css +51 -51
- package/src/lib/components/audit-log-details-dialog/audit-log-details-dialog.component.html +23 -23
- package/src/lib/components/audit-log-details-dialog/audit-log-details-dialog.component.spec.ts +23 -23
- package/src/lib/components/audit-log-details-dialog/audit-log-details-dialog.component.ts +69 -69
- package/src/lib/components/audit-log-list/audit-log.component.html +26 -23
- package/src/lib/components/audit-log-list/audit-log.component.scss +50 -0
- package/src/lib/components/audit-log-list/audit-log.component.spec.ts +25 -25
- package/src/lib/components/audit-log-list/audit-log.component.ts +114 -116
- package/src/lib/components/auto-complete/auto-complete.component.css +55 -14
- package/src/lib/components/auto-complete/auto-complete.component.html +45 -29
- package/src/lib/components/auto-complete/auto-complete.component.spec.ts +23 -23
- package/src/lib/components/auto-complete/auto-complete.component.ts +331 -330
- package/src/lib/components/base-form/base-form.component.html +59 -58
- package/src/lib/components/base-form/base-form.component.scss +68 -0
- package/src/lib/components/base-form/base-form.component.spec.ts +25 -25
- package/src/lib/components/base-form/base-form.component.ts +323 -305
- package/src/lib/components/base-form-canvas/base-form-canvas.component.css +196 -22
- package/src/lib/components/base-form-canvas/base-form-canvas.component.html +1095 -1006
- package/src/lib/components/base-form-canvas/base-form-canvas.component.spec.ts +23 -23
- package/src/lib/components/base-form-canvas/base-form-canvas.component.ts +680 -573
- package/src/lib/components/base-input-dialog/base-input-dialog.component.css +67 -0
- package/src/lib/components/base-input-dialog/base-input-dialog.component.html +47 -42
- package/src/lib/components/base-input-dialog/base-input-dialog.component.spec.ts +23 -23
- package/src/lib/components/base-input-dialog/base-input-dialog.component.ts +77 -78
- package/src/lib/components/base-table/base-table.component.html +268 -242
- package/src/lib/components/base-table/base-table.component.scss +140 -31
- package/src/lib/components/base-table/base-table.component.spec.ts +25 -25
- package/src/lib/components/base-table/base-table.component.ts +621 -568
- package/src/lib/components/button-actions/button-actions.component.html +27 -28
- package/src/lib/components/button-actions/button-actions.component.scss +101 -6
- package/src/lib/components/button-actions/button-actions.component.spec.ts +23 -23
- package/src/lib/components/button-actions/button-actions.component.ts +70 -72
- package/src/lib/components/editable-base-table/editable-base-table.component.html +337 -372
- package/src/lib/components/editable-base-table/editable-base-table.component.scss +126 -44
- package/src/lib/components/editable-base-table/editable-base-table.component.spec.ts +25 -25
- package/src/lib/components/editable-base-table/editable-base-table.component.ts +579 -570
- package/src/lib/components/equation-builder/equation-builder.component.css +39 -0
- package/src/lib/components/equation-builder/equation-builder.component.html +31 -31
- package/src/lib/components/equation-builder/equation-builder.component.spec.ts +23 -23
- package/src/lib/components/equation-builder/equation-builder.component.ts +119 -121
- package/src/lib/components/item-line-editor/item-line-editor.component.html +102 -0
- package/src/lib/components/item-line-editor/item-line-editor.component.scss +152 -0
- package/src/lib/components/item-line-editor/item-line-editor.component.spec.ts +23 -0
- package/src/lib/components/item-line-editor/item-line-editor.component.ts +306 -0
- package/src/lib/components/multi-auto-complete/multi-auto-complete.component.css +19 -11
- package/src/lib/components/multi-auto-complete/multi-auto-complete.component.html +38 -38
- package/src/lib/components/multi-auto-complete/multi-auto-complete.component.spec.ts +23 -23
- package/src/lib/components/multi-auto-complete/multi-auto-complete.component.ts +315 -317
- package/src/lib/components/paginator/paginator.component.css +65 -25
- package/src/lib/components/paginator/paginator.component.html +30 -34
- package/src/lib/components/paginator/paginator.component.ts +87 -94
- package/src/lib/components/report-details-dialog/report-details-dialog.component.css +17 -17
- package/src/lib/components/report-details-dialog/report-details-dialog.component.html +16 -16
- package/src/lib/components/report-details-dialog/report-details-dialog.component.spec.ts +23 -23
- package/src/lib/components/report-details-dialog/report-details-dialog.component.ts +111 -113
- package/src/lib/components/report-form/report-form.component.html +92 -94
- package/src/lib/components/report-form/report-form.component.scss +51 -0
- package/src/lib/components/report-form/report-form.component.spec.ts +25 -25
- package/src/lib/components/report-form/report-form.component.ts +599 -588
- package/src/lib/components/search-bar/search-bar.component.html +51 -62
- package/src/lib/components/search-bar/search-bar.component.scss +63 -8
- package/src/lib/components/search-bar/search-bar.component.spec.ts +25 -25
- package/src/lib/components/search-bar/search-bar.component.ts +68 -70
- package/src/lib/components/section-form-canvas/section-form-canvas.component.html +43 -0
- package/src/lib/components/section-form-canvas/section-form-canvas.component.scss +81 -0
- package/src/lib/components/section-form-canvas/section-form-canvas.component.spec.ts +23 -0
- package/src/lib/components/section-form-canvas/section-form-canvas.component.ts +67 -0
- package/src/lib/components/shared/action-button/action-button.component.html +12 -0
- package/src/lib/components/shared/action-button/action-button.component.scss +45 -0
- package/src/lib/components/shared/action-button/action-button.component.ts +51 -0
- package/src/lib/components/shared/action-card/action-card.component.html +78 -0
- package/src/lib/components/shared/action-card/action-card.component.scss +238 -0
- package/src/lib/components/shared/action-card/action-card.component.ts +56 -0
- package/src/lib/components/shared/attachment-uploader/attachment-uploader.component.css +135 -54
- package/src/lib/components/shared/attachment-uploader/attachment-uploader.component.html +36 -22
- package/src/lib/components/shared/attachment-uploader/attachment-uploader.component.spec.ts +23 -23
- package/src/lib/components/shared/attachment-uploader/attachment-uploader.component.ts +71 -45
- package/src/lib/components/shared-list/shared-list.component.html +17 -17
- package/src/lib/components/shared-list/shared-list.component.spec.ts +23 -23
- package/src/lib/components/shared-list/shared-list.component.ts +53 -53
- package/src/lib/components/snackbar-static/snackbar-static.component.html +20 -0
- package/src/lib/components/snackbar-static/snackbar-static.component.scss +135 -0
- package/src/lib/components/snackbar-static/snackbar-static.component.ts +26 -0
- package/src/lib/components/title-bar/title-bar.component.html +35 -31
- package/src/lib/components/title-bar/title-bar.component.scss +126 -23
- package/src/lib/components/title-bar/title-bar.component.spec.ts +23 -23
- package/src/lib/components/title-bar/title-bar.component.ts +126 -119
- package/src/lib/services/backend-service.ts +287 -286
- package/src/lib/services/index.ts +3 -3
- package/src/lib/services/top-panel.ts +17 -17
- package/src/lib/services/trigger-form.service.ts +11 -11
- package/src/lib/share-module/shared-module.ts +10 -10
- package/src/lib/utils/base-utils.ts +102 -102
- package/src/lib/validators/date-range-validator.ts +31 -31
- package/src/lib/validators/index.ts +3 -3
- package/src/lib/validators/match-list.validator.ts +10 -10
- package/src/lib/validators/multi-email-validator.ts +15 -15
- package/src/public-api.ts +29 -21
- package/tsconfig.lib.json +15 -15
- package/tsconfig.lib.prod.json +11 -11
- package/tsconfig.spec.json +15 -15
- package/src/lib/components/rejection-comment/action-comment.component.css +0 -33
- package/src/lib/components/rejection-comment/action-comment.component.html +0 -46
- package/src/lib/styles/invoiceq-theme.scss +0 -252
- package/src/lib/styles/styles.scss +0 -1723
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
|
|
2
|
-
export class WorkflowStep {
|
|
3
|
-
stepId?: number;
|
|
4
|
-
stepName: string='';
|
|
5
|
-
stepNameAr: string='';
|
|
6
|
-
isObsoleted: boolean=false;
|
|
7
|
-
description: string='';
|
|
8
|
-
|
|
9
|
-
}
|
|
1
|
+
|
|
2
|
+
export class WorkflowStep {
|
|
3
|
+
stepId?: number;
|
|
4
|
+
stepName: string='';
|
|
5
|
+
stepNameAr: string='';
|
|
6
|
+
isObsoleted: boolean=false;
|
|
7
|
+
description: string='';
|
|
8
|
+
|
|
9
|
+
}
|
|
@@ -1,52 +1,52 @@
|
|
|
1
|
-
import {WorkflowStep} from "./workflow-steps.model";
|
|
2
|
-
|
|
3
|
-
export class Workflow {
|
|
4
|
-
id: number;
|
|
5
|
-
corporateWorkflowId: number;
|
|
6
|
-
corporateId : number;
|
|
7
|
-
workflowProcessId: number;
|
|
8
|
-
workflowSteps : WorkflowStep[];
|
|
9
|
-
rejectionStrategy: 'TERMINATE' | 'STEP_BACK' | 'CREATE_STEP';
|
|
10
|
-
processName: string;
|
|
11
|
-
|
|
12
|
-
constructor(workflow: Workflow) {
|
|
13
|
-
this.id= workflow.id;
|
|
14
|
-
this.corporateWorkflowId= workflow.corporateWorkflowId;
|
|
15
|
-
this.corporateId = workflow.corporateId;
|
|
16
|
-
this.workflowProcessId = workflow.workflowProcessId;
|
|
17
|
-
this.workflowSteps = workflow.workflowSteps === undefined ? [] : workflow.workflowSteps;
|
|
18
|
-
this.processName = PROCESS_NAMES_MAP[this.workflowProcessId];
|
|
19
|
-
this.rejectionStrategy = workflow.rejectionStrategy;
|
|
20
|
-
}
|
|
21
|
-
}
|
|
22
|
-
export const PROCESS_NAMES_MAP: Record<number, string> = {
|
|
23
|
-
1: 'Outward Invoices',
|
|
24
|
-
2: 'Inward Invoices',
|
|
25
|
-
5: 'Customers Management',
|
|
26
|
-
6: 'Vendors Management',
|
|
27
|
-
8: 'Payment',
|
|
28
|
-
13: 'Users Management',
|
|
29
|
-
14: 'Groups Management',
|
|
30
|
-
19: 'Departments Management',
|
|
31
|
-
22: 'Credit Notes',
|
|
32
|
-
23: 'Debit Notes',
|
|
33
|
-
30: 'Store Management',
|
|
34
|
-
31: 'Branch Management ',
|
|
35
|
-
32: 'Division Management',
|
|
36
|
-
33: 'Product Management',
|
|
37
|
-
34: 'Import Stock',
|
|
38
|
-
35: 'Export Stock',
|
|
39
|
-
36: 'Stock Damage',
|
|
40
|
-
51: 'Internal Invoices',
|
|
41
|
-
60: 'Purchase Request',
|
|
42
|
-
61: 'Purchase Order',
|
|
43
|
-
62: 'Request for Quotation',
|
|
44
|
-
63: 'Proposal Evaluation',
|
|
45
|
-
64: 'Proposal By Vendor'
|
|
46
|
-
};
|
|
47
|
-
|
|
48
|
-
export const SEQ_PROCESS_NAMES_MAP: Record<number, string> = {
|
|
49
|
-
1: 'Outward Invoices / Invoice Number',
|
|
50
|
-
100: 'Outward Invoices / ePayment Number',
|
|
51
|
-
2: 'Inward Invoices'
|
|
52
|
-
};
|
|
1
|
+
import {WorkflowStep} from "./workflow-steps.model";
|
|
2
|
+
|
|
3
|
+
export class Workflow {
|
|
4
|
+
id: number;
|
|
5
|
+
corporateWorkflowId: number;
|
|
6
|
+
corporateId : number;
|
|
7
|
+
workflowProcessId: number;
|
|
8
|
+
workflowSteps : WorkflowStep[];
|
|
9
|
+
rejectionStrategy: 'TERMINATE' | 'STEP_BACK' | 'CREATE_STEP';
|
|
10
|
+
processName: string;
|
|
11
|
+
|
|
12
|
+
constructor(workflow: Workflow) {
|
|
13
|
+
this.id= workflow.id;
|
|
14
|
+
this.corporateWorkflowId= workflow.corporateWorkflowId;
|
|
15
|
+
this.corporateId = workflow.corporateId;
|
|
16
|
+
this.workflowProcessId = workflow.workflowProcessId;
|
|
17
|
+
this.workflowSteps = workflow.workflowSteps === undefined ? [] : workflow.workflowSteps;
|
|
18
|
+
this.processName = PROCESS_NAMES_MAP[this.workflowProcessId];
|
|
19
|
+
this.rejectionStrategy = workflow.rejectionStrategy;
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
export const PROCESS_NAMES_MAP: Record<number, string> = {
|
|
23
|
+
1: 'Outward Invoices',
|
|
24
|
+
2: 'Inward Invoices',
|
|
25
|
+
5: 'Customers Management',
|
|
26
|
+
6: 'Vendors Management',
|
|
27
|
+
8: 'Payment',
|
|
28
|
+
13: 'Users Management',
|
|
29
|
+
14: 'Groups Management',
|
|
30
|
+
19: 'Departments Management',
|
|
31
|
+
22: 'Credit Notes',
|
|
32
|
+
23: 'Debit Notes',
|
|
33
|
+
30: 'Store Management',
|
|
34
|
+
31: 'Branch Management ',
|
|
35
|
+
32: 'Division Management',
|
|
36
|
+
33: 'Product Management',
|
|
37
|
+
34: 'Import Stock',
|
|
38
|
+
35: 'Export Stock',
|
|
39
|
+
36: 'Stock Damage',
|
|
40
|
+
51: 'Internal Invoices',
|
|
41
|
+
60: 'Purchase Request',
|
|
42
|
+
61: 'Purchase Order',
|
|
43
|
+
62: 'Request for Quotation',
|
|
44
|
+
63: 'Proposal Evaluation',
|
|
45
|
+
64: 'Proposal By Vendor'
|
|
46
|
+
};
|
|
47
|
+
|
|
48
|
+
export const SEQ_PROCESS_NAMES_MAP: Record<number, string> = {
|
|
49
|
+
1: 'Outward Invoices / Invoice Number',
|
|
50
|
+
100: 'Outward Invoices / ePayment Number',
|
|
51
|
+
2: 'Inward Invoices'
|
|
52
|
+
};
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
|
|
2
|
+
.dialog-title {
|
|
3
|
+
font-size: 20px;
|
|
4
|
+
font-weight: 600;
|
|
5
|
+
padding: 0 16px;
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
.dialog-subtitle {
|
|
9
|
+
color: #666;
|
|
10
|
+
padding: 0 20px;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
.textarea-label {
|
|
14
|
+
font-weight: 600;
|
|
15
|
+
padding: 5px 20px;
|
|
16
|
+
margin: 0;
|
|
17
|
+
color: black;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
.info-text {
|
|
21
|
+
color: #888;
|
|
22
|
+
font-family: Lusail, sans-serif;
|
|
23
|
+
font-size: 16px;
|
|
24
|
+
font-style: normal;
|
|
25
|
+
font-weight: 400;
|
|
26
|
+
line-height: 120%;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
.info-box {
|
|
30
|
+
display: flex;
|
|
31
|
+
font-size: 12px;
|
|
32
|
+
|
|
33
|
+
mat-icon {
|
|
34
|
+
font-size: 18px;
|
|
35
|
+
color: var(--primary-color-3nd);
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
.footer-actions {
|
|
40
|
+
margin-top: 0px;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
.cancel-btn {
|
|
44
|
+
width: 121px !important;
|
|
45
|
+
}
|
|
46
|
+
.warn-btn {
|
|
47
|
+
width: 171px !important;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
.content-section {
|
|
51
|
+
padding: 0 20px;
|
|
52
|
+
}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
<div class="dialog-container" [dir]="currentDirection">
|
|
2
|
+
|
|
3
|
+
<h2 mat-dialog-title class="dialog-title" >
|
|
4
|
+
{{ titleKey | translate}} {{itemName}}
|
|
5
|
+
</h2>
|
|
6
|
+
|
|
7
|
+
<p class="dialog-subtitle">
|
|
8
|
+
{{ subtitleKey | translate }}
|
|
9
|
+
</p>
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
<p class="textarea-label">
|
|
13
|
+
{{ reasonLabelKey | translate }}
|
|
14
|
+
</p>
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
<mat-dialog-content class="content-section">
|
|
18
|
+
<mat-form-field appearance="outline" class="w-100">
|
|
19
|
+
<textarea
|
|
20
|
+
matInput
|
|
21
|
+
[(ngModel)]="comment"
|
|
22
|
+
placeholder="{{ placeholderKey | translate }}"
|
|
23
|
+
cdkTextareaAutosize
|
|
24
|
+
cdkAutosizeMinRows="4"
|
|
25
|
+
cdkAutosizeMaxRows="5"
|
|
26
|
+
></textarea>
|
|
27
|
+
</mat-form-field>
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
<div class="info-box">
|
|
31
|
+
<mat-icon>info</mat-icon>
|
|
32
|
+
<span class="info-text">
|
|
33
|
+
{{ warningKey | translate }}
|
|
34
|
+
</span>
|
|
35
|
+
</div>
|
|
36
|
+
</mat-dialog-content>
|
|
37
|
+
|
|
38
|
+
<mat-dialog-actions align="end" class="footer-actions">
|
|
39
|
+
<button mat-stroked-button class="btn-none-background-primary cancel-btn" (click)="cancel()">
|
|
40
|
+
{{ cancelKey | translate }}
|
|
41
|
+
</button>
|
|
42
|
+
|
|
43
|
+
<button mat-flat-button class="btn-background-primary warn-btn" (click)="commentAndClose()" [disabled]="!comment">
|
|
44
|
+
{{ actionKey | translate }}
|
|
45
|
+
</button>
|
|
46
|
+
</mat-dialog-actions>
|
|
47
|
+
</div>
|
package/src/lib/components/{rejection-comment → action-comment}/action-comment.component.spec.ts
RENAMED
|
@@ -1,23 +1,23 @@
|
|
|
1
|
-
import { ComponentFixture, TestBed } from '@angular/core/testing';
|
|
2
|
-
|
|
3
|
-
import { ActionCommentComponent } from './action-comment.component';
|
|
4
|
-
|
|
5
|
-
describe('ActionCommentComponent', () => {
|
|
6
|
-
let component: ActionCommentComponent;
|
|
7
|
-
let fixture: ComponentFixture<ActionCommentComponent>;
|
|
8
|
-
|
|
9
|
-
beforeEach(async () => {
|
|
10
|
-
await TestBed.configureTestingModule({
|
|
11
|
-
imports: [ActionCommentComponent]
|
|
12
|
-
})
|
|
13
|
-
.compileComponents();
|
|
14
|
-
|
|
15
|
-
fixture = TestBed.createComponent(ActionCommentComponent);
|
|
16
|
-
component = fixture.componentInstance;
|
|
17
|
-
fixture.detectChanges();
|
|
18
|
-
});
|
|
19
|
-
|
|
20
|
-
it('should create', () => {
|
|
21
|
-
expect(component).toBeTruthy();
|
|
22
|
-
});
|
|
23
|
-
});
|
|
1
|
+
import { ComponentFixture, TestBed } from '@angular/core/testing';
|
|
2
|
+
|
|
3
|
+
import { ActionCommentComponent } from './action-comment.component';
|
|
4
|
+
|
|
5
|
+
describe('ActionCommentComponent', () => {
|
|
6
|
+
let component: ActionCommentComponent;
|
|
7
|
+
let fixture: ComponentFixture<ActionCommentComponent>;
|
|
8
|
+
|
|
9
|
+
beforeEach(async () => {
|
|
10
|
+
await TestBed.configureTestingModule({
|
|
11
|
+
imports: [ActionCommentComponent]
|
|
12
|
+
})
|
|
13
|
+
.compileComponents();
|
|
14
|
+
|
|
15
|
+
fixture = TestBed.createComponent(ActionCommentComponent);
|
|
16
|
+
component = fixture.componentInstance;
|
|
17
|
+
fixture.detectChanges();
|
|
18
|
+
});
|
|
19
|
+
|
|
20
|
+
it('should create', () => {
|
|
21
|
+
expect(component).toBeTruthy();
|
|
22
|
+
});
|
|
23
|
+
});
|
|
@@ -1,86 +1,102 @@
|
|
|
1
|
-
import {Component, HostListener, Inject, OnInit} from '@angular/core';
|
|
2
|
-
import {
|
|
3
|
-
MAT_DIALOG_DATA,
|
|
4
|
-
MatDialogActions,
|
|
5
|
-
MatDialogContent,
|
|
6
|
-
MatDialogRef,
|
|
7
|
-
MatDialogTitle
|
|
8
|
-
} from "@angular/material/dialog";
|
|
9
|
-
import {MatFormField} from "@angular/material/form-field";
|
|
10
|
-
import {FormsModule} from "@angular/forms";
|
|
11
|
-
import {CdkTextareaAutosize} from "@angular/cdk/text-field";
|
|
12
|
-
import {TranslateModule} from "@ngx-translate/core";
|
|
13
|
-
import {
|
|
14
|
-
import {
|
|
15
|
-
import {
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
this.
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
this.
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
this.
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
this.
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
1
|
+
import {Component, HostListener, Inject, Input, OnInit} from '@angular/core';
|
|
2
|
+
import {
|
|
3
|
+
MAT_DIALOG_DATA,
|
|
4
|
+
MatDialogActions,
|
|
5
|
+
MatDialogContent,
|
|
6
|
+
MatDialogRef,
|
|
7
|
+
MatDialogTitle
|
|
8
|
+
} from "@angular/material/dialog";
|
|
9
|
+
import {MatFormField} from "@angular/material/form-field";
|
|
10
|
+
import {FormsModule} from "@angular/forms";
|
|
11
|
+
import {CdkTextareaAutosize} from "@angular/cdk/text-field";
|
|
12
|
+
import {TranslateModule} from "@ngx-translate/core";
|
|
13
|
+
import {MatButton} from "@angular/material/button";
|
|
14
|
+
import {MatInput} from "@angular/material/input";
|
|
15
|
+
import {MatIcon} from "@angular/material/icon";
|
|
16
|
+
|
|
17
|
+
@Component({
|
|
18
|
+
selector: 'app-action-comment',
|
|
19
|
+
standalone: true,
|
|
20
|
+
imports: [
|
|
21
|
+
MatDialogTitle,
|
|
22
|
+
MatFormField,
|
|
23
|
+
MatDialogContent,
|
|
24
|
+
FormsModule,
|
|
25
|
+
CdkTextareaAutosize,
|
|
26
|
+
TranslateModule,
|
|
27
|
+
MatDialogActions,
|
|
28
|
+
MatButton,
|
|
29
|
+
MatInput,
|
|
30
|
+
MatIcon
|
|
31
|
+
],
|
|
32
|
+
templateUrl: './action-comment.component.html',
|
|
33
|
+
styleUrl: './action-comment.component.css'
|
|
34
|
+
})
|
|
35
|
+
export class ActionCommentComponent implements OnInit {
|
|
36
|
+
itemName: string = '';
|
|
37
|
+
titleKey: string = '';
|
|
38
|
+
subtitleKey: string = '';
|
|
39
|
+
reasonLabelKey: string = '';
|
|
40
|
+
placeholderKey: string = '';
|
|
41
|
+
warningKey: string = '';
|
|
42
|
+
cancelKey: string = '';
|
|
43
|
+
actionKey: string = '';
|
|
44
|
+
currentDirection: 'ltr' | 'rtl' = 'ltr';
|
|
45
|
+
|
|
46
|
+
actionLabel : string =''
|
|
47
|
+
isTermination : boolean=false;
|
|
48
|
+
comment: string = '';
|
|
49
|
+
external: boolean = false;
|
|
50
|
+
signingRequired: boolean = false;
|
|
51
|
+
tokenReference: string = "";
|
|
52
|
+
otp: string = "";
|
|
53
|
+
isSubmitted: boolean = false;
|
|
54
|
+
warningMsg = false;
|
|
55
|
+
|
|
56
|
+
constructor(public dialogRef: MatDialogRef<ActionCommentComponent>,
|
|
57
|
+
@Inject(MAT_DIALOG_DATA) public data: any) {
|
|
58
|
+
dialogRef.disableClose = true;
|
|
59
|
+
}
|
|
60
|
+
@HostListener('window:keyup.esc') onKeyUp() {
|
|
61
|
+
this.dialogRef.close();
|
|
62
|
+
}
|
|
63
|
+
ngOnInit(): void {
|
|
64
|
+
this.actionLabel = this.data.label;
|
|
65
|
+
this.isTermination = this.data.isTermination ;
|
|
66
|
+
this.signingRequired = this.data.signingRequired;
|
|
67
|
+
this.tokenReference = this.data.tokenReference;
|
|
68
|
+
this.warningMsg = this.data.warningMsg || false;
|
|
69
|
+
|
|
70
|
+
this.itemName = this.data.deviceName;
|
|
71
|
+
this.titleKey = this.data.titleKey;
|
|
72
|
+
this.subtitleKey = this.data.subtitleKey;
|
|
73
|
+
this.reasonLabelKey = this.data.reasonLabelKey;
|
|
74
|
+
this.placeholderKey = this.data.placeholderKey;
|
|
75
|
+
this.warningKey = this.data.warningKey;
|
|
76
|
+
this.cancelKey = this.data.cancelKey;
|
|
77
|
+
this.actionKey = this.data.actionKey;
|
|
78
|
+
this.currentDirection = this.data.direction;
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
|
|
82
|
+
commentAndClose() {
|
|
83
|
+
this.isSubmitted = true;
|
|
84
|
+
if (this.signingRequired && !this.otp) return false;
|
|
85
|
+
let obj:{[key: string]:any} = {
|
|
86
|
+
comment: this.comment,
|
|
87
|
+
shareExternal : this.external
|
|
88
|
+
};
|
|
89
|
+
//
|
|
90
|
+
if(this.signingRequired) obj["token"] = this.otp;
|
|
91
|
+
if(this.signingRequired) obj["tokenReference"] = this.tokenReference;
|
|
92
|
+
//
|
|
93
|
+
this.dialogRef.close(obj);
|
|
94
|
+
|
|
95
|
+
return "";
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
cancel() {
|
|
99
|
+
this.dialogRef.close();
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
}
|
|
@@ -1,34 +1,46 @@
|
|
|
1
|
-
.
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
.
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
.
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
1
|
+
.confirm-dialog {
|
|
2
|
+
padding: 32px;
|
|
3
|
+
min-width: 500px;
|
|
4
|
+
box-sizing: border-box;
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
.header-row {
|
|
8
|
+
display: flex;
|
|
9
|
+
justify-content: space-between;
|
|
10
|
+
align-items: center;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
.title {
|
|
14
|
+
margin: 0;
|
|
15
|
+
font-size: 20px;
|
|
16
|
+
font-weight: 700;
|
|
17
|
+
color: #222;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
.close-btn mat-icon {
|
|
21
|
+
font-size: 24px;
|
|
22
|
+
color: #333;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
.message {
|
|
26
|
+
margin-top: 20px;
|
|
27
|
+
font-size: 16px;
|
|
28
|
+
color: #333;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
.actions {
|
|
32
|
+
display: flex;
|
|
33
|
+
justify-content: flex-end;
|
|
34
|
+
gap: 16px;
|
|
35
|
+
margin-top: 40px;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
.btn-cancel{
|
|
39
|
+
width: 121px !important;
|
|
40
|
+
margin: 0 !important;
|
|
41
|
+
}
|
|
42
|
+
.btn-confirm{
|
|
43
|
+
width: 171px !important;
|
|
44
|
+
margin: 0 !important;
|
|
45
|
+
}
|
|
46
|
+
|
|
@@ -1,18 +1,32 @@
|
|
|
1
|
-
<
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
1
|
+
<div class="confirm-dialog" [dir]="currentDirection">
|
|
2
|
+
|
|
3
|
+
<div class="header-row">
|
|
4
|
+
<h2 class="title">{{ titleMsg | translate }}</h2>
|
|
5
|
+
<button mat-icon-button class="close-btn" (click)="cancel()">
|
|
6
|
+
<mat-icon>close</mat-icon>
|
|
7
|
+
</button>
|
|
8
|
+
</div>
|
|
9
|
+
|
|
10
|
+
<p class="message">
|
|
11
|
+
{{ subMsg | translate }}
|
|
12
|
+
</p>
|
|
13
|
+
|
|
14
|
+
<div class="actions">
|
|
15
|
+
<button
|
|
16
|
+
mat-stroked-button
|
|
17
|
+
class="btn-none-background-primary btn-cancel"
|
|
18
|
+
(click)="cancel()"
|
|
19
|
+
id="rejectActionLabel">
|
|
20
|
+
{{ rejectActionLabel | translate }}
|
|
21
|
+
</button>
|
|
22
|
+
|
|
23
|
+
<button
|
|
24
|
+
mat-flat-button
|
|
25
|
+
class="btn-background-primary btn-confirm"
|
|
26
|
+
(click)="commentAndClose()"
|
|
27
|
+
id="acceptActionLabel">
|
|
28
|
+
{{ acceptActionLabel | translate }}
|
|
29
|
+
</button>
|
|
30
|
+
</div>
|
|
31
|
+
|
|
32
|
+
</div>
|
|
@@ -1,23 +1,23 @@
|
|
|
1
|
-
import { ComponentFixture, TestBed } from '@angular/core/testing';
|
|
2
|
-
|
|
3
|
-
import { ActionConfirmationComponent } from './action-confirmation.component';
|
|
4
|
-
|
|
5
|
-
describe('ActionCommentComponent', () => {
|
|
6
|
-
let component: ActionConfirmationComponent;
|
|
7
|
-
let fixture: ComponentFixture<ActionConfirmationComponent>;
|
|
8
|
-
|
|
9
|
-
beforeEach(async () => {
|
|
10
|
-
await TestBed.configureTestingModule({
|
|
11
|
-
imports: [ActionConfirmationComponent]
|
|
12
|
-
})
|
|
13
|
-
.compileComponents();
|
|
14
|
-
|
|
15
|
-
fixture = TestBed.createComponent(ActionConfirmationComponent);
|
|
16
|
-
component = fixture.componentInstance;
|
|
17
|
-
fixture.detectChanges();
|
|
18
|
-
});
|
|
19
|
-
|
|
20
|
-
it('should create', () => {
|
|
21
|
-
expect(component).toBeTruthy();
|
|
22
|
-
});
|
|
23
|
-
});
|
|
1
|
+
import { ComponentFixture, TestBed } from '@angular/core/testing';
|
|
2
|
+
|
|
3
|
+
import { ActionConfirmationComponent } from './action-confirmation.component';
|
|
4
|
+
|
|
5
|
+
describe('ActionCommentComponent', () => {
|
|
6
|
+
let component: ActionConfirmationComponent;
|
|
7
|
+
let fixture: ComponentFixture<ActionConfirmationComponent>;
|
|
8
|
+
|
|
9
|
+
beforeEach(async () => {
|
|
10
|
+
await TestBed.configureTestingModule({
|
|
11
|
+
imports: [ActionConfirmationComponent]
|
|
12
|
+
})
|
|
13
|
+
.compileComponents();
|
|
14
|
+
|
|
15
|
+
fixture = TestBed.createComponent(ActionConfirmationComponent);
|
|
16
|
+
component = fixture.componentInstance;
|
|
17
|
+
fixture.detectChanges();
|
|
18
|
+
});
|
|
19
|
+
|
|
20
|
+
it('should create', () => {
|
|
21
|
+
expect(component).toBeTruthy();
|
|
22
|
+
});
|
|
23
|
+
});
|