cat-qw-lib 0.64.16 → 1.0.0
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 +10 -0
- package/package.json +16 -25
- package/src/lib/admin/action-admin/action-admin.module.ts +25 -0
- package/src/lib/admin/action-admin/components/admin-action-form/admin-action-form.component.html +113 -0
- package/src/lib/admin/action-admin/components/admin-action-form/admin-action-form.component.scss +4 -0
- package/src/lib/admin/action-admin/components/admin-action-form/admin-action-form.component.spec.ts +119 -0
- package/src/lib/admin/action-admin/components/admin-action-form/admin-action-form.component.ts +79 -0
- package/src/lib/admin/action-admin/components/admin-action-list/admin-action-list.component.html +5 -0
- package/src/lib/admin/action-admin/components/admin-action-list/admin-action-list.component.scss +0 -0
- package/src/lib/admin/action-admin/components/admin-action-list/admin-action-list.component.spec.ts +36 -0
- package/src/lib/admin/action-admin/components/admin-action-list/admin-action-list.component.ts +33 -0
- package/src/lib/admin/action-admin/models/admin-action.model.ts +14 -0
- package/src/lib/admin/action-admin/state/admin-action.query.ts +11 -0
- package/src/lib/admin/action-admin/state/admin-action.service.spec.ts +66 -0
- package/src/lib/admin/action-admin/state/admin-action.service.ts +29 -0
- package/src/lib/admin/action-admin/state/admin-action.state.ts +14 -0
- package/src/lib/admin/action-admin/state/admin-action.store.ts +14 -0
- package/src/lib/admin/admin.module.ts +22 -0
- package/src/lib/admin/api-admin/api-admin.module.ts +37 -0
- package/src/lib/admin/api-admin/components/api-admin-form/api-admin-form.component.html +157 -0
- package/src/lib/admin/api-admin/components/api-admin-form/api-admin-form.component.scss +12 -0
- package/src/lib/admin/api-admin/components/api-admin-form/api-admin-form.component.spec.ts +134 -0
- package/src/lib/admin/api-admin/components/api-admin-form/api-admin-form.component.ts +110 -0
- package/src/lib/admin/api-admin/components/api-admin-list/api-admin-list.component.html +5 -0
- package/src/lib/admin/api-admin/components/api-admin-list/api-admin-list.component.scss +0 -0
- package/src/lib/admin/api-admin/components/api-admin-list/api-admin-list.component.spec.ts +38 -0
- package/src/lib/admin/api-admin/components/api-admin-list/api-admin-list.component.ts +28 -0
- package/src/lib/admin/api-admin/models/api-config.model.ts +14 -0
- package/src/lib/admin/api-admin/state/api-admin.query.ts +16 -0
- package/src/lib/admin/api-admin/state/api-admin.service.ts +34 -0
- package/src/lib/admin/api-admin/state/api-admin.state.ts +14 -0
- package/src/lib/admin/api-admin/state/api-admin.store.ts +13 -0
- package/src/lib/admin/dd-admin/components/dd-admin-form/dd-admin-form.component.html +115 -0
- package/src/lib/admin/dd-admin/components/dd-admin-form/dd-admin-form.component.scss +4 -0
- package/src/lib/admin/dd-admin/components/dd-admin-form/dd-admin-form.component.spec.ts +100 -0
- package/src/lib/admin/dd-admin/components/dd-admin-form/dd-admin-form.component.ts +105 -0
- package/src/lib/admin/dd-admin/components/dd-admin-item-form/dd-admin-item-form.component.html +64 -0
- package/src/lib/admin/dd-admin/components/dd-admin-item-form/dd-admin-item-form.component.scss +0 -0
- package/src/lib/admin/dd-admin/components/dd-admin-item-form/dd-admin-item-form.component.spec.ts +108 -0
- package/src/lib/admin/dd-admin/components/dd-admin-item-form/dd-admin-item-form.component.ts +96 -0
- package/src/lib/admin/dd-admin/components/dd-admin-list/dd-admin-list.component.html +5 -0
- package/src/lib/admin/dd-admin/components/dd-admin-list/dd-admin-list.component.scss +0 -0
- package/src/lib/admin/dd-admin/components/dd-admin-list/dd-admin-list.component.spec.ts +34 -0
- package/src/lib/admin/dd-admin/components/dd-admin-list/dd-admin-list.component.ts +27 -0
- package/src/lib/admin/dd-admin/dd-admin.module.ts +34 -0
- package/src/lib/admin/dd-admin/models/api-property.model.ts +7 -0
- package/src/lib/admin/dd-admin/models/dd-attribute-sidebar-view.model.ts +6 -0
- package/src/lib/admin/dd-admin/models/dictionary.model.ts +16 -0
- package/src/lib/admin/dd-admin/state/dictionary.query.ts +30 -0
- package/src/lib/admin/dd-admin/state/dictionary.service.ts +37 -0
- package/src/lib/admin/dd-admin/state/dictionary.state.ts +30 -0
- package/src/lib/admin/dd-admin/state/dictionary.store.ts +22 -0
- package/src/lib/admin/queue-admin/components/queue-admin-form/queue-admin-form.component.html +115 -0
- package/src/lib/admin/queue-admin/components/queue-admin-form/queue-admin-form.component.scss +71 -0
- package/src/lib/admin/queue-admin/components/queue-admin-form/queue-admin-form.component.spec.ts +22 -0
- package/src/lib/admin/queue-admin/components/queue-admin-form/queue-admin-form.component.ts +185 -0
- package/src/lib/admin/queue-admin/components/queue-admin-list/queue-admin-list.component.html +24 -0
- package/src/lib/admin/queue-admin/components/queue-admin-list/queue-admin-list.component.scss +33 -0
- package/src/lib/admin/queue-admin/components/queue-admin-list/queue-admin-list.component.spec.ts +23 -0
- package/src/lib/admin/queue-admin/components/queue-admin-list/queue-admin-list.component.ts +46 -0
- package/src/lib/admin/queue-admin/components/queue-application-list/queue-application-list.component.html +69 -0
- package/src/lib/admin/queue-admin/components/queue-application-list/queue-application-list.component.scss +84 -0
- package/src/lib/admin/queue-admin/components/queue-application-list/queue-application-list.component.spec.ts +21 -0
- package/src/lib/admin/queue-admin/components/queue-application-list/queue-application-list.component.ts +93 -0
- package/src/lib/admin/queue-admin/models/queue.model.ts +15 -0
- package/src/lib/admin/queue-admin/queue-admin-routing.module.ts +17 -0
- package/src/lib/admin/queue-admin/queue-admin.module.ts +26 -0
- package/src/lib/admin/queue-admin/state/queue.query.ts +11 -0
- package/src/lib/admin/queue-admin/state/queue.service.ts +34 -0
- package/{lib/admin/queue-admin/state/queue.state.d.ts → src/lib/admin/queue-admin/state/queue.state.ts} +14 -6
- package/src/lib/admin/queue-admin/state/queue.store.ts +13 -0
- package/src/lib/admin/template-admin/components/template-admin-form/template-admin-form.component.html +99 -0
- package/src/lib/admin/template-admin/components/template-admin-form/template-admin-form.component.scss +3 -0
- package/src/lib/admin/template-admin/components/template-admin-form/template-admin-form.component.spec.ts +23 -0
- package/src/lib/admin/template-admin/components/template-admin-form/template-admin-form.component.ts +82 -0
- package/src/lib/admin/template-admin/components/template-admin-list/template-admin-list.component.html +41 -0
- package/src/lib/admin/template-admin/components/template-admin-list/template-admin-list.component.scss +30 -0
- package/src/lib/admin/template-admin/components/template-admin-list/template-admin-list.component.spec.ts +23 -0
- package/src/lib/admin/template-admin/components/template-admin-list/template-admin-list.component.ts +34 -0
- package/src/lib/admin/template-admin/models/template.model.ts +12 -0
- package/src/lib/admin/template-admin/state/template-admin.query.ts +17 -0
- package/src/lib/admin/template-admin/state/template-admin.service.ts +45 -0
- package/src/lib/admin/template-admin/state/template-admin.state.ts +14 -0
- package/src/lib/admin/template-admin/state/template-admin.store.ts +15 -0
- package/src/lib/admin/template-admin/template-admin.module.ts +40 -0
- package/src/lib/admin/widget-admin/components/widget-admin-form/widget-admin-form.component.html +170 -0
- package/src/lib/admin/widget-admin/components/widget-admin-form/widget-admin-form.component.scss +4 -0
- package/src/lib/admin/widget-admin/components/widget-admin-form/widget-admin-form.component.spec.ts +23 -0
- package/src/lib/admin/widget-admin/components/widget-admin-form/widget-admin-form.component.ts +139 -0
- package/src/lib/admin/widget-admin/components/widget-admin-list/widget-admin-list.component.html +5 -0
- package/src/lib/admin/widget-admin/components/widget-admin-list/widget-admin-list.component.scss +0 -0
- package/src/lib/admin/widget-admin/components/widget-admin-list/widget-admin-list.component.spec.ts +23 -0
- package/src/lib/admin/widget-admin/components/widget-admin-list/widget-admin-list.component.ts +28 -0
- package/src/lib/admin/widget-admin/models/widget.model.ts +35 -0
- package/src/lib/admin/widget-admin/state/widget-admin.query.ts +17 -0
- package/src/lib/admin/widget-admin/state/widget-admin.service.ts +72 -0
- package/src/lib/admin/widget-admin/state/widget-admin.state.ts +14 -0
- package/src/lib/admin/widget-admin/state/widget-admin.store.ts +15 -0
- package/src/lib/admin/widget-admin/widget-admin.module.ts +30 -0
- package/src/lib/queue/ASSIGNMENT_FUNCTIONALITY.md +114 -0
- package/src/lib/queue/CHECKBOX_SELECTION_EXAMPLE.md +240 -0
- package/src/lib/queue/CONTENT_PROJECTION_GUIDE.md +163 -0
- package/src/lib/queue/components/queue-container/queue-container.component.html +37 -0
- package/src/lib/queue/components/queue-container/queue-container.component.scss +7 -0
- package/src/lib/queue/components/queue-container/queue-container.component.ts +155 -0
- package/src/lib/queue/components/queue-item/queue-item.component.html +37 -0
- package/src/lib/queue/components/queue-item/queue-item.component.scss +105 -0
- package/src/lib/queue/components/queue-item/queue-item.component.spec.ts +104 -0
- package/src/lib/queue/components/queue-item/queue-item.component.ts +67 -0
- package/src/lib/queue/components/queue-list/queue-list.component.html +4 -0
- package/src/lib/queue/components/queue-list/queue-list.component.scss +0 -0
- package/src/lib/queue/components/queue-list/queue-list.component.spec.ts +46 -0
- package/src/lib/queue/components/queue-list/queue-list.component.ts +18 -0
- package/src/lib/queue/components/queue-record-table/queue-record-table.component.html +14 -0
- package/src/lib/queue/components/queue-record-table/queue-record-table.component.scss +1 -0
- package/src/lib/queue/components/queue-record-table/queue-record-table.component.ts +241 -0
- package/src/lib/queue/components/queue-search/queue-search.component.html +11 -0
- package/src/lib/queue/components/queue-search/queue-search.component.scss +36 -0
- package/src/lib/queue/components/queue-search/queue-search.component.spec.ts +121 -0
- package/src/lib/queue/components/queue-search/queue-search.component.ts +77 -0
- package/src/lib/queue/models/queue.model.ts +11 -0
- package/src/lib/queue/queue-routing.module.ts +21 -0
- package/src/lib/queue/queue.module.ts +48 -0
- package/src/lib/queue/services/application-assignment.service.ts +27 -0
- package/src/lib/queue/services/queue-record-table-builder.service.ts +66 -0
- package/src/lib/queue/state/queue.service.ts +85 -0
- package/src/lib/queue/state/queue.state.ts +13 -0
- package/src/lib/queue/state/queue.store.ts +14 -0
- package/src/lib/shared/_base/base-container/base-container.component.html +1 -0
- package/src/lib/shared/_base/base-container/base-container.component.scss +0 -0
- package/src/lib/shared/_base/base-container/base-container.component.spec.ts +21 -0
- package/src/lib/shared/_base/base-container/base-container.component.ts +19 -0
- package/src/lib/shared/_base/base-control/base-control.component.html +1 -0
- package/src/lib/shared/_base/base-control/base-control.component.scss +0 -0
- package/src/lib/shared/_base/base-control/base-control.component.spec.ts +21 -0
- package/src/lib/shared/_base/base-control/base-control.component.ts +91 -0
- package/src/lib/shared/_base/base-form/base-form.component.html +1 -0
- package/src/lib/shared/_base/base-form/base-form.component.scss +0 -0
- package/src/lib/shared/_base/base-form/base-form.component.spec.ts +133 -0
- package/src/lib/shared/_base/base-form/base-form.component.ts +203 -0
- package/src/lib/shared/_base/base-list/base-list.component.html +1 -0
- package/src/lib/shared/_base/base-list/base-list.component.scss +0 -0
- package/src/lib/shared/_base/base-list/base-list.component.spec.ts +21 -0
- package/src/lib/shared/_base/base-list/base-list.component.ts +47 -0
- package/src/lib/shared/components/form-container/form-container.component.html +54 -0
- package/src/lib/shared/components/form-container/form-container.component.scss +94 -0
- package/src/lib/shared/components/form-container/form-container.component.spec.ts +21 -0
- package/src/lib/shared/components/form-container/form-container.component.ts +75 -0
- package/src/lib/shared/components/list/block-list.component.html +44 -0
- package/src/lib/shared/components/list/block-list.component.scss +46 -0
- package/src/lib/shared/components/list/block-list.component.spec.ts +21 -0
- package/src/lib/shared/components/list/block-list.component.ts +57 -0
- package/src/lib/shared/components/queue-search-customer/queue-search-customer.component.html +24 -0
- package/src/lib/shared/components/queue-search-customer/queue-search-customer.component.scss +36 -0
- package/src/lib/shared/components/queue-search-customer/queue-search-customer.component.spec.ts +21 -0
- package/src/lib/shared/components/queue-search-customer/queue-search-customer.component.ts +25 -0
- package/src/lib/shared/components/sidebar/sidebar.component.html +13 -0
- package/src/lib/shared/components/sidebar/sidebar.component.scss +42 -0
- package/src/lib/shared/components/sidebar/sidebar.component.spec.ts +24 -0
- package/src/lib/shared/components/sidebar/sidebar.component.ts +26 -0
- package/src/lib/shared/constant/CSS.ts +9 -0
- package/src/lib/shared/constant/DATASOURCES.ts +19 -0
- package/src/lib/shared/constant/ERROR.ts +17 -0
- package/src/lib/shared/constant/HEADERS.ts +4 -0
- package/src/lib/shared/constant/LIST-CONFIG.ts +28 -0
- package/src/lib/shared/constant/LOOKUPS.ts +3 -0
- package/src/lib/shared/constant/MESSAGES.ts +7 -0
- package/src/lib/shared/constant/PERMISSION.ts +16 -0
- package/src/lib/shared/constant/ROUTES.ts +16 -0
- package/src/lib/shared/constant/SHARED.ts +420 -0
- package/src/lib/shared/constant/URLS.ts +7 -0
- package/src/lib/shared/controls/button/button.component.html +25 -0
- package/src/lib/shared/controls/button/button.component.scss +0 -0
- package/src/lib/shared/controls/button/button.component.spec.ts +21 -0
- package/src/lib/shared/controls/button/button.component.ts +15 -0
- package/src/lib/shared/controls/check-box/check-box.component.html +22 -0
- package/src/lib/shared/controls/check-box/check-box.component.scss +32 -0
- package/src/lib/shared/controls/check-box/check-box.component.spec.ts +26 -0
- package/src/lib/shared/controls/check-box/check-box.component.ts +19 -0
- package/src/lib/shared/controls/date/date.component.html +43 -0
- package/src/lib/shared/controls/date/date.component.scss +0 -0
- package/src/lib/shared/controls/date/date.component.spec.ts +21 -0
- package/src/lib/shared/controls/date/date.component.ts +44 -0
- package/src/lib/shared/controls/dropdown/dropdown.component.html +32 -0
- package/src/lib/shared/controls/dropdown/dropdown.component.scss +12 -0
- package/src/lib/shared/controls/dropdown/dropdown.component.ts +79 -0
- package/src/lib/shared/controls/file-upload/file-upload.component.html +18 -0
- package/src/lib/shared/controls/file-upload/file-upload.component.scss +0 -0
- package/src/lib/shared/controls/file-upload/file-upload.component.spec.ts +21 -0
- package/src/lib/shared/controls/file-upload/file-upload.component.ts +19 -0
- package/src/lib/shared/controls/number-feild/number-feild.component.html +39 -0
- package/src/lib/shared/controls/number-feild/number-feild.component.scss +13 -0
- package/src/lib/shared/controls/number-feild/number-feild.component.spec.ts +21 -0
- package/src/lib/shared/controls/number-feild/number-feild.component.ts +35 -0
- package/src/lib/shared/controls/password/password.component.html +25 -0
- package/src/lib/shared/controls/password/password.component.scss +0 -0
- package/src/lib/shared/controls/password/password.component.spec.ts +28 -0
- package/src/lib/shared/controls/password/password.component.ts +26 -0
- package/src/lib/shared/controls/text-area/text-area.component.html +38 -0
- package/src/lib/shared/controls/text-area/text-area.component.scss +22 -0
- package/src/lib/shared/controls/text-area/text-area.component.spec.ts +23 -0
- package/src/lib/shared/controls/text-area/text-area.component.ts +25 -0
- package/src/lib/shared/controls/text-box/text-box.component.html +39 -0
- package/src/lib/shared/controls/text-box/text-box.component.scss +25 -0
- package/src/lib/shared/controls/text-box/text-box.component.spec.ts +30 -0
- package/src/lib/shared/controls/text-box/text-box.component.ts +26 -0
- package/src/lib/shared/controls/username/username.component.html +20 -0
- package/src/lib/shared/controls/username/username.component.scss +0 -0
- package/src/lib/shared/controls/username/username.component.spec.ts +29 -0
- package/src/lib/shared/controls/username/username.component.ts +17 -0
- package/src/lib/shared/directives/permission.directive.spec.ts +60 -0
- package/src/lib/shared/directives/permission.directive.ts +39 -0
- package/{lib/shared/index.d.ts → src/lib/shared/index.ts} +39 -34
- package/src/lib/shared/models/attribute.model.ts +44 -0
- package/src/lib/shared/models/base.model.ts +4 -0
- package/{lib/widget/models/custom-widget.model.d.ts → src/lib/shared/models/custom-widget.model.ts} +14 -13
- package/src/lib/shared/models/list.model.ts +27 -0
- package/src/lib/shared/models/message.model.ts +4 -0
- package/src/lib/shared/models/meta-data.model.ts +6 -0
- package/src/lib/shared/pipe/capitalize-words.pipe.spec.ts +8 -0
- package/src/lib/shared/pipe/capitalize-words.pipe.ts +17 -0
- package/src/lib/shared/services/app-config.service.spec.ts +16 -0
- package/src/lib/shared/services/app-config.service.ts +56 -0
- package/src/lib/shared/services/auth/auth.guard.spec.ts +47 -0
- package/src/lib/shared/services/auth/auth.guard.ts +25 -0
- package/src/lib/shared/services/custom-widget.service.ts +29 -0
- package/src/lib/shared/services/data-transformer.service.spec.ts +16 -0
- package/src/lib/shared/services/data-transformer.service.ts +41 -0
- package/src/lib/shared/services/date-parser.service.spec.ts +16 -0
- package/src/lib/shared/services/date-parser.service.ts +54 -0
- package/src/lib/shared/services/form-state.service.spec.ts +16 -0
- package/src/lib/shared/services/form-state.service.ts +50 -0
- package/src/lib/shared/services/list.service.spec.ts +16 -0
- package/src/lib/shared/services/list.service.ts +54 -0
- package/src/lib/shared/services/session.service.spec.ts +16 -0
- package/src/lib/shared/services/session.service.ts +44 -0
- package/src/lib/shared/services/style-builder.service.spec.ts +16 -0
- package/src/lib/shared/services/style-builder.service.ts +61 -0
- package/src/lib/shared/services/table.builder.ts +43 -0
- package/src/lib/shared/services/validator.service.spec.ts +16 -0
- package/src/lib/shared/services/validator.service.ts +13 -0
- package/src/lib/shared/shared.module.ts +68 -0
- package/src/lib/shared/state/base.query.ts +73 -0
- package/src/lib/shared/state/base.service.ts +104 -0
- package/{lib/shared/state/base.state.d.ts → src/lib/shared/state/base.state.ts} +10 -10
- package/src/lib/shared/state/base.store.ts +89 -0
- package/src/lib/shared/table-primary/components/table-primary.component.html +99 -0
- package/src/lib/shared/table-primary/components/table-primary.component.scss +226 -0
- package/src/lib/shared/table-primary/components/table-primary.component.spec.ts +21 -0
- package/src/lib/shared/table-primary/components/table-primary.component.ts +191 -0
- package/src/lib/shared/table-primary/models/table-primary-header.model.ts +7 -0
- package/src/lib/shared/table-primary/models/table-primary.model.ts +13 -0
- package/src/lib/shared/table-secondary/components/table-secondary.component.html +162 -0
- package/src/lib/shared/table-secondary/components/table-secondary.component.scss +406 -0
- package/src/lib/shared/table-secondary/components/table-secondary.component.spec.ts +95 -0
- package/src/lib/shared/table-secondary/components/table-secondary.component.ts +235 -0
- package/src/lib/shared/table-secondary/index.ts +3 -0
- package/src/lib/shared/table-secondary/models/table-secondary-form.model.ts +12 -0
- package/src/lib/shared/table-secondary/models/table-secondary-header.model.ts +7 -0
- package/src/lib/shared/table-secondary/models/table-secondary.model.ts +20 -0
- package/src/lib/widget/components/custom-widget/custom-widget.component.html +71 -0
- package/src/lib/widget/components/custom-widget/custom-widget.component.scss +43 -0
- package/src/lib/widget/components/custom-widget/custom-widget.component.spec.ts +23 -0
- package/src/lib/widget/components/custom-widget/custom-widget.component.ts +27 -0
- package/src/lib/widget/components/widget-body/widget-body.component.html +14 -0
- package/src/lib/widget/components/widget-body/widget-body.component.scss +16 -0
- package/src/lib/widget/components/widget-body/widget-body.component.spec.ts +23 -0
- package/src/lib/widget/components/widget-body/widget-body.component.ts +39 -0
- package/src/lib/widget/components/widget-container/widget-container.component.html +21 -0
- package/src/lib/widget/components/widget-container/widget-container.component.scss +86 -0
- package/src/lib/widget/components/widget-container/widget-container.component.spec.ts +56 -0
- package/src/lib/widget/components/widget-container/widget-container.component.ts +47 -0
- package/src/lib/widget/components/widget-footer/widget-footer.component.html +10 -0
- package/src/lib/widget/components/widget-footer/widget-footer.component.scss +0 -0
- package/src/lib/widget/components/widget-footer/widget-footer.component.spec.ts +23 -0
- package/src/lib/widget/components/widget-footer/widget-footer.component.ts +25 -0
- package/src/lib/widget/components/widget-header/widget-header.component.html +13 -0
- package/src/lib/widget/components/widget-header/widget-header.component.scss +25 -0
- package/src/lib/widget/components/widget-header/widget-header.component.spec.ts +108 -0
- package/src/lib/widget/components/widget-header/widget-header.component.ts +31 -0
- package/src/lib/widget/components/widget-item/widget-item.component.html +60 -0
- package/src/lib/widget/components/widget-item/widget-item.component.scss +83 -0
- package/src/lib/widget/components/widget-item/widget-item.component.spec.ts +159 -0
- package/src/lib/widget/components/widget-item/widget-item.component.ts +119 -0
- package/src/lib/widget/components/widget-main/widget-main.component.html +9 -0
- package/src/lib/widget/components/widget-main/widget-main.component.scss +0 -0
- package/src/lib/widget/components/widget-main/widget-main.component.spec.ts +60 -0
- package/src/lib/widget/components/widget-main/widget-main.component.ts +30 -0
- package/src/lib/widget/components/widget-menu/widget-menu.component.html +28 -0
- package/src/lib/widget/components/widget-menu/widget-menu.component.scss +0 -0
- package/src/lib/widget/components/widget-menu/widget-menu.component.spec.ts +251 -0
- package/src/lib/widget/components/widget-menu/widget-menu.component.ts +139 -0
- package/src/lib/widget/components/widget-menu-body/widget-menu-body.component.html +15 -0
- package/src/lib/widget/components/widget-menu-body/widget-menu-body.component.scss +11 -0
- package/src/lib/widget/components/widget-menu-body/widget-menu-body.component.spec.ts +23 -0
- package/src/lib/widget/components/widget-menu-body/widget-menu-body.component.ts +12 -0
- package/src/lib/widget/components/widget-menu-container/widget-menu-container.component.html +28 -0
- package/src/lib/widget/components/widget-menu-container/widget-menu-container.component.scss +66 -0
- package/src/lib/widget/components/widget-menu-container/widget-menu-container.component.spec.ts +23 -0
- package/src/lib/widget/components/widget-menu-container/widget-menu-container.component.ts +172 -0
- package/src/lib/widget/components/widget-menu-header/widget-menu-header.component.html +24 -0
- package/src/lib/widget/components/widget-menu-header/widget-menu-header.component.scss +19 -0
- package/src/lib/widget/components/widget-menu-header/widget-menu-header.component.spec.ts +23 -0
- package/src/lib/widget/components/widget-menu-header/widget-menu-header.component.ts +14 -0
- package/src/lib/widget/components/widget-menu-item/widget-menu-item.component.html +30 -0
- package/src/lib/widget/components/widget-menu-item/widget-menu-item.component.scss +32 -0
- package/src/lib/widget/components/widget-menu-item/widget-menu-item.component.spec.ts +23 -0
- package/src/lib/widget/components/widget-menu-item/widget-menu-item.component.ts +69 -0
- package/src/lib/widget/components/widget-row-tile/widget-row-tile.component.html +22 -0
- package/src/lib/widget/components/widget-row-tile/widget-row-tile.component.scss +0 -0
- package/src/lib/widget/components/widget-row-tile/widget-row-tile.component.spec.ts +69 -0
- package/src/lib/widget/components/widget-row-tile/widget-row-tile.component.ts +54 -0
- package/{lib/shared/models/custom-widget.model.d.ts → src/lib/widget/models/custom-widget.model.ts} +14 -13
- package/src/lib/widget/models/progress-chart.model.ts +11 -0
- package/src/lib/widget/models/widget.model.ts +51 -0
- package/src/lib/widget/state/widget.query.ts +45 -0
- package/src/lib/widget/state/widget.service.ts +46 -0
- package/src/lib/widget/state/widget.state.ts +18 -0
- package/src/lib/widget/state/widget.store.ts +59 -0
- package/src/lib/widget/widget.module.ts +39 -0
- package/{public-api.d.ts → src/public-api.ts} +36 -26
- package/tsconfig.lib.json +15 -0
- package/tsconfig.lib.prod.json +11 -0
- package/tsconfig.spec.json +15 -0
- package/fesm2022/cat-qw-lib.mjs +0 -6155
- package/fesm2022/cat-qw-lib.mjs.map +0 -1
- package/index.d.ts +0 -5
- package/lib/admin/action-admin/action-admin.module.d.ts +0 -15
- package/lib/admin/action-admin/components/admin-action-form/admin-action-form.component.d.ts +0 -31
- package/lib/admin/action-admin/components/admin-action-list/admin-action-list.component.d.ts +0 -18
- package/lib/admin/action-admin/models/admin-action.model.d.ts +0 -12
- package/lib/admin/action-admin/state/admin-action.service.d.ts +0 -16
- package/lib/admin/action-admin/state/admin-action.store.d.ts +0 -8
- package/lib/admin/api-admin/api-admin.module.d.ts +0 -18
- package/lib/admin/api-admin/components/api-admin-form/api-admin-form.component.d.ts +0 -36
- package/lib/admin/api-admin/components/api-admin-list/api-admin-list.component.d.ts +0 -18
- package/lib/admin/api-admin/models/api-config.model.d.ts +0 -13
- package/lib/admin/api-admin/state/api-admin.service.d.ts +0 -19
- package/lib/admin/api-admin/state/api-admin.store.d.ts +0 -8
- package/lib/admin/dd-admin/components/dd-admin-form/dd-admin-form.component.d.ts +0 -40
- package/lib/admin/dd-admin/components/dd-admin-item-form/dd-admin-item-form.component.d.ts +0 -35
- package/lib/admin/dd-admin/components/dd-admin-list/dd-admin-list.component.d.ts +0 -16
- package/lib/admin/dd-admin/dd-admin.module.d.ts +0 -20
- package/lib/admin/dd-admin/models/api-property.model.d.ts +0 -6
- package/lib/admin/dd-admin/models/dd-attribute-sidebar-view.model.d.ts +0 -4
- package/lib/admin/dd-admin/models/dictionary.model.d.ts +0 -14
- package/lib/admin/dd-admin/state/dictionary.query.d.ts +0 -20
- package/lib/admin/dd-admin/state/dictionary.service.d.ts +0 -17
- package/lib/admin/dd-admin/state/dictionary.store.d.ts +0 -14
- package/lib/admin/queue-admin/components/queue-admin-form/queue-admin-form.component.d.ts +0 -42
- package/lib/admin/queue-admin/components/queue-admin-list/queue-admin-list.component.d.ts +0 -18
- package/lib/admin/queue-admin/components/queue-application-list/queue-application-list.component.d.ts +0 -28
- package/lib/admin/queue-admin/models/queue.model.d.ts +0 -14
- package/lib/admin/queue-admin/queue-admin-routing.module.d.ts +0 -7
- package/lib/admin/queue-admin/queue-admin.module.d.ts +0 -16
- package/lib/admin/queue-admin/state/queue.query.d.ts +0 -10
- package/lib/admin/queue-admin/state/queue.service.d.ts +0 -16
- package/lib/admin/queue-admin/state/queue.store.d.ts +0 -8
- package/lib/admin/template-admin/components/template-admin-form/template-admin-form.component.d.ts +0 -34
- package/lib/admin/template-admin/components/template-admin-list/template-admin-list.component.d.ts +0 -18
- package/lib/admin/template-admin/models/template.model.d.ts +0 -11
- package/lib/admin/template-admin/state/template-admin.query.d.ts +0 -13
- package/lib/admin/template-admin/state/template-admin.service.d.ts +0 -17
- package/lib/admin/template-admin/state/template-admin.store.d.ts +0 -11
- package/lib/admin/template-admin/template-admin.module.d.ts +0 -17
- package/lib/admin/widget-admin/components/widget-admin-form/widget-admin-form.component.d.ts +0 -43
- package/lib/admin/widget-admin/components/widget-admin-list/widget-admin-list.component.d.ts +0 -17
- package/lib/admin/widget-admin/models/widget.model.d.ts +0 -31
- package/lib/admin/widget-admin/state/widget-admin.query.d.ts +0 -13
- package/lib/admin/widget-admin/state/widget-admin.service.d.ts +0 -23
- package/lib/admin/widget-admin/state/widget-admin.store.d.ts +0 -11
- package/lib/admin/widget-admin/widget-admin.module.d.ts +0 -20
- package/lib/queue/components/queue-container/queue-container.component.d.ts +0 -97
- package/lib/queue/components/queue-item/queue-item.component.d.ts +0 -25
- package/lib/queue/components/queue-list/queue-list.component.d.ts +0 -9
- package/lib/queue/components/queue-record-table/queue-record-table.component.d.ts +0 -80
- package/lib/queue/components/queue-search/queue-search.component.d.ts +0 -40
- package/lib/queue/models/queue.model.d.ts +0 -10
- package/lib/queue/queue-routing.module.d.ts +0 -7
- package/lib/queue/queue.module.d.ts +0 -23
- package/lib/queue/services/application-assignment.service.d.ts +0 -18
- package/lib/queue/services/queue-record-table-builder.service.d.ts +0 -10
- package/lib/queue/state/queue.service.d.ts +0 -45
- package/lib/queue/state/queue.state.d.ts +0 -4
- package/lib/queue/state/queue.store.d.ts +0 -8
- package/lib/shared/_base/base-container/base-container.component.d.ts +0 -10
- package/lib/shared/_base/base-control/base-control.component.d.ts +0 -34
- package/lib/shared/_base/base-form/base-form.component.d.ts +0 -48
- package/lib/shared/_base/base-list/base-list.component.d.ts +0 -26
- package/lib/shared/components/form-container/form-container.component.d.ts +0 -28
- package/lib/shared/components/list/block-list.component.d.ts +0 -16
- package/lib/shared/components/queue-search-customer/queue-search-customer.component.d.ts +0 -10
- package/lib/shared/components/sidebar/sidebar.component.d.ts +0 -13
- package/lib/shared/constant/CSS.d.ts +0 -11
- package/lib/shared/constant/DATASOURCES.d.ts +0 -18
- package/lib/shared/constant/ERROR.d.ts +0 -17
- package/lib/shared/constant/HEADERS.d.ts +0 -4
- package/lib/shared/constant/LIST-CONFIG.d.ts +0 -7
- package/lib/shared/constant/LOOKUPS.d.ts +0 -3
- package/lib/shared/constant/MESSAGES.d.ts +0 -7
- package/lib/shared/constant/PERMISSION.d.ts +0 -16
- package/lib/shared/constant/ROUTES.d.ts +0 -16
- package/lib/shared/constant/SHARED.d.ts +0 -261
- package/lib/shared/constant/URLS.d.ts +0 -6
- package/lib/shared/controls/button/button.component.d.ts +0 -6
- package/lib/shared/controls/check-box/check-box.component.d.ts +0 -9
- package/lib/shared/controls/date/date.component.d.ts +0 -14
- package/lib/shared/controls/dropdown/dropdown.component.d.ts +0 -24
- package/lib/shared/controls/file-upload/file-upload.component.d.ts +0 -7
- package/lib/shared/controls/password/password.component.d.ts +0 -11
- package/lib/shared/controls/text-area/text-area.component.d.ts +0 -8
- package/lib/shared/controls/text-box/text-box.component.d.ts +0 -7
- package/lib/shared/controls/username/username.component.d.ts +0 -6
- package/lib/shared/directives/permission.directive.d.ts +0 -14
- package/lib/shared/models/attribute.model.d.ts +0 -43
- package/lib/shared/models/base.model.d.ts +0 -4
- package/lib/shared/models/list.model.d.ts +0 -11
- package/lib/shared/models/meta-data.model.d.ts +0 -6
- package/lib/shared/pipe/capitalize-words.pipe.d.ts +0 -7
- package/lib/shared/services/app-config.service.d.ts +0 -19
- package/lib/shared/services/auth/auth.guard.d.ts +0 -12
- package/lib/shared/services/custom-widget.service.d.ts +0 -10
- package/lib/shared/services/data-transformer.service.d.ts +0 -8
- package/lib/shared/services/date-parser.service.d.ts +0 -7
- package/lib/shared/services/form-state.service.d.ts +0 -17
- package/lib/shared/services/list.service.d.ts +0 -13
- package/lib/shared/services/session.service.d.ts +0 -14
- package/lib/shared/services/style-builder.service.d.ts +0 -14
- package/lib/shared/services/table.builder.d.ts +0 -14
- package/lib/shared/services/validator.service.d.ts +0 -7
- package/lib/shared/shared.module.d.ts +0 -36
- package/lib/shared/state/base.query.d.ts +0 -29
- package/lib/shared/state/base.service.d.ts +0 -29
- package/lib/shared/state/base.store.d.ts +0 -36
- package/lib/shared/table-primary/components/table-primary.component.d.ts +0 -60
- package/lib/shared/table-primary/models/table-primary-header.model.d.ts +0 -6
- package/lib/shared/table-primary/models/table-primary.model.d.ts +0 -10
- package/lib/shared/table-secondary/components/table-secondary.component.d.ts +0 -132
- package/lib/shared/table-secondary/models/table-secondary-header.model.d.ts +0 -6
- package/lib/shared/table-secondary/models/table-secondary.model.d.ts +0 -17
- package/lib/widget/components/custom-widget/custom-widget.component.d.ts +0 -13
- package/lib/widget/components/widget-body/widget-body.component.d.ts +0 -17
- package/lib/widget/components/widget-container/widget-container.component.d.ts +0 -26
- package/lib/widget/components/widget-footer/widget-footer.component.d.ts +0 -16
- package/lib/widget/components/widget-header/widget-header.component.d.ts +0 -22
- package/lib/widget/components/widget-item/widget-item.component.d.ts +0 -57
- package/lib/widget/components/widget-main/widget-main.component.d.ts +0 -22
- package/lib/widget/components/widget-menu/widget-menu.component.d.ts +0 -36
- package/lib/widget/components/widget-menu-body/widget-menu-body.component.d.ts +0 -7
- package/lib/widget/components/widget-menu-container/widget-menu-container.component.d.ts +0 -48
- package/lib/widget/components/widget-menu-header/widget-menu-header.component.d.ts +0 -9
- package/lib/widget/components/widget-menu-item/widget-menu-item.component.d.ts +0 -23
- package/lib/widget/components/widget-row-tile/widget-row-tile.component.d.ts +0 -24
- package/lib/widget/models/progress-chart.model.d.ts +0 -9
- package/lib/widget/models/widget.model.d.ts +0 -47
- package/lib/widget/state/widget.query.d.ts +0 -22
- package/lib/widget/state/widget.service.d.ts +0 -20
- package/lib/widget/state/widget.store.d.ts +0 -25
- package/lib/widget/widget.module.d.ts +0 -27
- package/src/assets/icons/confirm-icon.svg +0 -4
package/ng-package.json
ADDED
package/package.json
CHANGED
|
@@ -1,25 +1,16 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "cat-qw-lib",
|
|
3
|
-
"version": "0.
|
|
4
|
-
"peerDependencies": {
|
|
5
|
-
"@angular/common": "^19.0.0",
|
|
6
|
-
"@angular/core": "^19.0.0"
|
|
7
|
-
},
|
|
8
|
-
"dependencies": {
|
|
9
|
-
"tslib": "^2.3.0"
|
|
10
|
-
},
|
|
11
|
-
"typings": "index.d.ts",
|
|
12
|
-
"main": "bundles/cat-qw-lib.umd.js",
|
|
13
|
-
"module": "
|
|
14
|
-
"es2015": "fesm2015/cat-qw-lib.js",
|
|
15
|
-
"sideEffects": false
|
|
16
|
-
|
|
17
|
-
"./package.json": {
|
|
18
|
-
"default": "./package.json"
|
|
19
|
-
},
|
|
20
|
-
".": {
|
|
21
|
-
"types": "./index.d.ts",
|
|
22
|
-
"default": "./fesm2022/cat-qw-lib.mjs"
|
|
23
|
-
}
|
|
24
|
-
}
|
|
25
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"name": "cat-qw-lib",
|
|
3
|
+
"version": "1.0.0",
|
|
4
|
+
"peerDependencies": {
|
|
5
|
+
"@angular/common": "^19.0.0",
|
|
6
|
+
"@angular/core": "^19.0.0"
|
|
7
|
+
},
|
|
8
|
+
"dependencies": {
|
|
9
|
+
"tslib": "^2.3.0"
|
|
10
|
+
},
|
|
11
|
+
"typings": "index.d.ts",
|
|
12
|
+
"main": "bundles/cat-qw-lib.umd.js",
|
|
13
|
+
"module": "fesm2015/cat-qw-lib.js",
|
|
14
|
+
"es2015": "fesm2015/cat-qw-lib.js",
|
|
15
|
+
"sideEffects": false
|
|
16
|
+
}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { NgModule } from '@angular/core';
|
|
2
|
+
import { CommonModule } from '@angular/common';
|
|
3
|
+
import { AdminActionListComponent } from './components/admin-action-list/admin-action-list.component';
|
|
4
|
+
import { CheckBoxComponent, SharedModule, TablePrimaryComponent } from '../../shared';
|
|
5
|
+
import { AdminActionFormComponent } from './components/admin-action-form/admin-action-form.component';
|
|
6
|
+
import { FormsModule } from '@angular/forms';
|
|
7
|
+
import { TextAreaComponent } from '../../shared/controls/text-area/text-area.component';
|
|
8
|
+
import { ButtonModule } from 'primeng/button';
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
@NgModule({
|
|
13
|
+
declarations: [AdminActionListComponent, AdminActionFormComponent],
|
|
14
|
+
imports: [
|
|
15
|
+
CommonModule,
|
|
16
|
+
FormsModule,
|
|
17
|
+
SharedModule,
|
|
18
|
+
TablePrimaryComponent,
|
|
19
|
+
TextAreaComponent,
|
|
20
|
+
ButtonModule,
|
|
21
|
+
CheckBoxComponent
|
|
22
|
+
],
|
|
23
|
+
exports: [AdminActionListComponent, AdminActionFormComponent]
|
|
24
|
+
})
|
|
25
|
+
export class ActionAdminModule { }
|
package/src/lib/admin/action-admin/components/admin-action-form/admin-action-form.component.html
ADDED
|
@@ -0,0 +1,113 @@
|
|
|
1
|
+
<form-container
|
|
2
|
+
[record]="record"
|
|
3
|
+
[headerText]="'Actions / Actions Form'"
|
|
4
|
+
[messages]="messages"
|
|
5
|
+
(onSave)="handleSubmit()"
|
|
6
|
+
[showSave]="true"
|
|
7
|
+
(onCancel)="handleCancel()"
|
|
8
|
+
>
|
|
9
|
+
<div class="card p-fluid p-formgrid grid ">
|
|
10
|
+
<h4 class="font-bold col-12 md:col-12">Actions Form</h4>
|
|
11
|
+
<div class="col-12 md:col-5">
|
|
12
|
+
<text-box
|
|
13
|
+
[store]="adminActionStore"
|
|
14
|
+
[record]="record"
|
|
15
|
+
[attributeModel]="{
|
|
16
|
+
readonly: false,
|
|
17
|
+
name: 'name',
|
|
18
|
+
isRequired: true,
|
|
19
|
+
displayText: 'Action Name',
|
|
20
|
+
placeholder: 'Enter Action Name'
|
|
21
|
+
}"
|
|
22
|
+
></text-box>
|
|
23
|
+
</div>
|
|
24
|
+
|
|
25
|
+
<div class="col-12 md:col-5">
|
|
26
|
+
<dropdown
|
|
27
|
+
[store]="adminActionStore"
|
|
28
|
+
[record]="record"
|
|
29
|
+
[attributeModel]="{
|
|
30
|
+
name: 'apiConfigId',
|
|
31
|
+
readonly: false,
|
|
32
|
+
isRequired: true,
|
|
33
|
+
displayText: 'End Point',
|
|
34
|
+
placeholder: 'Select End Point'
|
|
35
|
+
}"></dropdown>
|
|
36
|
+
</div>
|
|
37
|
+
|
|
38
|
+
<div class="col-2 md:col-2 mt-5">
|
|
39
|
+
<check-box [store]="adminActionStore" [record]="record" [attributeModel]="{
|
|
40
|
+
name:'isActive',
|
|
41
|
+
displayText : 'Active',
|
|
42
|
+
}">
|
|
43
|
+
</check-box>
|
|
44
|
+
</div>
|
|
45
|
+
|
|
46
|
+
<div class="col-12 md:col-6">
|
|
47
|
+
<dropdown
|
|
48
|
+
[store]="adminActionStore"
|
|
49
|
+
[record]="record"
|
|
50
|
+
[attributeModel]="{
|
|
51
|
+
name:'queueId',
|
|
52
|
+
isRequired: true,
|
|
53
|
+
displayText : 'Queue',
|
|
54
|
+
placeholder: 'Select Queue',
|
|
55
|
+
readonly: false
|
|
56
|
+
}"></dropdown>
|
|
57
|
+
</div>
|
|
58
|
+
|
|
59
|
+
<div class="col-12 md:col-6">
|
|
60
|
+
<text-box
|
|
61
|
+
[store]="adminActionStore"
|
|
62
|
+
[record]="record"
|
|
63
|
+
[attributeModel]="{
|
|
64
|
+
readonly: false,
|
|
65
|
+
name: 'apiDocsUrl',
|
|
66
|
+
isRequired: false,
|
|
67
|
+
displayText: 'API Docs URL',
|
|
68
|
+
placeholder: 'Enter API Docs URL'
|
|
69
|
+
}"
|
|
70
|
+
></text-box>
|
|
71
|
+
</div>
|
|
72
|
+
|
|
73
|
+
<div class="col-12 md:col-12">
|
|
74
|
+
<text-area
|
|
75
|
+
[store]="adminActionStore"
|
|
76
|
+
[record]="record"
|
|
77
|
+
[attributeModel]="{
|
|
78
|
+
readonly: false,
|
|
79
|
+
name: 'prompt',
|
|
80
|
+
isRequired: true,
|
|
81
|
+
displayText: 'Prompt',
|
|
82
|
+
placeholder: 'Enter prompt'
|
|
83
|
+
}"
|
|
84
|
+
></text-area>
|
|
85
|
+
</div>
|
|
86
|
+
|
|
87
|
+
<div class="w-full flex justify-content-end px-2 mt-2">
|
|
88
|
+
<button
|
|
89
|
+
pButton
|
|
90
|
+
pRipple
|
|
91
|
+
type="button"
|
|
92
|
+
label="Validate"
|
|
93
|
+
class="p-button-raised validate-btn-wrapper"
|
|
94
|
+
(click)="handleValidateAction()"
|
|
95
|
+
></button>
|
|
96
|
+
</div>
|
|
97
|
+
|
|
98
|
+
<div class="col-12 md:col-12">
|
|
99
|
+
<text-area
|
|
100
|
+
[store]="adminActionStore"
|
|
101
|
+
[record]="record"
|
|
102
|
+
[attributeModel]="{
|
|
103
|
+
readonly: false,
|
|
104
|
+
name: 'formFields',
|
|
105
|
+
isRequired: true,
|
|
106
|
+
displayText: 'Form Configuration',
|
|
107
|
+
placeholder: 'Enter form fields'
|
|
108
|
+
}"
|
|
109
|
+
></text-area>
|
|
110
|
+
</div>
|
|
111
|
+
</div>
|
|
112
|
+
|
|
113
|
+
</form-container>
|
package/src/lib/admin/action-admin/components/admin-action-form/admin-action-form.component.spec.ts
ADDED
|
@@ -0,0 +1,119 @@
|
|
|
1
|
+
import { ComponentFixture, fakeAsync, TestBed, tick } from '@angular/core/testing';
|
|
2
|
+
import { AdminActionFormComponent } from './admin-action-form.component';
|
|
3
|
+
import { ActivatedRoute } from '@angular/router';
|
|
4
|
+
import { AppConfigService, BaseService, ERROR, ROUTES, SHARED, TextBoxComponent } from '../../../../shared';
|
|
5
|
+
import { FormContainerComponent } from '../../../../shared/components/form-container/form-container.component';
|
|
6
|
+
import { DropdownComponent } from '../../../../shared/controls/dropdown/dropdown.component';
|
|
7
|
+
import { HttpClientTestingModule } from '@angular/common/http/testing';
|
|
8
|
+
import { TextAreaComponent } from '../../../../shared/controls/text-area/text-area.component';
|
|
9
|
+
import { AdminActionService } from '../../state/admin-action.service';
|
|
10
|
+
import { MESSAGE } from '../../../../shared/constant/MESSAGES';
|
|
11
|
+
import { of, throwError } from 'rxjs';
|
|
12
|
+
import { AdminActionModel } from '../../models/admin-action.model';
|
|
13
|
+
import { ValidatorService } from '../../../../shared/services/validator.service';
|
|
14
|
+
import { NO_ERRORS_SCHEMA } from '@angular/core';
|
|
15
|
+
|
|
16
|
+
describe('AdminActionFormComponent', () => {
|
|
17
|
+
let component: AdminActionFormComponent;
|
|
18
|
+
let fixture: ComponentFixture<AdminActionFormComponent>;
|
|
19
|
+
let adminActionService: jasmine.SpyObj<AdminActionService>;
|
|
20
|
+
let appConfigService: jasmine.SpyObj<AppConfigService>;
|
|
21
|
+
let activatedRouteMock: any;
|
|
22
|
+
let baseService: jasmine.SpyObj<BaseService<any>>;
|
|
23
|
+
let validatorService: jasmine.SpyObj<any>;
|
|
24
|
+
|
|
25
|
+
beforeEach(async () => {
|
|
26
|
+
const adminActionServiceSpy = jasmine.createSpyObj('AdminActionService', ['handleValidateAction', 'handleSubmit', 'initList']);
|
|
27
|
+
const appConfigServiceSpy = jasmine.createSpyObj('AppConfigService', ['swaggerUrl']);
|
|
28
|
+
const baseServiceSpy = jasmine.createSpyObj('BaseService', ['create', 'update']);
|
|
29
|
+
const validatorServiceSpy = jasmine.createSpyObj('ValidatorService', ['handleValidateRecords']);
|
|
30
|
+
await TestBed.configureTestingModule({
|
|
31
|
+
declarations: [AdminActionFormComponent],
|
|
32
|
+
imports: [HttpClientTestingModule, FormContainerComponent, TextBoxComponent, DropdownComponent, TextAreaComponent],
|
|
33
|
+
providers: [
|
|
34
|
+
{ provide: ActivatedRoute, useValue: activatedRouteMock },
|
|
35
|
+
{ provide: AdminActionService, useValue: adminActionServiceSpy },
|
|
36
|
+
{ provide: AppConfigService, useValue: appConfigServiceSpy },
|
|
37
|
+
{ provide: BaseService, useValue: baseServiceSpy },
|
|
38
|
+
{ provide: ValidatorService, useValue: validatorServiceSpy }
|
|
39
|
+
],
|
|
40
|
+
schemas: [NO_ERRORS_SCHEMA]
|
|
41
|
+
}).compileComponents();
|
|
42
|
+
|
|
43
|
+
component = TestBed.createComponent(AdminActionFormComponent).componentInstance;
|
|
44
|
+
adminActionService = TestBed.inject(AdminActionService) as jasmine.SpyObj<AdminActionService>;
|
|
45
|
+
baseService = TestBed.inject(BaseService) as jasmine.SpyObj<BaseService<any>>;
|
|
46
|
+
validatorService = TestBed.inject(ValidatorService) as jasmine.SpyObj<any>;
|
|
47
|
+
appConfigService = TestBed.inject(AppConfigService) as jasmine.SpyObj<AppConfigService>;
|
|
48
|
+
Object.defineProperty(appConfigService, 'swaggerUrl', {
|
|
49
|
+
get: () => 'mock-url',
|
|
50
|
+
configurable: true
|
|
51
|
+
});
|
|
52
|
+
adminActionService.initList.and.returnValue(Promise.resolve());
|
|
53
|
+
fixture = TestBed.createComponent(AdminActionFormComponent);
|
|
54
|
+
component = fixture.componentInstance;
|
|
55
|
+
fixture.detectChanges();
|
|
56
|
+
});
|
|
57
|
+
|
|
58
|
+
it('should create the component', () => {
|
|
59
|
+
expect(component).toBeTruthy();
|
|
60
|
+
});
|
|
61
|
+
|
|
62
|
+
it('should call handleValidateAction and set success message when response is successful', fakeAsync(() => {
|
|
63
|
+
const mockResponse: AdminActionModel[] = [
|
|
64
|
+
{
|
|
65
|
+
name: 'Action 1', apiConfigId: '1', prompt: 'Prompt 1', queueId: 'Q1', formFields: 'Field1', status: 'Enable', isActive: true,
|
|
66
|
+
|
|
67
|
+
apiDocsUrl: 'test'
|
|
68
|
+
},
|
|
69
|
+
{
|
|
70
|
+
name: 'Action 2', apiConfigId: '2', prompt: 'Prompt 2', queueId: 'Q2', formFields: 'Field2', status: 'Disable', isActive: false,
|
|
71
|
+
|
|
72
|
+
apiDocsUrl: 'test'
|
|
73
|
+
}
|
|
74
|
+
];
|
|
75
|
+
adminActionService.handleValidateAction.and.returnValue(of(mockResponse));
|
|
76
|
+
component.record = { name: 'Action 1', apiConfigId: '123', prompt: 'Prompt 1', queueId: 'Q1',apiDocsUrl:'', formFields: 'Field1', status: 'Enable', isActive: true }
|
|
77
|
+
component.handleValidateAction();
|
|
78
|
+
|
|
79
|
+
expect(adminActionService.handleValidateAction).toHaveBeenCalledOnceWith(
|
|
80
|
+
ROUTES.VALIDATE_ACTIONS, '123', { path: 'mock-url' }
|
|
81
|
+
);
|
|
82
|
+
expect(component.messages).toEqual([
|
|
83
|
+
{ severity: SHARED.SUCCESS, detail: MESSAGE.VALIDATE_ACTION_SUCCESS_MESSAGE }
|
|
84
|
+
]);
|
|
85
|
+
|
|
86
|
+
tick(3000);
|
|
87
|
+
expect(component.messages).toEqual(SHARED.EMPTYARRAY);
|
|
88
|
+
}));
|
|
89
|
+
|
|
90
|
+
it('should call handleValidateAction and set error message when response fails', fakeAsync(() => {
|
|
91
|
+
const errorResponse = { message: 'Error' };
|
|
92
|
+
adminActionService.handleValidateAction.and.returnValue(throwError(() => errorResponse));
|
|
93
|
+
component.record = { apiConfigId: '1', name: 'Action 1', prompt: 'Prompt 1', queueId: 'Q1', formFields: 'Field1', status: 'Enable', isActive: true, apiDocsUrl:'test' };
|
|
94
|
+
component.handleValidateAction();
|
|
95
|
+
|
|
96
|
+
expect(adminActionService.handleValidateAction).toHaveBeenCalledOnceWith(
|
|
97
|
+
ROUTES.VALIDATE_ACTIONS, '1', { path: 'mock-url' }
|
|
98
|
+
);
|
|
99
|
+
|
|
100
|
+
expect(component.messages).toEqual([
|
|
101
|
+
{ severity: SHARED.ERROR, detail: ERROR.VALIDATE_ACTION_API_FAILED }
|
|
102
|
+
]);
|
|
103
|
+
|
|
104
|
+
tick(3000);
|
|
105
|
+
expect(component.messages).toEqual(SHARED.EMPTYARRAY);
|
|
106
|
+
}));
|
|
107
|
+
|
|
108
|
+
it('should stringify formFields and call super.handleSubmit', () => {
|
|
109
|
+
component.record = { _id: null, apiConfigId: '1', name: 'Action 1', formFields: 'testing', status: 'Enable', isActive: true, prompt: 'test', queueId: '123', apiDocsUrl:'test' };
|
|
110
|
+
const mockFormFields = 'testing';
|
|
111
|
+
spyOn(component, 'handleSubmit').and.callThrough();
|
|
112
|
+
|
|
113
|
+
baseService.create.and.returnValue(of({ ...component.record, _id: '123' }));
|
|
114
|
+
component.handleSubmit();
|
|
115
|
+
|
|
116
|
+
expect(component.record.formFields).toEqual(JSON.stringify(mockFormFields));
|
|
117
|
+
expect(component.handleSubmit).toHaveBeenCalled();
|
|
118
|
+
});
|
|
119
|
+
});
|
package/src/lib/admin/action-admin/components/admin-action-form/admin-action-form.component.ts
ADDED
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
import { Component, OnDestroy, OnInit } from '@angular/core';
|
|
2
|
+
import { BaseFormComponent } from '../../../../shared/_base/base-form/base-form.component';
|
|
3
|
+
import { AdminActionModel } from '../../models/admin-action.model';
|
|
4
|
+
import { Message } from 'primeng/api';
|
|
5
|
+
import { SHARED } from '../../../../shared/constant/SHARED';
|
|
6
|
+
import { AdminActionService } from '../../state/admin-action.service';
|
|
7
|
+
import { ValidatorService } from '../../../../shared/services/validator.service';
|
|
8
|
+
import { ActivatedRoute, Router } from '@angular/router';
|
|
9
|
+
import { AdminActionStore } from '../../state/admin-action.store';
|
|
10
|
+
import { AppConfigService, BaseQuery, BaseStore, ROUTES } from '../../../../shared';
|
|
11
|
+
import { MESSAGE } from '../../../../shared/constant/MESSAGES';
|
|
12
|
+
|
|
13
|
+
@Component({
|
|
14
|
+
selector: 'lib-admin-action-form',
|
|
15
|
+
standalone : false,
|
|
16
|
+
templateUrl: './admin-action-form.component.html',
|
|
17
|
+
styleUrl: './admin-action-form.component.scss'
|
|
18
|
+
})
|
|
19
|
+
export class AdminActionFormComponent extends BaseFormComponent<AdminActionModel> implements OnInit, OnDestroy{
|
|
20
|
+
messages: Message[] = SHARED.EMPTYARRAY;
|
|
21
|
+
apiConfigList: any[] = [];
|
|
22
|
+
queueList: any[] = [];
|
|
23
|
+
|
|
24
|
+
constructor(public adminActionService: AdminActionService, override validatorService: ValidatorService, override router: Router, override activatedRoute: ActivatedRoute, public adminActionStore: AdminActionStore, private appConfigService: AppConfigService, override baseStore: BaseStore<AdminActionModel>, override baseQuery: BaseQuery<AdminActionModel>) {
|
|
25
|
+
super(adminActionService, validatorService, router, activatedRoute)
|
|
26
|
+
this.record = new AdminActionModel();
|
|
27
|
+
this.record.isActive = true;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
ngOnInit() {
|
|
31
|
+
this.init();
|
|
32
|
+
this.baseStore.setIsApiValidated(null);
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
handleValidateAction() {
|
|
36
|
+
const payload = {path: this.record.apiDocsUrl};
|
|
37
|
+
this.adminActionService.handleValidateAction(ROUTES.VALIDATE_ACTIONS,this.record.apiConfigId,payload)
|
|
38
|
+
.subscribe({
|
|
39
|
+
next: (res: any) => {
|
|
40
|
+
if (res) {
|
|
41
|
+
if (typeof res !== SHARED.STRING) {
|
|
42
|
+
this.record.formFields = JSON.stringify(res);
|
|
43
|
+
} else {
|
|
44
|
+
this.record.formFields = res;
|
|
45
|
+
}
|
|
46
|
+
this.messages = [{ severity: SHARED.SUCCESS, detail: MESSAGE.VALIDATE_ACTION_SUCCESS_MESSAGE }];
|
|
47
|
+
setTimeout(() => {
|
|
48
|
+
this.messages = SHARED.EMPTYARRAY;
|
|
49
|
+
}, 3000);
|
|
50
|
+
// this.baseStore.setIsApiValidated(SHARED.TRUE);
|
|
51
|
+
}
|
|
52
|
+
},
|
|
53
|
+
error: (error: any) => {
|
|
54
|
+
// this.baseStore.setIsApiValidated(SHARED.FALSE);
|
|
55
|
+
},
|
|
56
|
+
});
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
override handleSubmit(): void {
|
|
60
|
+
if (typeof this.record.formFields !== SHARED.STRING && !this.isValidJSONArray(this.record.formFields)) {
|
|
61
|
+
this.record.formFields = JSON.stringify(this.record.formFields);
|
|
62
|
+
}
|
|
63
|
+
super.handleSubmit();
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
private isValidJSONArray(value: string): boolean {
|
|
67
|
+
try {
|
|
68
|
+
const parsed = JSON.parse(value);
|
|
69
|
+
return Array.isArray(parsed);
|
|
70
|
+
} catch (e) {
|
|
71
|
+
return false;
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
override ngOnDestroy(): void {
|
|
76
|
+
this.record = {} as AdminActionModel;
|
|
77
|
+
super.ngOnDestroy();
|
|
78
|
+
}
|
|
79
|
+
}
|
package/src/lib/admin/action-admin/components/admin-action-list/admin-action-list.component.scss
ADDED
|
File without changes
|
package/src/lib/admin/action-admin/components/admin-action-list/admin-action-list.component.spec.ts
ADDED
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { ComponentFixture, TestBed } from '@angular/core/testing';
|
|
2
|
+
import { AdminActionListComponent } from './admin-action-list.component';
|
|
3
|
+
import { HttpClientTestingModule } from '@angular/common/http/testing';
|
|
4
|
+
import { TablePrimaryComponent } from '../../../../shared';
|
|
5
|
+
import { AdminActionService } from '../../state/admin-action.service';
|
|
6
|
+
import { of } from 'rxjs';
|
|
7
|
+
|
|
8
|
+
describe('AdminActionListComponent', () => {
|
|
9
|
+
let component: AdminActionListComponent;
|
|
10
|
+
let fixture: ComponentFixture<AdminActionListComponent>;
|
|
11
|
+
let mockActionAdminService: jasmine.SpyObj<AdminActionService>;
|
|
12
|
+
|
|
13
|
+
beforeEach(async () => {
|
|
14
|
+
const mockData = [{ _id: 1, name: 'Test API' }];
|
|
15
|
+
mockActionAdminService = jasmine.createSpyObj("AdminActionService", ['getAll']);
|
|
16
|
+
mockActionAdminService.getAll.and.returnValue(of(mockData) as any);
|
|
17
|
+
await TestBed.configureTestingModule({
|
|
18
|
+
declarations: [AdminActionListComponent],
|
|
19
|
+
imports:[HttpClientTestingModule, TablePrimaryComponent],
|
|
20
|
+
providers : [{provide : AdminActionService , useValue : mockActionAdminService}]
|
|
21
|
+
}).compileComponents();
|
|
22
|
+
|
|
23
|
+
fixture = TestBed.createComponent(AdminActionListComponent);
|
|
24
|
+
component = fixture.componentInstance;
|
|
25
|
+
fixture.detectChanges();
|
|
26
|
+
});
|
|
27
|
+
|
|
28
|
+
it('should create the component', () => {
|
|
29
|
+
expect(component).toBeTruthy();
|
|
30
|
+
});
|
|
31
|
+
|
|
32
|
+
it('should initialize table with data', () => {
|
|
33
|
+
expect(mockActionAdminService.getAll).toHaveBeenCalled();
|
|
34
|
+
expect(component.table).toBeDefined();
|
|
35
|
+
});
|
|
36
|
+
});
|
package/src/lib/admin/action-admin/components/admin-action-list/admin-action-list.component.ts
ADDED
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { Component, OnInit } from '@angular/core';
|
|
2
|
+
import { BaseListComponent } from '../../../../shared/_base/base-list/base-list.component';
|
|
3
|
+
import { AdminActionModel } from '../../models/admin-action.model';
|
|
4
|
+
import { TableBuilder } from '../../../../shared/services/table.builder';
|
|
5
|
+
import { AdminActionService } from '../../state/admin-action.service';
|
|
6
|
+
import { actionHiddenHeaderList, actionList, actionTableColumnWidthList } from '../../../../shared/constant/SHARED';
|
|
7
|
+
import { DATASOURCES } from '../../../../shared';
|
|
8
|
+
import { PERMISSION } from '../../../../shared/constant/PERMISSION';
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
* Admin Action List Component
|
|
12
|
+
*/
|
|
13
|
+
@Component({
|
|
14
|
+
selector: 'lib-admin-action-list',
|
|
15
|
+
standalone : false,
|
|
16
|
+
templateUrl: './admin-action-list.component.html',
|
|
17
|
+
styleUrl: './admin-action-list.component.scss'
|
|
18
|
+
})
|
|
19
|
+
export class AdminActionListComponent extends BaseListComponent<AdminActionModel>{
|
|
20
|
+
|
|
21
|
+
pathName:string = DATASOURCES.ACTIONS;
|
|
22
|
+
override editPermission: string = PERMISSION.ACTIONCONFIG_PUT
|
|
23
|
+
override deletePermission: string = PERMISSION.ACTIONCONFIG_DELETE
|
|
24
|
+
constructor(service: AdminActionService, private tableBuilder: TableBuilder){
|
|
25
|
+
super(service, tableBuilder)
|
|
26
|
+
this.tableBuilder.hiddenHeaders = actionHiddenHeaderList;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
ngOnInit() {
|
|
30
|
+
this.init(actionTableColumnWidthList);
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { BaseModel } from "../../../shared/models/base.model";
|
|
2
|
+
|
|
3
|
+
export class AdminActionModel extends BaseModel {
|
|
4
|
+
name!: string;
|
|
5
|
+
apiConfigId!: string;
|
|
6
|
+
prompt!: string;
|
|
7
|
+
queueId!: string;
|
|
8
|
+
formFields!: string;
|
|
9
|
+
status!: StatusType;
|
|
10
|
+
isActive!: boolean;
|
|
11
|
+
apiDocsUrl!: string;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
export type StatusType = "Enable" | "Disable";
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { Injectable } from '@angular/core';
|
|
2
|
+
import { AdminActionModel } from '../models/admin-action.model';
|
|
3
|
+
import { AdminActionStore } from './admin-action.store';
|
|
4
|
+
import { BaseQuery } from '../../../shared/state/base.query';
|
|
5
|
+
|
|
6
|
+
@Injectable({ providedIn: 'root' })
|
|
7
|
+
export class AdminActionQuery extends BaseQuery<AdminActionModel> {
|
|
8
|
+
constructor(protected override store: AdminActionStore) {
|
|
9
|
+
super(store);
|
|
10
|
+
}
|
|
11
|
+
}
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
import { TestBed } from '@angular/core/testing';
|
|
2
|
+
import { HttpClientTestingModule, HttpTestingController } from '@angular/common/http/testing';
|
|
3
|
+
import { AdminActionService } from './admin-action.service';
|
|
4
|
+
import { AdminActionStore } from './admin-action.store';
|
|
5
|
+
import { AdminActionModel } from '../models/admin-action.model';
|
|
6
|
+
import { AppConfigService } from '../../../shared';
|
|
7
|
+
|
|
8
|
+
describe('AdminActionService', () => {
|
|
9
|
+
let service: AdminActionService;
|
|
10
|
+
let httpMock: HttpTestingController;
|
|
11
|
+
let appConfigService: jasmine.SpyObj<AppConfigService>;
|
|
12
|
+
let actionStoreSpy: jasmine.SpyObj<AdminActionStore>;
|
|
13
|
+
|
|
14
|
+
const mockApiUrl = 'http://mock-api-url.com/';
|
|
15
|
+
const mockAppConfig = {
|
|
16
|
+
baseApi: mockApiUrl,
|
|
17
|
+
visibilityOption: [],
|
|
18
|
+
swaggerUrl: 'https://mock-swagger-url.com/',
|
|
19
|
+
};
|
|
20
|
+
beforeEach(() => {
|
|
21
|
+
const actionStoreSpyObj = jasmine.createSpyObj('ActionStore', ['set']);
|
|
22
|
+
const appConfigSpy = jasmine.createSpyObj('AppConfigService', ['apiBaseUrl', 'swaggerUrl']);
|
|
23
|
+
|
|
24
|
+
TestBed.configureTestingModule({
|
|
25
|
+
imports: [HttpClientTestingModule],
|
|
26
|
+
providers: [
|
|
27
|
+
AdminActionService,
|
|
28
|
+
{ provide: AdminActionStore, useValue: actionStoreSpyObj },
|
|
29
|
+
{ provide: AppConfigService, useValue: appConfigSpy },
|
|
30
|
+
],
|
|
31
|
+
});
|
|
32
|
+
|
|
33
|
+
service = TestBed.inject(AdminActionService);
|
|
34
|
+
httpMock = TestBed.inject(HttpTestingController);
|
|
35
|
+
appConfigService = TestBed.inject(AppConfigService) as jasmine.SpyObj<AppConfigService>;
|
|
36
|
+
actionStoreSpy = TestBed.inject(AdminActionStore) as jasmine.SpyObj<AdminActionStore>;
|
|
37
|
+
|
|
38
|
+
Object.defineProperty(appConfigService, 'apiBaseUrl', { get: () => mockAppConfig.baseApi });
|
|
39
|
+
Object.defineProperty(appConfigService, 'swaggerUrl', { get: () => mockAppConfig.swaggerUrl });
|
|
40
|
+
});
|
|
41
|
+
|
|
42
|
+
afterEach(() => {
|
|
43
|
+
httpMock.verify();
|
|
44
|
+
});
|
|
45
|
+
|
|
46
|
+
it('should make a POST request and call actionStore.set with the response data', () => {
|
|
47
|
+
const mockName = 'validate-action';
|
|
48
|
+
const mockId = '123';
|
|
49
|
+
const mockRecord = { key: 'value' };
|
|
50
|
+
const mockResponse: AdminActionModel[] = [
|
|
51
|
+
{ name: 'Action 1', apiConfigId: '123', prompt: '', queueId: '', formFields: '', status: 'Enable', isActive: true, apiDocsUrl:"test"},
|
|
52
|
+
{ name: 'Action 2', apiConfigId: '124', prompt: '', queueId: '', formFields: '', status: 'Disable', isActive: false, apiDocsUrl : "test" },
|
|
53
|
+
];
|
|
54
|
+
|
|
55
|
+
service.handleValidateAction(mockName, mockId, mockRecord).subscribe((response) => {
|
|
56
|
+
expect(response).toEqual(mockResponse);
|
|
57
|
+
expect(actionStoreSpy.set).toHaveBeenCalledWith(mockResponse);
|
|
58
|
+
});
|
|
59
|
+
|
|
60
|
+
const req = httpMock.expectOne(`${mockApiUrl}${mockName}/${encodeURIComponent(mockId)}`);
|
|
61
|
+
expect(req.request.method).toBe('POST');
|
|
62
|
+
expect(req.request.body).toEqual(mockRecord);
|
|
63
|
+
|
|
64
|
+
req.flush(mockResponse);
|
|
65
|
+
});
|
|
66
|
+
});
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
|
|
2
|
+
import { Injectable } from '@angular/core';
|
|
3
|
+
import { HttpClient } from '@angular/common/http';
|
|
4
|
+
import { AdminActionModel } from '../models/admin-action.model';
|
|
5
|
+
import { AdminActionStore } from './admin-action.store';
|
|
6
|
+
import { DATASOURCES } from '../../../shared/constant/DATASOURCES';
|
|
7
|
+
import { BaseService } from '../../../shared/state/base.service';
|
|
8
|
+
import { AppConfigService } from '../../../shared/services/app-config.service';
|
|
9
|
+
import { ListService } from '../../../shared/services/list.service';
|
|
10
|
+
import { LISTCONFIG } from '../../../shared/constant/LIST-CONFIG';
|
|
11
|
+
import { Observable, tap } from 'rxjs';
|
|
12
|
+
|
|
13
|
+
@Injectable({ providedIn: 'root' })
|
|
14
|
+
export class AdminActionService extends BaseService<AdminActionModel> {
|
|
15
|
+
|
|
16
|
+
protected override list : any= [...LISTCONFIG.QUEUEAPICONFIG, ...LISTCONFIG.ACTIONQUEUECONFIG];
|
|
17
|
+
|
|
18
|
+
constructor(protected actionStore: AdminActionStore, http: HttpClient, appConfigService : AppConfigService, listService:ListService) {
|
|
19
|
+
super(http, actionStore, appConfigService,listService);
|
|
20
|
+
this._pathName = DATASOURCES.ACTIONS;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
handleValidateAction(name:string, id: string, record:any): Observable<AdminActionModel[]> {
|
|
24
|
+
const apiUrl = `${this.apiUrl}${name}/${encodeURIComponent(id)}`;
|
|
25
|
+
return this.http.post<AdminActionModel[]>(`${apiUrl}`, record).pipe(
|
|
26
|
+
tap((entities: AdminActionModel[]) => this.actionStore.set(entities))
|
|
27
|
+
);
|
|
28
|
+
}
|
|
29
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { BaseState } from "../../../shared/state/base.state";
|
|
2
|
+
import { AdminActionModel } from "../models/admin-action.model";
|
|
3
|
+
|
|
4
|
+
export interface AdminActionState extends BaseState {
|
|
5
|
+
actions: AdminActionModel[];
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
export function createInitialState(): AdminActionState {
|
|
9
|
+
return {
|
|
10
|
+
actions: [],
|
|
11
|
+
records: [],
|
|
12
|
+
lists: []
|
|
13
|
+
};
|
|
14
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { Injectable } from '@angular/core';
|
|
2
|
+
import { StoreConfig } from '@datorama/akita';
|
|
3
|
+
import { BaseStore } from '../../../shared/state/base.store';
|
|
4
|
+
import { AdminActionModel } from '../models/admin-action.model';
|
|
5
|
+
|
|
6
|
+
@Injectable({ providedIn: 'root' })
|
|
7
|
+
@StoreConfig({ name: 'action' })
|
|
8
|
+
export class AdminActionStore extends BaseStore<AdminActionModel> {
|
|
9
|
+
|
|
10
|
+
constructor() {
|
|
11
|
+
super();
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { APP_INITIALIZER, NgModule } from '@angular/core';
|
|
2
|
+
import { CommonModule } from '@angular/common';
|
|
3
|
+
import { AppConfigService } from '../shared';
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
@NgModule({
|
|
8
|
+
declarations: [],
|
|
9
|
+
imports: [
|
|
10
|
+
CommonModule
|
|
11
|
+
],
|
|
12
|
+
providers: [
|
|
13
|
+
{
|
|
14
|
+
provide: APP_INITIALIZER,
|
|
15
|
+
useFactory: (configService: AppConfigService) => () =>
|
|
16
|
+
configService.loadAppConfig(),
|
|
17
|
+
deps: [AppConfigService],
|
|
18
|
+
multi: true,
|
|
19
|
+
},
|
|
20
|
+
],
|
|
21
|
+
})
|
|
22
|
+
export class AdminModule { }
|