@unifylib/ui-lib 1.0.3 → 1.1.4
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/esm2022/iq-ui-lib.mjs +5 -0
- package/esm2022/lib/base-model/SearchStrConfig.mjs +11 -0
- package/esm2022/lib/base-model/api-response.mjs +2 -0
- package/esm2022/lib/base-model/audit-log-entry.mjs +3 -0
- package/esm2022/lib/base-model/button-action-settings.mjs +16 -0
- package/esm2022/lib/base-model/column-def.model.mjs +28 -0
- package/esm2022/lib/base-model/do-action-request.mjs +8 -0
- package/esm2022/lib/base-model/field-action.mjs +6 -0
- package/esm2022/lib/base-model/field-filter.model.mjs +3 -0
- package/esm2022/lib/base-model/field-info.mjs +57 -0
- package/esm2022/lib/base-model/field-predicate.model.mjs +10 -0
- package/esm2022/lib/base-model/filter-request.mjs +13 -0
- package/esm2022/lib/base-model/filter.model.mjs +25 -0
- package/esm2022/lib/base-model/get-items-list.mjs +10 -0
- package/esm2022/lib/base-model/index.mjs +12 -0
- package/esm2022/lib/base-model/items-total.model.mjs +8 -0
- package/esm2022/lib/base-model/line-item.model.mjs +11 -0
- package/esm2022/lib/base-model/lookupItem.mjs +16 -0
- package/esm2022/lib/base-model/page-info.mjs +17 -0
- package/esm2022/lib/base-model/report-request.model.mjs +17 -0
- package/esm2022/lib/base-model/response-envelop.model.mjs +10 -0
- package/esm2022/lib/base-model/snack-message.model.mjs +11 -0
- package/esm2022/lib/base-model/table-column.interface.mjs +2 -0
- package/esm2022/lib/base-model/table-page-user-action.interface.mjs +21 -0
- package/esm2022/lib/base-model/workflow/workflow-steps.model.mjs +9 -0
- package/esm2022/lib/base-model/workflow/workflow.model.mjs +42 -0
- package/esm2022/lib/components/action-comment/action-comment.component.mjs +101 -0
- package/esm2022/lib/components/action-confirmation/action-confirmation.component.mjs +55 -0
- package/esm2022/lib/components/activity-report-form/activity-report-form.component.mjs +499 -0
- package/esm2022/lib/components/advanced-filter/field-filter/field-filter.component.mjs +41 -0
- package/esm2022/lib/components/advanced-filter/filter-builder/filter-builder.component.mjs +162 -0
- package/esm2022/lib/components/audit-log-details-dialog/audit-log-details-dialog.component.mjs +70 -0
- package/esm2022/lib/components/audit-log-list/audit-log.component.mjs +99 -0
- package/esm2022/lib/components/auto-complete/auto-complete.component.mjs +292 -0
- package/esm2022/lib/components/base-form/base-form.component.mjs +297 -0
- package/esm2022/lib/components/base-form-canvas/base-form-canvas.component.mjs +591 -0
- package/esm2022/lib/components/base-input-dialog/base-input-dialog.component.mjs +72 -0
- package/esm2022/lib/components/base-table/base-table.component.mjs +514 -0
- package/esm2022/lib/components/button-actions/button-actions.component.mjs +70 -0
- package/esm2022/lib/components/editable-base-table/editable-base-table.component.mjs +496 -0
- package/esm2022/lib/components/equation-builder/equation-builder.component.mjs +112 -0
- package/esm2022/lib/components/item-line-editor/item-line-editor.component.mjs +299 -0
- package/esm2022/lib/components/multi-auto-complete/multi-auto-complete.component.mjs +278 -0
- package/esm2022/lib/components/paginator/paginator.component.mjs +91 -0
- package/esm2022/lib/components/report-details-dialog/report-details-dialog.component.mjs +102 -0
- package/esm2022/lib/components/report-form/report-form.component.mjs +498 -0
- package/esm2022/lib/components/search-bar/search-bar.component.mjs +62 -0
- package/esm2022/lib/components/section-form-canvas/section-form-canvas.component.mjs +81 -0
- package/esm2022/lib/components/shared/action-button/action-button.component.mjs +59 -0
- package/esm2022/lib/components/shared/action-card/action-card.component.mjs +93 -0
- package/esm2022/lib/components/shared/attachment-uploader/attachment-uploader.component.mjs +70 -0
- package/esm2022/lib/components/shared-list/shared-list.component.mjs +47 -0
- package/esm2022/lib/components/snackbar-static/snackbar-static.component.mjs +43 -0
- package/esm2022/lib/components/title-bar/title-bar.component.mjs +119 -0
- package/esm2022/lib/services/backend-service.mjs +240 -0
- package/esm2022/lib/services/index.mjs +4 -0
- package/esm2022/lib/services/top-panel.mjs +22 -0
- package/esm2022/lib/services/trigger-form.service.mjs +17 -0
- package/esm2022/lib/utils/base-utils.mjs +97 -0
- package/esm2022/lib/validators/date-range-validator.mjs +27 -0
- package/esm2022/lib/validators/index.mjs +4 -0
- package/esm2022/lib/validators/match-list.validator.mjs +9 -0
- package/esm2022/lib/validators/multi-email-validator.mjs +13 -0
- package/esm2022/public-api.mjs +29 -0
- package/esm2022/q-btech-ui-lib.mjs +5 -0
- package/esm2022/unifylib-ui-lib.mjs +5 -0
- package/fesm2022/iq-ui-lib.mjs +5625 -0
- package/fesm2022/iq-ui-lib.mjs.map +1 -0
- package/fesm2022/q-btech-ui-lib.mjs +5619 -0
- package/fesm2022/q-btech-ui-lib.mjs.map +1 -0
- package/fesm2022/unifylib-ui-lib.mjs +5625 -0
- package/fesm2022/unifylib-ui-lib.mjs.map +1 -0
- package/index.d.ts +5 -0
- package/lib/base-model/SearchStrConfig.d.ts +8 -0
- package/{src/lib/base-model/api-response.ts → lib/base-model/api-response.d.ts} +5 -7
- package/lib/base-model/audit-log-entry.d.ts +7 -0
- package/lib/base-model/button-action-settings.d.ts +15 -0
- package/lib/base-model/column-def.model.d.ts +11 -0
- package/lib/base-model/do-action-request.d.ts +10 -0
- package/lib/base-model/field-action.d.ts +6 -0
- package/lib/base-model/field-filter.model.d.ts +7 -0
- package/lib/base-model/field-info.d.ts +53 -0
- package/lib/base-model/field-predicate.model.d.ts +7 -0
- package/lib/base-model/filter-request.d.ts +15 -0
- package/lib/base-model/filter.model.d.ts +22 -0
- package/lib/base-model/get-items-list.d.ts +21 -0
- package/lib/base-model/index.d.ts +11 -0
- package/lib/base-model/items-total.model.d.ts +6 -0
- package/lib/base-model/line-item.model.d.ts +9 -0
- package/lib/base-model/lookupItem.d.ts +13 -0
- package/{src/lib/base-model/page-info.ts → lib/base-model/page-info.d.ts} +25 -24
- package/lib/base-model/report-request.model.d.ts +18 -0
- package/lib/base-model/response-envelop.model.d.ts +8 -0
- package/lib/base-model/snack-message.model.d.ts +7 -0
- package/lib/base-model/table-column.interface.d.ts +28 -0
- package/lib/base-model/table-page-user-action.interface.d.ts +14 -0
- package/lib/base-model/workflow/workflow-steps.model.d.ts +7 -0
- package/lib/base-model/workflow/workflow.model.d.ts +13 -0
- package/lib/components/action-comment/action-comment.component.d.ts +32 -0
- package/lib/components/action-confirmation/action-confirmation.component.d.ts +19 -0
- package/lib/components/activity-report-form/activity-report-form.component.d.ts +93 -0
- package/lib/components/advanced-filter/field-filter/field-filter.component.d.ts +20 -0
- package/lib/components/advanced-filter/filter-builder/filter-builder.component.d.ts +28 -0
- package/lib/components/audit-log-details-dialog/audit-log-details-dialog.component.d.ts +25 -0
- package/lib/components/audit-log-list/audit-log.component.d.ts +36 -0
- package/lib/components/auto-complete/auto-complete.component.d.ts +51 -0
- package/lib/components/base-form/base-form.component.d.ts +59 -0
- package/lib/components/base-form-canvas/base-form-canvas.component.d.ts +124 -0
- package/lib/components/base-input-dialog/base-input-dialog.component.d.ts +23 -0
- package/lib/components/base-table/base-table.component.d.ts +128 -0
- package/lib/components/button-actions/button-actions.component.d.ts +17 -0
- package/lib/components/editable-base-table/editable-base-table.component.d.ts +106 -0
- package/lib/components/equation-builder/equation-builder.component.d.ts +23 -0
- package/lib/components/item-line-editor/item-line-editor.component.d.ts +64 -0
- package/lib/components/multi-auto-complete/multi-auto-complete.component.d.ts +51 -0
- package/lib/components/paginator/paginator.component.d.ts +26 -0
- package/lib/components/report-details-dialog/report-details-dialog.component.d.ts +34 -0
- package/lib/components/report-form/report-form.component.d.ts +92 -0
- package/lib/components/search-bar/search-bar.component.d.ts +29 -0
- package/lib/components/section-form-canvas/section-form-canvas.component.d.ts +27 -0
- package/lib/components/shared/action-button/action-button.component.d.ts +17 -0
- package/lib/components/shared/action-card/action-card.component.d.ts +37 -0
- package/lib/components/shared/attachment-uploader/attachment-uploader.component.d.ts +16 -0
- package/lib/components/shared-list/shared-list.component.d.ts +21 -0
- package/lib/components/snackbar-static/snackbar-static.component.d.ts +15 -0
- package/lib/components/title-bar/title-bar.component.d.ts +42 -0
- package/lib/services/backend-service.d.ts +59 -0
- package/{src/lib/services/index.ts → lib/services/index.d.ts} +1 -1
- package/lib/services/top-panel.d.ts +8 -0
- package/lib/services/trigger-form.service.d.ts +7 -0
- package/lib/utils/base-utils.d.ts +13 -0
- package/lib/validators/date-range-validator.d.ts +2 -0
- package/lib/validators/match-list.validator.d.ts +4 -0
- package/lib/validators/multi-email-validator.d.ts +6 -0
- package/package.json +19 -4
- package/{src/public-api.ts → public-api.d.ts} +22 -18
- package/ng-package.json +0 -7
- package/src/lib/base-model/SearchStrConfig.ts +0 -12
- package/src/lib/base-model/audit-log-entry.ts +0 -7
- package/src/lib/base-model/button-action-settings.ts +0 -25
- package/src/lib/base-model/column-def.model.ts +0 -34
- package/src/lib/base-model/do-action-request.ts +0 -11
- package/src/lib/base-model/field-action.ts +0 -7
- package/src/lib/base-model/field-filter.model.ts +0 -14
- package/src/lib/base-model/field-info.ts +0 -98
- package/src/lib/base-model/field-predicate.model.ts +0 -7
- package/src/lib/base-model/filter-request.ts +0 -27
- package/src/lib/base-model/filter.model.ts +0 -49
- package/src/lib/base-model/get-items-list.ts +0 -24
- package/src/lib/base-model/index.ts +0 -11
- package/src/lib/base-model/lookupItem.ts +0 -21
- package/src/lib/base-model/null-snackmessage.ts +0 -9
- package/src/lib/base-model/report-request.model.ts +0 -33
- package/src/lib/base-model/response-envelop.model.ts +0 -15
- package/src/lib/base-model/snack-message.model.ts +0 -14
- package/src/lib/base-model/snackmessage-interface.ts +0 -7
- package/src/lib/base-model/table-column.interface.ts +0 -29
- package/src/lib/base-model/table-page-user-action.interface.ts +0 -33
- package/src/lib/base-model/workflow/workflow-steps.model.ts +0 -9
- package/src/lib/base-model/workflow/workflow.model.ts +0 -52
- package/src/lib/components/action-confirmation/action-confirmation.component.css +0 -34
- package/src/lib/components/action-confirmation/action-confirmation.component.html +0 -18
- package/src/lib/components/action-confirmation/action-confirmation.component.spec.ts +0 -23
- package/src/lib/components/action-confirmation/action-confirmation.component.ts +0 -58
- package/src/lib/components/activity-report-form/activity-report-form.component.html +0 -109
- package/src/lib/components/activity-report-form/activity-report-form.component.scss +0 -0
- package/src/lib/components/activity-report-form/activity-report-form.component.spec.ts +0 -25
- package/src/lib/components/activity-report-form/activity-report-form.component.ts +0 -605
- package/src/lib/components/audit-log-details-dialog/audit-log-details-dialog.component.css +0 -51
- package/src/lib/components/audit-log-details-dialog/audit-log-details-dialog.component.html +0 -23
- package/src/lib/components/audit-log-details-dialog/audit-log-details-dialog.component.spec.ts +0 -23
- package/src/lib/components/audit-log-details-dialog/audit-log-details-dialog.component.ts +0 -69
- package/src/lib/components/audit-log-list/audit-log.component.html +0 -23
- package/src/lib/components/audit-log-list/audit-log.component.scss +0 -0
- package/src/lib/components/audit-log-list/audit-log.component.spec.ts +0 -25
- package/src/lib/components/audit-log-list/audit-log.component.ts +0 -116
- package/src/lib/components/auto-complete/auto-complete.component.css +0 -14
- package/src/lib/components/auto-complete/auto-complete.component.html +0 -29
- package/src/lib/components/auto-complete/auto-complete.component.spec.ts +0 -23
- package/src/lib/components/auto-complete/auto-complete.component.ts +0 -330
- package/src/lib/components/base-form/base-form.component.html +0 -58
- package/src/lib/components/base-form/base-form.component.scss +0 -0
- package/src/lib/components/base-form/base-form.component.spec.ts +0 -25
- package/src/lib/components/base-form/base-form.component.ts +0 -305
- package/src/lib/components/base-form-canvas/base-form-canvas.component.css +0 -22
- package/src/lib/components/base-form-canvas/base-form-canvas.component.html +0 -1006
- package/src/lib/components/base-form-canvas/base-form-canvas.component.spec.ts +0 -23
- package/src/lib/components/base-form-canvas/base-form-canvas.component.ts +0 -573
- package/src/lib/components/base-input-dialog/base-input-dialog.component.css +0 -0
- package/src/lib/components/base-input-dialog/base-input-dialog.component.html +0 -42
- package/src/lib/components/base-input-dialog/base-input-dialog.component.spec.ts +0 -23
- package/src/lib/components/base-input-dialog/base-input-dialog.component.ts +0 -78
- package/src/lib/components/base-table/base-table.component.html +0 -242
- package/src/lib/components/base-table/base-table.component.scss +0 -31
- package/src/lib/components/base-table/base-table.component.spec.ts +0 -25
- package/src/lib/components/base-table/base-table.component.ts +0 -568
- package/src/lib/components/button-actions/button-actions.component.html +0 -28
- package/src/lib/components/button-actions/button-actions.component.scss +0 -6
- package/src/lib/components/button-actions/button-actions.component.spec.ts +0 -23
- package/src/lib/components/button-actions/button-actions.component.ts +0 -72
- package/src/lib/components/editable-base-table/editable-base-table.component.html +0 -372
- package/src/lib/components/editable-base-table/editable-base-table.component.scss +0 -44
- package/src/lib/components/editable-base-table/editable-base-table.component.spec.ts +0 -25
- package/src/lib/components/editable-base-table/editable-base-table.component.ts +0 -570
- package/src/lib/components/equation-builder/equation-builder.component.css +0 -0
- package/src/lib/components/equation-builder/equation-builder.component.html +0 -31
- package/src/lib/components/equation-builder/equation-builder.component.spec.ts +0 -23
- package/src/lib/components/equation-builder/equation-builder.component.ts +0 -121
- package/src/lib/components/multi-auto-complete/multi-auto-complete.component.css +0 -11
- package/src/lib/components/multi-auto-complete/multi-auto-complete.component.html +0 -38
- package/src/lib/components/multi-auto-complete/multi-auto-complete.component.spec.ts +0 -23
- package/src/lib/components/multi-auto-complete/multi-auto-complete.component.ts +0 -317
- package/src/lib/components/paginator/paginator.component.css +0 -25
- package/src/lib/components/paginator/paginator.component.html +0 -34
- package/src/lib/components/paginator/paginator.component.ts +0 -94
- 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/components/rejection-comment/action-comment.component.spec.ts +0 -23
- package/src/lib/components/rejection-comment/action-comment.component.ts +0 -86
- package/src/lib/components/report-details-dialog/report-details-dialog.component.css +0 -17
- package/src/lib/components/report-details-dialog/report-details-dialog.component.html +0 -16
- package/src/lib/components/report-details-dialog/report-details-dialog.component.spec.ts +0 -23
- package/src/lib/components/report-details-dialog/report-details-dialog.component.ts +0 -113
- package/src/lib/components/report-form/report-form.component.html +0 -94
- package/src/lib/components/report-form/report-form.component.scss +0 -0
- package/src/lib/components/report-form/report-form.component.spec.ts +0 -25
- package/src/lib/components/report-form/report-form.component.ts +0 -588
- package/src/lib/components/search-bar/search-bar.component.html +0 -62
- package/src/lib/components/search-bar/search-bar.component.scss +0 -8
- package/src/lib/components/search-bar/search-bar.component.spec.ts +0 -25
- package/src/lib/components/search-bar/search-bar.component.ts +0 -70
- package/src/lib/components/shared/attachment-uploader/attachment-uploader.component.css +0 -54
- package/src/lib/components/shared/attachment-uploader/attachment-uploader.component.html +0 -22
- package/src/lib/components/shared/attachment-uploader/attachment-uploader.component.spec.ts +0 -23
- package/src/lib/components/shared/attachment-uploader/attachment-uploader.component.ts +0 -45
- package/src/lib/components/shared-list/shared-list.component.css +0 -0
- package/src/lib/components/shared-list/shared-list.component.html +0 -17
- package/src/lib/components/shared-list/shared-list.component.spec.ts +0 -23
- package/src/lib/components/shared-list/shared-list.component.ts +0 -53
- package/src/lib/components/title-bar/title-bar.component.css +0 -0
- package/src/lib/components/title-bar/title-bar.component.css.map +0 -1
- package/src/lib/components/title-bar/title-bar.component.html +0 -31
- package/src/lib/components/title-bar/title-bar.component.scss +0 -23
- package/src/lib/components/title-bar/title-bar.component.spec.ts +0 -23
- package/src/lib/components/title-bar/title-bar.component.ts +0 -119
- package/src/lib/services/backend-service.ts +0 -286
- package/src/lib/services/top-panel.ts +0 -17
- package/src/lib/services/trigger-form.service.ts +0 -11
- package/src/lib/share-module/shared-module.ts +0 -10
- package/src/lib/styles/invoiceq-theme.scss +0 -252
- package/src/lib/styles/styles.scss +0 -1723
- package/src/lib/utils/base-utils.ts +0 -102
- package/src/lib/validators/date-range-validator.ts +0 -31
- package/src/lib/validators/match-list.validator.ts +0 -10
- package/src/lib/validators/multi-email-validator.ts +0 -15
- package/tsconfig.lib.json +0 -15
- package/tsconfig.lib.prod.json +0 -11
- package/tsconfig.spec.json +0 -15
- /package/{src/lib/validators/index.ts → lib/validators/index.d.ts} +0 -0
|
@@ -1,58 +0,0 @@
|
|
|
1
|
-
<div fxLayout="column" fxFlex="2" fxHide.lt-sm [ngStyle]="{'height':isMatchHeight() ? '30vh' : '88vh' }">
|
|
2
|
-
|
|
3
|
-
</div>
|
|
4
|
-
|
|
5
|
-
<div fxLayout="column" style="width: 100%">
|
|
6
|
-
<div fxLayout="row" fxLayoutAlign="start start" style="margin-top: 2vh; width: 100%">
|
|
7
|
-
<div fxLayout="column" fxFlex="100">
|
|
8
|
-
<app-title-bar [pageTitle]="getTitle()" [newAction]="false" [hideBackButton]="hideBackButton"></app-title-bar>
|
|
9
|
-
</div>
|
|
10
|
-
</div>
|
|
11
|
-
<app-base-form-canvas
|
|
12
|
-
[pageInfo]="pageInfo"
|
|
13
|
-
[fields]="fields"
|
|
14
|
-
[editable]="editable"
|
|
15
|
-
[errors]="errors"
|
|
16
|
-
[item]="item"
|
|
17
|
-
(formUpdated)="updateForm($event)"
|
|
18
|
-
></app-base-form-canvas>
|
|
19
|
-
|
|
20
|
-
<div fxLayout="row" fxLayoutGap="10px" fxLayoutAlign="start start" fxLayoutAlign.lt-sm="center start"
|
|
21
|
-
class="main-form-canvas"
|
|
22
|
-
style="margin-top: 3vh; width: 100%">
|
|
23
|
-
|
|
24
|
-
<div fxLayout="column" fxFlex="49">
|
|
25
|
-
<div fxLayout="row" fxLayoutAlign="start center" fxFlex="100" >
|
|
26
|
-
<button *ngIf="hasWfPositivePermission()" color="primary" mat-flat-button (click)="doSaveApproveAction()"
|
|
27
|
-
[disabled]="disabledSaveButton(item)"
|
|
28
|
-
style="font-weight: bold;min-width: 140px; max-width: 200px; margin: 0 10px;">
|
|
29
|
-
{{ getPositiveWfActionKey(item?.stateType) | translate }}
|
|
30
|
-
</button>
|
|
31
|
-
<button *ngIf="hasWfNegativePermission()" color="second" mat-raised-button (click)="doCancelRejectAction()"
|
|
32
|
-
[disabled]="disabledSaveButton(item)"
|
|
33
|
-
style="font-weight: bold;min-width: 140px ;max-width: 200px;">
|
|
34
|
-
{{ getNegativeWfActionKey(item?.stateType) | translate }}
|
|
35
|
-
</button>
|
|
36
|
-
|
|
37
|
-
<button *ngIf="pageInfo.hideExtractButton === false && itemId > 0 && editable" color="primary" mat-raised-button (click)="doExtraAction()"
|
|
38
|
-
style="font-weight: bold;min-width: 140px; max-width: 200px; margin: 0 10px;">
|
|
39
|
-
{{ pageInfo.labelsSection + "." + "EXTRA_BUTTON_NAME" | translate }}
|
|
40
|
-
</button>
|
|
41
|
-
|
|
42
|
-
</div>
|
|
43
|
-
</div>
|
|
44
|
-
<div fxLayout="column" fxFlex="49"></div>
|
|
45
|
-
|
|
46
|
-
</div>
|
|
47
|
-
<ng-container *ngIf="!pageInfo.hideAuditLog">
|
|
48
|
-
<div fxLayout="row" fxLayoutGap="10px" fxLayoutAlign="start start" fxLayoutAlign.lt-sm="center start"
|
|
49
|
-
class="main-form-canvas" style="padding-top: 4vh; padding-bottom: 5vh; width: 100%">
|
|
50
|
-
<div fxLayout="column" fxFlex="95">
|
|
51
|
-
<app-audit-log [pageInfo]="pageInfo" [fields]="fields"></app-audit-log>
|
|
52
|
-
</div>
|
|
53
|
-
<!-- ></app-audit-log>-->
|
|
54
|
-
</div>
|
|
55
|
-
</ng-container>
|
|
56
|
-
</div>
|
|
57
|
-
|
|
58
|
-
|
|
File without changes
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
import {ComponentFixture, TestBed} from '@angular/core/testing';
|
|
2
|
-
|
|
3
|
-
import {BaseFormComponent} from './base-form.component';
|
|
4
|
-
|
|
5
|
-
describe('BaseFormComponent', () => {
|
|
6
|
-
let component: BaseFormComponent;
|
|
7
|
-
let fixture: ComponentFixture<BaseFormComponent>;
|
|
8
|
-
|
|
9
|
-
beforeEach(async () => {
|
|
10
|
-
await TestBed.configureTestingModule({
|
|
11
|
-
declarations: [ BaseFormComponent ]
|
|
12
|
-
})
|
|
13
|
-
.compileComponents();
|
|
14
|
-
});
|
|
15
|
-
|
|
16
|
-
beforeEach(() => {
|
|
17
|
-
fixture = TestBed.createComponent(BaseFormComponent);
|
|
18
|
-
component = fixture.componentInstance;
|
|
19
|
-
fixture.detectChanges();
|
|
20
|
-
});
|
|
21
|
-
|
|
22
|
-
it('should create', () => {
|
|
23
|
-
expect(component).toBeTruthy();
|
|
24
|
-
});
|
|
25
|
-
});
|
|
@@ -1,305 +0,0 @@
|
|
|
1
|
-
import {Component, EventEmitter, Inject, Input, OnChanges, OnInit, Output, SimpleChanges} from '@angular/core';
|
|
2
|
-
import {FieldInfo, Filter, FilterRequest, NEW, PageInfo, SAVE_AND_COMPLETE, SnackMessage} from "../../base-model";
|
|
3
|
-
import {FieldMessage} from "../../base-model/api-response";
|
|
4
|
-
import {TranslateModule} from "@ngx-translate/core";
|
|
5
|
-
import {BackendService} from "../../services";
|
|
6
|
-
import {FormGroup} from "@angular/forms";
|
|
7
|
-
import {Location, NgIf} from "@angular/common";
|
|
8
|
-
import {FlexLayoutModule} from "@angular/flex-layout";
|
|
9
|
-
import {MatButton, MatButtonModule} from "@angular/material/button";
|
|
10
|
-
import {MatIconModule} from "@angular/material/icon";
|
|
11
|
-
import {TitleBarComponent} from "../title-bar/title-bar.component";
|
|
12
|
-
import {BaseFormCanvasComponent} from "../base-form-canvas/base-form-canvas.component";
|
|
13
|
-
import {DoActionRequest, SAVE} from "../../base-model/do-action-request";
|
|
14
|
-
import {ActionCommentComponent} from "../rejection-comment/action-comment.component";
|
|
15
|
-
import {MatDialog} from "@angular/material/dialog";
|
|
16
|
-
import {BaseUtils, getNegativeWfActionKey, getPositiveWfActionKey, getWfActionId} from "../../utils/base-utils";
|
|
17
|
-
import {ActivatedRoute, Router} from "@angular/router";
|
|
18
|
-
import {AuditLogComponent} from "../audit-log-list/audit-log.component";
|
|
19
|
-
import {Directionality} from "@angular/cdk/bidi";
|
|
20
|
-
|
|
21
|
-
@Component({
|
|
22
|
-
selector: 'app-base-form',
|
|
23
|
-
standalone: true,
|
|
24
|
-
imports: [
|
|
25
|
-
FlexLayoutModule,
|
|
26
|
-
TitleBarComponent,
|
|
27
|
-
BaseFormCanvasComponent,
|
|
28
|
-
MatButtonModule,
|
|
29
|
-
TranslateModule,
|
|
30
|
-
NgIf,
|
|
31
|
-
MatIconModule,
|
|
32
|
-
MatButton,
|
|
33
|
-
AuditLogComponent
|
|
34
|
-
],
|
|
35
|
-
templateUrl: './base-form.component.html',
|
|
36
|
-
styleUrl: './base-form.component.scss'
|
|
37
|
-
})
|
|
38
|
-
export class BaseFormComponent extends BaseUtils implements OnInit, OnChanges {
|
|
39
|
-
|
|
40
|
-
@Input()
|
|
41
|
-
override pageInfo!: PageInfo;
|
|
42
|
-
|
|
43
|
-
@Input()// @ts-ignore
|
|
44
|
-
fields: FieldInfo[] = [];
|
|
45
|
-
|
|
46
|
-
@Input()// @ts-ignore
|
|
47
|
-
errors: FieldMessage[] = [];
|
|
48
|
-
|
|
49
|
-
@Input()
|
|
50
|
-
editable: boolean = false;
|
|
51
|
-
|
|
52
|
-
@Input()
|
|
53
|
-
itemId: number;
|
|
54
|
-
|
|
55
|
-
@Output()
|
|
56
|
-
actionResultEmitter: EventEmitter<any> = new EventEmitter<any>();
|
|
57
|
-
|
|
58
|
-
@Output()
|
|
59
|
-
formUpdated: EventEmitter<FormGroup> = new EventEmitter<FormGroup>();
|
|
60
|
-
|
|
61
|
-
@Output()
|
|
62
|
-
itemLoaded: EventEmitter<any> = new EventEmitter<any>();
|
|
63
|
-
|
|
64
|
-
@Output()
|
|
65
|
-
extraAction: EventEmitter<any> = new EventEmitter<any>();
|
|
66
|
-
|
|
67
|
-
item : any = {};
|
|
68
|
-
isLoaded : boolean = false;
|
|
69
|
-
|
|
70
|
-
@Output()
|
|
71
|
-
hyperTextEvent: EventEmitter<boolean> = new EventEmitter();
|
|
72
|
-
|
|
73
|
-
currentDirection: 'ltr' | 'rtl';
|
|
74
|
-
isSaveDisabled: boolean = true;
|
|
75
|
-
isRejectDisabled: boolean = true;
|
|
76
|
-
|
|
77
|
-
@Input()
|
|
78
|
-
hideBackButton: boolean = true;
|
|
79
|
-
protected readonly SAVE = SAVE;
|
|
80
|
-
private isPending: boolean;
|
|
81
|
-
|
|
82
|
-
constructor(public dialog: MatDialog,
|
|
83
|
-
private activatedRoute: ActivatedRoute,
|
|
84
|
-
private router:Router,
|
|
85
|
-
private directionality: Directionality,
|
|
86
|
-
private location:Location,
|
|
87
|
-
@Inject('securityManager') private securityManager: any,
|
|
88
|
-
public backendService: BackendService) {
|
|
89
|
-
super();
|
|
90
|
-
}
|
|
91
|
-
|
|
92
|
-
ngOnInit(): void {
|
|
93
|
-
this.currentDirection = this.directionality.value;
|
|
94
|
-
this.directionality.change.subscribe((value) => {
|
|
95
|
-
this.currentDirection = value;
|
|
96
|
-
})
|
|
97
|
-
|
|
98
|
-
// console.log('editable', this.editable)
|
|
99
|
-
this.securityManager.loadPermissions().subscribe(x => {
|
|
100
|
-
console.log("before edit", this.editable);
|
|
101
|
-
this.loadItem();
|
|
102
|
-
console.log("after edit", this.editable);
|
|
103
|
-
});
|
|
104
|
-
}
|
|
105
|
-
|
|
106
|
-
ngOnChanges({item, errors, fields}: SimpleChanges): void {
|
|
107
|
-
}
|
|
108
|
-
|
|
109
|
-
isValid() {
|
|
110
|
-
return this.backendService.parentForm?.valid;
|
|
111
|
-
}
|
|
112
|
-
|
|
113
|
-
isMatchHeight() {
|
|
114
|
-
return this.pageInfo.pageHeight === 'match';
|
|
115
|
-
}
|
|
116
|
-
|
|
117
|
-
private loadItem() {
|
|
118
|
-
this.editable = false;
|
|
119
|
-
this.isPending = this.backendService.decrypt(this.activatedRoute.snapshot.queryParams['mode']) === 'pending';
|
|
120
|
-
|
|
121
|
-
if (this.activatedRoute.snapshot.queryParams['token'] && this.activatedRoute.snapshot.queryParams['mode']) {
|
|
122
|
-
this.itemId = this.backendService.decrypt(this.activatedRoute.snapshot.queryParams['token']);
|
|
123
|
-
} else {
|
|
124
|
-
// console.log(' ****** ****** ****** ****** error in url ')
|
|
125
|
-
}
|
|
126
|
-
if (this.itemId > 0) {
|
|
127
|
-
const filterRequest = new FilterRequest;
|
|
128
|
-
filterRequest.columns = this.fields.filter(c => c.type !== 'spacer').map(c => c.property);
|
|
129
|
-
filterRequest.pendingPage = this.isPending;
|
|
130
|
-
filterRequest.filters = [];
|
|
131
|
-
filterRequest.filters.push(new Filter({
|
|
132
|
-
key: 0,
|
|
133
|
-
fieldType: 'Long',
|
|
134
|
-
fieldName: 'id',
|
|
135
|
-
valueObject: this.itemId,
|
|
136
|
-
filterType: 'FILED_FILTER',
|
|
137
|
-
operator: 'EQUALS'
|
|
138
|
-
}));
|
|
139
|
-
///audit-log
|
|
140
|
-
this.backendService.getItemAuditLog(filterRequest, this.pageInfo!.apiUri).subscribe(resp => {
|
|
141
|
-
// console.log('resp', resp);
|
|
142
|
-
});
|
|
143
|
-
this.backendService.getItemsByFilter(filterRequest, this.pageInfo!.apiUri).subscribe(resp => {
|
|
144
|
-
if (resp?.valid && resp.body?.length >= 0) {
|
|
145
|
-
this.item = resp.body[0];
|
|
146
|
-
this.editable = (!this.pageInfo.draftSupported || !this.isPending) && this.securityManager.hasPagePermission(this.pageInfo.id, 'EDIT')
|
|
147
|
-
&& (!this.pageInfo.draftSupported ||this.item['stateType'] === 'COMPLETED' );
|
|
148
|
-
this.itemLoaded.emit(this.item);
|
|
149
|
-
this.isLoaded = true;
|
|
150
|
-
}
|
|
151
|
-
});
|
|
152
|
-
} else {
|
|
153
|
-
this.editable = this.securityManager.hasPagePermission(this.pageInfo.id, 'EDIT');
|
|
154
|
-
this.item = {};
|
|
155
|
-
this.itemLoaded.emit(this.item);
|
|
156
|
-
this.isLoaded = true;
|
|
157
|
-
}
|
|
158
|
-
|
|
159
|
-
}
|
|
160
|
-
|
|
161
|
-
buildDoActionSubject(): any {
|
|
162
|
-
const newVar = this.editable ? Object.assign(this.item, this.backendService.parentForm.value) : this.item;
|
|
163
|
-
if (this.itemId <= 0 && this.editable ) {
|
|
164
|
-
//TODO this is like a hack and must be handled from backend
|
|
165
|
-
newVar['stateType'] = 'NEW';
|
|
166
|
-
}
|
|
167
|
-
this.fields.forEach(field => {
|
|
168
|
-
if (field.flattenBySubAttribute){
|
|
169
|
-
newVar[field.property] = newVar[field.property][field.flattenBySubAttribute]
|
|
170
|
-
}
|
|
171
|
-
})
|
|
172
|
-
if (!this.pageInfo.draftSupported){
|
|
173
|
-
newVar['status'] = true;
|
|
174
|
-
}
|
|
175
|
-
return newVar;
|
|
176
|
-
}
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
doSaveApproveAction() {
|
|
180
|
-
let actionId = getWfActionId(this.item.stateType);
|
|
181
|
-
if (this.itemId <= 0 && this.editable ) {
|
|
182
|
-
actionId = NEW
|
|
183
|
-
}
|
|
184
|
-
if (!this.pageInfo.draftSupported) {
|
|
185
|
-
actionId = SAVE_AND_COMPLETE
|
|
186
|
-
}
|
|
187
|
-
if (this.editable && this.backendService.parentForm.valid !== true) {
|
|
188
|
-
this.backendService.topPanelMessage$.next(new SnackMessage('INVALID_INPUT_FORM', true, 'error'));
|
|
189
|
-
return;
|
|
190
|
-
}
|
|
191
|
-
const request = new DoActionRequest();
|
|
192
|
-
request.actionId = actionId;
|
|
193
|
-
request.subject = this.buildDoActionSubject();
|
|
194
|
-
|
|
195
|
-
const dialogRef = this.dialog.open(ActionCommentComponent, {
|
|
196
|
-
data: {label: 'save', isTermination: false},
|
|
197
|
-
width: '600px',
|
|
198
|
-
height: 'auto',
|
|
199
|
-
direction: this.currentDirection
|
|
200
|
-
});
|
|
201
|
-
dialogRef.afterClosed().subscribe(result => {
|
|
202
|
-
if (result) {
|
|
203
|
-
request.comment = result.comment;
|
|
204
|
-
this.backendService.doActionWithAttachments(request, [], this.pageInfo!).subscribe(resp => {
|
|
205
|
-
console.log('step',actionId);
|
|
206
|
-
this.actionResultEmitter.emit({ valid: resp.valid, actionId: actionId });
|
|
207
|
-
if (resp.valid ) {
|
|
208
|
-
let message = 'approve_successfully';
|
|
209
|
-
switch (actionId) {
|
|
210
|
-
case 1:
|
|
211
|
-
message = 'saved_successfully';
|
|
212
|
-
break;
|
|
213
|
-
case 2:
|
|
214
|
-
message = 'updated_successfully';
|
|
215
|
-
break;
|
|
216
|
-
default:
|
|
217
|
-
message = 'approve_successfully';
|
|
218
|
-
}
|
|
219
|
-
this.backendService.topPanelMessage$.next(new SnackMessage(message, true, 'success'));
|
|
220
|
-
this.backToParent();
|
|
221
|
-
}
|
|
222
|
-
else{
|
|
223
|
-
request.subject['stateType'] = null;
|
|
224
|
-
if (resp.message[0].errorMessage.toLowerCase().includes('duplic'))
|
|
225
|
-
this.backendService.topPanelMessage$.next(new SnackMessage(this.pageInfo.labelsSection + '.' + resp.message[0].errorCode, true, 'error'));
|
|
226
|
-
}
|
|
227
|
-
});
|
|
228
|
-
}
|
|
229
|
-
});
|
|
230
|
-
}
|
|
231
|
-
|
|
232
|
-
backToParent() {
|
|
233
|
-
const idIdx = this.router.url.lastIndexOf('/');
|
|
234
|
-
this.router.navigateByUrl(this.router.url.substring(0, idIdx));
|
|
235
|
-
}
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
getTitle() {
|
|
239
|
-
return `${this.pageInfo.labelsSection}.${this.pageInfo.id}` ;
|
|
240
|
-
}
|
|
241
|
-
|
|
242
|
-
updateForm($event: FormGroup) {
|
|
243
|
-
this.backendService.parentForm = $event;
|
|
244
|
-
this.formUpdated.emit($event);
|
|
245
|
-
}
|
|
246
|
-
|
|
247
|
-
doCancelRejectAction() {
|
|
248
|
-
if (!this.editable){
|
|
249
|
-
let actionId = 3;
|
|
250
|
-
// console.log('actionId',actionId);
|
|
251
|
-
const request = new DoActionRequest();
|
|
252
|
-
request.actionId = actionId;
|
|
253
|
-
request.subject = this.buildDoActionSubject();
|
|
254
|
-
|
|
255
|
-
const dialogRef = this.dialog.open(ActionCommentComponent, {
|
|
256
|
-
data: {label: 'reject', acceptActionLabel: 'accept', rejectActionLabel: 'return'},
|
|
257
|
-
width: '600px',
|
|
258
|
-
height: 'auto',
|
|
259
|
-
direction: this.currentDirection
|
|
260
|
-
});
|
|
261
|
-
dialogRef.afterClosed().subscribe(result => {
|
|
262
|
-
if (result) {
|
|
263
|
-
request.comment = result.comment;
|
|
264
|
-
this.backendService.doActionWithAttachments(request, [], this.pageInfo!).subscribe(resp => {
|
|
265
|
-
this.actionResultEmitter.emit({ valid: resp.valid, actionId: actionId });
|
|
266
|
-
if (resp.valid) {
|
|
267
|
-
this.backendService.topPanelMessage$.next(new SnackMessage('successful_reject_message', true, 'success'));
|
|
268
|
-
this.backToParent();
|
|
269
|
-
}
|
|
270
|
-
});
|
|
271
|
-
}
|
|
272
|
-
});
|
|
273
|
-
}
|
|
274
|
-
else {
|
|
275
|
-
this.location.back()
|
|
276
|
-
}
|
|
277
|
-
}
|
|
278
|
-
|
|
279
|
-
hasWfPermission() {
|
|
280
|
-
return (this.securityManager.hasPagePermission(this.pageInfo.id, 'EDIT')
|
|
281
|
-
|| this.securityManager.hasPagePermission(this.pageInfo.id, 'COMPLETE')
|
|
282
|
-
|| this.securityManager.hasPagePermission(this.pageInfo.id, 'TERMINATE'))
|
|
283
|
-
}
|
|
284
|
-
|
|
285
|
-
protected readonly getPositiveWfActionKey = getPositiveWfActionKey;
|
|
286
|
-
protected readonly getNegativeWfActionKey = getNegativeWfActionKey;
|
|
287
|
-
|
|
288
|
-
hasWfPositivePermission() {
|
|
289
|
-
return (!this.editable && this.securityManager.hasPagePermission(this.pageInfo.id, 'COMPLETE')) ||
|
|
290
|
-
(this.editable && this.securityManager.hasPagePermission(this.pageInfo.id, 'EDIT'))
|
|
291
|
-
}
|
|
292
|
-
|
|
293
|
-
hasWfNegativePermission() {
|
|
294
|
-
return (!this.editable && this.securityManager.hasPagePermission(this.pageInfo.id, 'TERMINATE')) ||
|
|
295
|
-
(this.editable && this.securityManager.hasPagePermission(this.pageInfo.id, 'EDIT'))
|
|
296
|
-
}
|
|
297
|
-
|
|
298
|
-
doExtraAction() {
|
|
299
|
-
this.extraAction.emit()
|
|
300
|
-
}
|
|
301
|
-
disabledSaveButton(element) {
|
|
302
|
-
return (!this.isPending && element.stateType == 'PENDING') && this.pageInfo.draftSupported ;
|
|
303
|
-
}
|
|
304
|
-
|
|
305
|
-
}
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
.chipList {
|
|
2
|
-
display: inline-block !important;
|
|
3
|
-
}
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
::ng-deep .mdc-floating-label--required:not(.mdc-floating-label--hide-required-marker)::after {
|
|
8
|
-
color: red !important; /* asterisk */
|
|
9
|
-
font-size: 20px;
|
|
10
|
-
margin-left: 2px;
|
|
11
|
-
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
.arrow_drop_down_autocomplete {
|
|
16
|
-
position: absolute;
|
|
17
|
-
right: 0;
|
|
18
|
-
top: 7px;
|
|
19
|
-
color: rgba(0, 0, 0, 0.54);
|
|
20
|
-
cursor: pointer;
|
|
21
|
-
font-size: 28px !important;
|
|
22
|
-
}
|