arco-support-request 0.0.64 → 0.0.65
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/karma.conf.js +44 -0
- package/ng-package.json +18 -0
- package/package.json +11 -22
- package/src/lib/Pipe/allpipe.pipe.ts +127 -0
- package/src/lib/Pipe/handlebar-helper-register.ts +197 -0
- package/src/lib/Pipe/translate.pipe.ts +32 -0
- package/src/lib/all-routing.ts +61 -0
- package/src/lib/arco-support-request.component.spec.ts +25 -0
- package/src/lib/arco-support-request.component.ts +20 -0
- package/src/lib/arco-support-request.module.ts +19 -0
- package/src/lib/arco-support-request.service.spec.ts +16 -0
- package/src/lib/arco-support-request.service.ts +16 -0
- package/src/lib/commonstyles/new-style-rtl.css +381 -0
- package/src/lib/commonstyles/styles.scss +3984 -0
- package/src/lib/core/encodeurl.service.ts +23 -0
- package/src/lib/core/global.service.ts +1810 -0
- package/src/lib/core/handlebar-helper-register.ts +213 -0
- package/src/lib/core/httpcancel.service.ts +21 -0
- package/src/lib/core/loader.service.ts +19 -0
- package/src/lib/core/loading-provider.service.ts +64 -0
- package/src/lib/core/managehttp.interceptor.ts +49 -0
- package/src/lib/core/static/jwt.ts +7 -0
- package/src/lib/core/token.service.ts +37 -0
- package/src/lib/entity-type-setup/activities-create/activities-create.component.html +68 -0
- package/src/lib/entity-type-setup/activities-create/activities-create.component.scss +0 -0
- package/src/lib/entity-type-setup/activities-create/activities-create.component.spec.ts +25 -0
- package/src/lib/entity-type-setup/activities-create/activities-create.component.ts +121 -0
- package/src/lib/entity-type-setup/activities-view/activities-view.component.html +19 -0
- package/src/lib/entity-type-setup/activities-view/activities-view.component.scss +3 -0
- package/src/lib/entity-type-setup/activities-view/activities-view.component.spec.ts +25 -0
- package/src/lib/entity-type-setup/activities-view/activities-view.component.ts +53 -0
- package/src/lib/entity-type-setup/activity-template/activity-template.component.html +73 -0
- package/src/lib/entity-type-setup/activity-template/activity-template.component.scss +0 -0
- package/src/lib/entity-type-setup/activity-template/activity-template.component.spec.ts +25 -0
- package/src/lib/entity-type-setup/activity-template/activity-template.component.ts +208 -0
- package/src/lib/entity-type-setup/activity-template-details/activity-template-details.component.html +356 -0
- package/src/lib/entity-type-setup/activity-template-details/activity-template-details.component.scss +50 -0
- package/src/lib/entity-type-setup/activity-template-details/activity-template-details.component.spec.ts +25 -0
- package/src/lib/entity-type-setup/activity-template-details/activity-template-details.component.ts +346 -0
- package/src/lib/entity-type-setup/commom-condition/commom-condition.component.html +92 -0
- package/src/lib/entity-type-setup/commom-condition/commom-condition.component.scss +90 -0
- package/src/lib/entity-type-setup/commom-condition/commom-condition.component.spec.ts +25 -0
- package/src/lib/entity-type-setup/commom-condition/commom-condition.component.ts +74 -0
- package/src/lib/entity-type-setup/dynamic/data-fields/data-fields.component.html +57 -0
- package/src/lib/entity-type-setup/dynamic/data-fields/data-fields.component.scss +16 -0
- package/src/lib/entity-type-setup/dynamic/data-fields/data-fields.component.spec.ts +25 -0
- package/src/lib/entity-type-setup/dynamic/data-fields/data-fields.component.ts +59 -0
- package/src/lib/entity-type-setup/dynamic/dynamic-details-view/dynamic-details-view.component.html +102 -0
- package/src/lib/entity-type-setup/dynamic/dynamic-details-view/dynamic-details-view.component.scss +3 -0
- package/src/lib/entity-type-setup/dynamic/dynamic-details-view/dynamic-details-view.component.spec.ts +25 -0
- package/src/lib/entity-type-setup/dynamic/dynamic-details-view/dynamic-details-view.component.ts +498 -0
- package/src/lib/entity-type-setup/dynamic/entity-dynamic-field/entity-dynamic-field.component.html +408 -0
- package/src/lib/entity-type-setup/dynamic/entity-dynamic-field/entity-dynamic-field.component.scss +123 -0
- package/src/lib/entity-type-setup/dynamic/entity-dynamic-field/entity-dynamic-field.component.spec.ts +25 -0
- package/src/lib/entity-type-setup/dynamic/entity-dynamic-field/entity-dynamic-field.component.ts +1051 -0
- package/src/lib/entity-type-setup/dynamic/entity-dynamic-field/validation-error.component.ts +84 -0
- package/src/lib/entity-type-setup/dynamic/entity-dynamic-form/entity-dynamic-form.component.html +194 -0
- package/src/lib/entity-type-setup/dynamic/entity-dynamic-form/entity-dynamic-form.component.scss +81 -0
- package/src/lib/entity-type-setup/dynamic/entity-dynamic-form/entity-dynamic-form.component.spec.ts +25 -0
- package/src/lib/entity-type-setup/dynamic/entity-dynamic-form/entity-dynamic-form.component.ts +1466 -0
- package/src/lib/entity-type-setup/dynamic/entity-dynamic-view/entity-dynamic-view.component.html +137 -0
- package/src/lib/entity-type-setup/dynamic/entity-dynamic-view/entity-dynamic-view.component.scss +0 -0
- package/src/lib/entity-type-setup/dynamic/entity-dynamic-view/entity-dynamic-view.component.spec.ts +25 -0
- package/src/lib/entity-type-setup/dynamic/entity-dynamic-view/entity-dynamic-view.component.ts +1232 -0
- package/src/lib/entity-type-setup/dynamic-task-details/dynamic-task-details.component.html +329 -0
- package/src/lib/entity-type-setup/dynamic-task-details/dynamic-task-details.component.scss +0 -0
- package/src/lib/entity-type-setup/dynamic-task-details/dynamic-task-details.component.spec.ts +25 -0
- package/src/lib/entity-type-setup/dynamic-task-details/dynamic-task-details.component.ts +520 -0
- package/src/lib/entity-type-setup/dynamic-task-list/dynamic-task-list.component.html +609 -0
- package/src/lib/entity-type-setup/dynamic-task-list/dynamic-task-list.component.scss +99 -0
- package/src/lib/entity-type-setup/dynamic-task-list/dynamic-task-list.component.spec.ts +25 -0
- package/src/lib/entity-type-setup/dynamic-task-list/dynamic-task-list.component.ts +784 -0
- package/src/lib/entity-type-setup/dynamic-ticket-details/dynamic-ticket-details.component.html +632 -0
- package/src/lib/entity-type-setup/dynamic-ticket-details/dynamic-ticket-details.component.scss +261 -0
- package/src/lib/entity-type-setup/dynamic-ticket-details/dynamic-ticket-details.component.spec.ts +25 -0
- package/src/lib/entity-type-setup/dynamic-ticket-details/dynamic-ticket-details.component.ts +765 -0
- package/src/lib/entity-type-setup/dynamic-ticket-details-popup/dynamic-ticket-details-popup.component.html +368 -0
- package/src/lib/entity-type-setup/dynamic-ticket-details-popup/dynamic-ticket-details-popup.component.scss +0 -0
- package/src/lib/entity-type-setup/dynamic-ticket-details-popup/dynamic-ticket-details-popup.component.spec.ts +25 -0
- package/src/lib/entity-type-setup/dynamic-ticket-details-popup/dynamic-ticket-details-popup.component.ts +334 -0
- package/src/lib/entity-type-setup/dynamic-ticket-list/dynamic-ticket-list.component.html +500 -0
- package/src/lib/entity-type-setup/dynamic-ticket-list/dynamic-ticket-list.component.scss +0 -0
- package/src/lib/entity-type-setup/dynamic-ticket-list/dynamic-ticket-list.component.spec.ts +25 -0
- package/src/lib/entity-type-setup/dynamic-ticket-list/dynamic-ticket-list.component.ts +862 -0
- package/src/lib/entity-type-setup/entity-attachment-setup/entity-attachment-setup.component.html +139 -0
- package/src/lib/entity-type-setup/entity-attachment-setup/entity-attachment-setup.component.scss +14 -0
- package/src/lib/entity-type-setup/entity-attachment-setup/entity-attachment-setup.component.spec.ts +25 -0
- package/src/lib/entity-type-setup/entity-attachment-setup/entity-attachment-setup.component.ts +347 -0
- package/src/lib/entity-type-setup/entity-category-activities/entity-category-activities.component.html +150 -0
- package/src/lib/entity-type-setup/entity-category-activities/entity-category-activities.component.scss +27 -0
- package/src/lib/entity-type-setup/entity-category-activities/entity-category-activities.component.ts +384 -0
- package/src/lib/entity-type-setup/entity-category-details/entity-category-details.component.html +305 -0
- package/src/lib/entity-type-setup/entity-category-details/entity-category-details.component.scss +31 -0
- package/src/lib/entity-type-setup/entity-category-details/entity-category-details.component.ts +572 -0
- package/src/lib/entity-type-setup/entity-field-rules/entity-field-rules.component.html +610 -0
- package/src/lib/entity-type-setup/entity-field-rules/entity-field-rules.component.scss +50 -0
- package/src/lib/entity-type-setup/entity-field-rules/entity-field-rules.component.spec.ts +25 -0
- package/src/lib/entity-type-setup/entity-field-rules/entity-field-rules.component.ts +633 -0
- package/src/lib/entity-type-setup/entity-type-field/entity-type-field.component.html +609 -0
- package/src/lib/entity-type-setup/entity-type-field/entity-type-field.component.scss +4 -0
- package/src/lib/entity-type-setup/entity-type-field/entity-type-field.component.ts +702 -0
- package/src/lib/entity-type-setup/entity-type-form/entity-type-form.component.html +530 -0
- package/src/lib/entity-type-setup/entity-type-form/entity-type-form.component.scss +12 -0
- package/src/lib/entity-type-setup/entity-type-form/entity-type-form.component.ts +767 -0
- package/src/lib/entity-type-setup/entity-type-setup-routing.module.ts +92 -0
- package/src/lib/entity-type-setup/entity-type-setup.module.ts +114 -0
- package/src/lib/entity-type-setup/events/events.component.html +211 -0
- package/src/lib/entity-type-setup/events/events.component.scss +61 -0
- package/src/lib/entity-type-setup/events/events.component.spec.ts +25 -0
- package/src/lib/entity-type-setup/events/events.component.ts +517 -0
- package/src/lib/entity-type-setup/field-type/field-type.component.html +447 -0
- package/src/lib/entity-type-setup/field-type/field-type.component.scss +0 -0
- package/src/lib/entity-type-setup/field-type/field-type.component.spec.ts +25 -0
- package/src/lib/entity-type-setup/field-type/field-type.component.ts +531 -0
- package/src/lib/entity-type-setup/field-type-detail/field-type-detail.component.html +152 -0
- package/src/lib/entity-type-setup/field-type-detail/field-type-detail.component.scss +24 -0
- package/src/lib/entity-type-setup/field-type-detail/field-type-detail.component.spec.ts +25 -0
- package/src/lib/entity-type-setup/field-type-detail/field-type-detail.component.ts +35 -0
- package/src/lib/entity-type-setup/instruction/instruction.component.html +239 -0
- package/src/lib/entity-type-setup/instruction/instruction.component.scss +18 -0
- package/src/lib/entity-type-setup/instruction/instruction.component.ts +450 -0
- package/src/lib/entity-type-setup/interface/entityTypeInterface.ts +1045 -0
- package/src/lib/entity-type-setup/interface/eventEnum.ts +191 -0
- package/src/lib/entity-type-setup/issue-group/issue-group.component.html +77 -0
- package/src/lib/entity-type-setup/issue-group/issue-group.component.scss +0 -0
- package/src/lib/entity-type-setup/issue-group/issue-group.component.ts +221 -0
- package/src/lib/entity-type-setup/issue-sub-group/issue-sub-group.component.html +192 -0
- package/src/lib/entity-type-setup/issue-sub-group/issue-sub-group.component.scss +10 -0
- package/src/lib/entity-type-setup/issue-sub-group/issue-sub-group.component.ts +418 -0
- package/src/lib/entity-type-setup/issue-sub-group-detail/issue-sub-group-detail.component.html +42 -0
- package/src/lib/entity-type-setup/issue-sub-group-detail/issue-sub-group-detail.component.scss +8 -0
- package/src/lib/entity-type-setup/issue-sub-group-detail/issue-sub-group-detail.component.ts +52 -0
- package/src/lib/entity-type-setup/my-task/my-task.component.html +599 -0
- package/src/lib/entity-type-setup/my-task/my-task.component.scss +0 -0
- package/src/lib/entity-type-setup/my-task/my-task.component.spec.ts +25 -0
- package/src/lib/entity-type-setup/my-task/my-task.component.ts +770 -0
- package/src/lib/entity-type-setup/page-form-instance.ts +73 -0
- package/src/lib/entity-type-setup/page.interface.classes.ts +43 -0
- package/src/lib/entity-type-setup/service/dropdown.directive.ts +12 -0
- package/src/lib/entity-type-setup/service/entity-type-setup.service.ts +2821 -0
- package/src/lib/entity-type-setup/task-crete/task-crete.component.html +61 -0
- package/src/lib/entity-type-setup/task-crete/task-crete.component.scss +0 -0
- package/src/lib/entity-type-setup/task-crete/task-crete.component.ts +117 -0
- package/src/lib/entity-type-setup/ticket-create/ticket-create.component.html +95 -0
- package/src/lib/entity-type-setup/ticket-create/ticket-create.component.scss +23 -0
- package/src/lib/entity-type-setup/ticket-create/ticket-create.component.spec.ts +25 -0
- package/src/lib/entity-type-setup/ticket-create/ticket-create.component.ts +213 -0
- package/src/lib/entity-type-setup/workflow-dynamic-popup/workflow-dynamic-popup.component.html +222 -0
- package/src/lib/entity-type-setup/workflow-dynamic-popup/workflow-dynamic-popup.component.scss +14 -0
- package/src/lib/entity-type-setup/workflow-dynamic-popup/workflow-dynamic-popup.component.spec.ts +25 -0
- package/src/lib/entity-type-setup/workflow-dynamic-popup/workflow-dynamic-popup.component.ts +328 -0
- package/src/lib/search.pipe.spec.ts +8 -0
- package/src/lib/search.pipe.ts +21 -0
- package/src/lib/support-request/action/action.component.html +122 -0
- package/src/lib/support-request/action/action.component.scss +6 -0
- package/src/lib/support-request/action/action.component.ts +179 -0
- package/src/lib/support-request/case-list/case-list.component.html +220 -0
- package/src/lib/support-request/case-list/case-list.component.scss +208 -0
- package/src/lib/support-request/case-list/case-list.component.ts +433 -0
- package/src/lib/support-request/home/home.component.html +16 -0
- package/src/lib/support-request/home/home.component.scss +4 -0
- package/src/lib/support-request/home/home.component.ts +23 -0
- package/src/lib/support-request/pagination/pagination.component.html +71 -0
- package/src/lib/support-request/pagination/pagination.component.scss +77 -0
- package/src/lib/support-request/pagination/pagination.component.ts +29 -0
- package/src/lib/support-request/request-flow/request-flow.component.html +330 -0
- package/src/lib/support-request/request-flow/request-flow.component.scss +2 -0
- package/src/lib/support-request/request-flow/request-flow.component.ts +846 -0
- package/src/lib/support-request/self-service-flow/self-service-flow.component.html +64 -0
- package/src/lib/support-request/self-service-flow/self-service-flow.component.scss +2 -0
- package/src/lib/support-request/self-service-flow/self-service-flow.component.ts +87 -0
- package/src/lib/support-request/support-request-create/support-request-create.component.html +103 -0
- package/src/lib/support-request/support-request-create/support-request-create.component.scss +39 -0
- package/src/lib/support-request/support-request-create/support-request-create.component.ts +319 -0
- package/src/lib/support-request/support-request-details/support-request-details.component.html +268 -0
- package/src/lib/support-request/support-request-details/support-request-details.component.scss +319 -0
- package/src/lib/support-request/support-request-details/support-request-details.component.ts +678 -0
- package/src/lib/support-request/support-request-index/support-request-index.component.html +4 -0
- package/src/lib/support-request/support-request-index/support-request-index.component.scss +0 -0
- package/src/lib/support-request/support-request-index/support-request-index.component.ts +16 -0
- package/src/lib/support-request/support-request-list/support-request-list.component.html +455 -0
- package/src/lib/support-request/support-request-list/support-request-list.component.scss +0 -0
- package/src/lib/support-request/support-request-list/support-request-list.component.ts +869 -0
- package/src/lib/support-request/support-request-routing.module.ts +21 -0
- package/src/lib/support-request/support-request.module.ts +103 -0
- package/src/lib/support-request/support-request.service.ts +145 -0
- package/src/lib/support-request/supportRequestInterface.ts +6 -0
- package/src/lib/task/Interfaces/TaskInterface.ts +164 -0
- package/src/lib/task/Services/task.service.spec.ts +16 -0
- package/src/lib/task/Services/task.service.ts +354 -0
- package/src/lib/task/task-routing.module.ts +12 -0
- package/src/lib/task/task.module.ts +23 -0
- package/src/lib/template/template.component.html +22 -0
- package/src/lib/template/template.component.scss +0 -0
- package/src/lib/template/template.component.spec.ts +25 -0
- package/src/lib/template/template.component.ts +24 -0
- package/src/lib/templates/attachmentsetup/attach-list/attach-list.component.html +83 -0
- package/src/lib/templates/attachmentsetup/attach-list/attach-list.component.scss +0 -0
- package/src/lib/templates/attachmentsetup/attach-list/attach-list.component.ts +120 -0
- package/src/lib/templates/attachmentsetup/attach-popup/attach-popup.component.html +134 -0
- package/src/lib/templates/attachmentsetup/attach-popup/attach-popup.component.scss +0 -0
- package/src/lib/templates/attachmentsetup/attach-popup/attach-popup.component.ts +185 -0
- package/src/lib/templates/attachmentsetup/attachment-api.ts +55 -0
- package/src/lib/templates/attachmentsetup/attachment-interface.ts +100 -0
- package/src/lib/templates/attachmentsetup/attachment.service.ts +233 -0
- package/src/lib/templates/attachmentsetup/attachmentsetup/attachmentsetup.component.html +97 -0
- package/src/lib/templates/attachmentsetup/attachmentsetup/attachmentsetup.component.scss +10 -0
- package/src/lib/templates/attachmentsetup/attachmentsetup/attachmentsetup.component.ts +367 -0
- package/src/lib/templates/attachmentsetup/documenttype/documenttype.component.html +49 -0
- package/src/lib/templates/attachmentsetup/documenttype/documenttype.component.scss +0 -0
- package/src/lib/templates/attachmentsetup/documenttype/documenttype.component.ts +226 -0
- package/src/lib/templates/attachmentsetup/menu-item-data/menu-item-data.component.html +140 -0
- package/src/lib/templates/attachmentsetup/menu-item-data/menu-item-data.component.scss +8 -0
- package/src/lib/templates/attachmentsetup/menu-item-data/menu-item-data.component.ts +176 -0
- package/src/lib/templates/card/card.component.html +56 -0
- package/src/lib/templates/card/card.component.scss +0 -0
- package/src/lib/templates/card/card.component.spec.ts +25 -0
- package/src/lib/templates/card/card.component.ts +306 -0
- package/src/lib/templates/dashboard/dashboard.component.html +333 -0
- package/src/lib/templates/dashboard/dashboard.component.scss +16 -0
- package/src/lib/templates/dashboard/dashboard.component.ts +2290 -0
- package/src/lib/templates/details/details.component.html +233 -0
- package/src/lib/templates/details/details.component.scss +0 -0
- package/src/lib/templates/details/details.component.spec.ts +25 -0
- package/src/lib/templates/details/details.component.ts +15 -0
- package/src/lib/templates/detailstwo/detailstwo.component.html +694 -0
- package/src/lib/templates/detailstwo/detailstwo.component.scss +0 -0
- package/src/lib/templates/detailstwo/detailstwo.component.spec.ts +25 -0
- package/src/lib/templates/detailstwo/detailstwo.component.ts +15 -0
- package/src/lib/templates/dyanamic-page/dyanamic-page.component.html +1 -0
- package/src/lib/templates/dyanamic-page/dyanamic-page.component.scss +0 -0
- package/src/lib/templates/dyanamic-page/dyanamic-page.component.spec.ts +25 -0
- package/src/lib/templates/dyanamic-page/dyanamic-page.component.ts +15 -0
- package/src/lib/templates/grid/grid-datatype/grid-datatype.component.ts +39 -0
- package/src/lib/templates/grid/grid-service.service.ts +140 -0
- package/src/lib/templates/grid/grid.component.html +270 -0
- package/src/lib/templates/grid/grid.component.scss +99 -0
- package/src/lib/templates/grid/grid.component.spec.ts +25 -0
- package/src/lib/templates/grid/grid.component.ts +458 -0
- package/src/lib/templates/grid/inner-grid/inner-grid.component.html +1 -0
- package/src/lib/templates/grid/inner-grid/inner-grid.component.scss +0 -0
- package/src/lib/templates/grid/inner-grid/inner-grid.component.spec.ts +25 -0
- package/src/lib/templates/grid/inner-grid/inner-grid.component.ts +15 -0
- package/src/lib/templates/home/home.component.html +251 -0
- package/src/lib/templates/home/home.component.scss +20 -0
- package/src/lib/templates/home/home.component.spec.ts +25 -0
- package/src/lib/templates/home/home.component.ts +15 -0
- package/src/lib/templates/interface_enum/common-Interface.ts +107 -0
- package/src/lib/templates/interface_enum/common-enum.ts +147 -0
- package/src/lib/templates/interface_enum/icon-class.ts +1149 -0
- package/src/lib/templates/leftside/leftside.component.html +77 -0
- package/src/lib/templates/leftside/leftside.component.scss +0 -0
- package/src/lib/templates/leftside/leftside.component.spec.ts +25 -0
- package/src/lib/templates/leftside/leftside.component.ts +238 -0
- package/src/lib/templates/login/login.component.html +93 -0
- package/src/lib/templates/login/login.component.scss +110 -0
- package/src/lib/templates/login/login.component.spec.ts +25 -0
- package/src/lib/templates/login/login.component.ts +142 -0
- package/src/lib/templates/main-content/main-content.component.html +31 -0
- package/src/lib/templates/main-content/main-content.component.scss +6 -0
- package/src/lib/templates/main-content/main-content.component.spec.ts +25 -0
- package/src/lib/templates/main-content/main-content.component.ts +24 -0
- package/src/lib/templates/menu-item/child-menu/child-menu.component.html +5 -0
- package/src/lib/templates/menu-item/child-menu/child-menu.component.scss +3 -0
- package/src/lib/templates/menu-item/child-menu/child-menu.component.ts +22 -0
- package/src/lib/templates/menu-item/menu-item.component.html +25 -0
- package/src/lib/templates/menu-item/menu-item.component.scss +11 -0
- package/src/lib/templates/menu-item/menu-item.component.ts +29 -0
- package/src/lib/templates/pagination/pagination.component.html +71 -0
- package/src/lib/templates/pagination/pagination.component.scss +73 -0
- package/src/lib/templates/pagination/pagination.component.ts +29 -0
- package/src/lib/templates/pie-chart/pie-chart.component.html +0 -0
- package/src/lib/templates/pie-chart/pie-chart.component.scss +0 -0
- package/src/lib/templates/pie-chart/pie-chart.component.ts +14 -0
- package/src/lib/templates/pipe/multiple-search.pipe.ts +28 -0
- package/src/lib/templates/pipe/simple-search.pipe.ts +18 -0
- package/src/lib/templates/pipe/translate.pipe.ts +31 -0
- package/src/lib/templates/request-flow-dash/request-flow-dash.component.html +16 -0
- package/src/lib/templates/request-flow-dash/request-flow-dash.component.scss +0 -0
- package/src/lib/templates/request-flow-dash/request-flow-dash.component.spec.ts +25 -0
- package/src/lib/templates/request-flow-dash/request-flow-dash.component.ts +59 -0
- package/src/lib/templates/table/table.component.html +310 -0
- package/src/lib/templates/table/table.component.scss +0 -0
- package/src/lib/templates/table/table.component.spec.ts +25 -0
- package/src/lib/templates/table/table.component.ts +52 -0
- package/src/lib/templates/template.service.ts +43 -0
- package/src/lib/templates/templates-routing.module.ts +21 -0
- package/src/lib/templates/templates.module.ts +80 -0
- package/src/lib/templates/topnav/topnav.component.html +172 -0
- package/src/lib/templates/topnav/topnav.component.scss +10 -0
- package/src/lib/templates/topnav/topnav.component.spec.ts +25 -0
- package/src/lib/templates/topnav/topnav.component.ts +59 -0
- package/src/lib/ticket/_interfaces/master-models.ts +66 -0
- package/src/lib/ticket/_interfaces/model.ts +252 -0
- package/src/lib/ticket/_ticket-services/ticket-api.service.ts +319 -0
- package/src/lib/ticket/_ticket-services/ticket-master-api.service.ts +169 -0
- package/src/lib/ticket/_ticket-services/ticket-priority.service.ts +86 -0
- package/src/lib/ticket/_ticket-services/ticketchannel.service.ts +107 -0
- package/src/lib/ticket/ticket-routing.module.ts +12 -0
- package/src/lib/ticket/ticket.module.ts +29 -0
- package/{public-api.d.ts → src/public-api.ts} +6 -1
- package/src/test.ts +26 -0
- package/tsconfig.lib.json +25 -0
- package/tsconfig.lib.prod.json +10 -0
- package/tsconfig.spec.json +17 -0
- package/tslint.json +17 -0
- package/arco-support-request.d.ts +0 -32
- package/arco-support-request.metadata.json +0 -1
- package/bundles/arco-support-request.umd.js +0 -10935
- package/bundles/arco-support-request.umd.js.map +0 -1
- package/bundles/arco-support-request.umd.min.js +0 -2
- package/bundles/arco-support-request.umd.min.js.map +0 -1
- package/esm2015/arco-support-request.js +0 -33
- package/esm2015/lib/Pipe/allpipe.pipe.js +0 -110
- package/esm2015/lib/Pipe/translate.pipe.js +0 -31
- package/esm2015/lib/arco-support-request.component.js +0 -18
- package/esm2015/lib/arco-support-request.module.js +0 -20
- package/esm2015/lib/arco-support-request.service.js +0 -19
- package/esm2015/lib/core/global.service.js +0 -1747
- package/esm2015/lib/core/handlebar-helper-register.js +0 -182
- package/esm2015/lib/core/static/jwt.js +0 -8
- package/esm2015/lib/entity-type-setup/activities-create/activities-create.component.js +0 -105
- package/esm2015/lib/entity-type-setup/activities-view/activities-view.component.js +0 -46
- package/esm2015/lib/entity-type-setup/dynamic/dynamic-details-view/dynamic-details-view.component.js +0 -367
- package/esm2015/lib/entity-type-setup/dynamic/entity-dynamic-field/entity-dynamic-field.component.js +0 -850
- package/esm2015/lib/entity-type-setup/dynamic/entity-dynamic-field/validation-error.component.js +0 -85
- package/esm2015/lib/entity-type-setup/dynamic/entity-dynamic-view/entity-dynamic-view.component.js +0 -957
- package/esm2015/lib/entity-type-setup/interface/entityTypeInterface.js +0 -51
- package/esm2015/lib/entity-type-setup/interface/eventEnum.js +0 -84
- package/esm2015/lib/entity-type-setup/page-form-instance.js +0 -65
- package/esm2015/lib/entity-type-setup/page.interface.classes.js +0 -40
- package/esm2015/lib/entity-type-setup/service/entity-type-setup.service.js +0 -1833
- package/esm2015/lib/entity-type-setup/workflow-dynamic-popup/workflow-dynamic-popup.component.js +0 -276
- package/esm2015/lib/search.pipe.js +0 -19
- package/esm2015/lib/support-request/action/action.component.js +0 -104
- package/esm2015/lib/support-request/case-list/case-list.component.js +0 -390
- package/esm2015/lib/support-request/home/home.component.js +0 -23
- package/esm2015/lib/support-request/pagination/pagination.component.js +0 -34
- package/esm2015/lib/support-request/request-flow/request-flow.component.js +0 -684
- package/esm2015/lib/support-request/self-service-flow/self-service-flow.component.js +0 -78
- package/esm2015/lib/support-request/support-request-create/support-request-create.component.js +0 -270
- package/esm2015/lib/support-request/support-request-details/support-request-details.component.js +0 -508
- package/esm2015/lib/support-request/support-request-index/support-request-index.component.js +0 -16
- package/esm2015/lib/support-request/support-request-routing.module.js +0 -22
- package/esm2015/lib/support-request/support-request.module.js +0 -98
- package/esm2015/lib/support-request/support-request.service.js +0 -105
- package/esm2015/lib/support-request/supportRequestInterface.js +0 -2
- package/esm2015/lib/task/Interfaces/TaskInterface.js +0 -7
- package/esm2015/lib/task/Services/task.service.js +0 -251
- package/esm2015/lib/templates/Pipe/translate.pipe.js +0 -31
- package/esm2015/lib/templates/attachmentsetup/attachment-interface.js +0 -2
- package/esm2015/lib/templates/attachmentsetup/attachment.service.js +0 -196
- package/esm2015/lib/templates/grid/grid-datatype/grid-datatype.component.js +0 -37
- package/esm2015/lib/templates/grid/grid-service.service.js +0 -85
- package/esm2015/lib/templates/grid/grid.component.js +0 -436
- package/esm2015/lib/templates/grid/inner-grid/inner-grid.component.js +0 -15
- package/esm2015/lib/templates/interface_enum/common-Interface.js +0 -2
- package/esm2015/lib/templates/interface_enum/common-enum.js +0 -153
- package/esm2015/lib/ticket/_interfaces/model.js +0 -2
- package/esm2015/lib/ticket/_ticket-services/ticket-api.service.js +0 -232
- package/esm2015/public-api.js +0 -9
- package/fesm2015/arco-support-request.js +0 -10335
- package/fesm2015/arco-support-request.js.map +0 -1
- package/lib/Pipe/allpipe.pipe.d.ts +0 -19
- package/lib/Pipe/translate.pipe.d.ts +0 -7
- package/lib/arco-support-request.component.d.ts +0 -5
- package/lib/arco-support-request.module.d.ts +0 -2
- package/lib/arco-support-request.service.d.ts +0 -9
- package/lib/core/global.service.d.ts +0 -78
- package/lib/core/handlebar-helper-register.d.ts +0 -1
- package/lib/core/static/jwt.d.ts +0 -7
- package/lib/entity-type-setup/activities-create/activities-create.component.d.ts +0 -30
- package/lib/entity-type-setup/activities-view/activities-view.component.d.ts +0 -16
- package/lib/entity-type-setup/dynamic/dynamic-details-view/dynamic-details-view.component.d.ts +0 -67
- package/lib/entity-type-setup/dynamic/entity-dynamic-field/entity-dynamic-field.component.d.ts +0 -88
- package/lib/entity-type-setup/dynamic/entity-dynamic-field/validation-error.component.d.ts +0 -11
- package/lib/entity-type-setup/dynamic/entity-dynamic-view/entity-dynamic-view.component.d.ts +0 -69
- package/lib/entity-type-setup/interface/entityTypeInterface.d.ts +0 -916
- package/lib/entity-type-setup/interface/eventEnum.d.ts +0 -161
- package/lib/entity-type-setup/page-form-instance.d.ts +0 -13
- package/lib/entity-type-setup/page.interface.classes.d.ts +0 -33
- package/lib/entity-type-setup/service/entity-type-setup.service.d.ts +0 -604
- package/lib/entity-type-setup/workflow-dynamic-popup/workflow-dynamic-popup.component.d.ts +0 -66
- package/lib/search.pipe.d.ts +0 -4
- package/lib/support-request/action/action.component.d.ts +0 -31
- package/lib/support-request/case-list/case-list.component.d.ts +0 -91
- package/lib/support-request/home/home.component.d.ts +0 -6
- package/lib/support-request/pagination/pagination.component.d.ts +0 -18
- package/lib/support-request/request-flow/request-flow.component.d.ts +0 -143
- package/lib/support-request/self-service-flow/self-service-flow.component.d.ts +0 -31
- package/lib/support-request/support-request-create/support-request-create.component.d.ts +0 -55
- package/lib/support-request/support-request-details/support-request-details.component.d.ts +0 -116
- package/lib/support-request/support-request-index/support-request-index.component.d.ts +0 -5
- package/lib/support-request/support-request-routing.module.d.ts +0 -2
- package/lib/support-request/support-request.module.d.ts +0 -2
- package/lib/support-request/support-request.service.d.ts +0 -35
- package/lib/support-request/supportRequestInterface.d.ts +0 -6
- package/lib/task/Interfaces/TaskInterface.d.ts +0 -132
- package/lib/task/Services/task.service.d.ts +0 -75
- package/lib/templates/Pipe/translate.pipe.d.ts +0 -7
- package/lib/templates/attachmentsetup/attachment-interface.d.ts +0 -90
- package/lib/templates/attachmentsetup/attachment.service.d.ts +0 -61
- package/lib/templates/grid/grid-datatype/grid-datatype.component.d.ts +0 -11
- package/lib/templates/grid/grid-service.service.d.ts +0 -40
- package/lib/templates/grid/grid.component.d.ts +0 -155
- package/lib/templates/grid/inner-grid/inner-grid.component.d.ts +0 -5
- package/lib/templates/interface_enum/common-Interface.d.ts +0 -90
- package/lib/templates/interface_enum/common-enum.d.ts +0 -129
- package/lib/ticket/_interfaces/model.d.ts +0 -192
- package/lib/ticket/_ticket-services/ticket-api.service.d.ts +0 -81
package/src/lib/entity-type-setup/dynamic/entity-dynamic-form/entity-dynamic-form.component.ts
ADDED
|
@@ -0,0 +1,1466 @@
|
|
|
1
|
+
import { Component, Input, OnInit } from '@angular/core';
|
|
2
|
+
import { FormGroup, FormBuilder } from '@angular/forms';
|
|
3
|
+
import { PageDetailsRow, PageGroup } from '../../page.interface.classes';
|
|
4
|
+
import { PageForm } from '../../page-form-instance';
|
|
5
|
+
import { EntityTypeSetupService } from '../../service/entity-type-setup.service';
|
|
6
|
+
import { ActivatedRoute, Router } from '@angular/router';
|
|
7
|
+
import {
|
|
8
|
+
EntityTypeFieldVM,
|
|
9
|
+
EntityTypeFormCVM,
|
|
10
|
+
EntityTypeFormUVM,
|
|
11
|
+
EntityTypeFormVM,
|
|
12
|
+
EntityTypeSetUpVM,
|
|
13
|
+
FieldValidators,
|
|
14
|
+
} from '../../interface/entityTypeInterface';
|
|
15
|
+
import {
|
|
16
|
+
eFieldValidatorType,
|
|
17
|
+
E_DataType,
|
|
18
|
+
} from '../../../templates/interface_enum/common-enum';
|
|
19
|
+
import { Observable } from 'rxjs';
|
|
20
|
+
import { Validators } from '@angular/forms';
|
|
21
|
+
import Swal from 'sweetalert2';
|
|
22
|
+
import * as Handlebars from 'handlebars';
|
|
23
|
+
import { errorMessageType, GlobalService } from '../../../core/global.service';
|
|
24
|
+
import { TranslatePipe } from '../../../Pipe/translate.pipe';
|
|
25
|
+
import { registerHandlebarHelperMethods } from '../../../core/handlebar-helper-register';
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
@Component({
|
|
29
|
+
selector: 'app-entity-dynamic-form',
|
|
30
|
+
templateUrl: './entity-dynamic-form.component.html',
|
|
31
|
+
styleUrls: ['./entity-dynamic-form.component.scss'],
|
|
32
|
+
})
|
|
33
|
+
export class EntityDynamicFormComponent implements OnInit {
|
|
34
|
+
constructor(
|
|
35
|
+
private entityTypeSetup: EntityTypeSetupService,
|
|
36
|
+
private router: Router,
|
|
37
|
+
private fb: FormBuilder,
|
|
38
|
+
private route: ActivatedRoute,
|
|
39
|
+
public globelService : GlobalService,
|
|
40
|
+
) { }
|
|
41
|
+
|
|
42
|
+
ngOnInit(): void {
|
|
43
|
+
// this.route.paramMap.subscribe(res => {
|
|
44
|
+
// this.EntityTypeId = Number(res.get('EntityType') || "");
|
|
45
|
+
// this.EntityFormId = Number(res.get('EntityForm') || "");
|
|
46
|
+
// registerHandlebarHelperMethods();
|
|
47
|
+
if (this.EntityTypeId) {
|
|
48
|
+
this.getEntityTypeDetails();
|
|
49
|
+
this.getFieldListByEntityType();
|
|
50
|
+
// this.getListView();
|
|
51
|
+
this.getAllRules();
|
|
52
|
+
// this.dynamicFormGroup = this.getFieldFormGroup();
|
|
53
|
+
this.buildReactiveForm();
|
|
54
|
+
}
|
|
55
|
+
if (this.EntityFormId) {
|
|
56
|
+
if (this.ActivityTemplateForm && this.ViewType == 'ActivityTemplate')
|
|
57
|
+
this.getActivityTemplateForms();
|
|
58
|
+
else {
|
|
59
|
+
this.getEntityForm();
|
|
60
|
+
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
ngOnChanges(changes) {
|
|
66
|
+
if (changes['EntityFormId']) {
|
|
67
|
+
|
|
68
|
+
if (this.EntityFormId) {
|
|
69
|
+
this.getEntityForm();
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
@Input() ParameterData:any=null;
|
|
75
|
+
|
|
76
|
+
@Input() EntityFormId: number;
|
|
77
|
+
@Input() EntityTypeId: number;
|
|
78
|
+
@Input() EntityType: number;
|
|
79
|
+
@Input() FormStatus: number;
|
|
80
|
+
|
|
81
|
+
@Input() EntityTypeForm: EntityTypeFormVM;
|
|
82
|
+
|
|
83
|
+
@Input() ActivityTemplateForm: any;
|
|
84
|
+
|
|
85
|
+
@Input() ViewType: string;
|
|
86
|
+
|
|
87
|
+
EntityFieldList: EntityTypeFieldVM[] = [];
|
|
88
|
+
|
|
89
|
+
// EntityTypeId: number;
|
|
90
|
+
// EntityFormId: number;
|
|
91
|
+
|
|
92
|
+
EntityTypeDetail: EntityTypeSetUpVM;
|
|
93
|
+
getEntityTypeDetails() {
|
|
94
|
+
|
|
95
|
+
this.entityTypeSetup.getSingleEntityTypeSetupById(this.EntityTypeId)
|
|
96
|
+
.subscribe(
|
|
97
|
+
(res: any) => {
|
|
98
|
+
|
|
99
|
+
this.EntityTypeDetail = res;
|
|
100
|
+
this.EntityType = this.EntityTypeDetail.EntityType;
|
|
101
|
+
|
|
102
|
+
if (this.ActivityTemplateForm && this.ViewType == 'ActivityTemplate')
|
|
103
|
+
this.getActivityTemplateForms();
|
|
104
|
+
else {
|
|
105
|
+
if (this.EntityTypeDetail.TemplateId) {
|
|
106
|
+
this.getAllDefaultEntityTypeForm(this.EntityTypeDetail.TemplateId);
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
this.setStaticActivityForm();
|
|
111
|
+
|
|
112
|
+
|
|
113
|
+
},
|
|
114
|
+
(error) => {
|
|
115
|
+
|
|
116
|
+
console.log(error);
|
|
117
|
+
}
|
|
118
|
+
);
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
saveDesignForm() {
|
|
122
|
+
|
|
123
|
+
let formvalue = this._PageForm.form.value;
|
|
124
|
+
|
|
125
|
+
let obj = {
|
|
126
|
+
PageGroup: this.pageGroups,
|
|
127
|
+
defaultPageGroups: this.EntityTypeDetail.TemplateId,
|
|
128
|
+
PageGroupValues: formvalue,
|
|
129
|
+
};
|
|
130
|
+
|
|
131
|
+
let pagedesign = JSON.stringify(obj);
|
|
132
|
+
// let pagedesign = JSON.stringify(this.pageGroups);
|
|
133
|
+
// this.EntityTypeForm.FormData = pagedesign;
|
|
134
|
+
|
|
135
|
+
if (this.EntityTypeForm && this.EntityTypeForm.RecId) {
|
|
136
|
+
const data: EntityTypeFormUVM = {
|
|
137
|
+
RecId: this.EntityTypeForm.RecId,
|
|
138
|
+
EntityTypeId: this.EntityTypeForm.EntityTypeRecId,
|
|
139
|
+
FieldId: this.EntityTypeForm.FieldId,
|
|
140
|
+
FieldControlType: this.EntityTypeForm.FieldControlType,
|
|
141
|
+
DataSourceLink: this.EntityTypeForm.DataSourceLink,
|
|
142
|
+
CascadeFieldId: this.EntityTypeForm.CascadeFieldId,
|
|
143
|
+
IsVisible: this.EntityTypeForm.IsVisible,
|
|
144
|
+
OrderId: this.EntityTypeForm.OrderId,
|
|
145
|
+
FormType: this.EntityTypeForm.FormType,
|
|
146
|
+
FormData: pagedesign,
|
|
147
|
+
};
|
|
148
|
+
|
|
149
|
+
this.entityTypeSetup.putEntityTypeForm(data).subscribe((res) => {
|
|
150
|
+
Swal.fire(this.translatePipe.transform('Form Design'), this.translatePipe.transform('Form Design Updated Successfully'), 'success');
|
|
151
|
+
this.getEntityForm();
|
|
152
|
+
});
|
|
153
|
+
} else {
|
|
154
|
+
const data: EntityTypeFormCVM = {
|
|
155
|
+
EntityTypeId: this.EntityTypeId,
|
|
156
|
+
FieldId: null,
|
|
157
|
+
FieldControlType: null,
|
|
158
|
+
DataSourceLink: null,
|
|
159
|
+
CascadeFieldId: null,
|
|
160
|
+
IsVisible: true,
|
|
161
|
+
OrderId: null,
|
|
162
|
+
FormData: pagedesign,
|
|
163
|
+
FormType: null,
|
|
164
|
+
};
|
|
165
|
+
|
|
166
|
+
this.entityTypeSetup.postEntityTypeForm(data).subscribe((res: any) => {
|
|
167
|
+
|
|
168
|
+
this.EntityFormId = res.RecId;
|
|
169
|
+
this.getEntityForm();
|
|
170
|
+
});
|
|
171
|
+
}
|
|
172
|
+
}
|
|
173
|
+
|
|
174
|
+
getFieldListByEntityType() {
|
|
175
|
+
|
|
176
|
+
this.entityTypeSetup.getAllEntityTypeField(null, this.EntityTypeId)
|
|
177
|
+
.subscribe((res: any) => {
|
|
178
|
+
|
|
179
|
+
this.EntityFieldList = res.Data;
|
|
180
|
+
// this.getListView();
|
|
181
|
+
|
|
182
|
+
this.setStaticActivityForm();
|
|
183
|
+
// this.TempFieldValidators();
|
|
184
|
+
},
|
|
185
|
+
(error) => {
|
|
186
|
+
|
|
187
|
+
console.log(error);
|
|
188
|
+
});
|
|
189
|
+
}
|
|
190
|
+
|
|
191
|
+
EntityFieldListsWithTable:any[] =[];
|
|
192
|
+
|
|
193
|
+
getListView() {
|
|
194
|
+
this.entityTypeSetup.getlistview(this.EntityTypeId)
|
|
195
|
+
.subscribe((res: any) => {
|
|
196
|
+
|
|
197
|
+
this.EntityFieldListsWithTable = res.Data;
|
|
198
|
+
let i = -9999;
|
|
199
|
+
this.EntityFieldListsWithTable.map(x => {
|
|
200
|
+
i++;
|
|
201
|
+
if(this.EntityFieldList.some(y=>y.Description != x.Description)) {
|
|
202
|
+
let _temp: EntityTypeFieldVM = {
|
|
203
|
+
Description: x.Description,
|
|
204
|
+
RecId: i,
|
|
205
|
+
DataType: E_DataType.string,
|
|
206
|
+
Label: x.Label,
|
|
207
|
+
IsTableField:true,
|
|
208
|
+
showDetilsForm:true,
|
|
209
|
+
};
|
|
210
|
+
|
|
211
|
+
this.EntityFieldList.push(_temp)
|
|
212
|
+
}
|
|
213
|
+
|
|
214
|
+
});
|
|
215
|
+
|
|
216
|
+
|
|
217
|
+
});
|
|
218
|
+
}
|
|
219
|
+
|
|
220
|
+
getEntityForm() {
|
|
221
|
+
|
|
222
|
+
|
|
223
|
+
this.entityTypeSetup.getSingleEntityTypeFormById(this.EntityFormId)
|
|
224
|
+
.subscribe(
|
|
225
|
+
(res: any) => {
|
|
226
|
+
|
|
227
|
+
this.EntityTypeForm = res;
|
|
228
|
+
if (this.EntityTypeForm && this.EntityTypeForm.FormData) {
|
|
229
|
+
let _FormData = JSON.parse(this.EntityTypeForm.FormData);
|
|
230
|
+
|
|
231
|
+
if (_FormData.PageGroup) {
|
|
232
|
+
if (Array.isArray(_FormData.PageGroup)) {
|
|
233
|
+
this.pageGroups = _FormData.PageGroup;
|
|
234
|
+
}
|
|
235
|
+
} else {
|
|
236
|
+
if (Array.isArray(_FormData.PageGroup)) {
|
|
237
|
+
this.pageGroups = _FormData;
|
|
238
|
+
}
|
|
239
|
+
}
|
|
240
|
+
|
|
241
|
+
if (_FormData.PageGroupValues)
|
|
242
|
+
this.PageGroupValues = _FormData.PageGroupValues;
|
|
243
|
+
else this.PageGroupValues = {};
|
|
244
|
+
this.buildReactiveForm();
|
|
245
|
+
// this.onFormInit(this.EntityTypeForm);
|
|
246
|
+
}
|
|
247
|
+
},
|
|
248
|
+
|
|
249
|
+
(error) => {
|
|
250
|
+
|
|
251
|
+
console.log(error);
|
|
252
|
+
}
|
|
253
|
+
);
|
|
254
|
+
}
|
|
255
|
+
/* #region ActivityTemplate */
|
|
256
|
+
|
|
257
|
+
getActivityTemplateForms() {
|
|
258
|
+
let _FormData = this.ActivityTemplateForm;
|
|
259
|
+
|
|
260
|
+
if (_FormData.PageGroup) {
|
|
261
|
+
this.pageGroups = _FormData.PageGroup;
|
|
262
|
+
}
|
|
263
|
+
|
|
264
|
+
if (_FormData.defaultPageGroups) {
|
|
265
|
+
this.defaultPageGroups = _FormData.defaultPageGroups;
|
|
266
|
+
}
|
|
267
|
+
|
|
268
|
+
if (_FormData.PageGroupValues)
|
|
269
|
+
this.PageGroupValues = _FormData.PageGroupValues;
|
|
270
|
+
else this.PageGroupValues = {};
|
|
271
|
+
this.buildReactiveForm();
|
|
272
|
+
}
|
|
273
|
+
|
|
274
|
+
/* #endregion */
|
|
275
|
+
|
|
276
|
+
setDefaultFormData() { }
|
|
277
|
+
|
|
278
|
+
pageGroups: PageDetailsRow[] = [];
|
|
279
|
+
defaultPageGroups: PageDetailsRow[] = [];
|
|
280
|
+
PageGroupValues: any = {};
|
|
281
|
+
|
|
282
|
+
addRow() {
|
|
283
|
+
|
|
284
|
+
this.pageGroups.push(new PageDetailsRow());
|
|
285
|
+
let row = this.pageGroups[this.pageGroups.length - 1];
|
|
286
|
+
this.addGroup(row);
|
|
287
|
+
}
|
|
288
|
+
|
|
289
|
+
addGroup(row: PageDetailsRow) {
|
|
290
|
+
|
|
291
|
+
let group = new PageGroup();
|
|
292
|
+
row.Groups.push(group);
|
|
293
|
+
this.buildReactiveForm();
|
|
294
|
+
this.setGroupWidth(row);
|
|
295
|
+
}
|
|
296
|
+
|
|
297
|
+
setGroupWidth(row: PageDetailsRow) {
|
|
298
|
+
for (let index = 0; index < row.Groups.length; index++) {
|
|
299
|
+
let Width = 100 / row.Groups.length;
|
|
300
|
+
row.Groups[index].Width = Width;
|
|
301
|
+
row.Groups[index].Height = Width;
|
|
302
|
+
}
|
|
303
|
+
}
|
|
304
|
+
|
|
305
|
+
_PageForm: PageForm = new PageForm(new FormGroup({}));
|
|
306
|
+
dynamicFormGroup: FormGroup;
|
|
307
|
+
submitted: boolean;
|
|
308
|
+
|
|
309
|
+
validationError(name: string, errorName: string) {
|
|
310
|
+
if (name && errorName)
|
|
311
|
+
return this.dynamicFormGroup.get(name).errors[errorName] ? true : false;
|
|
312
|
+
else return this.dynamicFormGroup.get(name).errors ? true : false;
|
|
313
|
+
}
|
|
314
|
+
|
|
315
|
+
getType(_dataType: E_DataType | number) {
|
|
316
|
+
switch (_dataType) {
|
|
317
|
+
case E_DataType.int:
|
|
318
|
+
case E_DataType.decimal:
|
|
319
|
+
return 'number';
|
|
320
|
+
case E_DataType.date:
|
|
321
|
+
return 'date';
|
|
322
|
+
case E_DataType.dateTime:
|
|
323
|
+
return 'datetime-local';
|
|
324
|
+
case E_DataType.timespan:
|
|
325
|
+
return 'time';
|
|
326
|
+
case E_DataType.bool:
|
|
327
|
+
return 'checkbox';
|
|
328
|
+
case E_DataType.string:
|
|
329
|
+
return 'text';
|
|
330
|
+
case E_DataType.image:
|
|
331
|
+
return 'file';
|
|
332
|
+
|
|
333
|
+
default:
|
|
334
|
+
return 'text';
|
|
335
|
+
}
|
|
336
|
+
}
|
|
337
|
+
|
|
338
|
+
changeTextEvent(event) {
|
|
339
|
+
|
|
340
|
+
}
|
|
341
|
+
|
|
342
|
+
SelectedFiles: any = null;
|
|
343
|
+
selectedFileItem: any = null;
|
|
344
|
+
|
|
345
|
+
changeFile(event: any, item) {
|
|
346
|
+
|
|
347
|
+
this.selectedFileItem = item;
|
|
348
|
+
this.SelectedFiles = event.target.files;
|
|
349
|
+
}
|
|
350
|
+
|
|
351
|
+
selectRowIndex: any;
|
|
352
|
+
selectGroupIndex: any;
|
|
353
|
+
|
|
354
|
+
addNestedGroup(rowIndex, groupIndex) {
|
|
355
|
+
|
|
356
|
+
this.selectRowIndex = rowIndex;
|
|
357
|
+
this.selectGroupIndex = groupIndex;
|
|
358
|
+
}
|
|
359
|
+
|
|
360
|
+
groupSetting(rowIndex, groupIndex) {
|
|
361
|
+
|
|
362
|
+
this.selectRowIndex = rowIndex;
|
|
363
|
+
this.selectGroupIndex = groupIndex;
|
|
364
|
+
}
|
|
365
|
+
|
|
366
|
+
deleteGroup(rowIndex, groupIndex) {
|
|
367
|
+
|
|
368
|
+
this.selectRowIndex = rowIndex;
|
|
369
|
+
this.selectGroupIndex = groupIndex;
|
|
370
|
+
|
|
371
|
+
this.pageGroups[this.selectRowIndex].Groups.splice(
|
|
372
|
+
this.selectGroupIndex,
|
|
373
|
+
1
|
|
374
|
+
);
|
|
375
|
+
if (this.pageGroups[this.selectRowIndex].Groups.length == 0)
|
|
376
|
+
this.pageGroups.splice(this.selectRowIndex, 1);
|
|
377
|
+
}
|
|
378
|
+
|
|
379
|
+
/* #region DataFIleds */
|
|
380
|
+
|
|
381
|
+
showDataFiledPopup: boolean = false;
|
|
382
|
+
openDataField(rowIndex, groupIndex) {
|
|
383
|
+
|
|
384
|
+
this.selectRowIndex = rowIndex;
|
|
385
|
+
this.selectGroupIndex = groupIndex;
|
|
386
|
+
this.showDataFiledPopup = true;
|
|
387
|
+
// this.dataFieldPopup = true;
|
|
388
|
+
}
|
|
389
|
+
|
|
390
|
+
closeDataField() {
|
|
391
|
+
|
|
392
|
+
this.showDataFiledPopup = false;
|
|
393
|
+
|
|
394
|
+
// this.dataFieldPopup = false;
|
|
395
|
+
}
|
|
396
|
+
|
|
397
|
+
submitDataFields(Fields: EntityTypeFieldVM[]) {
|
|
398
|
+
|
|
399
|
+
// if (Fields && Fields.length > 0)
|
|
400
|
+
for (let index = 0; index < Fields.length; index++) {
|
|
401
|
+
this.pageGroups[this.selectRowIndex].Groups[
|
|
402
|
+
this.selectGroupIndex
|
|
403
|
+
].Fields.push(Fields[index]);
|
|
404
|
+
}
|
|
405
|
+
|
|
406
|
+
this.buildReactiveForm();
|
|
407
|
+
this.showDataFiledPopup = false;
|
|
408
|
+
}
|
|
409
|
+
|
|
410
|
+
/* #endregion */
|
|
411
|
+
|
|
412
|
+
/* #region Field Actions */
|
|
413
|
+
|
|
414
|
+
deleteField(fieldIndex, groupIndex, rowIndex) {
|
|
415
|
+
|
|
416
|
+
this.pageGroups[rowIndex].Groups[groupIndex].Fields.splice(fieldIndex, 1);
|
|
417
|
+
this.buildReactiveForm();
|
|
418
|
+
}
|
|
419
|
+
downField(fieldIndex, groupIndex, rowIndex) {
|
|
420
|
+
|
|
421
|
+
if (
|
|
422
|
+
fieldIndex !=
|
|
423
|
+
this.pageGroups[rowIndex].Groups[groupIndex].Fields.length - 1
|
|
424
|
+
)
|
|
425
|
+
moveItem(
|
|
426
|
+
this.pageGroups[rowIndex].Groups[groupIndex].Fields,
|
|
427
|
+
fieldIndex,
|
|
428
|
+
fieldIndex + 1
|
|
429
|
+
);
|
|
430
|
+
this.buildReactiveForm();
|
|
431
|
+
}
|
|
432
|
+
|
|
433
|
+
upField(fieldIndex, groupIndex, rowIndex) {
|
|
434
|
+
|
|
435
|
+
if (fieldIndex != 0)
|
|
436
|
+
moveItem(
|
|
437
|
+
this.pageGroups[rowIndex].Groups[groupIndex].Fields,
|
|
438
|
+
fieldIndex,
|
|
439
|
+
fieldIndex - 1
|
|
440
|
+
);
|
|
441
|
+
this.buildReactiveForm();
|
|
442
|
+
}
|
|
443
|
+
|
|
444
|
+
/* #endregion */
|
|
445
|
+
|
|
446
|
+
/* #region DynamicViewPopup */
|
|
447
|
+
|
|
448
|
+
showDynamicViewPopup: boolean = false;
|
|
449
|
+
openDynamicViewPopup() {
|
|
450
|
+
|
|
451
|
+
this.showDynamicViewPopup = true;
|
|
452
|
+
}
|
|
453
|
+
closeDynamicViewPopup() {
|
|
454
|
+
this.showDynamicViewPopup = false;
|
|
455
|
+
}
|
|
456
|
+
/* #endregion */
|
|
457
|
+
|
|
458
|
+
getAllFields() {
|
|
459
|
+
let fields: EntityTypeFieldVM[] = [];
|
|
460
|
+
|
|
461
|
+
for (let index = 0; index < this.pageGroups.length; index++) {
|
|
462
|
+
let Groups = this.pageGroups[index].Groups;
|
|
463
|
+
for (let i = 0; i < Groups.length; i++) {
|
|
464
|
+
fields.push(...Groups[i].Fields);
|
|
465
|
+
}
|
|
466
|
+
}
|
|
467
|
+
|
|
468
|
+
for (let index = 0; index < this.defaultPageGroups.length; index++) {
|
|
469
|
+
let Groups = this.defaultPageGroups[index].Groups;
|
|
470
|
+
for (let i = 0; i < Groups.length; i++) {
|
|
471
|
+
fields.push(...Groups[i].Fields);
|
|
472
|
+
}
|
|
473
|
+
}
|
|
474
|
+
|
|
475
|
+
return fields;
|
|
476
|
+
}
|
|
477
|
+
|
|
478
|
+
buildReactiveForm() {
|
|
479
|
+
|
|
480
|
+
let fields: EntityTypeFieldVM[] = this.getAllFields();
|
|
481
|
+
|
|
482
|
+
this._PageForm = new PageForm(this.createFormGroup(fields));
|
|
483
|
+
|
|
484
|
+
this.BindDesignFormData();
|
|
485
|
+
this.setFieldsInPageGroupsForm();
|
|
486
|
+
}
|
|
487
|
+
|
|
488
|
+
|
|
489
|
+
setFieldsInPageGroupsForm() {
|
|
490
|
+
|
|
491
|
+
if (!(this.EntityFieldList && this.EntityFieldList.length > 0))
|
|
492
|
+
return
|
|
493
|
+
|
|
494
|
+
this.pageGroups.map((PG) => {
|
|
495
|
+
PG.Groups.map((group) => {
|
|
496
|
+
group.Fields = group.Fields.map(PGF => this.EntityFieldList.find(f => f.Description === PGF.Description) || PGF);
|
|
497
|
+
})
|
|
498
|
+
})
|
|
499
|
+
this.defaultPageGroups.map((PG) => {
|
|
500
|
+
PG.Groups.map((group) => {
|
|
501
|
+
group.Fields = group.Fields.map(PGF => this.EntityFieldList.find(f => f.Description === PGF.Description) || PGF);
|
|
502
|
+
})
|
|
503
|
+
})
|
|
504
|
+
}
|
|
505
|
+
|
|
506
|
+
|
|
507
|
+
|
|
508
|
+
createFormGroup(fields: EntityTypeFieldVM[]) {
|
|
509
|
+
let form = this.fb.group({});
|
|
510
|
+
if (Array.isArray(fields) && fields.length > 0) {
|
|
511
|
+
for (const field of fields) {
|
|
512
|
+
|
|
513
|
+
const value = null;
|
|
514
|
+
if (field.IsMandatory)
|
|
515
|
+
form.addControl(
|
|
516
|
+
field.Description,
|
|
517
|
+
this.fb.control(value, Validators.required)
|
|
518
|
+
);
|
|
519
|
+
else form.addControl(field.Description, this.fb.control(value));
|
|
520
|
+
}
|
|
521
|
+
}
|
|
522
|
+
return form;
|
|
523
|
+
}
|
|
524
|
+
|
|
525
|
+
getFieldFormValue(field) {
|
|
526
|
+
return this._PageForm.form.get(field);
|
|
527
|
+
}
|
|
528
|
+
|
|
529
|
+
getAllDefaultEntityTypeForm(EntityTypeId) {
|
|
530
|
+
|
|
531
|
+
this.entityTypeSetup.getActiveEntityForm(EntityTypeId).subscribe(
|
|
532
|
+
(res: any) => {
|
|
533
|
+
|
|
534
|
+
|
|
535
|
+
if (res && res.FormData) {
|
|
536
|
+
let _FormData = JSON.parse(res.FormData);
|
|
537
|
+
|
|
538
|
+
if (_FormData.PageGroup) {
|
|
539
|
+
if (Array.isArray(_FormData.PageGroup)) {
|
|
540
|
+
this.defaultPageGroups = _FormData.PageGroup;
|
|
541
|
+
}
|
|
542
|
+
}
|
|
543
|
+
|
|
544
|
+
this.buildReactiveForm();
|
|
545
|
+
}
|
|
546
|
+
},
|
|
547
|
+
(error) => {
|
|
548
|
+
|
|
549
|
+
Swal.fire(this.translatePipe.transform('Template form'), this.translatePipe.transform('Template form not found'), 'warning');
|
|
550
|
+
console.log(error);
|
|
551
|
+
}
|
|
552
|
+
);
|
|
553
|
+
}
|
|
554
|
+
|
|
555
|
+
BindDesignFormData() {
|
|
556
|
+
|
|
557
|
+
// let _data ={
|
|
558
|
+
// textbox:"ASASAS",
|
|
559
|
+
// textboxNumber:"1234",
|
|
560
|
+
// DateField:"06/13/2021",
|
|
561
|
+
// DateTime:"06/13/2025",
|
|
562
|
+
// textArea:"xzxx cscc",
|
|
563
|
+
// Bolean:true
|
|
564
|
+
// };
|
|
565
|
+
this._PageForm.form.patchValue(this.PageGroupValues);
|
|
566
|
+
}
|
|
567
|
+
|
|
568
|
+
FieldChangeEvent(FieldData: EntityTypeFieldVM, RestData: any) {
|
|
569
|
+
|
|
570
|
+
let _rulesField = null;
|
|
571
|
+
if (this.AllRules && this.AllRules.FieldRules) {
|
|
572
|
+
_rulesField = this.AllRules.FieldRules;
|
|
573
|
+
_rulesField = _rulesField.filter(x => (x.EntityTypeRecId == this.EntityTypeId || x.EntityTypeRecId == this.EntityTypeDetail.TemplateId));
|
|
574
|
+
} else {
|
|
575
|
+
return;
|
|
576
|
+
}
|
|
577
|
+
let _currentFieldRule = _rulesField.filter(x => x.Field == FieldData.Description)[0]
|
|
578
|
+
|
|
579
|
+
if (_currentFieldRule && _currentFieldRule.Rules) {
|
|
580
|
+
let rulesData = JSON.parse(_currentFieldRule.Rules);
|
|
581
|
+
|
|
582
|
+
if (Array.isArray(rulesData)) {
|
|
583
|
+
|
|
584
|
+
let _rulesData = rulesData.filter((x) => {
|
|
585
|
+
if (x.CurrentEntityTypeId) {
|
|
586
|
+
if (x.CurrentEntityTypeId.includes(this.EntityTypeId))
|
|
587
|
+
return x;
|
|
588
|
+
}
|
|
589
|
+
else
|
|
590
|
+
return x;
|
|
591
|
+
});
|
|
592
|
+
|
|
593
|
+
for (let rI = 0; rI < _rulesData.length; rI++) {
|
|
594
|
+
this._fieldrulesImplement(_rulesData[rI], RestData,FieldData)
|
|
595
|
+
}
|
|
596
|
+
}
|
|
597
|
+
else
|
|
598
|
+
this._fieldrulesImplement(rulesData, RestData,FieldData)
|
|
599
|
+
|
|
600
|
+
|
|
601
|
+
}
|
|
602
|
+
|
|
603
|
+
}
|
|
604
|
+
|
|
605
|
+
|
|
606
|
+
_fieldrulesImplement(rulesData, RestData,FieldData: EntityTypeFieldVM) {
|
|
607
|
+
|
|
608
|
+
if (!rulesData || !rulesData.Condtion) {
|
|
609
|
+
return
|
|
610
|
+
}
|
|
611
|
+
|
|
612
|
+
let _condition = true;
|
|
613
|
+
|
|
614
|
+
for (let index = 0; index < rulesData.Condtion.length; index++) {
|
|
615
|
+
|
|
616
|
+
|
|
617
|
+
let _con = rulesData.Condtion[index];
|
|
618
|
+
|
|
619
|
+
let _Icondition = false;
|
|
620
|
+
|
|
621
|
+
let _fieldValue = this._PageForm.form.value[_con.Field];
|
|
622
|
+
if (FieldData.DataType == E_DataType.bool)
|
|
623
|
+
_fieldValue = _fieldValue.toString()
|
|
624
|
+
|
|
625
|
+
if (_con.FieldType && _con.FieldType == "Value") {
|
|
626
|
+
let _handleData = this._PageForm.form.value;
|
|
627
|
+
_handleData.data = RestData;
|
|
628
|
+
_handleData.currentLang = this.globelService.CurrentLanguage;
|
|
629
|
+
if (this.ParameterData)
|
|
630
|
+
_handleData.params = this.ParameterData;
|
|
631
|
+
_fieldValue = this.hanbleBarHtml(_con.Field, _handleData)
|
|
632
|
+
}
|
|
633
|
+
let value = (_con.Value == "FieldValue" ? this._PageForm.form.value[_con.ValueTwo] : _con.ValueTwo)
|
|
634
|
+
|
|
635
|
+
switch (_con.Type) {
|
|
636
|
+
case "Equal": {
|
|
637
|
+
_Icondition = (_fieldValue == value ? true : false)
|
|
638
|
+
break
|
|
639
|
+
}
|
|
640
|
+
case "NotEqual": {
|
|
641
|
+
_Icondition = (_fieldValue != value ? true : false)
|
|
642
|
+
break
|
|
643
|
+
}
|
|
644
|
+
case "LessThen": {
|
|
645
|
+
_Icondition = (_fieldValue < value ? true : false)
|
|
646
|
+
break
|
|
647
|
+
}
|
|
648
|
+
case "LessThenEqual": {
|
|
649
|
+
_Icondition = (_fieldValue < value ? true : false)
|
|
650
|
+
break
|
|
651
|
+
}
|
|
652
|
+
case "GreaterThen": {
|
|
653
|
+
_Icondition = (_fieldValue + " >" + value ? true : false)
|
|
654
|
+
break
|
|
655
|
+
}
|
|
656
|
+
case "GreaterThenEqual": {
|
|
657
|
+
_Icondition = (_fieldValue >= value ? true : false)
|
|
658
|
+
break
|
|
659
|
+
}
|
|
660
|
+
case "IsNull": {
|
|
661
|
+
_Icondition = (_fieldValue == null ? true : false)
|
|
662
|
+
break
|
|
663
|
+
}
|
|
664
|
+
case "IsNotNull": {
|
|
665
|
+
_Icondition = (_fieldValue != null ? true : false)
|
|
666
|
+
break
|
|
667
|
+
}
|
|
668
|
+
|
|
669
|
+
default:
|
|
670
|
+
_Icondition = false
|
|
671
|
+
break
|
|
672
|
+
}
|
|
673
|
+
|
|
674
|
+
|
|
675
|
+
if (index > 0) {
|
|
676
|
+
if (rulesData.CondtionOperator == 1) {
|
|
677
|
+
_condition = (_condition && _Icondition ? true : false)
|
|
678
|
+
}
|
|
679
|
+
else {
|
|
680
|
+
_condition = (_condition || _Icondition ? true : false)
|
|
681
|
+
}
|
|
682
|
+
}
|
|
683
|
+
else {
|
|
684
|
+
_condition = _Icondition;
|
|
685
|
+
}
|
|
686
|
+
|
|
687
|
+
}
|
|
688
|
+
|
|
689
|
+
|
|
690
|
+
|
|
691
|
+
if (_condition) {
|
|
692
|
+
|
|
693
|
+
this.OnRulesApply(rulesData, RestData)
|
|
694
|
+
}
|
|
695
|
+
|
|
696
|
+
}
|
|
697
|
+
|
|
698
|
+
|
|
699
|
+
hanbleBarHtml(_code, data?) {
|
|
700
|
+
|
|
701
|
+
if (!data || (typeof data != 'object'))
|
|
702
|
+
data = {};
|
|
703
|
+
data.Local = localStorage;
|
|
704
|
+
data.Cookies = this.Cookies;
|
|
705
|
+
if (_code && data) {
|
|
706
|
+
let template = Handlebars.compile(_code);
|
|
707
|
+
let result = template(data);
|
|
708
|
+
return result
|
|
709
|
+
}
|
|
710
|
+
else {
|
|
711
|
+
return _code
|
|
712
|
+
}
|
|
713
|
+
|
|
714
|
+
}
|
|
715
|
+
|
|
716
|
+
get Cookies() {
|
|
717
|
+
let cookies = document.cookie.split(';');
|
|
718
|
+
let cookie = {};
|
|
719
|
+
for (let i = 0; i < cookies.length; i++) {
|
|
720
|
+
let hash = (cookies[i].split('='));
|
|
721
|
+
let _key = hash[0].toString().replace(" ", "");
|
|
722
|
+
cookie[_key] = hash[1];
|
|
723
|
+
}
|
|
724
|
+
return cookie;
|
|
725
|
+
}
|
|
726
|
+
|
|
727
|
+
|
|
728
|
+
|
|
729
|
+
|
|
730
|
+
|
|
731
|
+
onFormInit(FormData, RestData?: any) {
|
|
732
|
+
|
|
733
|
+
|
|
734
|
+
if (FormData.RulesData) {
|
|
735
|
+
let _formInitRule = JSON.parse(FormData.RulesData);
|
|
736
|
+
|
|
737
|
+
let onInitRules = _formInitRule.filter(x => x.Type == "OnInit")
|
|
738
|
+
|
|
739
|
+
for (let index = 0; index < onInitRules.length; index++) {
|
|
740
|
+
|
|
741
|
+
// let rulesData = _formInitRule.filter(x => x.Type == "OnInit")[0];
|
|
742
|
+
let rulesData = onInitRules[index];
|
|
743
|
+
if (!rulesData) {
|
|
744
|
+
return;
|
|
745
|
+
}
|
|
746
|
+
|
|
747
|
+
let _condition = true;
|
|
748
|
+
|
|
749
|
+
for (let index = 0; index < rulesData.Condtion.length; index++) {
|
|
750
|
+
|
|
751
|
+
|
|
752
|
+
let _con = rulesData.Condtion[index];
|
|
753
|
+
|
|
754
|
+
let _Icondition = false;
|
|
755
|
+
|
|
756
|
+
let _fieldValue = this._PageForm.form.value[_con.Field];
|
|
757
|
+
if (_con.FieldType && _con.FieldType == "Value") {
|
|
758
|
+
let _handleData = this._PageForm.form.value;
|
|
759
|
+
_handleData.data = RestData;
|
|
760
|
+
_handleData.currentLang = this.globelService.CurrentLanguage;
|
|
761
|
+
if (this.ParameterData)
|
|
762
|
+
_handleData.params = this.ParameterData;
|
|
763
|
+
_fieldValue = this.hanbleBarHtml(_con.Field, _handleData)
|
|
764
|
+
}
|
|
765
|
+
|
|
766
|
+
let value = (_con.Value == "FieldValue" ? this._PageForm.form.value[_con.ValueTwo] : _con.ValueTwo);
|
|
767
|
+
switch (_con.Type) {
|
|
768
|
+
case 'Equal': {
|
|
769
|
+
_Icondition =
|
|
770
|
+
_fieldValue == value ? true : false;
|
|
771
|
+
break;
|
|
772
|
+
}
|
|
773
|
+
case 'NotEqual': {
|
|
774
|
+
_Icondition =
|
|
775
|
+
_fieldValue != value ? true : false;
|
|
776
|
+
break;
|
|
777
|
+
}
|
|
778
|
+
case 'LessThen': {
|
|
779
|
+
_Icondition =
|
|
780
|
+
_fieldValue < value ? true : false;
|
|
781
|
+
break;
|
|
782
|
+
}
|
|
783
|
+
case 'LessThenEqual': {
|
|
784
|
+
_Icondition =
|
|
785
|
+
_fieldValue < value ? true : false;
|
|
786
|
+
break;
|
|
787
|
+
}
|
|
788
|
+
case 'GreaterThen': {
|
|
789
|
+
_Icondition =
|
|
790
|
+
_fieldValue + ' >' + value
|
|
791
|
+
? true
|
|
792
|
+
: false;
|
|
793
|
+
break;
|
|
794
|
+
}
|
|
795
|
+
case 'GreaterThenEqual': {
|
|
796
|
+
_Icondition =
|
|
797
|
+
_fieldValue >= value ? true : false;
|
|
798
|
+
break;
|
|
799
|
+
}
|
|
800
|
+
case 'IsNull': {
|
|
801
|
+
_Icondition =
|
|
802
|
+
_fieldValue == null ? true : false;
|
|
803
|
+
break;
|
|
804
|
+
}
|
|
805
|
+
case 'IsNotNull': {
|
|
806
|
+
_Icondition =
|
|
807
|
+
_fieldValue != null ? true : false;
|
|
808
|
+
break;
|
|
809
|
+
}
|
|
810
|
+
|
|
811
|
+
default:
|
|
812
|
+
_Icondition = false;
|
|
813
|
+
break;
|
|
814
|
+
}
|
|
815
|
+
|
|
816
|
+
if (index > 0) {
|
|
817
|
+
if (rulesData.CondtionOperator == 1) {
|
|
818
|
+
_condition = _condition && _Icondition ? true : false;
|
|
819
|
+
} else {
|
|
820
|
+
_condition = _condition || _Icondition ? true : false;
|
|
821
|
+
}
|
|
822
|
+
} else {
|
|
823
|
+
_condition = _Icondition;
|
|
824
|
+
}
|
|
825
|
+
}
|
|
826
|
+
|
|
827
|
+
|
|
828
|
+
if (_condition) {
|
|
829
|
+
this.OnRulesApply(rulesData, RestData)
|
|
830
|
+
}
|
|
831
|
+
|
|
832
|
+
}
|
|
833
|
+
}
|
|
834
|
+
}
|
|
835
|
+
|
|
836
|
+
|
|
837
|
+
OnRulesApply(rulesData, RestData) {
|
|
838
|
+
let rulesList = rulesData;
|
|
839
|
+
if (rulesData.action) rulesList = rulesData.action;
|
|
840
|
+
|
|
841
|
+
for (let index = 0; index < rulesList.length; index++) {
|
|
842
|
+
let rules = rulesList[index];
|
|
843
|
+
|
|
844
|
+
|
|
845
|
+
if (rules.Condition == 'ClearFieldValue') {
|
|
846
|
+
this._PageForm.form.get(rules.Field).setValue('', { entitySelf:true });
|
|
847
|
+
this.setDDLFieldDesc(rules.Field,"");
|
|
848
|
+
}
|
|
849
|
+
|
|
850
|
+
if (rules.Condition == 'SetFieldValue') {
|
|
851
|
+
let _rulesValue = rules.Value
|
|
852
|
+
try {
|
|
853
|
+
let _handleData = this._PageForm.form.value;
|
|
854
|
+
_handleData.data = RestData;
|
|
855
|
+
_handleData.currentLang = this.globelService.CurrentLanguage;
|
|
856
|
+
if (this.ParameterData)
|
|
857
|
+
_handleData.params = this.ParameterData;
|
|
858
|
+
let _rulesValueArr:any[] =rules.Value.split('<br>');
|
|
859
|
+
|
|
860
|
+
_rulesValue = this.hanbleBarHtml(_rulesValueArr[0], _handleData)
|
|
861
|
+
this._PageForm.form.get(rules.Field).setValue(_rulesValue, { entitySelf:true });
|
|
862
|
+
|
|
863
|
+
if(_rulesValueArr.length>1) {
|
|
864
|
+
let _rulesValueDes = this.hanbleBarHtml(_rulesValueArr[1], _handleData)
|
|
865
|
+
this.setDDLFieldDesc(rules.Field,_rulesValueDes)
|
|
866
|
+
}
|
|
867
|
+
|
|
868
|
+
|
|
869
|
+
// if (RestData && Object.keys(RestData).length > 0)
|
|
870
|
+
// _rulesValue = this.hanbleBarHtml(rules.Value, RestData)
|
|
871
|
+
|
|
872
|
+
|
|
873
|
+
|
|
874
|
+
}
|
|
875
|
+
catch (err) {
|
|
876
|
+
alert("SetFieldValueerr -"+ err);
|
|
877
|
+
console.log(err);
|
|
878
|
+
// this._PageForm.form.get(rules.Field).setValue(_rulesValue, { onlySelf: true });
|
|
879
|
+
}
|
|
880
|
+
}
|
|
881
|
+
|
|
882
|
+
if (rules.Condition == 'CopyFieldValue') {
|
|
883
|
+
if (rules.Value)
|
|
884
|
+
this._PageForm.form
|
|
885
|
+
.get(rules.Value)
|
|
886
|
+
.setValue(this._PageForm.form.get(rules.Field).value, {
|
|
887
|
+
onlySelf: true,
|
|
888
|
+
});
|
|
889
|
+
}
|
|
890
|
+
|
|
891
|
+
if (rules.Condition == 'RemoveValidation') {
|
|
892
|
+
this._PageForm.form.controls[rules.Field].setValidators([]);
|
|
893
|
+
this._PageForm.form.controls[rules.Field].updateValueAndValidity();
|
|
894
|
+
|
|
895
|
+
this.fieldValidation.map(x => {
|
|
896
|
+
if (x.Field == rules.Field) {
|
|
897
|
+
x.Validators = [];
|
|
898
|
+
}
|
|
899
|
+
});
|
|
900
|
+
|
|
901
|
+
}
|
|
902
|
+
|
|
903
|
+
if (rules.Condition == 'AddValidation') {
|
|
904
|
+
|
|
905
|
+
if (rules.Type == 'Required') {
|
|
906
|
+
this._PageForm.form.controls[rules.Field].setValidators([Validators.required,]);
|
|
907
|
+
this._PageForm.form.controls[rules.Field].updateValueAndValidity();
|
|
908
|
+
}
|
|
909
|
+
if (rules.Type == 'MinMax') {
|
|
910
|
+
let validateArry = [Validators.required];
|
|
911
|
+
if (rules.Value) validateArry.push(Validators.min(rules.Value));
|
|
912
|
+
if (rules.ValueTwo)
|
|
913
|
+
validateArry.push(Validators.max(rules.ValueTwo));
|
|
914
|
+
|
|
915
|
+
this._PageForm.form.controls[rules.Field].setValidators(
|
|
916
|
+
validateArry
|
|
917
|
+
);
|
|
918
|
+
this._PageForm.form.controls[
|
|
919
|
+
rules.Field
|
|
920
|
+
].updateValueAndValidity();
|
|
921
|
+
}
|
|
922
|
+
if (rules.Type == 'MinLength') {
|
|
923
|
+
let validateArry = [Validators.required];
|
|
924
|
+
if (rules.Value)
|
|
925
|
+
validateArry.push(Validators.minLength(rules.Value));
|
|
926
|
+
|
|
927
|
+
this._PageForm.form.controls[rules.Field].setValidators(
|
|
928
|
+
validateArry
|
|
929
|
+
);
|
|
930
|
+
this._PageForm.form.controls[
|
|
931
|
+
rules.Field
|
|
932
|
+
].updateValueAndValidity();
|
|
933
|
+
}
|
|
934
|
+
if (rules.Type == 'MaxLength') {
|
|
935
|
+
let validateArry = [Validators.required];
|
|
936
|
+
if (rules.Value)
|
|
937
|
+
validateArry.push(Validators.maxLength(rules.Value));
|
|
938
|
+
|
|
939
|
+
this._PageForm.form.controls[rules.Field].setValidators(
|
|
940
|
+
validateArry
|
|
941
|
+
);
|
|
942
|
+
this._PageForm.form.controls[
|
|
943
|
+
rules.Field
|
|
944
|
+
].updateValueAndValidity();
|
|
945
|
+
}
|
|
946
|
+
if (rules.Type == 'Pattern') {
|
|
947
|
+
if (rules.Value)
|
|
948
|
+
this._PageForm.form.controls[rules.Field].setValidators([Validators.pattern(rules.Value)]);
|
|
949
|
+
this._PageForm.form.controls[rules.Field].updateValueAndValidity()
|
|
950
|
+
}
|
|
951
|
+
|
|
952
|
+
this.setValidationOnField(rules.Field, rules.ValidationMessage, rules.ValidationMessageAr, rules.Type)
|
|
953
|
+
|
|
954
|
+
if (this.fieldValidation.filter(x => x.Field == rules.Field).length < 1) {
|
|
955
|
+
this.fieldValidation.push({ Field: rules.Field, Validators: [] })
|
|
956
|
+
}
|
|
957
|
+
this.fieldValidation.map(x => {
|
|
958
|
+
if (x.Field == rules.Field) {
|
|
959
|
+
if (rules.Type == 'Required') {
|
|
960
|
+
x.Validators.push(Validators.required);
|
|
961
|
+
}
|
|
962
|
+
else if (rules.Type == 'MinMax') {
|
|
963
|
+
if (rules.Value)
|
|
964
|
+
x.Validators.push(Validators.min(rules.Value));
|
|
965
|
+
if (rules.ValueTwo)
|
|
966
|
+
x.Validators.push(Validators.max(rules.ValueTwo));
|
|
967
|
+
}
|
|
968
|
+
else if (rules.Type == 'MinLength') {
|
|
969
|
+
if (rules.Value)
|
|
970
|
+
x.Validators.push(Validators.minLength(rules.Value));
|
|
971
|
+
}
|
|
972
|
+
else if (rules.Type == 'MaxLength') {
|
|
973
|
+
if (rules.Value)
|
|
974
|
+
x.Validators.push(Validators.maxLength(rules.Value));
|
|
975
|
+
}
|
|
976
|
+
else if (rules.Type == 'Pattern') {
|
|
977
|
+
if (rules.Value)
|
|
978
|
+
x.Validators.push(Validators.pattern(rules.Value));
|
|
979
|
+
}
|
|
980
|
+
}
|
|
981
|
+
});
|
|
982
|
+
|
|
983
|
+
let _Validators = this.fieldValidation.filter(x => x.Field == rules.Field)[0].Validators;
|
|
984
|
+
|
|
985
|
+
|
|
986
|
+
this._PageForm.form.controls[rules.Field].setValidators(_Validators);
|
|
987
|
+
this._PageForm.form.controls[rules.Field].updateValueAndValidity();
|
|
988
|
+
|
|
989
|
+
|
|
990
|
+
}
|
|
991
|
+
|
|
992
|
+
if (rules.Condition == 'IsEditable') {
|
|
993
|
+
if (rules.Value == 'true') {
|
|
994
|
+
this.setReadOnlyOnField(rules.Field, true)
|
|
995
|
+
}
|
|
996
|
+
else if (rules.Value == 'false') {
|
|
997
|
+
this.setReadOnlyOnField(rules.Field, false)
|
|
998
|
+
}
|
|
999
|
+
}
|
|
1000
|
+
if (rules.Condition == 'IsVisible') {
|
|
1001
|
+
if (rules.Value == 'true') {
|
|
1002
|
+
this.setIsHideOnField(rules.Field, false)
|
|
1003
|
+
}
|
|
1004
|
+
else if (rules.Value == 'false') {
|
|
1005
|
+
this.setIsHideOnField(rules.Field, true)
|
|
1006
|
+
}
|
|
1007
|
+
}
|
|
1008
|
+
if (rules.Condition == 'Datasource') {
|
|
1009
|
+
this.getDatasoureData(rules.Value,rules.ValueTwo,rules.ValueThree);
|
|
1010
|
+
}
|
|
1011
|
+
}
|
|
1012
|
+
}
|
|
1013
|
+
|
|
1014
|
+
|
|
1015
|
+
getDatasoureData(EntityFormId,Fields,Triggr){
|
|
1016
|
+
|
|
1017
|
+
this.entityTypeSetup.getSingleEntityTypeFormById(EntityFormId)
|
|
1018
|
+
.subscribe(
|
|
1019
|
+
(res: any) => {
|
|
1020
|
+
|
|
1021
|
+
let _EntityTypeForm = res;
|
|
1022
|
+
if(_EntityTypeForm.DataSource) {
|
|
1023
|
+
let RestData =JSON.parse( _EntityTypeForm.DataSource)
|
|
1024
|
+
|
|
1025
|
+
let _hanbleBardata:any ={};
|
|
1026
|
+
_hanbleBardata.FormData = this._PageForm.form.value;
|
|
1027
|
+
|
|
1028
|
+
RestData.URL = this.hanbleBarHtml(RestData.URL,_hanbleBardata);
|
|
1029
|
+
RestData.Body = this.hanbleBarHtml(RestData.Body,_hanbleBardata);
|
|
1030
|
+
RestData.QueryStrings = RestData.QueryStrings.map(x => {
|
|
1031
|
+
|
|
1032
|
+
x.Value = this.hanbleBarHtml(x.Value,_hanbleBardata);
|
|
1033
|
+
|
|
1034
|
+
if(x.Value)
|
|
1035
|
+
return x
|
|
1036
|
+
});
|
|
1037
|
+
|
|
1038
|
+
RestData.Headers = RestData.Headers.map(x => {
|
|
1039
|
+
x.Value = this.hanbleBarHtml(x.Value,_hanbleBardata);
|
|
1040
|
+
return x
|
|
1041
|
+
});
|
|
1042
|
+
|
|
1043
|
+
this.entityTypeSetup.dynamicAPi(RestData)
|
|
1044
|
+
.subscribe((res: any) => {
|
|
1045
|
+
|
|
1046
|
+
let _data: any = res;
|
|
1047
|
+
if (RestData.ResponseView) {
|
|
1048
|
+
let _rview = RestData.ResponseView.split(".");
|
|
1049
|
+
_rview.forEach(x => {
|
|
1050
|
+
_data = _data[x];
|
|
1051
|
+
});
|
|
1052
|
+
}
|
|
1053
|
+
|
|
1054
|
+
try {
|
|
1055
|
+
if(Fields){
|
|
1056
|
+
let _Fields = JSON.parse(JSON.parse(Fields));
|
|
1057
|
+
_Fields.forEach(x => {
|
|
1058
|
+
debugger;
|
|
1059
|
+
let _value = _data[x.Value];
|
|
1060
|
+
let currentfield = this.EntityFieldList.filter(y => y.Description == x.Field)[0];
|
|
1061
|
+
|
|
1062
|
+
if(currentfield.DataType == E_DataType.date || currentfield.DataType == E_DataType.dateTime){
|
|
1063
|
+
if(_data[x.Value]){
|
|
1064
|
+
_value = new Date(_data[x.Value]);
|
|
1065
|
+
}
|
|
1066
|
+
}
|
|
1067
|
+
|
|
1068
|
+
this._PageForm.form.get(x.Field).setValue(_value, { entitySelf: true });
|
|
1069
|
+
});
|
|
1070
|
+
}
|
|
1071
|
+
if(Triggr){
|
|
1072
|
+
let _TriggrFields = JSON.parse(JSON.parse(Triggr));
|
|
1073
|
+
_TriggrFields.forEach(x => {
|
|
1074
|
+
|
|
1075
|
+
let _Triggrfield = this.EntityFieldList.filter(y => y.Description == x.Field)[0]
|
|
1076
|
+
if (_Triggrfield)
|
|
1077
|
+
this.FieldChangeEvent(_Triggrfield, null)
|
|
1078
|
+
});
|
|
1079
|
+
}
|
|
1080
|
+
}
|
|
1081
|
+
catch (err) {
|
|
1082
|
+
|
|
1083
|
+
alert(err)
|
|
1084
|
+
}
|
|
1085
|
+
|
|
1086
|
+
},
|
|
1087
|
+
(error) => {
|
|
1088
|
+
|
|
1089
|
+
console.log(error);
|
|
1090
|
+
Swal.fire(errorMessageType(error));
|
|
1091
|
+
});
|
|
1092
|
+
}
|
|
1093
|
+
},
|
|
1094
|
+
|
|
1095
|
+
(error) => {
|
|
1096
|
+
|
|
1097
|
+
console.log(error);
|
|
1098
|
+
}
|
|
1099
|
+
);
|
|
1100
|
+
|
|
1101
|
+
}
|
|
1102
|
+
|
|
1103
|
+
|
|
1104
|
+
AllRules: any = null;
|
|
1105
|
+
getAllRules() {
|
|
1106
|
+
|
|
1107
|
+
this.entityTypeSetup.getAllRulesWithTemplateData(this.EntityTypeId).subscribe(
|
|
1108
|
+
(res: any) => {
|
|
1109
|
+
|
|
1110
|
+
this.AllRules = res;
|
|
1111
|
+
},
|
|
1112
|
+
(error) => {
|
|
1113
|
+
|
|
1114
|
+
}
|
|
1115
|
+
);
|
|
1116
|
+
}
|
|
1117
|
+
|
|
1118
|
+
setValidationOnField(Field, ValidationMessage, ValidationMessageAr, Type) {
|
|
1119
|
+
this.pageGroups.map((PG) => {
|
|
1120
|
+
|
|
1121
|
+
PG.Groups.map((group) => {
|
|
1122
|
+
group.Fields.map((PGF) => {
|
|
1123
|
+
if (PGF.Description == Field) {
|
|
1124
|
+
let temp = { MsgEn: ValidationMessage, MsgAr: ValidationMessageAr, Type: Type }
|
|
1125
|
+
if (PGF.ValidationMessage) {
|
|
1126
|
+
if (PGF.ValidationMessage.filter(x => (x.Type == temp.Type && x.MsgEn == temp.MsgEn)).length < 1)
|
|
1127
|
+
PGF.ValidationMessage.push(temp)
|
|
1128
|
+
}
|
|
1129
|
+
else
|
|
1130
|
+
PGF.ValidationMessage = [temp];
|
|
1131
|
+
|
|
1132
|
+
}
|
|
1133
|
+
})
|
|
1134
|
+
})
|
|
1135
|
+
|
|
1136
|
+
})
|
|
1137
|
+
this.defaultPageGroups.map((PG) => {
|
|
1138
|
+
|
|
1139
|
+
PG.Groups.map((group) => {
|
|
1140
|
+
group.Fields.map((PGF) => {
|
|
1141
|
+
if (PGF.Description == Field) {
|
|
1142
|
+
let temp = { MsgEn: ValidationMessage, MsgAr: ValidationMessageAr, Type: Type }
|
|
1143
|
+
if (PGF.ValidationMessage) {
|
|
1144
|
+
if (PGF.ValidationMessage.filter(x => (x.Type == temp.Type && x.MsgEn == temp.MsgEn)).length < 1)
|
|
1145
|
+
PGF.ValidationMessage.push(temp)
|
|
1146
|
+
}
|
|
1147
|
+
else
|
|
1148
|
+
PGF.ValidationMessage = [temp];
|
|
1149
|
+
|
|
1150
|
+
}
|
|
1151
|
+
})
|
|
1152
|
+
})
|
|
1153
|
+
|
|
1154
|
+
})
|
|
1155
|
+
}
|
|
1156
|
+
|
|
1157
|
+
|
|
1158
|
+
|
|
1159
|
+
setReadOnlyOnField(Field, IsReadonly: boolean) {
|
|
1160
|
+
this.pageGroups.map((PG) => {
|
|
1161
|
+
|
|
1162
|
+
PG.Groups.map((group) => {
|
|
1163
|
+
group.Fields.map((PGF) => {
|
|
1164
|
+
if (PGF.Description == Field) {
|
|
1165
|
+
PGF.IsReadonly = IsReadonly
|
|
1166
|
+
}
|
|
1167
|
+
|
|
1168
|
+
})
|
|
1169
|
+
})
|
|
1170
|
+
|
|
1171
|
+
})
|
|
1172
|
+
this.defaultPageGroups.map((PG) => {
|
|
1173
|
+
|
|
1174
|
+
PG.Groups.map((group) => {
|
|
1175
|
+
group.Fields.map((PGF) => {
|
|
1176
|
+
if (PGF.Description == Field) {
|
|
1177
|
+
PGF.IsReadonly = IsReadonly
|
|
1178
|
+
}
|
|
1179
|
+
|
|
1180
|
+
})
|
|
1181
|
+
})
|
|
1182
|
+
|
|
1183
|
+
})
|
|
1184
|
+
}
|
|
1185
|
+
|
|
1186
|
+
setIsHideOnField(Field, IsHide: boolean) {
|
|
1187
|
+
this.pageGroups.map((PG) => {
|
|
1188
|
+
|
|
1189
|
+
PG.Groups.map((group) => {
|
|
1190
|
+
group.Fields.map((PGF) => {
|
|
1191
|
+
if (PGF.Description == Field) {
|
|
1192
|
+
PGF.IsHide = IsHide
|
|
1193
|
+
}
|
|
1194
|
+
|
|
1195
|
+
})
|
|
1196
|
+
})
|
|
1197
|
+
|
|
1198
|
+
})
|
|
1199
|
+
this.defaultPageGroups.map((PG) => {
|
|
1200
|
+
|
|
1201
|
+
PG.Groups.map((group) => {
|
|
1202
|
+
group.Fields.map((PGF) => {
|
|
1203
|
+
if (PGF.Description == Field) {
|
|
1204
|
+
PGF.IsHide = IsHide
|
|
1205
|
+
}
|
|
1206
|
+
|
|
1207
|
+
})
|
|
1208
|
+
})
|
|
1209
|
+
|
|
1210
|
+
})
|
|
1211
|
+
}
|
|
1212
|
+
|
|
1213
|
+
|
|
1214
|
+
setDDLFieldDesc(Field, value) {
|
|
1215
|
+
this.pageGroups.map((PG) => {
|
|
1216
|
+
|
|
1217
|
+
PG.Groups.map((group) => {
|
|
1218
|
+
group.Fields.map((PGF) => {
|
|
1219
|
+
if (PGF.Description == Field) {
|
|
1220
|
+
PGF.showSelectedValues = value
|
|
1221
|
+
}
|
|
1222
|
+
|
|
1223
|
+
})
|
|
1224
|
+
})
|
|
1225
|
+
|
|
1226
|
+
})
|
|
1227
|
+
this.defaultPageGroups.map((PG) => {
|
|
1228
|
+
|
|
1229
|
+
PG.Groups.map((group) => {
|
|
1230
|
+
group.Fields.map((PGF) => {
|
|
1231
|
+
if (PGF.Description == Field) {
|
|
1232
|
+
PGF.showSelectedValues = value
|
|
1233
|
+
}
|
|
1234
|
+
|
|
1235
|
+
})
|
|
1236
|
+
})
|
|
1237
|
+
|
|
1238
|
+
})
|
|
1239
|
+
}
|
|
1240
|
+
|
|
1241
|
+
// getAllValidators(Field) {
|
|
1242
|
+
|
|
1243
|
+
// let validators =[];
|
|
1244
|
+
// this.EntityFieldList.map((field)=> {
|
|
1245
|
+
// if(field.Description ==Field && field.IsMandatory ) {
|
|
1246
|
+
// let rulesObj = {
|
|
1247
|
+
// Condition: "AddValidation",
|
|
1248
|
+
// Field: Field,
|
|
1249
|
+
// Type: 'Required',
|
|
1250
|
+
// Value: '',
|
|
1251
|
+
// ValueTwo: '',
|
|
1252
|
+
// ValidationMessage: null,
|
|
1253
|
+
// ValidationMessageAr: null,
|
|
1254
|
+
// };
|
|
1255
|
+
// validators.push(rulesObj)
|
|
1256
|
+
|
|
1257
|
+
// }
|
|
1258
|
+
// });
|
|
1259
|
+
|
|
1260
|
+
|
|
1261
|
+
// if (this.EntityTypeForm.RulesData) { // OnInit Rules
|
|
1262
|
+
// let _formInitRule = JSON.parse(this.EntityTypeForm.RulesData);
|
|
1263
|
+
// let onInitRules = _formInitRule.filter(x => x.Type == "OnInit")
|
|
1264
|
+
// onInitRules.map((rules) => {
|
|
1265
|
+
|
|
1266
|
+
// let rulesData = JSON.parse(rules.Rules);
|
|
1267
|
+
|
|
1268
|
+
// if (Array.isArray(rulesData)) {
|
|
1269
|
+
// let _rulesData = rulesData.filter((x) => {
|
|
1270
|
+
// if (x.CurrentEntityTypeId) {
|
|
1271
|
+
// if (x.CurrentEntityTypeId.includes(this.EntityTypeId))
|
|
1272
|
+
// return x;
|
|
1273
|
+
// }
|
|
1274
|
+
// else
|
|
1275
|
+
// return x;
|
|
1276
|
+
// });
|
|
1277
|
+
|
|
1278
|
+
// _rulesData.map((ruleD) => {
|
|
1279
|
+
// ruleD.action.map((action) => {
|
|
1280
|
+
// if (action.Condition == "AddValidation" && action.Field == Field) {
|
|
1281
|
+
// validators.push(action);
|
|
1282
|
+
// }
|
|
1283
|
+
// });
|
|
1284
|
+
// });
|
|
1285
|
+
|
|
1286
|
+
// }
|
|
1287
|
+
|
|
1288
|
+
|
|
1289
|
+
// });
|
|
1290
|
+
// }
|
|
1291
|
+
|
|
1292
|
+
|
|
1293
|
+
// this.AllRules.FieldRules.map((rules) => {
|
|
1294
|
+
|
|
1295
|
+
// let rulesData = JSON.parse(rules.Rules);
|
|
1296
|
+
|
|
1297
|
+
// if (Array.isArray(rulesData)) {
|
|
1298
|
+
// let _rulesData = rulesData.filter((x) => {
|
|
1299
|
+
// if (x.CurrentEntityTypeId) {
|
|
1300
|
+
// if (x.CurrentEntityTypeId.includes(this.EntityTypeId))
|
|
1301
|
+
// return x;
|
|
1302
|
+
// }
|
|
1303
|
+
// else
|
|
1304
|
+
// return x;
|
|
1305
|
+
// });
|
|
1306
|
+
|
|
1307
|
+
// _rulesData.map((ruleD) => {
|
|
1308
|
+
// ruleD.action.map((action) => {
|
|
1309
|
+
// if(action.Condition=="AddValidation" && action.Field ==Field) {
|
|
1310
|
+
// validators.push(action);
|
|
1311
|
+
// }
|
|
1312
|
+
// });
|
|
1313
|
+
// });
|
|
1314
|
+
|
|
1315
|
+
// }
|
|
1316
|
+
|
|
1317
|
+
|
|
1318
|
+
// });
|
|
1319
|
+
|
|
1320
|
+
// return validators
|
|
1321
|
+
|
|
1322
|
+
// }
|
|
1323
|
+
|
|
1324
|
+
// setMultipleValidation(Field) {
|
|
1325
|
+
// let setVaidators = [];
|
|
1326
|
+
// let allValidation = this.getAllValidators(Field);
|
|
1327
|
+
// allValidation.map((rules) => {
|
|
1328
|
+
// if (rules.Type == 'Required') {
|
|
1329
|
+
// setVaidators.push(Validators.required)
|
|
1330
|
+
// }
|
|
1331
|
+
// else if (rules.Type == 'MinMax') {
|
|
1332
|
+
// if (rules.Value) setVaidators.push(Validators.min(rules.Value));
|
|
1333
|
+
// if (rules.ValueTwo)
|
|
1334
|
+
// setVaidators.push(Validators.max(rules.ValueTwo));
|
|
1335
|
+
// }
|
|
1336
|
+
// if (rules.Type == 'MinLength') {
|
|
1337
|
+
// if (rules.Value)
|
|
1338
|
+
// setVaidators.push(Validators.minLength(rules.Value));
|
|
1339
|
+
// }
|
|
1340
|
+
// if (rules.Type == 'MaxLength') {
|
|
1341
|
+
// if (rules.Value)
|
|
1342
|
+
// setVaidators.push(Validators.maxLength(rules.Value));
|
|
1343
|
+
// }
|
|
1344
|
+
// if (rules.Type == 'Pattern') {
|
|
1345
|
+
// setVaidators.push(Validators.pattern(rules.Value))
|
|
1346
|
+
// }
|
|
1347
|
+
|
|
1348
|
+
// });
|
|
1349
|
+
|
|
1350
|
+
// this._PageForm.form.controls[Field].setValidators(setVaidators);
|
|
1351
|
+
// this._PageForm.form.controls[Field].updateValueAndValidity()
|
|
1352
|
+
|
|
1353
|
+
// }
|
|
1354
|
+
|
|
1355
|
+
fieldValidation: FieldValidators[] = [];
|
|
1356
|
+
|
|
1357
|
+
TempFieldValidators() {
|
|
1358
|
+
this.EntityFieldList.map((field) => {
|
|
1359
|
+
if (field.IsMandatory) {
|
|
1360
|
+
this.fieldValidation.push({ Field: field.Description, Validators: [Validators.required] })
|
|
1361
|
+
}
|
|
1362
|
+
});
|
|
1363
|
+
}
|
|
1364
|
+
|
|
1365
|
+
|
|
1366
|
+
|
|
1367
|
+
/* #region SMS-Activity */
|
|
1368
|
+
|
|
1369
|
+
setStaticActivityForm() {
|
|
1370
|
+
|
|
1371
|
+
if(this.EntityTypeForm && this.EntityTypeForm.Status !=1)
|
|
1372
|
+
return
|
|
1373
|
+
|
|
1374
|
+
|
|
1375
|
+
if (this.EntityFieldList.length > 0 && this.EntityTypeDetail && this.EntityTypeDetail.EntityType == 30 && (this.EntityTypeDetail.ActionType == "1" || this.EntityTypeDetail.ActionType == "2") ) {
|
|
1376
|
+
|
|
1377
|
+
this.pageGroups = [];
|
|
1378
|
+
this.addRow();
|
|
1379
|
+
|
|
1380
|
+
this.selectRowIndex = 0;
|
|
1381
|
+
this.selectGroupIndex = 0;
|
|
1382
|
+
|
|
1383
|
+
if(this.EntityTypeDetail.ActionType == "1"){
|
|
1384
|
+
this.setSMSActivityStaticForm();
|
|
1385
|
+
}
|
|
1386
|
+
if(this.EntityTypeDetail.ActionType == "2"){
|
|
1387
|
+
this.setEmailActivityStaticForm();
|
|
1388
|
+
}
|
|
1389
|
+
}
|
|
1390
|
+
|
|
1391
|
+
}
|
|
1392
|
+
|
|
1393
|
+
setSMSActivityStaticForm() {
|
|
1394
|
+
|
|
1395
|
+
|
|
1396
|
+
let _Fields = [];
|
|
1397
|
+
let _MobileNumber = this.EntityFieldList.filter(x => x.Description == "MobileNumber");
|
|
1398
|
+
if (!_MobileNumber || _MobileNumber.length == 0) {
|
|
1399
|
+
Swal.fire(this.translatePipe.transform("MobileNumber Field not found"));
|
|
1400
|
+
return
|
|
1401
|
+
}
|
|
1402
|
+
_Fields.push(_MobileNumber[0]);
|
|
1403
|
+
|
|
1404
|
+
let _Message = this.EntityFieldList.filter(x => x.Description == "Message");
|
|
1405
|
+
if (!_Message || _Message.length == 0) {
|
|
1406
|
+
Swal.fire(this.translatePipe.transform("Message Field not found"));
|
|
1407
|
+
return
|
|
1408
|
+
}
|
|
1409
|
+
_Fields.push(_Message[0]);
|
|
1410
|
+
|
|
1411
|
+
this.submitDataFields(_Fields)
|
|
1412
|
+
this.saveDesignForm()
|
|
1413
|
+
|
|
1414
|
+
}
|
|
1415
|
+
|
|
1416
|
+
/* #endregion */
|
|
1417
|
+
|
|
1418
|
+
/* #region Email-Activity */
|
|
1419
|
+
setEmailActivityStaticForm() {
|
|
1420
|
+
|
|
1421
|
+
|
|
1422
|
+
let _Fields = [];
|
|
1423
|
+
let _To = this.EntityFieldList.filter(x => x.Description == "To");
|
|
1424
|
+
if (!_To || _To.length == 0) {
|
|
1425
|
+
Swal.fire(this.translatePipe.transform("To Field not found"));
|
|
1426
|
+
return
|
|
1427
|
+
}
|
|
1428
|
+
_Fields.push(_To[0]);
|
|
1429
|
+
|
|
1430
|
+
let _CC = this.EntityFieldList.filter(x => x.Description == "CC");
|
|
1431
|
+
if (!_CC || _CC.length == 0) {
|
|
1432
|
+
Swal.fire(this.translatePipe.transform("CC Field not found"));
|
|
1433
|
+
return
|
|
1434
|
+
}
|
|
1435
|
+
_Fields.push(_CC[0]);
|
|
1436
|
+
|
|
1437
|
+
let _Subject = this.EntityFieldList.filter(x => x.Description == "Subject");
|
|
1438
|
+
if (!_Subject || _Subject.length == 0) {
|
|
1439
|
+
Swal.fire(this.translatePipe.transform("Subject Field not found"));
|
|
1440
|
+
return
|
|
1441
|
+
}
|
|
1442
|
+
_Fields.push(_Subject[0]);
|
|
1443
|
+
|
|
1444
|
+
let _Message = this.EntityFieldList.filter(x => x.Description == "Message");
|
|
1445
|
+
if (!_Message || _Message.length == 0) {
|
|
1446
|
+
Swal.fire(this.translatePipe.transform("Message Field not found "));
|
|
1447
|
+
return
|
|
1448
|
+
}
|
|
1449
|
+
_Fields.push(_Message[0]);
|
|
1450
|
+
|
|
1451
|
+
this.submitDataFields(_Fields)
|
|
1452
|
+
this.saveDesignForm()
|
|
1453
|
+
|
|
1454
|
+
}
|
|
1455
|
+
|
|
1456
|
+
/* #endregion */
|
|
1457
|
+
|
|
1458
|
+
translatePipe = new TranslatePipe(this.globelService);
|
|
1459
|
+
}
|
|
1460
|
+
|
|
1461
|
+
export function moveItem(data: any[], from: number, to: number) {
|
|
1462
|
+
let f = data.splice(from, 1)[0];
|
|
1463
|
+
data.splice(to, 0, f);
|
|
1464
|
+
return data;
|
|
1465
|
+
}
|
|
1466
|
+
|