@alfresco/aca-content 4.0.0 → 4.1.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/{lib/components/create-menu/create-menu.component.d.ts → about/about.component.d.ts} +15 -16
- package/about/aca-about.module.d.ts +9 -0
- package/about/assets/about.plugin.json +47 -0
- package/about/dev-mode.tokens.d.ts +25 -0
- package/about/index.d.ts +5 -0
- package/about/package-json.token.d.ts +25 -0
- package/about/public-api.d.ts +27 -0
- package/assets/app.extensions.json +158 -131
- package/assets/i18n/ar.json +10 -26
- package/assets/i18n/cs.json +10 -26
- package/assets/i18n/da.json +9 -25
- package/assets/i18n/de.json +8 -24
- package/assets/i18n/en.json +9 -25
- package/assets/i18n/es.json +8 -24
- package/assets/i18n/fi.json +9 -25
- package/assets/i18n/fr.json +9 -25
- package/assets/i18n/it.json +9 -25
- package/assets/i18n/ja.json +9 -25
- package/assets/i18n/nb.json +9 -25
- package/assets/i18n/nl.json +8 -24
- package/assets/i18n/pl.json +10 -26
- package/assets/i18n/pt-BR.json +9 -25
- package/assets/i18n/ru.json +10 -26
- package/assets/i18n/sv.json +9 -25
- package/assets/i18n/zh-CN.json +8 -24
- package/esm2020/about/about.component.mjs +73 -0
- package/esm2020/about/aca-about.module.mjs +46 -0
- package/esm2020/about/alfresco-aca-content-about.mjs +5 -0
- package/esm2020/about/dev-mode.tokens.mjs +26 -0
- package/esm2020/about/package-json.token.mjs +26 -0
- package/esm2020/about/public-api.mjs +28 -0
- package/esm2020/folder-rules/alfresco-aca-content-folder-rules.mjs +5 -0
- package/esm2020/folder-rules/folder-rules.module.mjs +123 -0
- package/esm2020/folder-rules/folder-rules.rules.mjs +28 -0
- package/esm2020/folder-rules/manage-rules/manage-rules.smart-component.mjs +240 -0
- package/esm2020/folder-rules/model/action-parameter-constraint.model.mjs +25 -0
- package/esm2020/folder-rules/model/rule-action.model.mjs +26 -0
- package/esm2020/folder-rules/model/rule-composite-condition.model.mjs +25 -0
- package/esm2020/folder-rules/model/rule-grouping-item.model.mjs +25 -0
- package/esm2020/folder-rules/model/rule-set.model.mjs +25 -0
- package/esm2020/folder-rules/model/rule-simple-condition.model.mjs +25 -0
- package/esm2020/folder-rules/model/rule.model.mjs +25 -0
- package/esm2020/folder-rules/public-api.mjs +26 -0
- package/esm2020/folder-rules/rule-details/actions/rule-action-list.ui-component.mjs +112 -0
- package/esm2020/folder-rules/rule-details/actions/rule-action.ui-component.mjs +277 -0
- package/esm2020/folder-rules/rule-details/conditions/rule-composite-condition.ui-component.mjs +159 -0
- package/esm2020/folder-rules/rule-details/conditions/rule-condition-comparators.mjs +87 -0
- package/esm2020/folder-rules/rule-details/conditions/rule-condition-fields.mjs +62 -0
- package/esm2020/folder-rules/rule-details/conditions/rule-mime-types.mjs +25 -0
- package/esm2020/folder-rules/rule-details/conditions/rule-simple-condition.ui-component.mjs +144 -0
- package/esm2020/folder-rules/rule-details/edit-rule-dialog.ui-component.mjs +70 -0
- package/esm2020/folder-rules/rule-details/options/rule-options.ui-component.mjs +134 -0
- package/esm2020/folder-rules/rule-details/rule-details.ui-component.mjs +166 -0
- package/esm2020/folder-rules/rule-details/triggers/rule-triggers.ui-component.mjs +85 -0
- package/esm2020/folder-rules/rule-details/validators/rule-actions.validator.mjs +37 -0
- package/esm2020/folder-rules/rule-details/validators/rule-composite-condition.validator.mjs +31 -0
- package/esm2020/folder-rules/rule-list/rule-list/rule-list.ui-component.mjs +142 -0
- package/esm2020/folder-rules/rule-list/rule-list-grouping/rule-list-grouping.ui-component.mjs +77 -0
- package/esm2020/folder-rules/rule-list/rule-list-item/rule-list-item.ui-component.mjs +56 -0
- package/esm2020/folder-rules/rule-set-picker/rule-set-picker.smart-component.mjs +104 -0
- package/esm2020/folder-rules/services/actions.service.mjs +114 -0
- package/esm2020/folder-rules/services/folder-rule-sets.service.mjs +221 -0
- package/esm2020/folder-rules/services/folder-rules.service.mjs +193 -0
- package/esm2020/lib/aca-content.module.mjs +55 -90
- package/esm2020/lib/aca-content.routes.mjs +2 -2
- package/esm2020/lib/components/common/common.module.mjs +8 -39
- package/esm2020/lib/components/common/language-picker/language-picker.component.mjs +18 -11
- package/esm2020/lib/components/common/location-link/location-link.component.mjs +17 -16
- package/esm2020/lib/components/common/logout/logout.component.mjs +16 -9
- package/esm2020/lib/components/common/toggle-shared/toggle-shared.component.mjs +29 -18
- package/esm2020/lib/components/common/user-info/user-info.component.mjs +24 -13
- package/esm2020/lib/components/context-menu/context-menu-item.component.mjs +16 -10
- package/esm2020/lib/components/context-menu/context-menu-outside-event.directive.mjs +5 -4
- package/esm2020/lib/components/context-menu/context-menu.component.mjs +29 -15
- package/esm2020/lib/components/context-menu/context-menu.service.mjs +5 -6
- package/esm2020/lib/components/details/details.component.mjs +41 -23
- package/esm2020/lib/components/dl-custom-components/document-list-custom-components.module.mjs +7 -15
- package/esm2020/lib/components/dl-custom-components/name-column/name-column.component.mjs +16 -16
- package/esm2020/lib/components/dl-custom-components/tags-column/tags-column.component.mjs +34 -12
- package/esm2020/lib/components/dl-custom-components/thumbnail-column/thumbnail-column.component.mjs +32 -15
- package/esm2020/lib/components/favorite-libraries/favorite-libraries.component.mjs +17 -28
- package/esm2020/lib/components/favorites/favorites.component.mjs +18 -34
- package/esm2020/lib/components/files/files.component.mjs +28 -43
- package/esm2020/lib/components/home/home.component.mjs +7 -6
- package/esm2020/lib/components/info-drawer/comments-tab/comments-tab.component.mjs +15 -10
- package/esm2020/lib/components/info-drawer/info.drawer.module.mjs +28 -47
- package/esm2020/lib/components/info-drawer/library-metadata-tab/library-metadata-form.component.mjs +39 -17
- package/esm2020/lib/components/info-drawer/library-metadata-tab/library-metadata-tab.component.mjs +10 -7
- package/esm2020/lib/components/info-drawer/metadata-tab/metadata-tab.component.mjs +13 -12
- package/esm2020/lib/components/info-drawer/versions-tab/versions-tab.component.mjs +18 -10
- package/esm2020/lib/components/libraries/libraries.component.mjs +17 -27
- package/esm2020/lib/components/recent-files/recent-files.component.mjs +18 -37
- package/esm2020/lib/components/search/search-action-menu/search-action-menu.component.mjs +3 -3
- package/esm2020/lib/components/search/search-input/search-input.component.mjs +11 -6
- package/esm2020/lib/components/search/search-input-control/search-input-control.component.mjs +5 -5
- package/esm2020/lib/components/search/search-input.module.mjs +4 -4
- package/esm2020/lib/components/search/search-libraries-results/search-libraries-query-builder.service.mjs +5 -6
- package/esm2020/lib/components/search/search-libraries-results/search-libraries-results.component.mjs +21 -30
- package/esm2020/lib/components/search/search-navigation.service.mjs +3 -3
- package/esm2020/lib/components/search/search-results/search-results.component.mjs +33 -41
- package/esm2020/lib/components/search/search-results-row/search-results-row.component.mjs +6 -7
- package/esm2020/lib/components/search/search-results.module.mjs +31 -23
- package/esm2020/lib/components/shared-files/shared-files.component.mjs +18 -34
- package/esm2020/lib/components/shared-link-view/shared-link-view.component.mjs +9 -7
- package/esm2020/lib/components/shared-link-view/shared-link-view.module.mjs +5 -9
- package/esm2020/lib/components/sidenav/components/button-menu.component.mjs +5 -5
- package/esm2020/lib/components/sidenav/components/expand-menu.component.mjs +5 -5
- package/esm2020/lib/components/sidenav/components/sidenav-header.component.mjs +5 -5
- package/esm2020/lib/components/sidenav/directives/action.directive.mjs +3 -3
- package/esm2020/lib/components/sidenav/directives/active-link.directive.mjs +3 -3
- package/esm2020/lib/components/sidenav/directives/expansion-panel.directive.mjs +3 -3
- package/esm2020/lib/components/sidenav/directives/menu-panel.directive.mjs +3 -3
- package/esm2020/lib/components/sidenav/sidenav.component.mjs +3 -3
- package/esm2020/lib/components/sidenav/sidenav.module.mjs +11 -9
- package/esm2020/lib/components/sidenav/user-menu/user-menu.component.mjs +96 -0
- package/esm2020/lib/components/toolbar/toggle-edit-offline/toggle-edit-offline.component.mjs +10 -17
- package/esm2020/lib/components/toolbar/toggle-favorite/toggle-favorite.component.mjs +3 -3
- package/esm2020/lib/components/toolbar/toggle-favorite-library/toggle-favorite-library.component.mjs +3 -3
- package/esm2020/lib/components/toolbar/toggle-info-drawer/toggle-info-drawer.component.mjs +3 -3
- package/esm2020/lib/components/toolbar/toggle-join-library/toggle-join-library-button.component.mjs +3 -3
- package/esm2020/lib/components/toolbar/toggle-join-library/toggle-join-library-menu.component.mjs +3 -3
- package/esm2020/lib/components/toolbar/toolbar.module.mjs +7 -13
- package/esm2020/lib/components/toolbar/view-node/view-node.component.mjs +3 -3
- package/esm2020/lib/components/trashcan/trashcan.component.mjs +37 -29
- package/esm2020/lib/components/upload-files-dialog/upload-files-dialog.component.mjs +3 -3
- package/esm2020/lib/components/view-profile/view-profile.component.mjs +35 -16
- package/esm2020/lib/components/view-profile/view-profile.guard.mjs +5 -5
- package/esm2020/lib/dialogs/node-template/create-from-template.dialog.mjs +16 -15
- package/esm2020/lib/directives/directives.module.mjs +4 -4
- package/esm2020/lib/directives/document-list.directive.mjs +3 -3
- package/esm2020/lib/extensions/core.extensions.module.mjs +4 -4
- package/esm2020/lib/material.module.mjs +4 -4
- package/esm2020/lib/services/content-management.service.mjs +3 -3
- package/esm2020/lib/services/content-service-extension.service.mjs +3 -3
- package/esm2020/lib/services/content-url.service.mjs +3 -3
- package/esm2020/lib/services/node-actions.service.mjs +5 -5
- package/esm2020/lib/services/node-template.service.mjs +3 -3
- package/esm2020/lib/store/app-store.module.mjs +4 -4
- package/esm2020/lib/store/effects/app.effects.mjs +3 -3
- package/esm2020/lib/store/effects/contextmenu.effects.mjs +3 -3
- package/esm2020/lib/store/effects/download.effects.mjs +3 -3
- package/esm2020/lib/store/effects/favorite.effects.mjs +3 -3
- package/esm2020/lib/store/effects/library.effects.mjs +3 -3
- package/esm2020/lib/store/effects/node.effects.mjs +3 -3
- package/esm2020/lib/store/effects/search.effects.mjs +3 -3
- package/esm2020/lib/store/effects/template.effects.mjs +3 -3
- package/esm2020/lib/store/effects/upload.effects.mjs +5 -5
- package/esm2020/lib/store/effects/viewer.effects.mjs +5 -5
- package/esm2020/ms-office/actions/aos.actions.mjs +31 -0
- package/esm2020/ms-office/alfresco-aca-content-ms-office.mjs +5 -0
- package/esm2020/ms-office/aos-extension.module.mjs +54 -0
- package/esm2020/ms-office/aos-extension.service.mjs +134 -0
- package/esm2020/ms-office/effects/aos.effects.mjs +48 -0
- package/esm2020/ms-office/public-api.mjs +28 -0
- package/fesm2015/alfresco-aca-content-about.mjs +194 -0
- package/fesm2015/alfresco-aca-content-about.mjs.map +1 -0
- package/fesm2015/alfresco-aca-content-folder-rules.mjs +2479 -0
- package/fesm2015/alfresco-aca-content-folder-rules.mjs.map +1 -0
- package/fesm2015/alfresco-aca-content-ms-office.mjs +260 -0
- package/fesm2015/alfresco-aca-content-ms-office.mjs.map +1 -0
- package/fesm2015/alfresco-aca-content.mjs +3457 -3847
- package/fesm2015/alfresco-aca-content.mjs.map +1 -1
- package/fesm2020/alfresco-aca-content-about.mjs +194 -0
- package/fesm2020/alfresco-aca-content-about.mjs.map +1 -0
- package/fesm2020/alfresco-aca-content-folder-rules.mjs +2538 -0
- package/fesm2020/alfresco-aca-content-folder-rules.mjs.map +1 -0
- package/fesm2020/alfresco-aca-content-ms-office.mjs +282 -0
- package/fesm2020/alfresco-aca-content-ms-office.mjs.map +1 -0
- package/fesm2020/alfresco-aca-content.mjs +4622 -4995
- package/fesm2020/alfresco-aca-content.mjs.map +1 -1
- package/folder-rules/assets/folder-rules.plugin.json +71 -0
- package/folder-rules/assets/i18n/ar.json +144 -0
- package/folder-rules/assets/i18n/cs.json +144 -0
- package/folder-rules/assets/i18n/da.json +144 -0
- package/folder-rules/assets/i18n/de.json +144 -0
- package/folder-rules/assets/i18n/en.json +144 -0
- package/folder-rules/assets/i18n/es.json +144 -0
- package/folder-rules/assets/i18n/fi.json +144 -0
- package/folder-rules/assets/i18n/fr.json +144 -0
- package/folder-rules/assets/i18n/it.json +144 -0
- package/folder-rules/assets/i18n/ja.json +144 -0
- package/folder-rules/assets/i18n/nb.json +144 -0
- package/folder-rules/assets/i18n/nl.json +144 -0
- package/folder-rules/assets/i18n/pl.json +144 -0
- package/folder-rules/assets/i18n/pt-BR.json +144 -0
- package/folder-rules/assets/i18n/ru.json +144 -0
- package/folder-rules/assets/i18n/sv.json +144 -0
- package/folder-rules/assets/i18n/zh-CN.json +144 -0
- package/folder-rules/folder-rules.module.d.ts +51 -0
- package/folder-rules/folder-rules.rules.d.ts +27 -0
- package/folder-rules/index.d.ts +5 -0
- package/folder-rules/manage-rules/manage-rules.smart-component.d.ts +87 -0
- package/folder-rules/model/action-parameter-constraint.model.d.ts +31 -0
- package/folder-rules/model/rule-action.model.d.ts +48 -0
- package/folder-rules/model/rule-composite-condition.model.d.ts +30 -0
- package/folder-rules/model/rule-grouping-item.model.d.ts +34 -0
- package/folder-rules/model/rule-set.model.d.ts +34 -0
- package/folder-rules/model/rule-simple-condition.model.d.ts +28 -0
- package/folder-rules/model/rule.model.d.ts +58 -0
- package/folder-rules/public-api.d.ts +25 -0
- package/folder-rules/rule-details/actions/rule-action-list.ui-component.d.ts +47 -0
- package/folder-rules/rule-details/actions/rule-action.ui-component.d.ts +75 -0
- package/folder-rules/rule-details/conditions/rule-composite-condition.ui-component.d.ts +60 -0
- package/folder-rules/rule-details/conditions/rule-condition-comparators.d.ts +30 -0
- package/folder-rules/rule-details/conditions/rule-condition-fields.d.ts +31 -0
- package/folder-rules/rule-details/conditions/rule-mime-types.d.ts +27 -0
- package/folder-rules/rule-details/conditions/rule-simple-condition.ui-component.d.ts +62 -0
- package/folder-rules/rule-details/edit-rule-dialog.ui-component.d.ts +53 -0
- package/folder-rules/rule-details/options/rule-options.ui-component.d.ts +55 -0
- package/folder-rules/rule-details/rule-details.ui-component.d.ts +54 -0
- package/folder-rules/rule-details/triggers/rule-triggers.ui-component.d.ts +43 -0
- package/folder-rules/rule-details/validators/rule-actions.validator.d.ts +27 -0
- package/folder-rules/rule-details/validators/rule-composite-condition.validator.d.ts +25 -0
- package/folder-rules/rule-list/rule-list/rule-list.ui-component.d.ts +57 -0
- package/folder-rules/rule-list/rule-list-grouping/rule-list-grouping.ui-component.d.ts +44 -0
- package/{lib/components/node-version/node-version-form.component.d.ts → folder-rules/rule-list/rule-list-item/rule-list-item.ui-component.d.ts} +10 -21
- package/folder-rules/rule-set-picker/rule-set-picker.smart-component.d.ts +61 -0
- package/folder-rules/services/actions.service.d.ts +28 -0
- package/folder-rules/services/folder-rule-sets.service.d.ts +49 -0
- package/folder-rules/services/folder-rules.service.d.ts +41 -0
- package/lib/aca-content.module.d.ts +37 -37
- package/lib/components/common/common.module.d.ts +29 -17
- package/lib/components/common/language-picker/language-picker.component.d.ts +1 -1
- package/lib/components/common/location-link/location-link.component.d.ts +1 -6
- package/lib/components/common/logout/logout.component.d.ts +2 -3
- package/lib/components/common/toggle-shared/toggle-shared.component.d.ts +9 -6
- package/lib/components/common/user-info/user-info.component.d.ts +15 -3
- package/lib/components/context-menu/context-menu-item.component.d.ts +1 -1
- package/lib/components/context-menu/context-menu-outside-event.directive.d.ts +1 -1
- package/lib/components/context-menu/context-menu.component.d.ts +1 -1
- package/lib/components/details/details.component.d.ts +3 -6
- package/lib/components/dl-custom-components/document-list-custom-components.module.d.ts +4 -8
- package/lib/components/dl-custom-components/name-column/name-column.component.d.ts +3 -3
- package/lib/components/dl-custom-components/tags-column/tags-column.component.d.ts +5 -28
- package/lib/components/dl-custom-components/thumbnail-column/thumbnail-column.component.d.ts +32 -12
- package/lib/components/favorite-libraries/favorite-libraries.component.d.ts +3 -8
- package/lib/components/favorites/favorites.component.d.ts +2 -12
- package/lib/components/files/files.component.d.ts +6 -15
- package/lib/components/info-drawer/comments-tab/comments-tab.component.d.ts +28 -3
- package/lib/components/info-drawer/info.drawer.module.d.ts +5 -12
- package/lib/components/info-drawer/library-metadata-tab/library-metadata-form.component.d.ts +5 -4
- package/lib/components/info-drawer/library-metadata-tab/library-metadata-tab.component.d.ts +1 -1
- package/lib/components/info-drawer/metadata-tab/metadata-tab.component.d.ts +2 -2
- package/lib/components/info-drawer/versions-tab/versions-tab.component.d.ts +1 -1
- package/lib/components/libraries/libraries.component.d.ts +2 -31
- package/lib/components/recent-files/recent-files.component.d.ts +2 -13
- package/lib/components/search/search-input/search-input.component.d.ts +2 -1
- package/lib/components/search/search-libraries-results/search-libraries-results.component.d.ts +2 -31
- package/lib/components/search/search-results/search-results.component.d.ts +7 -13
- package/lib/components/search/search-results-row/search-results-row.component.d.ts +1 -1
- package/lib/components/search/search-results.module.d.ts +7 -5
- package/lib/components/shared-files/shared-files.component.d.ts +2 -11
- package/lib/components/shared-link-view/shared-link-view.component.d.ts +3 -2
- package/lib/components/shared-link-view/shared-link-view.module.d.ts +5 -6
- package/lib/components/sidenav/sidenav.module.d.ts +5 -5
- package/lib/components/sidenav/user-menu/user-menu.component.d.ts +58 -0
- package/lib/components/toolbar/toggle-edit-offline/toggle-edit-offline.component.d.ts +2 -1
- package/lib/components/toolbar/toolbar.module.d.ts +13 -15
- package/lib/components/trashcan/trashcan.component.d.ts +4 -35
- package/lib/components/view-profile/view-profile.component.d.ts +11 -4
- package/lib/components/view-profile/view-profile.guard.d.ts +2 -2
- package/lib/dialogs/node-template/create-from-template.dialog.d.ts +2 -2
- package/lib/store/effects/upload.effects.d.ts +3 -3
- package/ms-office/actions/aos.actions.d.ts +31 -0
- package/ms-office/aos-extension.module.d.ts +34 -0
- package/ms-office/aos-extension.service.d.ts +48 -0
- package/ms-office/assets/aos.plugin.json +74 -0
- package/ms-office/assets/i18n/ar.json +10 -0
- package/ms-office/assets/i18n/cs.json +10 -0
- package/ms-office/assets/i18n/da.json +10 -0
- package/ms-office/assets/i18n/de.json +10 -0
- package/ms-office/assets/i18n/en.json +10 -0
- package/ms-office/assets/i18n/es.json +10 -0
- package/ms-office/assets/i18n/fi.json +10 -0
- package/ms-office/assets/i18n/fr.json +10 -0
- package/ms-office/assets/i18n/it.json +10 -0
- package/ms-office/assets/i18n/ja.json +10 -0
- package/ms-office/assets/i18n/nb.json +10 -0
- package/ms-office/assets/i18n/nl.json +10 -0
- package/ms-office/assets/i18n/pl.json +10 -0
- package/ms-office/assets/i18n/pt-BR.json +10 -0
- package/ms-office/assets/i18n/ru.json +10 -0
- package/ms-office/assets/i18n/sv.json +10 -0
- package/ms-office/assets/i18n/zh-CN.json +10 -0
- package/ms-office/effects/aos.effects.d.ts +11 -0
- package/ms-office/index.d.ts +5 -0
- package/ms-office/public-api.d.ts +27 -0
- package/package.json +37 -2
- package/ui/application.scss +8 -0
- package/ui/overrides/adf-about.theme.scss +0 -5
- package/ui/overrides/adf-pagination.theme.scss +0 -1
- package/ui/overrides/ay11.scss +1 -1
- package/ui/variables/variables.scss +6 -13
- package/esm2020/lib/components/context-menu/context-menu.module.mjs +0 -76
- package/esm2020/lib/components/create-menu/create-menu.component.mjs +0 -73
- package/esm2020/lib/components/create-menu/create-menu.module.mjs +0 -44
- package/esm2020/lib/components/node-version/node-version-form.component.mjs +0 -70
- package/esm2020/lib/components/node-version/node-version.module.mjs +0 -78
- package/esm2020/lib/components/toolbar/document-display-mode/document-display-mode.component.mjs +0 -84
- package/esm2020/lib/components/trashcan/trashcan.module.mjs +0 -74
- package/esm2020/lib/components/view-profile/view-profile.module.mjs +0 -42
- package/lib/components/context-menu/context-menu.module.d.ts +0 -18
- package/lib/components/create-menu/create-menu.module.d.ts +0 -10
- package/lib/components/node-version/node-version.module.d.ts +0 -16
- package/lib/components/toolbar/document-display-mode/document-display-mode.component.d.ts +0 -13
- package/lib/components/trashcan/trashcan.module.d.ts +0 -16
- package/lib/components/view-profile/view-profile.module.d.ts +0 -9
|
@@ -0,0 +1,2479 @@
|
|
|
1
|
+
import * as i1 from '@alfresco/adf-core';
|
|
2
|
+
import { CardViewSelectItemModel, CardViewTextItemModel, CardViewBoolItemModel, CardViewUpdateService, CoreModule } from '@alfresco/adf-core';
|
|
3
|
+
import * as i2$4 from '@alfresco/adf-extensions';
|
|
4
|
+
import { ExtensionsModule, provideExtensionConfig } from '@alfresco/adf-extensions';
|
|
5
|
+
import * as i0 from '@angular/core';
|
|
6
|
+
import { Injectable, forwardRef, Component, ViewEncapsulation, Input, HostBinding, EventEmitter, Output, Inject, ChangeDetectionStrategy, NgModule } from '@angular/core';
|
|
7
|
+
import { canEditFolder, hasFolderSelected, isNotFavorites } from '@alfresco/aca-shared/rules';
|
|
8
|
+
import * as i1$1 from '@angular/common';
|
|
9
|
+
import { CommonModule } from '@angular/common';
|
|
10
|
+
import * as i3$3 from '@angular/router';
|
|
11
|
+
import { RouterModule } from '@angular/router';
|
|
12
|
+
import * as i2 from '@angular/material/dialog';
|
|
13
|
+
import { MAT_DIALOG_DATA } from '@angular/material/dialog';
|
|
14
|
+
import * as i3$2 from '@angular/material/button';
|
|
15
|
+
import * as i4 from '@angular/material/icon';
|
|
16
|
+
import * as i2$1 from '@angular/forms';
|
|
17
|
+
import { FormGroup, FormControl, Validators, NG_VALUE_ACCESSOR, FormArray, UntypedFormGroup, UntypedFormControl } from '@angular/forms';
|
|
18
|
+
import { BehaviorSubject, from, Subject, of, combineLatest, forkJoin } from 'rxjs';
|
|
19
|
+
import { map, finalize, takeUntil, distinctUntilChanged, catchError, switchMap, tap, delay } from 'rxjs/operators';
|
|
20
|
+
import { __awaiter } from 'tslib';
|
|
21
|
+
import * as i5 from '@angular/material/form-field';
|
|
22
|
+
import * as i6 from '@angular/material/input';
|
|
23
|
+
import * as i5$1 from '@angular/material/menu';
|
|
24
|
+
import * as i8 from '@alfresco/adf-content-services';
|
|
25
|
+
import { NodeAction, ContentNodeSelectorComponent, ConfirmDialogComponent, BreadcrumbModule, DocumentListModule, ContentNodeSelectorModule } from '@alfresco/adf-content-services';
|
|
26
|
+
import * as i3 from '@ngx-translate/core';
|
|
27
|
+
import * as i3$1 from '@angular/material/core';
|
|
28
|
+
import * as i7 from '@angular/material/select';
|
|
29
|
+
import * as i2$2 from '@angular/material/checkbox';
|
|
30
|
+
import * as i13 from '@alfresco/aca-shared';
|
|
31
|
+
import { PageLayoutModule, GenericErrorComponent } from '@alfresco/aca-shared';
|
|
32
|
+
import * as i7$1 from '@angular/material/progress-spinner';
|
|
33
|
+
import * as i2$3 from '@angular/material/slide-toggle';
|
|
34
|
+
import { ActionsApi } from '@alfresco/js-api';
|
|
35
|
+
import * as i10 from '@angular/material/divider';
|
|
36
|
+
import * as i12 from '@angular/material/progress-bar';
|
|
37
|
+
import * as i6$1 from '@angular/material/tooltip';
|
|
38
|
+
|
|
39
|
+
/*!
|
|
40
|
+
* Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved.
|
|
41
|
+
*
|
|
42
|
+
* Alfresco Example Content Application
|
|
43
|
+
*
|
|
44
|
+
* This file is part of the Alfresco Example Content Application.
|
|
45
|
+
* If the software was purchased under a paid Alfresco license, the terms of
|
|
46
|
+
* the paid license agreement will prevail. Otherwise, the software is
|
|
47
|
+
* provided under the following open source license terms:
|
|
48
|
+
*
|
|
49
|
+
* The Alfresco Example Content Application is free software: you can redistribute it and/or modify
|
|
50
|
+
* it under the terms of the GNU Lesser General Public License as published by
|
|
51
|
+
* the Free Software Foundation, either version 3 of the License, or
|
|
52
|
+
* (at your option) any later version.
|
|
53
|
+
*
|
|
54
|
+
* The Alfresco Example Content Application is distributed in the hope that it will be useful,
|
|
55
|
+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
56
|
+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
57
|
+
* GNU Lesser General Public License for more details.
|
|
58
|
+
*
|
|
59
|
+
* You should have received a copy of the GNU Lesser General Public License
|
|
60
|
+
* from Hyland Software. If not, see <http://www.gnu.org/licenses/>.
|
|
61
|
+
*/
|
|
62
|
+
const isFolderRulesEnabled = (context) => context.appConfig.get('plugins.folderRules', false);
|
|
63
|
+
const isFolderRulesAllowed = (context) => isFolderRulesEnabled(context) && canEditFolder(context) && hasFolderSelected(context) && isNotFavorites(context);
|
|
64
|
+
const canManageFolderRules = (context) => isFolderRulesAllowed(context);
|
|
65
|
+
|
|
66
|
+
/*!
|
|
67
|
+
* Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved.
|
|
68
|
+
*
|
|
69
|
+
* Alfresco Example Content Application
|
|
70
|
+
*
|
|
71
|
+
* This file is part of the Alfresco Example Content Application.
|
|
72
|
+
* If the software was purchased under a paid Alfresco license, the terms of
|
|
73
|
+
* the paid license agreement will prevail. Otherwise, the software is
|
|
74
|
+
* provided under the following open source license terms:
|
|
75
|
+
*
|
|
76
|
+
* The Alfresco Example Content Application is free software: you can redistribute it and/or modify
|
|
77
|
+
* it under the terms of the GNU Lesser General Public License as published by
|
|
78
|
+
* the Free Software Foundation, either version 3 of the License, or
|
|
79
|
+
* (at your option) any later version.
|
|
80
|
+
*
|
|
81
|
+
* The Alfresco Example Content Application is distributed in the hope that it will be useful,
|
|
82
|
+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
83
|
+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
84
|
+
* GNU Lesser General Public License for more details.
|
|
85
|
+
*
|
|
86
|
+
* You should have received a copy of the GNU Lesser General Public License
|
|
87
|
+
* from Hyland Software. If not, see <http://www.gnu.org/licenses/>.
|
|
88
|
+
*/
|
|
89
|
+
const isCompositeConditionValid = (value, isRootCondition = true) => {
|
|
90
|
+
if (value.compositeConditions.length > 0) {
|
|
91
|
+
return value.compositeConditions.reduce((arrayValid, nestedCondition) => arrayValid && isCompositeConditionValid(nestedCondition, false), true);
|
|
92
|
+
}
|
|
93
|
+
return !!value.simpleConditions.length || isRootCondition;
|
|
94
|
+
};
|
|
95
|
+
const ruleCompositeConditionValidator = () => (control) => isCompositeConditionValid(control.value) ? null : { ruleCompositeConditionInvalid: true };
|
|
96
|
+
|
|
97
|
+
class FolderRulesService {
|
|
98
|
+
constructor(apiService) {
|
|
99
|
+
this.apiService = apiService;
|
|
100
|
+
this.selectedRuleSource = new BehaviorSubject(null);
|
|
101
|
+
this.deletedRuleIdSource = new BehaviorSubject(null);
|
|
102
|
+
this.selectedRule$ = this.selectedRuleSource.asObservable();
|
|
103
|
+
this.deletedRuleId$ = this.deletedRuleIdSource.asObservable();
|
|
104
|
+
}
|
|
105
|
+
static get emptyCompositeCondition() {
|
|
106
|
+
return {
|
|
107
|
+
inverted: false,
|
|
108
|
+
booleanMode: 'and',
|
|
109
|
+
compositeConditions: [],
|
|
110
|
+
simpleConditions: []
|
|
111
|
+
};
|
|
112
|
+
}
|
|
113
|
+
static get emptyRuleOptions() {
|
|
114
|
+
return {
|
|
115
|
+
isEnabled: true,
|
|
116
|
+
isInheritable: false,
|
|
117
|
+
isAsynchronous: false,
|
|
118
|
+
errorScript: ''
|
|
119
|
+
};
|
|
120
|
+
}
|
|
121
|
+
static get emptyRule() {
|
|
122
|
+
return Object.assign({ id: '', name: '', description: '', isShared: false, triggers: ['inbound'], conditions: FolderRulesService.emptyCompositeCondition, actions: [] }, FolderRulesService.emptyRuleOptions);
|
|
123
|
+
}
|
|
124
|
+
static get emptyRuleForForm() {
|
|
125
|
+
const value = Object.assign(Object.assign({}, FolderRulesService.emptyRule), { options: FolderRulesService.emptyRuleOptions });
|
|
126
|
+
Object.keys(value.options).forEach((key) => {
|
|
127
|
+
delete value[key];
|
|
128
|
+
});
|
|
129
|
+
return value;
|
|
130
|
+
}
|
|
131
|
+
callApi(path, httpMethod, body = {}) {
|
|
132
|
+
// APIs used by this service are still private and not yet available for public use
|
|
133
|
+
const params = [{}, {}, {}, {}, body, ['application/json'], ['application/json']];
|
|
134
|
+
return this.apiService.getInstance().contentPrivateClient.callApi(path, httpMethod, ...params);
|
|
135
|
+
}
|
|
136
|
+
getRules(owningFolderId, ruleSetId, skipCount = 0) {
|
|
137
|
+
return from(this.callApi(`/nodes/${owningFolderId}/rule-sets/${ruleSetId}/rules?skipCount=${skipCount}&maxItems=${FolderRulesService.MAX_RULES_PER_GET}`, 'GET')).pipe(map((res) => {
|
|
138
|
+
var _a, _b;
|
|
139
|
+
return ({
|
|
140
|
+
rules: this.formatRules(res),
|
|
141
|
+
hasMoreRules: !!((_b = (_a = res === null || res === void 0 ? void 0 : res.list) === null || _a === void 0 ? void 0 : _a.pagination) === null || _b === void 0 ? void 0 : _b.hasMoreItems)
|
|
142
|
+
});
|
|
143
|
+
}));
|
|
144
|
+
}
|
|
145
|
+
loadRules(ruleSet, skipCount = ruleSet.rules.length, selectRule = null) {
|
|
146
|
+
if (ruleSet && !ruleSet.loadingRules) {
|
|
147
|
+
ruleSet.loadingRules = true;
|
|
148
|
+
this.getRules(ruleSet.owningFolder.id, ruleSet.id, skipCount)
|
|
149
|
+
.pipe(finalize(() => {
|
|
150
|
+
ruleSet.loadingRules = false;
|
|
151
|
+
}))
|
|
152
|
+
.subscribe((res) => {
|
|
153
|
+
ruleSet.hasMoreRules = res.hasMoreRules;
|
|
154
|
+
ruleSet.rules.splice(skipCount);
|
|
155
|
+
ruleSet.rules.push(...res.rules);
|
|
156
|
+
this.selectRuleInRuleSet(ruleSet, selectRule);
|
|
157
|
+
});
|
|
158
|
+
}
|
|
159
|
+
}
|
|
160
|
+
createRule(nodeId, rule, ruleSetId = '-default-') {
|
|
161
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
162
|
+
const response = yield this.callApi(`/nodes/${nodeId}/rule-sets/${ruleSetId}/rules`, 'POST', Object.assign({}, rule));
|
|
163
|
+
return this.formatRule(response.entry);
|
|
164
|
+
});
|
|
165
|
+
}
|
|
166
|
+
updateRule(nodeId, ruleId, rule, ruleSetId = '-default-') {
|
|
167
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
168
|
+
const response = yield this.callApi(`/nodes/${nodeId}/rule-sets/${ruleSetId}/rules/${ruleId}`, 'PUT', Object.assign({}, rule));
|
|
169
|
+
return this.formatRule(response.entry);
|
|
170
|
+
});
|
|
171
|
+
}
|
|
172
|
+
deleteRule(nodeId, ruleId, ruleSetId = '-default-') {
|
|
173
|
+
from(this.callApi(`/nodes/${nodeId}/rule-sets/${ruleSetId}/rules/${ruleId}`, 'DELETE')).subscribe(() => {
|
|
174
|
+
this.deletedRuleIdSource.next(ruleId);
|
|
175
|
+
}, (error) => {
|
|
176
|
+
this.deletedRuleIdSource.next(error);
|
|
177
|
+
});
|
|
178
|
+
}
|
|
179
|
+
getRuleSettings(nodeId, key = '-isInheritanceEnabled-') {
|
|
180
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
181
|
+
const response = yield this.callApi(`/nodes/${nodeId}/rule-settings/${key}`, 'GET');
|
|
182
|
+
return response.entry;
|
|
183
|
+
});
|
|
184
|
+
}
|
|
185
|
+
updateRuleSettings(nodeId, key, body) {
|
|
186
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
187
|
+
const response = yield this.callApi(`/nodes/${nodeId}/rule-settings/${key}`, 'PUT', Object.assign({}, body));
|
|
188
|
+
return response.entry;
|
|
189
|
+
});
|
|
190
|
+
}
|
|
191
|
+
formatRules(res) {
|
|
192
|
+
return [...res.list.entries.map((entry) => this.formatRule(entry.entry))];
|
|
193
|
+
}
|
|
194
|
+
formatRule(obj) {
|
|
195
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
|
|
196
|
+
return {
|
|
197
|
+
id: obj.id,
|
|
198
|
+
name: (_a = obj.name) !== null && _a !== void 0 ? _a : FolderRulesService.emptyRule.name,
|
|
199
|
+
description: (_b = obj.description) !== null && _b !== void 0 ? _b : FolderRulesService.emptyRule.description,
|
|
200
|
+
isEnabled: (_c = obj.isEnabled) !== null && _c !== void 0 ? _c : FolderRulesService.emptyRule.isEnabled,
|
|
201
|
+
isInheritable: (_d = obj.isInheritable) !== null && _d !== void 0 ? _d : FolderRulesService.emptyRule.isInheritable,
|
|
202
|
+
isAsynchronous: (_e = obj.isAsynchronous) !== null && _e !== void 0 ? _e : FolderRulesService.emptyRule.isAsynchronous,
|
|
203
|
+
errorScript: (_f = obj.errorScript) !== null && _f !== void 0 ? _f : FolderRulesService.emptyRule.errorScript,
|
|
204
|
+
isShared: (_g = obj.isShared) !== null && _g !== void 0 ? _g : FolderRulesService.emptyRule.isShared,
|
|
205
|
+
triggers: (_h = obj.triggers) !== null && _h !== void 0 ? _h : FolderRulesService.emptyRule.triggers,
|
|
206
|
+
conditions: this.formatCompositeCondition((_j = obj.conditions) !== null && _j !== void 0 ? _j : Object.assign({}, FolderRulesService.emptyRule.conditions)),
|
|
207
|
+
actions: (_k = obj.actions) !== null && _k !== void 0 ? _k : FolderRulesService.emptyRule.actions
|
|
208
|
+
};
|
|
209
|
+
}
|
|
210
|
+
formatCompositeCondition(obj) {
|
|
211
|
+
var _a, _b;
|
|
212
|
+
return {
|
|
213
|
+
inverted: (_a = obj.inverted) !== null && _a !== void 0 ? _a : false,
|
|
214
|
+
booleanMode: (_b = obj.booleanMode) !== null && _b !== void 0 ? _b : 'and',
|
|
215
|
+
compositeConditions: (obj.compositeConditions || []).map((condition) => this.formatCompositeCondition(condition)),
|
|
216
|
+
simpleConditions: this.parseSimpleCondition(obj.simpleConditions)
|
|
217
|
+
};
|
|
218
|
+
}
|
|
219
|
+
parseSimpleCondition(arr) {
|
|
220
|
+
if (arr) {
|
|
221
|
+
if (arr.every((element) => element === null)) {
|
|
222
|
+
return [];
|
|
223
|
+
}
|
|
224
|
+
return arr.map((condition) => this.formatSimpleCondition(condition));
|
|
225
|
+
}
|
|
226
|
+
else {
|
|
227
|
+
return [];
|
|
228
|
+
}
|
|
229
|
+
}
|
|
230
|
+
formatSimpleCondition(obj) {
|
|
231
|
+
return {
|
|
232
|
+
field: obj.field || 'cm:name',
|
|
233
|
+
comparator: obj.comparator || 'equals',
|
|
234
|
+
parameter: obj.parameter || ''
|
|
235
|
+
};
|
|
236
|
+
}
|
|
237
|
+
selectRule(rule) {
|
|
238
|
+
this.selectedRuleSource.next(rule);
|
|
239
|
+
}
|
|
240
|
+
selectRuleInRuleSet(ruleSet, selectRule = null) {
|
|
241
|
+
if (selectRule === 'first') {
|
|
242
|
+
this.selectRule(ruleSet.rules[0]);
|
|
243
|
+
}
|
|
244
|
+
else if (selectRule === 'last') {
|
|
245
|
+
this.selectRule(ruleSet.rules[ruleSet.rules.length - 1]);
|
|
246
|
+
}
|
|
247
|
+
else if (selectRule) {
|
|
248
|
+
this.selectRule(selectRule);
|
|
249
|
+
}
|
|
250
|
+
}
|
|
251
|
+
}
|
|
252
|
+
FolderRulesService.MAX_RULES_PER_GET = 100;
|
|
253
|
+
FolderRulesService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.1.3", ngImport: i0, type: FolderRulesService, deps: [{ token: i1.AlfrescoApiService }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
254
|
+
FolderRulesService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.1.3", ngImport: i0, type: FolderRulesService, providedIn: 'root' });
|
|
255
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.1.3", ngImport: i0, type: FolderRulesService, decorators: [{
|
|
256
|
+
type: Injectable,
|
|
257
|
+
args: [{
|
|
258
|
+
providedIn: 'root'
|
|
259
|
+
}]
|
|
260
|
+
}], ctorParameters: function () { return [{ type: i1.AlfrescoApiService }]; } });
|
|
261
|
+
|
|
262
|
+
/*!
|
|
263
|
+
* Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved.
|
|
264
|
+
*
|
|
265
|
+
* Alfresco Example Content Application
|
|
266
|
+
*
|
|
267
|
+
* This file is part of the Alfresco Example Content Application.
|
|
268
|
+
* If the software was purchased under a paid Alfresco license, the terms of
|
|
269
|
+
* the paid license agreement will prevail. Otherwise, the software is
|
|
270
|
+
* provided under the following open source license terms:
|
|
271
|
+
*
|
|
272
|
+
* The Alfresco Example Content Application is free software: you can redistribute it and/or modify
|
|
273
|
+
* it under the terms of the GNU Lesser General Public License as published by
|
|
274
|
+
* the Free Software Foundation, either version 3 of the License, or
|
|
275
|
+
* (at your option) any later version.
|
|
276
|
+
*
|
|
277
|
+
* The Alfresco Example Content Application is distributed in the hope that it will be useful,
|
|
278
|
+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
279
|
+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
280
|
+
* GNU Lesser General Public License for more details.
|
|
281
|
+
*
|
|
282
|
+
* You should have received a copy of the GNU Lesser General Public License
|
|
283
|
+
* from Hyland Software. If not, see <http://www.gnu.org/licenses/>.
|
|
284
|
+
*/
|
|
285
|
+
const isRuleAction = (obj) => typeof obj === 'object' && typeof obj.actionDefinitionId === 'string' && (obj.params === undefined || typeof obj.params === 'object');
|
|
286
|
+
const isRuleActions = (obj) => typeof obj === 'object' && obj instanceof Array && obj.reduce((acc, curr) => acc && isRuleAction(curr), true);
|
|
287
|
+
|
|
288
|
+
/*!
|
|
289
|
+
* Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved.
|
|
290
|
+
*
|
|
291
|
+
* Alfresco Example Content Application
|
|
292
|
+
*
|
|
293
|
+
* This file is part of the Alfresco Example Content Application.
|
|
294
|
+
* If the software was purchased under a paid Alfresco license, the terms of
|
|
295
|
+
* the paid license agreement will prevail. Otherwise, the software is
|
|
296
|
+
* provided under the following open source license terms:
|
|
297
|
+
*
|
|
298
|
+
* The Alfresco Example Content Application is free software: you can redistribute it and/or modify
|
|
299
|
+
* it under the terms of the GNU Lesser General Public License as published by
|
|
300
|
+
* the Free Software Foundation, either version 3 of the License, or
|
|
301
|
+
* (at your option) any later version.
|
|
302
|
+
*
|
|
303
|
+
* The Alfresco Example Content Application is distributed in the hope that it will be useful,
|
|
304
|
+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
305
|
+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
306
|
+
* GNU Lesser General Public License for more details.
|
|
307
|
+
*
|
|
308
|
+
* You should have received a copy of the GNU Lesser General Public License
|
|
309
|
+
* from Hyland Software. If not, see <http://www.gnu.org/licenses/>.
|
|
310
|
+
*/
|
|
311
|
+
const isRuleActionValid = (value, actionDefinitions) => {
|
|
312
|
+
const actionDefinition = isRuleAction(value)
|
|
313
|
+
? actionDefinitions.find((actionDef) => value.actionDefinitionId === actionDef.id)
|
|
314
|
+
: undefined;
|
|
315
|
+
return (isRuleAction(value) &&
|
|
316
|
+
actionDefinition &&
|
|
317
|
+
actionDefinition.parameterDefinitions.reduce((isValid, paramDef) => isValid && (!paramDef.mandatory || !!value.params[paramDef.name]), true));
|
|
318
|
+
};
|
|
319
|
+
const isRuleActionsValid = (value, actionDefinitions) => isRuleActions(value) &&
|
|
320
|
+
value.reduce((isValid, currentAction) => isValid && isRuleActionValid(currentAction, actionDefinitions), true);
|
|
321
|
+
const ruleActionValidator = (actionDefinitions) => (control) => isRuleActionValid(control.value, actionDefinitions) ? null : { ruleActionInvalid: true };
|
|
322
|
+
const ruleActionsValidator = (actionDefinitions) => (control) => isRuleActionsValid(control.value, actionDefinitions) ? null : { ruleActionsInvalid: true };
|
|
323
|
+
|
|
324
|
+
/*!
|
|
325
|
+
* Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved.
|
|
326
|
+
*
|
|
327
|
+
* Alfresco Example Content Application
|
|
328
|
+
*
|
|
329
|
+
* This file is part of the Alfresco Example Content Application.
|
|
330
|
+
* If the software was purchased under a paid Alfresco license, the terms of
|
|
331
|
+
* the paid license agreement will prevail. Otherwise, the software is
|
|
332
|
+
* provided under the following open source license terms:
|
|
333
|
+
*
|
|
334
|
+
* The Alfresco Example Content Application is free software: you can redistribute it and/or modify
|
|
335
|
+
* it under the terms of the GNU Lesser General Public License as published by
|
|
336
|
+
* the Free Software Foundation, either version 3 of the License, or
|
|
337
|
+
* (at your option) any later version.
|
|
338
|
+
*
|
|
339
|
+
* The Alfresco Example Content Application is distributed in the hope that it will be useful,
|
|
340
|
+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
341
|
+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
342
|
+
* GNU Lesser General Public License for more details.
|
|
343
|
+
*
|
|
344
|
+
* You should have received a copy of the GNU Lesser General Public License
|
|
345
|
+
* from Hyland Software. If not, see <http://www.gnu.org/licenses/>.
|
|
346
|
+
*/
|
|
347
|
+
class RuleActionUiComponent {
|
|
348
|
+
constructor(cardViewUpdateService, dialog, translate) {
|
|
349
|
+
this.cardViewUpdateService = cardViewUpdateService;
|
|
350
|
+
this.dialog = dialog;
|
|
351
|
+
this.translate = translate;
|
|
352
|
+
this.nodeId = '';
|
|
353
|
+
this.readOnly = false;
|
|
354
|
+
this._parameterConstraints = [];
|
|
355
|
+
this.isFullWidth = false;
|
|
356
|
+
this.form = new FormGroup({
|
|
357
|
+
actionDefinitionId: new FormControl('', Validators.required)
|
|
358
|
+
});
|
|
359
|
+
this.cardViewItems = [];
|
|
360
|
+
this.parameters = {};
|
|
361
|
+
this.onDestroy$ = new Subject();
|
|
362
|
+
this.onChange = () => undefined;
|
|
363
|
+
this.onTouch = () => undefined;
|
|
364
|
+
}
|
|
365
|
+
get parameterConstraints() {
|
|
366
|
+
return this._parameterConstraints;
|
|
367
|
+
}
|
|
368
|
+
set parameterConstraints(value) {
|
|
369
|
+
this._parameterConstraints = value.map((obj) => (Object.assign(Object.assign({}, obj), { constraints: this.parseConstraintsToSelectOptions(obj.constraints) })));
|
|
370
|
+
}
|
|
371
|
+
get selectedActionDefinitionId() {
|
|
372
|
+
return this.form.get('actionDefinitionId').value;
|
|
373
|
+
}
|
|
374
|
+
get selectedActionDefinition() {
|
|
375
|
+
return this.actionDefinitions.find((actionDefinition) => actionDefinition.id === this.selectedActionDefinitionId);
|
|
376
|
+
}
|
|
377
|
+
get cardViewStyle() {
|
|
378
|
+
return this.isFullWidth ? { width: '100%' } : {};
|
|
379
|
+
}
|
|
380
|
+
writeValue(action) {
|
|
381
|
+
this.form.setValue({
|
|
382
|
+
actionDefinitionId: action.actionDefinitionId
|
|
383
|
+
});
|
|
384
|
+
this.parameters = Object.assign(Object.assign({}, this.parameters), action.params);
|
|
385
|
+
this.setCardViewProperties();
|
|
386
|
+
}
|
|
387
|
+
registerOnChange(fn) {
|
|
388
|
+
this.onChange = fn;
|
|
389
|
+
}
|
|
390
|
+
registerOnTouched(fn) {
|
|
391
|
+
this.onTouch = fn;
|
|
392
|
+
}
|
|
393
|
+
ngOnInit() {
|
|
394
|
+
this.actionDefinitions = this.actionDefinitions.sort((firstActionDefinition, secondActionDefinition) => firstActionDefinition.title.localeCompare(secondActionDefinition.title));
|
|
395
|
+
this.form.valueChanges.pipe(takeUntil(this.onDestroy$)).subscribe(() => {
|
|
396
|
+
this.setDefaultParameters();
|
|
397
|
+
this.setCardViewProperties();
|
|
398
|
+
this.onChange({
|
|
399
|
+
actionDefinitionId: this.selectedActionDefinitionId,
|
|
400
|
+
params: this.parameters
|
|
401
|
+
});
|
|
402
|
+
this.onTouch();
|
|
403
|
+
});
|
|
404
|
+
this.cardViewUpdateService.itemUpdated$.pipe(takeUntil(this.onDestroy$)).subscribe((updateNotification) => {
|
|
405
|
+
this.parameters = Object.assign(Object.assign({}, this.parameters), updateNotification.changed);
|
|
406
|
+
this.onChange({
|
|
407
|
+
actionDefinitionId: this.selectedActionDefinitionId,
|
|
408
|
+
params: this.parameters
|
|
409
|
+
});
|
|
410
|
+
this.onTouch();
|
|
411
|
+
});
|
|
412
|
+
}
|
|
413
|
+
ngOnChanges(changes) {
|
|
414
|
+
var _a;
|
|
415
|
+
const readOnly = (_a = changes['readOnly']) === null || _a === void 0 ? void 0 : _a.currentValue;
|
|
416
|
+
if (readOnly !== undefined && readOnly !== null) {
|
|
417
|
+
this.readOnly = readOnly;
|
|
418
|
+
this.setDisabledState(readOnly);
|
|
419
|
+
}
|
|
420
|
+
}
|
|
421
|
+
ngOnDestroy() {
|
|
422
|
+
this.onDestroy$.next();
|
|
423
|
+
this.onDestroy$.complete();
|
|
424
|
+
}
|
|
425
|
+
setCardViewProperties() {
|
|
426
|
+
var _a, _b;
|
|
427
|
+
this.cardViewItems = ((_b = (_a = this.selectedActionDefinition) === null || _a === void 0 ? void 0 : _a.parameterDefinitions) !== null && _b !== void 0 ? _b : []).map((paramDef) => {
|
|
428
|
+
var _a, _b, _c;
|
|
429
|
+
this.isFullWidth = false;
|
|
430
|
+
const constraintsForDropdownBox = this._parameterConstraints.find((obj) => obj.name === paramDef.name);
|
|
431
|
+
const cardViewPropertiesModel = Object.assign({ label: paramDef.displayLabel + (paramDef.mandatory ? ' *' : ''), key: paramDef.name, editable: true }, (paramDef.mandatory
|
|
432
|
+
? {
|
|
433
|
+
validators: [
|
|
434
|
+
{
|
|
435
|
+
message: 'ACA_FOLDER_RULES.RULE_DETAILS.ERROR.REQUIRED',
|
|
436
|
+
isValid: (value) => !!value
|
|
437
|
+
}
|
|
438
|
+
]
|
|
439
|
+
}
|
|
440
|
+
: {}));
|
|
441
|
+
switch (paramDef.type) {
|
|
442
|
+
case 'd:boolean':
|
|
443
|
+
return new CardViewBoolItemModel(Object.assign(Object.assign({}, cardViewPropertiesModel), { value: (_a = this.parameters[paramDef.name]) !== null && _a !== void 0 ? _a : false }));
|
|
444
|
+
case 'd:noderef':
|
|
445
|
+
if (!constraintsForDropdownBox && !this.readOnly && paramDef.name !== 'category-value') {
|
|
446
|
+
return new CardViewTextItemModel(Object.assign(Object.assign({}, cardViewPropertiesModel), { icon: 'folder', default: '', clickable: true, clickCallBack: this.openSelectorDialog.bind(this, paramDef.name), value: this.parameters[paramDef.name] }));
|
|
447
|
+
}
|
|
448
|
+
// falls through
|
|
449
|
+
default:
|
|
450
|
+
if (constraintsForDropdownBox && !this.readOnly) {
|
|
451
|
+
this.isFullWidth = true;
|
|
452
|
+
return new CardViewSelectItemModel(Object.assign(Object.assign({}, cardViewPropertiesModel), { value: (_b = this.parameters[paramDef.name]) !== null && _b !== void 0 ? _b : '', options$: of(constraintsForDropdownBox.constraints) }));
|
|
453
|
+
}
|
|
454
|
+
return new CardViewTextItemModel(Object.assign(Object.assign({}, cardViewPropertiesModel), { value: (_c = this.parameters[paramDef.name]) !== null && _c !== void 0 ? _c : '' }));
|
|
455
|
+
}
|
|
456
|
+
});
|
|
457
|
+
}
|
|
458
|
+
openSelectorDialog(paramDefName) {
|
|
459
|
+
const data = {
|
|
460
|
+
title: this.translate.instant('ACA_FOLDER_RULES.RULE_DETAILS.PLACEHOLDER.CHOOSE_FOLDER'),
|
|
461
|
+
actionName: NodeAction.CHOOSE,
|
|
462
|
+
currentFolderId: this.nodeId,
|
|
463
|
+
select: new Subject()
|
|
464
|
+
};
|
|
465
|
+
this.dialog.open(ContentNodeSelectorComponent, {
|
|
466
|
+
data,
|
|
467
|
+
panelClass: 'adf-content-node-selector-dialog',
|
|
468
|
+
width: '630px'
|
|
469
|
+
});
|
|
470
|
+
data.select.subscribe((selections) => {
|
|
471
|
+
if (selections[0].id) {
|
|
472
|
+
this.writeValue({
|
|
473
|
+
actionDefinitionId: this.selectedActionDefinitionId,
|
|
474
|
+
params: Object.assign(Object.assign({}, this.parameters), { [paramDefName]: selections[0].id })
|
|
475
|
+
});
|
|
476
|
+
this.onChange({
|
|
477
|
+
actionDefinitionId: this.selectedActionDefinitionId,
|
|
478
|
+
params: this.parameters
|
|
479
|
+
});
|
|
480
|
+
this.onTouch();
|
|
481
|
+
}
|
|
482
|
+
}, (error) => {
|
|
483
|
+
console.error(error);
|
|
484
|
+
}, () => {
|
|
485
|
+
this.dialog.closeAll();
|
|
486
|
+
});
|
|
487
|
+
}
|
|
488
|
+
setDefaultParameters() {
|
|
489
|
+
var _a, _b;
|
|
490
|
+
this.parameters = {};
|
|
491
|
+
((_b = (_a = this.selectedActionDefinition) === null || _a === void 0 ? void 0 : _a.parameterDefinitions) !== null && _b !== void 0 ? _b : []).forEach((paramDef) => {
|
|
492
|
+
switch (paramDef.type) {
|
|
493
|
+
case 'd:boolean':
|
|
494
|
+
this.parameters[paramDef.name] = false;
|
|
495
|
+
break;
|
|
496
|
+
default:
|
|
497
|
+
this.parameters[paramDef.name] = '';
|
|
498
|
+
}
|
|
499
|
+
});
|
|
500
|
+
}
|
|
501
|
+
setDisabledState(isDisabled) {
|
|
502
|
+
if (isDisabled) {
|
|
503
|
+
this.readOnly = true;
|
|
504
|
+
this.form.disable();
|
|
505
|
+
}
|
|
506
|
+
else {
|
|
507
|
+
this.readOnly = false;
|
|
508
|
+
this.form.enable();
|
|
509
|
+
}
|
|
510
|
+
}
|
|
511
|
+
parseConstraintsToSelectOptions(constraints) {
|
|
512
|
+
return constraints
|
|
513
|
+
.sort((a, b) => {
|
|
514
|
+
var _a, _b;
|
|
515
|
+
if (!a.label && b.label) {
|
|
516
|
+
return 1;
|
|
517
|
+
}
|
|
518
|
+
if (!b.label && a.label) {
|
|
519
|
+
return -1;
|
|
520
|
+
}
|
|
521
|
+
return (_b = (_a = a.label) === null || _a === void 0 ? void 0 : _a.localeCompare(b.label)) !== null && _b !== void 0 ? _b : -1;
|
|
522
|
+
})
|
|
523
|
+
.map((constraint) => ({
|
|
524
|
+
key: constraint.value,
|
|
525
|
+
label: constraint.label ? `${constraint.label} [${constraint.value}]` : constraint.value
|
|
526
|
+
}));
|
|
527
|
+
}
|
|
528
|
+
}
|
|
529
|
+
RuleActionUiComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.1.3", ngImport: i0, type: RuleActionUiComponent, deps: [{ token: i1.CardViewUpdateService }, { token: i2.MatDialog }, { token: i3.TranslateService }], target: i0.ɵɵFactoryTarget.Component });
|
|
530
|
+
RuleActionUiComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.1.3", type: RuleActionUiComponent, selector: "aca-rule-action", inputs: { nodeId: "nodeId", actionDefinitions: "actionDefinitions", readOnly: "readOnly", parameterConstraints: "parameterConstraints" }, host: { classAttribute: "aca-rule-action" }, providers: [
|
|
531
|
+
{
|
|
532
|
+
provide: NG_VALUE_ACCESSOR,
|
|
533
|
+
multi: true,
|
|
534
|
+
useExisting: forwardRef(() => RuleActionUiComponent)
|
|
535
|
+
},
|
|
536
|
+
CardViewUpdateService
|
|
537
|
+
], usesOnChanges: true, ngImport: i0, template: "<form class=\"aca-rule-action__form\" [formGroup]=\"form\">\n\n <mat-form-field>\n <mat-select\n formControlName=\"actionDefinitionId\"\n data-automation-id=\"rule-action-select\"\n [placeholder]=\"'ACA_FOLDER_RULES.RULE_DETAILS.ACTION_SELECT_PLACEHOLDER' | translate\">\n <mat-option\n *ngFor=\"let actionDefinition of actionDefinitions\"\n [value]=\"actionDefinition.id\">\n {{ actionDefinition.title }}\n </mat-option>\n </mat-select>\n </mat-form-field>\n\n <adf-card-view\n data-automation-id=\"rule-action-card-view\"\n [properties]=\"cardViewItems\"\n [ngClass]=\"{ 'aca-rule-action-full-width': isFullWidth }\"\n [editable]=\"!readOnly\">\n </adf-card-view>\n\n</form>\n", styles: [".aca-rule-action__form{display:flex;flex-direction:row;gap:20px}.aca-rule-action__form adf-card-view .adf-property-list .adf-property adf-card-view-item-dispatcher adf-card-view-textitem .mat-form-field .mat-form-field-infix{width:280px}.aca-rule-action-full-width{width:100%}\n"], dependencies: [{ kind: "directive", type: i1$1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i1$1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i2$1.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { kind: "directive", type: i2$1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i2$1.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i2$1.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: i2$1.FormControlName, selector: "[formControlName]", inputs: ["formControlName", "disabled", "ngModel"], outputs: ["ngModelChange"] }, { kind: "component", type: i3$1.MatOption, selector: "mat-option", exportAs: ["matOption"] }, { kind: "component", type: i5.MatFormField, selector: "mat-form-field", inputs: ["color", "appearance", "hideRequiredMarker", "hintLabel", "floatLabel"], exportAs: ["matFormField"] }, { kind: "component", type: i7.MatSelect, selector: "mat-select", inputs: ["disabled", "disableRipple", "tabIndex"], exportAs: ["matSelect"] }, { kind: "component", type: i1.CardViewComponent, selector: "adf-card-view", inputs: ["properties", "editable", "displayEmpty", "displayNoneOption", "displayClearAction", "copyToClipboardAction", "useChipsForMultiValueProperty", "multiValueSeparator"] }, { kind: "pipe", type: i3.TranslatePipe, name: "translate" }], encapsulation: i0.ViewEncapsulation.None });
|
|
538
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.1.3", ngImport: i0, type: RuleActionUiComponent, decorators: [{
|
|
539
|
+
type: Component,
|
|
540
|
+
args: [{ selector: 'aca-rule-action', encapsulation: ViewEncapsulation.None, host: { class: 'aca-rule-action' }, providers: [
|
|
541
|
+
{
|
|
542
|
+
provide: NG_VALUE_ACCESSOR,
|
|
543
|
+
multi: true,
|
|
544
|
+
useExisting: forwardRef(() => RuleActionUiComponent)
|
|
545
|
+
},
|
|
546
|
+
CardViewUpdateService
|
|
547
|
+
], template: "<form class=\"aca-rule-action__form\" [formGroup]=\"form\">\n\n <mat-form-field>\n <mat-select\n formControlName=\"actionDefinitionId\"\n data-automation-id=\"rule-action-select\"\n [placeholder]=\"'ACA_FOLDER_RULES.RULE_DETAILS.ACTION_SELECT_PLACEHOLDER' | translate\">\n <mat-option\n *ngFor=\"let actionDefinition of actionDefinitions\"\n [value]=\"actionDefinition.id\">\n {{ actionDefinition.title }}\n </mat-option>\n </mat-select>\n </mat-form-field>\n\n <adf-card-view\n data-automation-id=\"rule-action-card-view\"\n [properties]=\"cardViewItems\"\n [ngClass]=\"{ 'aca-rule-action-full-width': isFullWidth }\"\n [editable]=\"!readOnly\">\n </adf-card-view>\n\n</form>\n", styles: [".aca-rule-action__form{display:flex;flex-direction:row;gap:20px}.aca-rule-action__form adf-card-view .adf-property-list .adf-property adf-card-view-item-dispatcher adf-card-view-textitem .mat-form-field .mat-form-field-infix{width:280px}.aca-rule-action-full-width{width:100%}\n"] }]
|
|
548
|
+
}], ctorParameters: function () { return [{ type: i1.CardViewUpdateService }, { type: i2.MatDialog }, { type: i3.TranslateService }]; }, propDecorators: { nodeId: [{
|
|
549
|
+
type: Input
|
|
550
|
+
}], actionDefinitions: [{
|
|
551
|
+
type: Input
|
|
552
|
+
}], readOnly: [{
|
|
553
|
+
type: Input
|
|
554
|
+
}], parameterConstraints: [{
|
|
555
|
+
type: Input
|
|
556
|
+
}] } });
|
|
557
|
+
|
|
558
|
+
/*!
|
|
559
|
+
* Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved.
|
|
560
|
+
*
|
|
561
|
+
* Alfresco Example Content Application
|
|
562
|
+
*
|
|
563
|
+
* This file is part of the Alfresco Example Content Application.
|
|
564
|
+
* If the software was purchased under a paid Alfresco license, the terms of
|
|
565
|
+
* the paid license agreement will prevail. Otherwise, the software is
|
|
566
|
+
* provided under the following open source license terms:
|
|
567
|
+
*
|
|
568
|
+
* The Alfresco Example Content Application is free software: you can redistribute it and/or modify
|
|
569
|
+
* it under the terms of the GNU Lesser General Public License as published by
|
|
570
|
+
* the Free Software Foundation, either version 3 of the License, or
|
|
571
|
+
* (at your option) any later version.
|
|
572
|
+
*
|
|
573
|
+
* The Alfresco Example Content Application is distributed in the hope that it will be useful,
|
|
574
|
+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
575
|
+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
576
|
+
* GNU Lesser General Public License for more details.
|
|
577
|
+
*
|
|
578
|
+
* You should have received a copy of the GNU Lesser General Public License
|
|
579
|
+
* from Hyland Software. If not, see <http://www.gnu.org/licenses/>.
|
|
580
|
+
*/
|
|
581
|
+
class RuleActionListUiComponent {
|
|
582
|
+
constructor() {
|
|
583
|
+
this.actionDefinitions = [];
|
|
584
|
+
this.readOnly = false;
|
|
585
|
+
this.parameterConstraints = [];
|
|
586
|
+
this.nodeId = '';
|
|
587
|
+
this.formArray = new FormArray([]);
|
|
588
|
+
this.formControls = [];
|
|
589
|
+
this.onChange = () => undefined;
|
|
590
|
+
this.onTouch = () => undefined;
|
|
591
|
+
}
|
|
592
|
+
writeValue(actions) {
|
|
593
|
+
var _a;
|
|
594
|
+
if (actions.length === 0) {
|
|
595
|
+
actions = [
|
|
596
|
+
{
|
|
597
|
+
actionDefinitionId: null,
|
|
598
|
+
params: {}
|
|
599
|
+
}
|
|
600
|
+
];
|
|
601
|
+
}
|
|
602
|
+
this.formArray = new FormArray(actions.map((action) => new FormControl(action)));
|
|
603
|
+
this.formControls = this.formArray.controls;
|
|
604
|
+
(_a = this.formArraySubscription) === null || _a === void 0 ? void 0 : _a.unsubscribe();
|
|
605
|
+
this.formArraySubscription = this.formArray.valueChanges.subscribe((value) => {
|
|
606
|
+
this.onChange(value);
|
|
607
|
+
this.onTouch();
|
|
608
|
+
});
|
|
609
|
+
}
|
|
610
|
+
registerOnChange(fn) {
|
|
611
|
+
this.onChange = fn;
|
|
612
|
+
}
|
|
613
|
+
registerOnTouched(fn) {
|
|
614
|
+
this.onTouch = fn;
|
|
615
|
+
}
|
|
616
|
+
addAction() {
|
|
617
|
+
const newAction = {
|
|
618
|
+
actionDefinitionId: null,
|
|
619
|
+
params: {}
|
|
620
|
+
};
|
|
621
|
+
this.formArray.push(new FormControl(newAction, [Validators.required, ruleActionValidator(this.actionDefinitions)]));
|
|
622
|
+
this.formControls = this.formArray.controls;
|
|
623
|
+
}
|
|
624
|
+
ngOnDestroy() {
|
|
625
|
+
var _a;
|
|
626
|
+
(_a = this.formArraySubscription) === null || _a === void 0 ? void 0 : _a.unsubscribe();
|
|
627
|
+
}
|
|
628
|
+
removeAction(control) {
|
|
629
|
+
const index = this.formArray.value.indexOf(control.value);
|
|
630
|
+
this.formArray.removeAt(index);
|
|
631
|
+
this.formControls = this.formArray.controls;
|
|
632
|
+
}
|
|
633
|
+
}
|
|
634
|
+
RuleActionListUiComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.1.3", ngImport: i0, type: RuleActionListUiComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
635
|
+
RuleActionListUiComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.1.3", type: RuleActionListUiComponent, selector: "aca-rule-action-list", inputs: { actionDefinitions: "actionDefinitions", readOnly: "readOnly", parameterConstraints: "parameterConstraints", nodeId: "nodeId" }, host: { classAttribute: "aca-rule-action-list" }, providers: [
|
|
636
|
+
{
|
|
637
|
+
provide: NG_VALUE_ACCESSOR,
|
|
638
|
+
multi: true,
|
|
639
|
+
useExisting: forwardRef(() => RuleActionListUiComponent)
|
|
640
|
+
}
|
|
641
|
+
], ngImport: i0, template: "<div class=\"aca-rule-action-list__item \" *ngFor=\"let control of formControls\">\n <aca-rule-action\n [actionDefinitions]=\"actionDefinitions\"\n [parameterConstraints]=\"parameterConstraints\"\n [readOnly]=\"readOnly\"\n [formControl]=\"control\"\n [nodeId]=\"nodeId\">\n </aca-rule-action>\n\n <button\n mat-icon-button\n data-automation-id=\"rule-action-list-action-menu\"\n *ngIf=\"!readOnly\" [matMenuTriggerFor]=\"menu\">\n <mat-icon>more_vert</mat-icon>\n </button>\n\n <mat-menu #menu>\n <button\n mat-menu-item\n data-automation-id=\"rule-action-list-remove-action-button\"\n [title]=\"'ACA_FOLDER_RULES.RULE_DETAILS.ACTION_BUTTONS.REMOVE' | translate\"\n [disabled]=\"formControls.length <= 1\"\n (click)=\"removeAction(control)\">\n <mat-icon>delete</mat-icon>\n <span>{{ 'ACA_FOLDER_RULES.RULE_DETAILS.ACTION_BUTTONS.REMOVE' | translate }}</span>\n </button>\n </mat-menu>\n</div>\n\n<button mat-button data-automation-id=\"rule-action-list-add-action-button\" (click)=\"addAction()\" *ngIf=\"!readOnly\">\n <mat-icon>add</mat-icon>\n <span>{{ 'ACA_FOLDER_RULES.RULE_DETAILS.ACTION_BUTTONS.ADD_ACTION' | translate }}</span>\n</button>\n", styles: [".aca-rule-action-list__item{padding:4px 8px;border-radius:8px;display:flex}.aca-rule-action-list__item>.aca-rule-action{flex:1}.aca-rule-action-list__item:nth-child(2n){background-color:#f2f2f2}\n"], dependencies: [{ kind: "directive", type: i1$1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i1$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i2$1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i2$1.FormControlDirective, selector: "[formControl]", inputs: ["formControl", "disabled", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }, { kind: "component", type: i3$2.MatButton, selector: "button[mat-button], button[mat-raised-button], button[mat-icon-button], button[mat-fab], button[mat-mini-fab], button[mat-stroked-button], button[mat-flat-button]", inputs: ["disabled", "disableRipple", "color"], exportAs: ["matButton"] }, { kind: "component", type: i4.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "component", type: i5$1.MatMenu, selector: "mat-menu", exportAs: ["matMenu"] }, { kind: "component", type: i5$1.MatMenuItem, selector: "[mat-menu-item]", inputs: ["disabled", "disableRipple", "role"], exportAs: ["matMenuItem"] }, { kind: "directive", type: i5$1.MatMenuTrigger, selector: "[mat-menu-trigger-for], [matMenuTriggerFor]", exportAs: ["matMenuTrigger"] }, { kind: "component", type: RuleActionUiComponent, selector: "aca-rule-action", inputs: ["nodeId", "actionDefinitions", "readOnly", "parameterConstraints"] }, { kind: "pipe", type: i3.TranslatePipe, name: "translate" }], encapsulation: i0.ViewEncapsulation.None });
|
|
642
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.1.3", ngImport: i0, type: RuleActionListUiComponent, decorators: [{
|
|
643
|
+
type: Component,
|
|
644
|
+
args: [{ selector: 'aca-rule-action-list', encapsulation: ViewEncapsulation.None, host: { class: 'aca-rule-action-list' }, providers: [
|
|
645
|
+
{
|
|
646
|
+
provide: NG_VALUE_ACCESSOR,
|
|
647
|
+
multi: true,
|
|
648
|
+
useExisting: forwardRef(() => RuleActionListUiComponent)
|
|
649
|
+
}
|
|
650
|
+
], template: "<div class=\"aca-rule-action-list__item \" *ngFor=\"let control of formControls\">\n <aca-rule-action\n [actionDefinitions]=\"actionDefinitions\"\n [parameterConstraints]=\"parameterConstraints\"\n [readOnly]=\"readOnly\"\n [formControl]=\"control\"\n [nodeId]=\"nodeId\">\n </aca-rule-action>\n\n <button\n mat-icon-button\n data-automation-id=\"rule-action-list-action-menu\"\n *ngIf=\"!readOnly\" [matMenuTriggerFor]=\"menu\">\n <mat-icon>more_vert</mat-icon>\n </button>\n\n <mat-menu #menu>\n <button\n mat-menu-item\n data-automation-id=\"rule-action-list-remove-action-button\"\n [title]=\"'ACA_FOLDER_RULES.RULE_DETAILS.ACTION_BUTTONS.REMOVE' | translate\"\n [disabled]=\"formControls.length <= 1\"\n (click)=\"removeAction(control)\">\n <mat-icon>delete</mat-icon>\n <span>{{ 'ACA_FOLDER_RULES.RULE_DETAILS.ACTION_BUTTONS.REMOVE' | translate }}</span>\n </button>\n </mat-menu>\n</div>\n\n<button mat-button data-automation-id=\"rule-action-list-add-action-button\" (click)=\"addAction()\" *ngIf=\"!readOnly\">\n <mat-icon>add</mat-icon>\n <span>{{ 'ACA_FOLDER_RULES.RULE_DETAILS.ACTION_BUTTONS.ADD_ACTION' | translate }}</span>\n</button>\n", styles: [".aca-rule-action-list__item{padding:4px 8px;border-radius:8px;display:flex}.aca-rule-action-list__item>.aca-rule-action{flex:1}.aca-rule-action-list__item:nth-child(2n){background-color:#f2f2f2}\n"] }]
|
|
651
|
+
}], propDecorators: { actionDefinitions: [{
|
|
652
|
+
type: Input
|
|
653
|
+
}], readOnly: [{
|
|
654
|
+
type: Input
|
|
655
|
+
}], parameterConstraints: [{
|
|
656
|
+
type: Input
|
|
657
|
+
}], nodeId: [{
|
|
658
|
+
type: Input
|
|
659
|
+
}] } });
|
|
660
|
+
|
|
661
|
+
/*!
|
|
662
|
+
* Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved.
|
|
663
|
+
*
|
|
664
|
+
* Alfresco Example Content Application
|
|
665
|
+
*
|
|
666
|
+
* This file is part of the Alfresco Example Content Application.
|
|
667
|
+
* If the software was purchased under a paid Alfresco license, the terms of
|
|
668
|
+
* the paid license agreement will prevail. Otherwise, the software is
|
|
669
|
+
* provided under the following open source license terms:
|
|
670
|
+
*
|
|
671
|
+
* The Alfresco Example Content Application is free software: you can redistribute it and/or modify
|
|
672
|
+
* it under the terms of the GNU Lesser General Public License as published by
|
|
673
|
+
* the Free Software Foundation, either version 3 of the License, or
|
|
674
|
+
* (at your option) any later version.
|
|
675
|
+
*
|
|
676
|
+
* The Alfresco Example Content Application is distributed in the hope that it will be useful,
|
|
677
|
+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
678
|
+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
679
|
+
* GNU Lesser General Public License for more details.
|
|
680
|
+
*
|
|
681
|
+
* You should have received a copy of the GNU Lesser General Public License
|
|
682
|
+
* from Hyland Software. If not, see <http://www.gnu.org/licenses/>.
|
|
683
|
+
*/
|
|
684
|
+
const comparatorHiddenForConditionFieldType = ['special', 'mimeType'];
|
|
685
|
+
const ruleConditionFields = [
|
|
686
|
+
{
|
|
687
|
+
name: 'cm:name',
|
|
688
|
+
label: 'ACA_FOLDER_RULES.RULE_DETAILS.FIELDS.NAME',
|
|
689
|
+
type: 'string'
|
|
690
|
+
},
|
|
691
|
+
{
|
|
692
|
+
name: 'size',
|
|
693
|
+
label: 'ACA_FOLDER_RULES.RULE_DETAILS.FIELDS.SIZE',
|
|
694
|
+
type: 'number'
|
|
695
|
+
},
|
|
696
|
+
{
|
|
697
|
+
name: 'mimetype',
|
|
698
|
+
label: 'ACA_FOLDER_RULES.RULE_DETAILS.FIELDS.MIMETYPE',
|
|
699
|
+
type: 'mimeType'
|
|
700
|
+
},
|
|
701
|
+
{
|
|
702
|
+
name: 'encoding',
|
|
703
|
+
label: 'ACA_FOLDER_RULES.RULE_DETAILS.FIELDS.ENCODING',
|
|
704
|
+
type: 'special'
|
|
705
|
+
},
|
|
706
|
+
{
|
|
707
|
+
name: 'category',
|
|
708
|
+
label: 'ACA_FOLDER_RULES.RULE_DETAILS.FIELDS.HAS_CATEGORY',
|
|
709
|
+
type: 'special'
|
|
710
|
+
},
|
|
711
|
+
{
|
|
712
|
+
name: 'tag',
|
|
713
|
+
label: 'ACA_FOLDER_RULES.RULE_DETAILS.FIELDS.HAS_TAG',
|
|
714
|
+
type: 'special'
|
|
715
|
+
},
|
|
716
|
+
{
|
|
717
|
+
name: 'aspect',
|
|
718
|
+
label: 'ACA_FOLDER_RULES.RULE_DETAILS.FIELDS.HAS_ASPECT',
|
|
719
|
+
type: 'special'
|
|
720
|
+
}
|
|
721
|
+
];
|
|
722
|
+
|
|
723
|
+
/*!
|
|
724
|
+
* Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved.
|
|
725
|
+
*
|
|
726
|
+
* Alfresco Example Content Application
|
|
727
|
+
*
|
|
728
|
+
* This file is part of the Alfresco Example Content Application.
|
|
729
|
+
* If the software was purchased under a paid Alfresco license, the terms of
|
|
730
|
+
* the paid license agreement will prevail. Otherwise, the software is
|
|
731
|
+
* provided under the following open source license terms:
|
|
732
|
+
*
|
|
733
|
+
* The Alfresco Example Content Application is free software: you can redistribute it and/or modify
|
|
734
|
+
* it under the terms of the GNU Lesser General Public License as published by
|
|
735
|
+
* the Free Software Foundation, either version 3 of the License, or
|
|
736
|
+
* (at your option) any later version.
|
|
737
|
+
*
|
|
738
|
+
* The Alfresco Example Content Application is distributed in the hope that it will be useful,
|
|
739
|
+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
740
|
+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
741
|
+
* GNU Lesser General Public License for more details.
|
|
742
|
+
*
|
|
743
|
+
* You should have received a copy of the GNU Lesser General Public License
|
|
744
|
+
* from Hyland Software. If not, see <http://www.gnu.org/licenses/>.
|
|
745
|
+
*/
|
|
746
|
+
const ruleConditionComparators = [
|
|
747
|
+
{
|
|
748
|
+
name: 'equals',
|
|
749
|
+
labels: {
|
|
750
|
+
string: 'ACA_FOLDER_RULES.RULE_DETAILS.COMPARATORS.EQUALS',
|
|
751
|
+
number: 'ACA_FOLDER_RULES.RULE_DETAILS.COMPARATORS.EQUALS',
|
|
752
|
+
date: 'ACA_FOLDER_RULES.RULE_DETAILS.COMPARATORS.ON',
|
|
753
|
+
special: ''
|
|
754
|
+
}
|
|
755
|
+
},
|
|
756
|
+
{
|
|
757
|
+
name: 'contains',
|
|
758
|
+
labels: {
|
|
759
|
+
string: 'ACA_FOLDER_RULES.RULE_DETAILS.COMPARATORS.CONTAINS'
|
|
760
|
+
}
|
|
761
|
+
},
|
|
762
|
+
{
|
|
763
|
+
name: 'begins',
|
|
764
|
+
labels: {
|
|
765
|
+
string: 'ACA_FOLDER_RULES.RULE_DETAILS.COMPARATORS.STARTS_WITH'
|
|
766
|
+
}
|
|
767
|
+
},
|
|
768
|
+
{
|
|
769
|
+
name: 'ends',
|
|
770
|
+
labels: {
|
|
771
|
+
string: 'ACA_FOLDER_RULES.RULE_DETAILS.COMPARATORS.ENDS_WITH'
|
|
772
|
+
}
|
|
773
|
+
},
|
|
774
|
+
{
|
|
775
|
+
name: 'greater_than',
|
|
776
|
+
labels: {
|
|
777
|
+
number: 'ACA_FOLDER_RULES.RULE_DETAILS.COMPARATORS.GREATER_THAN',
|
|
778
|
+
date: 'ACA_FOLDER_RULES.RULE_DETAILS.COMPARATORS.AFTER'
|
|
779
|
+
}
|
|
780
|
+
},
|
|
781
|
+
{
|
|
782
|
+
name: 'less_than',
|
|
783
|
+
labels: {
|
|
784
|
+
number: 'ACA_FOLDER_RULES.RULE_DETAILS.COMPARATORS.LESS_THAN',
|
|
785
|
+
date: 'ACA_FOLDER_RULES.RULE_DETAILS.COMPARATORS.BEFORE'
|
|
786
|
+
}
|
|
787
|
+
},
|
|
788
|
+
{
|
|
789
|
+
name: 'greater_than_equal',
|
|
790
|
+
labels: {
|
|
791
|
+
number: 'ACA_FOLDER_RULES.RULE_DETAILS.COMPARATORS.GREATER_THAN_OR_EQUAL',
|
|
792
|
+
date: 'ACA_FOLDER_RULES.RULE_DETAILS.COMPARATORS.ON_OR_AFTER'
|
|
793
|
+
}
|
|
794
|
+
},
|
|
795
|
+
{
|
|
796
|
+
name: 'less_than_equal',
|
|
797
|
+
labels: {
|
|
798
|
+
number: 'ACA_FOLDER_RULES.RULE_DETAILS.COMPARATORS.LESS_THAN_OR_EQUAL',
|
|
799
|
+
date: 'ACA_FOLDER_RULES.RULE_DETAILS.COMPARATORS.ON_OR_BEFORE'
|
|
800
|
+
}
|
|
801
|
+
},
|
|
802
|
+
{
|
|
803
|
+
name: 'instance_of',
|
|
804
|
+
labels: {
|
|
805
|
+
type: 'ACA_FOLDER_RULES.RULE_DETAILS.COMPARATORS.INSTANCE_OF'
|
|
806
|
+
}
|
|
807
|
+
}
|
|
808
|
+
];
|
|
809
|
+
|
|
810
|
+
/*!
|
|
811
|
+
* Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved.
|
|
812
|
+
*
|
|
813
|
+
* Alfresco Example Content Application
|
|
814
|
+
*
|
|
815
|
+
* This file is part of the Alfresco Example Content Application.
|
|
816
|
+
* If the software was purchased under a paid Alfresco license, the terms of
|
|
817
|
+
* the paid license agreement will prevail. Otherwise, the software is
|
|
818
|
+
* provided under the following open source license terms:
|
|
819
|
+
*
|
|
820
|
+
* The Alfresco Example Content Application is free software: you can redistribute it and/or modify
|
|
821
|
+
* it under the terms of the GNU Lesser General Public License as published by
|
|
822
|
+
* the Free Software Foundation, either version 3 of the License, or
|
|
823
|
+
* (at your option) any later version.
|
|
824
|
+
*
|
|
825
|
+
* The Alfresco Example Content Application is distributed in the hope that it will be useful,
|
|
826
|
+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
827
|
+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
828
|
+
* GNU Lesser General Public License for more details.
|
|
829
|
+
*
|
|
830
|
+
* You should have received a copy of the GNU Lesser General Public License
|
|
831
|
+
* from Hyland Software. If not, see <http://www.gnu.org/licenses/>.
|
|
832
|
+
*/
|
|
833
|
+
class RuleSimpleConditionUiComponent {
|
|
834
|
+
constructor(config) {
|
|
835
|
+
this.config = config;
|
|
836
|
+
this.fields = ruleConditionFields;
|
|
837
|
+
this.form = new FormGroup({
|
|
838
|
+
field: new FormControl('cm:name'),
|
|
839
|
+
comparator: new FormControl('equals'),
|
|
840
|
+
parameter: new FormControl()
|
|
841
|
+
});
|
|
842
|
+
this.mimeTypes = [];
|
|
843
|
+
this._readOnly = false;
|
|
844
|
+
this.formSubscription = this.form.valueChanges.subscribe((value) => {
|
|
845
|
+
this.onChange(value);
|
|
846
|
+
this.onTouch();
|
|
847
|
+
});
|
|
848
|
+
this.onChange = () => undefined;
|
|
849
|
+
this.onTouch = () => undefined;
|
|
850
|
+
this.mimeTypes = this.config.get('mimeTypes');
|
|
851
|
+
}
|
|
852
|
+
get readOnly() {
|
|
853
|
+
return this._readOnly;
|
|
854
|
+
}
|
|
855
|
+
set readOnly(isReadOnly) {
|
|
856
|
+
this.setDisabledState(isReadOnly);
|
|
857
|
+
}
|
|
858
|
+
get isSelectedFieldKnown() {
|
|
859
|
+
const selectedFieldName = this.form.get('field').value;
|
|
860
|
+
return this.fields.findIndex((field) => selectedFieldName === field.name) > -1;
|
|
861
|
+
}
|
|
862
|
+
get selectedField() {
|
|
863
|
+
const selectedFieldName = this.form.get('field').value;
|
|
864
|
+
if (!this.isSelectedFieldKnown) {
|
|
865
|
+
return {
|
|
866
|
+
name: selectedFieldName,
|
|
867
|
+
label: selectedFieldName,
|
|
868
|
+
type: 'special'
|
|
869
|
+
};
|
|
870
|
+
}
|
|
871
|
+
return this.fields.find((field) => field.name === selectedFieldName);
|
|
872
|
+
}
|
|
873
|
+
get selectedFieldComparators() {
|
|
874
|
+
return ruleConditionComparators.filter((comparator) => Object.keys(comparator.labels).includes(this.selectedField.type));
|
|
875
|
+
}
|
|
876
|
+
get isComparatorHidden() {
|
|
877
|
+
var _a;
|
|
878
|
+
return comparatorHiddenForConditionFieldType.includes((_a = this.selectedField) === null || _a === void 0 ? void 0 : _a.type);
|
|
879
|
+
}
|
|
880
|
+
get comparatorControl() {
|
|
881
|
+
return this.form.get('comparator');
|
|
882
|
+
}
|
|
883
|
+
get parameterControl() {
|
|
884
|
+
return this.form.get('parameter');
|
|
885
|
+
}
|
|
886
|
+
writeValue(value) {
|
|
887
|
+
this.form.setValue(value);
|
|
888
|
+
}
|
|
889
|
+
registerOnChange(fn) {
|
|
890
|
+
this.onChange = fn;
|
|
891
|
+
}
|
|
892
|
+
registerOnTouched(fn) {
|
|
893
|
+
this.onTouch = fn;
|
|
894
|
+
}
|
|
895
|
+
setDisabledState(isDisabled) {
|
|
896
|
+
if (isDisabled) {
|
|
897
|
+
this._readOnly = true;
|
|
898
|
+
this.form.disable();
|
|
899
|
+
}
|
|
900
|
+
else {
|
|
901
|
+
this._readOnly = false;
|
|
902
|
+
this.form.enable();
|
|
903
|
+
}
|
|
904
|
+
}
|
|
905
|
+
onChangeField() {
|
|
906
|
+
var _a, _b;
|
|
907
|
+
if (!this.selectedFieldComparators.find((comparator) => comparator.name === this.comparatorControl.value)) {
|
|
908
|
+
this.comparatorControl.setValue('equals');
|
|
909
|
+
}
|
|
910
|
+
if (!this.parameterControl.value && ((_a = this.selectedField) === null || _a === void 0 ? void 0 : _a.type) === 'mimeType') {
|
|
911
|
+
this.parameterControl.setValue((_b = this.mimeTypes[0]) === null || _b === void 0 ? void 0 : _b.value);
|
|
912
|
+
}
|
|
913
|
+
else if (this.parameterControl.value) {
|
|
914
|
+
this.parameterControl.setValue('');
|
|
915
|
+
}
|
|
916
|
+
}
|
|
917
|
+
ngOnDestroy() {
|
|
918
|
+
this.formSubscription.unsubscribe();
|
|
919
|
+
}
|
|
920
|
+
}
|
|
921
|
+
RuleSimpleConditionUiComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.1.3", ngImport: i0, type: RuleSimpleConditionUiComponent, deps: [{ token: i1.AppConfigService }], target: i0.ɵɵFactoryTarget.Component });
|
|
922
|
+
RuleSimpleConditionUiComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.1.3", type: RuleSimpleConditionUiComponent, selector: "aca-rule-simple-condition", inputs: { readOnly: "readOnly" }, host: { classAttribute: "aca-rule-simple-condition" }, providers: [
|
|
923
|
+
{
|
|
924
|
+
provide: NG_VALUE_ACCESSOR,
|
|
925
|
+
multi: true,
|
|
926
|
+
useExisting: forwardRef(() => RuleSimpleConditionUiComponent)
|
|
927
|
+
}
|
|
928
|
+
], ngImport: i0, template: "<form class=\"aca-rule-simple-condition__form\" [formGroup]=\"form\">\n <mat-form-field class=\"aca-rule-simple-condition__form__field-input\">\n <mat-select formControlName=\"field\" data-automation-id=\"field-select\"\n (selectionChange)=\"onChangeField()\">\n <mat-option *ngIf=\"!isSelectedFieldKnown\" [value]=\"selectedField.name\" data-automation-id=\"unknown-field-option\">\n {{ selectedField.label }}\n </mat-option>\n <mat-option *ngFor=\"let field of fields\" [value]=\"field.name\">\n {{ field.label | translate }}\n </mat-option>\n </mat-select>\n </mat-form-field>\n\n <mat-form-field class=\"aca-rule-simple-condition__form__comparator-input\" [class]=\"{ hidden: isComparatorHidden }\" data-automation-id=\"comparator-form-field\">\n <mat-select formControlName=\"comparator\" data-automation-id=\"comparator-select\">\n <mat-option\n *ngFor=\"let comparator of selectedFieldComparators\"\n [value]=\"comparator.name\">\n {{ comparator.labels[this.selectedField?.type || 'equals'] | translate }}\n </mat-option>\n </mat-select>\n </mat-form-field>\n\n <mat-form-field class=\"aca-rule-simple-condition__form__parameter-input\">\n <mat-select formControlName=\"parameter\" data-automation-id=\"simple-condition-value-select\" *ngIf=\"selectedField?.type === 'mimeType'; else valueInput\">\n <mat-option *ngFor=\"let mimeType of mimeTypes\"\n [value]=\"mimeType.value\">\n {{ mimeType.label }}\n </mat-option>\n </mat-select>\n <ng-template #valueInput>\n <input matInput placeholder=\"{{ 'ACA_FOLDER_RULES.RULE_DETAILS.PLACEHOLDER.VALUE' | translate }}\" type=\"text\" formControlName=\"parameter\" data-automation-id=\"value-input\">\n </ng-template>\n </mat-form-field>\n</form>\n", styles: [".aca-rule-simple-condition__form{display:flex;flex-direction:row;gap:8px}.aca-rule-simple-condition__form mat-form-field{flex:2;font-size:inherit}.aca-rule-simple-condition__form__comparator-input.hidden{display:none}\n"], dependencies: [{ kind: "directive", type: i1$1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i1$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i2$1.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { kind: "directive", type: i2$1.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i2$1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i2$1.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i2$1.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: i2$1.FormControlName, selector: "[formControlName]", inputs: ["formControlName", "disabled", "ngModel"], outputs: ["ngModelChange"] }, { kind: "component", type: i3$1.MatOption, selector: "mat-option", exportAs: ["matOption"] }, { kind: "component", type: i5.MatFormField, selector: "mat-form-field", inputs: ["color", "appearance", "hideRequiredMarker", "hintLabel", "floatLabel"], exportAs: ["matFormField"] }, { kind: "directive", type: i6.MatInput, selector: "input[matInput], textarea[matInput], select[matNativeControl], input[matNativeControl], textarea[matNativeControl]", inputs: ["disabled", "id", "placeholder", "name", "required", "type", "errorStateMatcher", "aria-describedby", "value", "readonly"], exportAs: ["matInput"] }, { kind: "component", type: i7.MatSelect, selector: "mat-select", inputs: ["disabled", "disableRipple", "tabIndex"], exportAs: ["matSelect"] }, { kind: "pipe", type: i3.TranslatePipe, name: "translate" }], encapsulation: i0.ViewEncapsulation.None });
|
|
929
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.1.3", ngImport: i0, type: RuleSimpleConditionUiComponent, decorators: [{
|
|
930
|
+
type: Component,
|
|
931
|
+
args: [{ selector: 'aca-rule-simple-condition', encapsulation: ViewEncapsulation.None, host: { class: 'aca-rule-simple-condition' }, providers: [
|
|
932
|
+
{
|
|
933
|
+
provide: NG_VALUE_ACCESSOR,
|
|
934
|
+
multi: true,
|
|
935
|
+
useExisting: forwardRef(() => RuleSimpleConditionUiComponent)
|
|
936
|
+
}
|
|
937
|
+
], template: "<form class=\"aca-rule-simple-condition__form\" [formGroup]=\"form\">\n <mat-form-field class=\"aca-rule-simple-condition__form__field-input\">\n <mat-select formControlName=\"field\" data-automation-id=\"field-select\"\n (selectionChange)=\"onChangeField()\">\n <mat-option *ngIf=\"!isSelectedFieldKnown\" [value]=\"selectedField.name\" data-automation-id=\"unknown-field-option\">\n {{ selectedField.label }}\n </mat-option>\n <mat-option *ngFor=\"let field of fields\" [value]=\"field.name\">\n {{ field.label | translate }}\n </mat-option>\n </mat-select>\n </mat-form-field>\n\n <mat-form-field class=\"aca-rule-simple-condition__form__comparator-input\" [class]=\"{ hidden: isComparatorHidden }\" data-automation-id=\"comparator-form-field\">\n <mat-select formControlName=\"comparator\" data-automation-id=\"comparator-select\">\n <mat-option\n *ngFor=\"let comparator of selectedFieldComparators\"\n [value]=\"comparator.name\">\n {{ comparator.labels[this.selectedField?.type || 'equals'] | translate }}\n </mat-option>\n </mat-select>\n </mat-form-field>\n\n <mat-form-field class=\"aca-rule-simple-condition__form__parameter-input\">\n <mat-select formControlName=\"parameter\" data-automation-id=\"simple-condition-value-select\" *ngIf=\"selectedField?.type === 'mimeType'; else valueInput\">\n <mat-option *ngFor=\"let mimeType of mimeTypes\"\n [value]=\"mimeType.value\">\n {{ mimeType.label }}\n </mat-option>\n </mat-select>\n <ng-template #valueInput>\n <input matInput placeholder=\"{{ 'ACA_FOLDER_RULES.RULE_DETAILS.PLACEHOLDER.VALUE' | translate }}\" type=\"text\" formControlName=\"parameter\" data-automation-id=\"value-input\">\n </ng-template>\n </mat-form-field>\n</form>\n", styles: [".aca-rule-simple-condition__form{display:flex;flex-direction:row;gap:8px}.aca-rule-simple-condition__form mat-form-field{flex:2;font-size:inherit}.aca-rule-simple-condition__form__comparator-input.hidden{display:none}\n"] }]
|
|
938
|
+
}], ctorParameters: function () { return [{ type: i1.AppConfigService }]; }, propDecorators: { readOnly: [{
|
|
939
|
+
type: Input
|
|
940
|
+
}] } });
|
|
941
|
+
|
|
942
|
+
/*!
|
|
943
|
+
* Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved.
|
|
944
|
+
*
|
|
945
|
+
* Alfresco Example Content Application
|
|
946
|
+
*
|
|
947
|
+
* This file is part of the Alfresco Example Content Application.
|
|
948
|
+
* If the software was purchased under a paid Alfresco license, the terms of
|
|
949
|
+
* the paid license agreement will prevail. Otherwise, the software is
|
|
950
|
+
* provided under the following open source license terms:
|
|
951
|
+
*
|
|
952
|
+
* The Alfresco Example Content Application is free software: you can redistribute it and/or modify
|
|
953
|
+
* it under the terms of the GNU Lesser General Public License as published by
|
|
954
|
+
* the Free Software Foundation, either version 3 of the License, or
|
|
955
|
+
* (at your option) any later version.
|
|
956
|
+
*
|
|
957
|
+
* The Alfresco Example Content Application is distributed in the hope that it will be useful,
|
|
958
|
+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
959
|
+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
960
|
+
* GNU Lesser General Public License for more details.
|
|
961
|
+
*
|
|
962
|
+
* You should have received a copy of the GNU Lesser General Public License
|
|
963
|
+
* from Hyland Software. If not, see <http://www.gnu.org/licenses/>.
|
|
964
|
+
*/
|
|
965
|
+
class RuleCompositeConditionUiComponent {
|
|
966
|
+
constructor() {
|
|
967
|
+
this.secondaryBackground = false;
|
|
968
|
+
this.childCondition = false;
|
|
969
|
+
this.form = new FormGroup({
|
|
970
|
+
inverted: new FormControl(),
|
|
971
|
+
booleanMode: new FormControl(),
|
|
972
|
+
compositeConditions: new FormArray([]),
|
|
973
|
+
simpleConditions: new FormArray([])
|
|
974
|
+
});
|
|
975
|
+
this.isOrImplemented = false;
|
|
976
|
+
this.readOnly = false;
|
|
977
|
+
this.formSubscription = this.form.valueChanges.subscribe((value) => {
|
|
978
|
+
this.onChange(value);
|
|
979
|
+
this.onTouch();
|
|
980
|
+
});
|
|
981
|
+
this.invertedControl = this.form.get('inverted');
|
|
982
|
+
this.booleanModeControl = this.form.get('booleanMode');
|
|
983
|
+
this.onChange = () => undefined;
|
|
984
|
+
this.onTouch = () => undefined;
|
|
985
|
+
}
|
|
986
|
+
get compositeConditionsFormArray() {
|
|
987
|
+
return this.form.get('compositeConditions');
|
|
988
|
+
}
|
|
989
|
+
get simpleConditionsFormArray() {
|
|
990
|
+
return this.form.get('simpleConditions');
|
|
991
|
+
}
|
|
992
|
+
get conditionFormControls() {
|
|
993
|
+
return [...this.compositeConditionsFormArray.controls, ...this.simpleConditionsFormArray.controls];
|
|
994
|
+
}
|
|
995
|
+
get hasNoConditions() {
|
|
996
|
+
return this.conditionFormControls.length === 0;
|
|
997
|
+
}
|
|
998
|
+
writeValue(value) {
|
|
999
|
+
this.form.get('inverted').setValue(value.inverted);
|
|
1000
|
+
this.form.get('booleanMode').setValue(value.booleanMode);
|
|
1001
|
+
this.form.setControl('compositeConditions', new FormArray(value.compositeConditions.map((condition) => new FormControl(condition))));
|
|
1002
|
+
this.form.setControl('simpleConditions', new FormArray(value.simpleConditions.map((condition) => new FormControl(condition))));
|
|
1003
|
+
}
|
|
1004
|
+
registerOnChange(fn) {
|
|
1005
|
+
this.onChange = fn;
|
|
1006
|
+
}
|
|
1007
|
+
registerOnTouched(fn) {
|
|
1008
|
+
this.onTouch = fn;
|
|
1009
|
+
}
|
|
1010
|
+
setDisabledState(isDisabled) {
|
|
1011
|
+
if (isDisabled) {
|
|
1012
|
+
this.readOnly = true;
|
|
1013
|
+
this.form.disable();
|
|
1014
|
+
}
|
|
1015
|
+
else {
|
|
1016
|
+
this.readOnly = false;
|
|
1017
|
+
this.form.enable();
|
|
1018
|
+
}
|
|
1019
|
+
}
|
|
1020
|
+
isFormControlSimpleCondition(control) {
|
|
1021
|
+
// eslint-disable-next-line no-prototype-builtins
|
|
1022
|
+
return control.value.hasOwnProperty('field');
|
|
1023
|
+
}
|
|
1024
|
+
removeCondition(control) {
|
|
1025
|
+
const formArray = this.isFormControlSimpleCondition(control) ? this.simpleConditionsFormArray : this.compositeConditionsFormArray;
|
|
1026
|
+
const index = formArray.value.indexOf(control.value);
|
|
1027
|
+
formArray.removeAt(index);
|
|
1028
|
+
}
|
|
1029
|
+
addSimpleCondition() {
|
|
1030
|
+
const newCondition = {
|
|
1031
|
+
field: 'cm:name',
|
|
1032
|
+
comparator: 'equals',
|
|
1033
|
+
parameter: ''
|
|
1034
|
+
};
|
|
1035
|
+
this.simpleConditionsFormArray.push(new FormControl(newCondition));
|
|
1036
|
+
}
|
|
1037
|
+
addCompositeCondition() {
|
|
1038
|
+
const newCondition = {
|
|
1039
|
+
inverted: false,
|
|
1040
|
+
booleanMode: 'and',
|
|
1041
|
+
compositeConditions: [],
|
|
1042
|
+
simpleConditions: []
|
|
1043
|
+
};
|
|
1044
|
+
this.compositeConditionsFormArray.push(new FormControl(newCondition));
|
|
1045
|
+
}
|
|
1046
|
+
ngOnDestroy() {
|
|
1047
|
+
this.formSubscription.unsubscribe();
|
|
1048
|
+
}
|
|
1049
|
+
ngOnChanges(changes) {
|
|
1050
|
+
const readOnly = changes['readOnly'].currentValue;
|
|
1051
|
+
if (readOnly !== undefined && readOnly !== null) {
|
|
1052
|
+
this.readOnly = readOnly;
|
|
1053
|
+
this.setDisabledState(readOnly);
|
|
1054
|
+
}
|
|
1055
|
+
}
|
|
1056
|
+
}
|
|
1057
|
+
RuleCompositeConditionUiComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.1.3", ngImport: i0, type: RuleCompositeConditionUiComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
1058
|
+
RuleCompositeConditionUiComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.1.3", type: RuleCompositeConditionUiComponent, selector: "aca-rule-composite-condition", inputs: { secondaryBackground: "secondaryBackground", childCondition: "childCondition", readOnly: "readOnly" }, host: { properties: { "class.secondaryBackground": "this.secondaryBackground", "class.childCompositeCondition": "this.childCondition" }, classAttribute: "aca-rule-composite-condition" }, providers: [
|
|
1059
|
+
{
|
|
1060
|
+
provide: NG_VALUE_ACCESSOR,
|
|
1061
|
+
multi: true,
|
|
1062
|
+
useExisting: forwardRef(() => RuleCompositeConditionUiComponent)
|
|
1063
|
+
}
|
|
1064
|
+
], usesOnChanges: true, ngImport: i0, template: "<form class=\"aca-rule-composite-condition__form\" [formGroup]=\"form\">\n <div *ngIf=\"hasNoConditions\" class=\"aca-rule-composite-condition__form__no-conditions\" data-automation-id=\"no-conditions\">\n {{ 'ACA_FOLDER_RULES.RULE_DETAILS.' + (childCondition ? 'NO_CONDITIONS_IN_GROUP' : 'NO_CONDITIONS') | translate }}\n </div>\n\n <div\n class=\"aca-rule-composite-condition__form__row\"\n *ngFor=\"let control of conditionFormControls; let i = index\">\n\n <mat-form-field *ngIf=\"i === 0\">\n <mat-select\n [formControl]=\"invertedControl\"\n [disabled]=\"readOnly\">\n <mat-option [value]=\"false\">{{ 'ACA_FOLDER_RULES.RULE_DETAILS.LOGIC_OPERATORS.IF' | translate }}</mat-option>\n <mat-option [value]=\"true\">{{ 'ACA_FOLDER_RULES.RULE_DETAILS.LOGIC_OPERATORS.NOT_IF' | translate }}</mat-option>\n </mat-select>\n </mat-form-field>\n\n <mat-form-field *ngIf=\"i > 0\">\n <mat-select\n [disabled]=\"!isOrImplemented || i > 1 || readOnly\"\n [formControl]=\"booleanModeControl\">\n <mat-option value=\"and\">{{ 'ACA_FOLDER_RULES.RULE_DETAILS.LOGIC_OPERATORS.AND' | translate }}</mat-option>\n <mat-option value=\"or\">{{ 'ACA_FOLDER_RULES.RULE_DETAILS.LOGIC_OPERATORS.OR' | translate }}</mat-option>\n </mat-select>\n </mat-form-field>\n\n <aca-rule-composite-condition\n *ngIf=\"!isFormControlSimpleCondition(control)\"\n [secondaryBackground]=\"!secondaryBackground\"\n [childCondition]=\"true\"\n [formControl]=\"control\"\n [readOnly]=\"readOnly\">\n </aca-rule-composite-condition>\n\n <aca-rule-simple-condition\n *ngIf=\"isFormControlSimpleCondition(control)\"\n [formControl]=\"control\"\n [readOnly]=\"readOnly\">\n </aca-rule-simple-condition>\n\n <button mat-icon-button [matMenuTriggerFor]=\"menu\" *ngIf=\"!readOnly\" data-automation-id=\"condition-actions-button\">\n <mat-icon>more_vert</mat-icon>\n </button>\n\n <mat-menu #menu=\"matMenu\">\n <button\n mat-menu-item\n [title]=\"'ACA_FOLDER_RULES.RULE_DETAILS.CONDITION_BUTTONS.REMOVE' | translate\"\n (click)=\"removeCondition(control)\">\n <mat-icon>delete</mat-icon>\n <span>{{ 'ACA_FOLDER_RULES.RULE_DETAILS.CONDITION_BUTTONS.REMOVE' | translate }}</span>\n </button>\n </mat-menu>\n\n </div>\n\n <div class=\"aca-rule-composite-condition__form__actions\" *ngIf=\"!readOnly\" data-automation-id=\"add-actions\">\n <button mat-button (click)=\"addSimpleCondition()\" data-automation-id=\"add-condition-button\">\n <mat-icon>add</mat-icon>\n <span>{{ 'ACA_FOLDER_RULES.RULE_DETAILS.CONDITION_BUTTONS.ADD_CONDITION' | translate }}</span>\n </button>\n <button mat-button (click)=\"addCompositeCondition()\" data-automation-id=\"add-group-button\">\n <mat-icon>add</mat-icon>\n <span>{{ 'ACA_FOLDER_RULES.RULE_DETAILS.CONDITION_BUTTONS.ADD_GROUP' | translate }}</span>\n </button>\n </div>\n</form>\n", styles: [".aca-rule-composite-condition{display:block;border-radius:8px}.aca-rule-composite-condition.childCompositeCondition{padding:8px 16px;background-color:#fff}.aca-rule-composite-condition.childCompositeCondition.secondaryBackground{background-color:#f2f2f2}.aca-rule-composite-condition__form{display:flex;flex-direction:column;gap:8px}.aca-rule-composite-condition__form__no-conditions{color:var(--theme-disabled-text-color);margin:.5em 0}.aca-rule-composite-condition__form__row{display:flex;gap:8px}.aca-rule-composite-condition__form__row>:nth-child(1){width:5em;font-size:inherit}.aca-rule-composite-condition__form__row>:nth-child(2){flex:1}\n"], dependencies: [{ kind: "directive", type: i1$1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i1$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i2$1.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { kind: "directive", type: i2$1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i2$1.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i2$1.FormControlDirective, selector: "[formControl]", inputs: ["formControl", "disabled", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }, { kind: "directive", type: i2$1.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "component", type: i3$1.MatOption, selector: "mat-option", exportAs: ["matOption"] }, { kind: "component", type: i3$2.MatButton, selector: "button[mat-button], button[mat-raised-button], button[mat-icon-button], button[mat-fab], button[mat-mini-fab], button[mat-stroked-button], button[mat-flat-button]", inputs: ["disabled", "disableRipple", "color"], exportAs: ["matButton"] }, { kind: "component", type: i4.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "component", type: i5.MatFormField, selector: "mat-form-field", inputs: ["color", "appearance", "hideRequiredMarker", "hintLabel", "floatLabel"], exportAs: ["matFormField"] }, { kind: "component", type: i7.MatSelect, selector: "mat-select", inputs: ["disabled", "disableRipple", "tabIndex"], exportAs: ["matSelect"] }, { kind: "component", type: i5$1.MatMenu, selector: "mat-menu", exportAs: ["matMenu"] }, { kind: "component", type: i5$1.MatMenuItem, selector: "[mat-menu-item]", inputs: ["disabled", "disableRipple", "role"], exportAs: ["matMenuItem"] }, { kind: "directive", type: i5$1.MatMenuTrigger, selector: "[mat-menu-trigger-for], [matMenuTriggerFor]", exportAs: ["matMenuTrigger"] }, { kind: "component", type: RuleCompositeConditionUiComponent, selector: "aca-rule-composite-condition", inputs: ["secondaryBackground", "childCondition", "readOnly"] }, { kind: "component", type: RuleSimpleConditionUiComponent, selector: "aca-rule-simple-condition", inputs: ["readOnly"] }, { kind: "pipe", type: i3.TranslatePipe, name: "translate" }], encapsulation: i0.ViewEncapsulation.None });
|
|
1065
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.1.3", ngImport: i0, type: RuleCompositeConditionUiComponent, decorators: [{
|
|
1066
|
+
type: Component,
|
|
1067
|
+
args: [{ selector: 'aca-rule-composite-condition', encapsulation: ViewEncapsulation.None, host: { class: 'aca-rule-composite-condition' }, providers: [
|
|
1068
|
+
{
|
|
1069
|
+
provide: NG_VALUE_ACCESSOR,
|
|
1070
|
+
multi: true,
|
|
1071
|
+
useExisting: forwardRef(() => RuleCompositeConditionUiComponent)
|
|
1072
|
+
}
|
|
1073
|
+
], template: "<form class=\"aca-rule-composite-condition__form\" [formGroup]=\"form\">\n <div *ngIf=\"hasNoConditions\" class=\"aca-rule-composite-condition__form__no-conditions\" data-automation-id=\"no-conditions\">\n {{ 'ACA_FOLDER_RULES.RULE_DETAILS.' + (childCondition ? 'NO_CONDITIONS_IN_GROUP' : 'NO_CONDITIONS') | translate }}\n </div>\n\n <div\n class=\"aca-rule-composite-condition__form__row\"\n *ngFor=\"let control of conditionFormControls; let i = index\">\n\n <mat-form-field *ngIf=\"i === 0\">\n <mat-select\n [formControl]=\"invertedControl\"\n [disabled]=\"readOnly\">\n <mat-option [value]=\"false\">{{ 'ACA_FOLDER_RULES.RULE_DETAILS.LOGIC_OPERATORS.IF' | translate }}</mat-option>\n <mat-option [value]=\"true\">{{ 'ACA_FOLDER_RULES.RULE_DETAILS.LOGIC_OPERATORS.NOT_IF' | translate }}</mat-option>\n </mat-select>\n </mat-form-field>\n\n <mat-form-field *ngIf=\"i > 0\">\n <mat-select\n [disabled]=\"!isOrImplemented || i > 1 || readOnly\"\n [formControl]=\"booleanModeControl\">\n <mat-option value=\"and\">{{ 'ACA_FOLDER_RULES.RULE_DETAILS.LOGIC_OPERATORS.AND' | translate }}</mat-option>\n <mat-option value=\"or\">{{ 'ACA_FOLDER_RULES.RULE_DETAILS.LOGIC_OPERATORS.OR' | translate }}</mat-option>\n </mat-select>\n </mat-form-field>\n\n <aca-rule-composite-condition\n *ngIf=\"!isFormControlSimpleCondition(control)\"\n [secondaryBackground]=\"!secondaryBackground\"\n [childCondition]=\"true\"\n [formControl]=\"control\"\n [readOnly]=\"readOnly\">\n </aca-rule-composite-condition>\n\n <aca-rule-simple-condition\n *ngIf=\"isFormControlSimpleCondition(control)\"\n [formControl]=\"control\"\n [readOnly]=\"readOnly\">\n </aca-rule-simple-condition>\n\n <button mat-icon-button [matMenuTriggerFor]=\"menu\" *ngIf=\"!readOnly\" data-automation-id=\"condition-actions-button\">\n <mat-icon>more_vert</mat-icon>\n </button>\n\n <mat-menu #menu=\"matMenu\">\n <button\n mat-menu-item\n [title]=\"'ACA_FOLDER_RULES.RULE_DETAILS.CONDITION_BUTTONS.REMOVE' | translate\"\n (click)=\"removeCondition(control)\">\n <mat-icon>delete</mat-icon>\n <span>{{ 'ACA_FOLDER_RULES.RULE_DETAILS.CONDITION_BUTTONS.REMOVE' | translate }}</span>\n </button>\n </mat-menu>\n\n </div>\n\n <div class=\"aca-rule-composite-condition__form__actions\" *ngIf=\"!readOnly\" data-automation-id=\"add-actions\">\n <button mat-button (click)=\"addSimpleCondition()\" data-automation-id=\"add-condition-button\">\n <mat-icon>add</mat-icon>\n <span>{{ 'ACA_FOLDER_RULES.RULE_DETAILS.CONDITION_BUTTONS.ADD_CONDITION' | translate }}</span>\n </button>\n <button mat-button (click)=\"addCompositeCondition()\" data-automation-id=\"add-group-button\">\n <mat-icon>add</mat-icon>\n <span>{{ 'ACA_FOLDER_RULES.RULE_DETAILS.CONDITION_BUTTONS.ADD_GROUP' | translate }}</span>\n </button>\n </div>\n</form>\n", styles: [".aca-rule-composite-condition{display:block;border-radius:8px}.aca-rule-composite-condition.childCompositeCondition{padding:8px 16px;background-color:#fff}.aca-rule-composite-condition.childCompositeCondition.secondaryBackground{background-color:#f2f2f2}.aca-rule-composite-condition__form{display:flex;flex-direction:column;gap:8px}.aca-rule-composite-condition__form__no-conditions{color:var(--theme-disabled-text-color);margin:.5em 0}.aca-rule-composite-condition__form__row{display:flex;gap:8px}.aca-rule-composite-condition__form__row>:nth-child(1){width:5em;font-size:inherit}.aca-rule-composite-condition__form__row>:nth-child(2){flex:1}\n"] }]
|
|
1074
|
+
}], propDecorators: { secondaryBackground: [{
|
|
1075
|
+
type: HostBinding,
|
|
1076
|
+
args: ['class.secondaryBackground']
|
|
1077
|
+
}, {
|
|
1078
|
+
type: Input
|
|
1079
|
+
}], childCondition: [{
|
|
1080
|
+
type: HostBinding,
|
|
1081
|
+
args: ['class.childCompositeCondition']
|
|
1082
|
+
}, {
|
|
1083
|
+
type: Input
|
|
1084
|
+
}], readOnly: [{
|
|
1085
|
+
type: Input
|
|
1086
|
+
}] } });
|
|
1087
|
+
|
|
1088
|
+
/*!
|
|
1089
|
+
* Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved.
|
|
1090
|
+
*
|
|
1091
|
+
* Alfresco Example Content Application
|
|
1092
|
+
*
|
|
1093
|
+
* This file is part of the Alfresco Example Content Application.
|
|
1094
|
+
* If the software was purchased under a paid Alfresco license, the terms of
|
|
1095
|
+
* the paid license agreement will prevail. Otherwise, the software is
|
|
1096
|
+
* provided under the following open source license terms:
|
|
1097
|
+
*
|
|
1098
|
+
* The Alfresco Example Content Application is free software: you can redistribute it and/or modify
|
|
1099
|
+
* it under the terms of the GNU Lesser General Public License as published by
|
|
1100
|
+
* the Free Software Foundation, either version 3 of the License, or
|
|
1101
|
+
* (at your option) any later version.
|
|
1102
|
+
*
|
|
1103
|
+
* The Alfresco Example Content Application is distributed in the hope that it will be useful,
|
|
1104
|
+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
1105
|
+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
1106
|
+
* GNU Lesser General Public License for more details.
|
|
1107
|
+
*
|
|
1108
|
+
* You should have received a copy of the GNU Lesser General Public License
|
|
1109
|
+
* from Hyland Software. If not, see <http://www.gnu.org/licenses/>.
|
|
1110
|
+
*/
|
|
1111
|
+
class RuleTriggersUiComponent {
|
|
1112
|
+
constructor() {
|
|
1113
|
+
this.triggerOptions = ['inbound', 'update', 'outbound'];
|
|
1114
|
+
this.selectedTriggers = {
|
|
1115
|
+
inbound: true
|
|
1116
|
+
};
|
|
1117
|
+
this.value = ['inbound'];
|
|
1118
|
+
this.readOnly = false;
|
|
1119
|
+
this.onChange = () => undefined;
|
|
1120
|
+
this.onTouch = () => undefined;
|
|
1121
|
+
}
|
|
1122
|
+
writeValue(triggers) {
|
|
1123
|
+
this.value = triggers;
|
|
1124
|
+
this.selectedTriggers = {};
|
|
1125
|
+
this.value.forEach((trigger) => (this.selectedTriggers[trigger] = true));
|
|
1126
|
+
}
|
|
1127
|
+
registerOnChange(fn) {
|
|
1128
|
+
this.onChange = fn;
|
|
1129
|
+
}
|
|
1130
|
+
registerOnTouched(fn) {
|
|
1131
|
+
this.onTouch = fn;
|
|
1132
|
+
}
|
|
1133
|
+
setDisabledState(isDisabled) {
|
|
1134
|
+
this.readOnly = isDisabled;
|
|
1135
|
+
}
|
|
1136
|
+
onTriggerChange(trigger, checked) {
|
|
1137
|
+
if (checked) {
|
|
1138
|
+
this.value.push(trigger);
|
|
1139
|
+
}
|
|
1140
|
+
else {
|
|
1141
|
+
this.value.splice(this.value.findIndex((t) => t === trigger), 1);
|
|
1142
|
+
}
|
|
1143
|
+
this.selectedTriggers[trigger] = checked;
|
|
1144
|
+
this.onTouch();
|
|
1145
|
+
this.onChange([...this.value]);
|
|
1146
|
+
}
|
|
1147
|
+
}
|
|
1148
|
+
RuleTriggersUiComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.1.3", ngImport: i0, type: RuleTriggersUiComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
1149
|
+
RuleTriggersUiComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.1.3", type: RuleTriggersUiComponent, selector: "aca-rule-triggers", host: { classAttribute: "aca-rule-triggers" }, providers: [
|
|
1150
|
+
{
|
|
1151
|
+
provide: NG_VALUE_ACCESSOR,
|
|
1152
|
+
multi: true,
|
|
1153
|
+
useExisting: forwardRef(() => RuleTriggersUiComponent)
|
|
1154
|
+
}
|
|
1155
|
+
], ngImport: i0, template: "<div *ngFor=\"let trigger of triggerOptions\">\n <ng-container *ngIf=\"readOnly; else checkbox\">\n <div\n *ngIf=\"selectedTriggers[trigger]\"\n [attr.data-automation-id]=\"'rule-trigger-value-' + trigger | lowercase\">\n {{ 'ACA_FOLDER_RULES.RULE_DETAILS.TRIGGERS.' + trigger | uppercase | translate }}\n </div>\n </ng-container>\n\n <ng-template #checkbox>\n <mat-checkbox\n [attr.data-automation-id]=\"'rule-trigger-checkbox-' + trigger | lowercase\"\n [checked]=\"selectedTriggers[trigger]\"\n (change)=\"onTriggerChange(trigger, $event.checked)\">\n {{ 'ACA_FOLDER_RULES.RULE_DETAILS.TRIGGERS.' + trigger | uppercase | translate }}\n </mat-checkbox>\n </ng-template>\n</div>\n", dependencies: [{ kind: "directive", type: i1$1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i1$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: i2$2.MatCheckbox, selector: "mat-checkbox", inputs: ["disableRipple", "color", "tabIndex"], exportAs: ["matCheckbox"] }, { kind: "pipe", type: i1$1.UpperCasePipe, name: "uppercase" }, { kind: "pipe", type: i1$1.LowerCasePipe, name: "lowercase" }, { kind: "pipe", type: i3.TranslatePipe, name: "translate" }], encapsulation: i0.ViewEncapsulation.None });
|
|
1156
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.1.3", ngImport: i0, type: RuleTriggersUiComponent, decorators: [{
|
|
1157
|
+
type: Component,
|
|
1158
|
+
args: [{ selector: 'aca-rule-triggers', encapsulation: ViewEncapsulation.None, host: { class: 'aca-rule-triggers' }, providers: [
|
|
1159
|
+
{
|
|
1160
|
+
provide: NG_VALUE_ACCESSOR,
|
|
1161
|
+
multi: true,
|
|
1162
|
+
useExisting: forwardRef(() => RuleTriggersUiComponent)
|
|
1163
|
+
}
|
|
1164
|
+
], template: "<div *ngFor=\"let trigger of triggerOptions\">\n <ng-container *ngIf=\"readOnly; else checkbox\">\n <div\n *ngIf=\"selectedTriggers[trigger]\"\n [attr.data-automation-id]=\"'rule-trigger-value-' + trigger | lowercase\">\n {{ 'ACA_FOLDER_RULES.RULE_DETAILS.TRIGGERS.' + trigger | uppercase | translate }}\n </div>\n </ng-container>\n\n <ng-template #checkbox>\n <mat-checkbox\n [attr.data-automation-id]=\"'rule-trigger-checkbox-' + trigger | lowercase\"\n [checked]=\"selectedTriggers[trigger]\"\n (change)=\"onTriggerChange(trigger, $event.checked)\">\n {{ 'ACA_FOLDER_RULES.RULE_DETAILS.TRIGGERS.' + trigger | uppercase | translate }}\n </mat-checkbox>\n </ng-template>\n</div>\n" }]
|
|
1165
|
+
}] });
|
|
1166
|
+
|
|
1167
|
+
/*!
|
|
1168
|
+
* Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved.
|
|
1169
|
+
*
|
|
1170
|
+
* Alfresco Example Content Application
|
|
1171
|
+
*
|
|
1172
|
+
* This file is part of the Alfresco Example Content Application.
|
|
1173
|
+
* If the software was purchased under a paid Alfresco license, the terms of
|
|
1174
|
+
* the paid license agreement will prevail. Otherwise, the software is
|
|
1175
|
+
* provided under the following open source license terms:
|
|
1176
|
+
*
|
|
1177
|
+
* The Alfresco Example Content Application is free software: you can redistribute it and/or modify
|
|
1178
|
+
* it under the terms of the GNU Lesser General Public License as published by
|
|
1179
|
+
* the Free Software Foundation, either version 3 of the License, or
|
|
1180
|
+
* (at your option) any later version.
|
|
1181
|
+
*
|
|
1182
|
+
* The Alfresco Example Content Application is distributed in the hope that it will be useful,
|
|
1183
|
+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
1184
|
+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
1185
|
+
* GNU Lesser General Public License for more details.
|
|
1186
|
+
*
|
|
1187
|
+
* You should have received a copy of the GNU Lesser General Public License
|
|
1188
|
+
* from Hyland Software. If not, see <http://www.gnu.org/licenses/>.
|
|
1189
|
+
*/
|
|
1190
|
+
class RuleOptionsUiComponent {
|
|
1191
|
+
constructor() {
|
|
1192
|
+
this.form = new FormGroup({
|
|
1193
|
+
isDisabled: new FormControl(),
|
|
1194
|
+
isInheritable: new FormControl(),
|
|
1195
|
+
isAsynchronous: new FormControl(),
|
|
1196
|
+
errorScript: new FormControl()
|
|
1197
|
+
});
|
|
1198
|
+
this.formSubscription = this.form.valueChanges.subscribe((value) => {
|
|
1199
|
+
var _a;
|
|
1200
|
+
this.isAsynchronousChecked = value.isAsynchronous;
|
|
1201
|
+
this.isInheritableChecked = value.isInheritable;
|
|
1202
|
+
this.onChange({
|
|
1203
|
+
isEnabled: !value.isDisabled,
|
|
1204
|
+
isInheritable: value.isInheritable,
|
|
1205
|
+
isAsynchronous: value.isAsynchronous,
|
|
1206
|
+
errorScript: (_a = value.errorScript) !== null && _a !== void 0 ? _a : ''
|
|
1207
|
+
});
|
|
1208
|
+
this.onTouch();
|
|
1209
|
+
});
|
|
1210
|
+
this.hideErrorScriptDropdown = true;
|
|
1211
|
+
this.readOnly = false;
|
|
1212
|
+
this.onChange = () => undefined;
|
|
1213
|
+
this.onTouch = () => undefined;
|
|
1214
|
+
this.isAsynchronousChecked = false;
|
|
1215
|
+
this.isInheritableChecked = false;
|
|
1216
|
+
this.errorScriptOptions = [];
|
|
1217
|
+
}
|
|
1218
|
+
writeValue(options) {
|
|
1219
|
+
var _a;
|
|
1220
|
+
const isAsynchronousFormControl = this.form.get('isAsynchronous');
|
|
1221
|
+
const errorScriptFormControl = this.form.get('errorScript');
|
|
1222
|
+
this.form.get('isDisabled').setValue(!options.isEnabled);
|
|
1223
|
+
this.form.get('isInheritable').setValue(options.isInheritable);
|
|
1224
|
+
this.form.get('isAsynchronous').setValue(options.isAsynchronous);
|
|
1225
|
+
errorScriptFormControl.setValue((_a = options.errorScript) !== null && _a !== void 0 ? _a : '');
|
|
1226
|
+
if (isAsynchronousFormControl.value) {
|
|
1227
|
+
this.hideErrorScriptDropdown = false;
|
|
1228
|
+
errorScriptFormControl.enable();
|
|
1229
|
+
}
|
|
1230
|
+
else {
|
|
1231
|
+
this.hideErrorScriptDropdown = true;
|
|
1232
|
+
errorScriptFormControl.disable();
|
|
1233
|
+
}
|
|
1234
|
+
}
|
|
1235
|
+
registerOnChange(fn) {
|
|
1236
|
+
this.onChange = fn;
|
|
1237
|
+
}
|
|
1238
|
+
registerOnTouched(fn) {
|
|
1239
|
+
this.onTouch = fn;
|
|
1240
|
+
}
|
|
1241
|
+
setDisabledState(isDisabled) {
|
|
1242
|
+
if (isDisabled) {
|
|
1243
|
+
this.form.disable();
|
|
1244
|
+
this.readOnly = true;
|
|
1245
|
+
}
|
|
1246
|
+
else {
|
|
1247
|
+
this.form.enable();
|
|
1248
|
+
this.readOnly = false;
|
|
1249
|
+
}
|
|
1250
|
+
}
|
|
1251
|
+
ngOnInit() {
|
|
1252
|
+
var _a, _b;
|
|
1253
|
+
this.errorScriptOptions = (_b = (_a = this.errorScriptConstraint) === null || _a === void 0 ? void 0 : _a.constraints) !== null && _b !== void 0 ? _b : [];
|
|
1254
|
+
}
|
|
1255
|
+
ngOnDestroy() {
|
|
1256
|
+
this.formSubscription.unsubscribe();
|
|
1257
|
+
}
|
|
1258
|
+
toggleErrorScriptDropdown(value) {
|
|
1259
|
+
const formControl = this.form.get('errorScript');
|
|
1260
|
+
if (value.checked) {
|
|
1261
|
+
this.hideErrorScriptDropdown = false;
|
|
1262
|
+
formControl.enable();
|
|
1263
|
+
}
|
|
1264
|
+
else {
|
|
1265
|
+
this.hideErrorScriptDropdown = true;
|
|
1266
|
+
formControl.disable();
|
|
1267
|
+
}
|
|
1268
|
+
}
|
|
1269
|
+
}
|
|
1270
|
+
RuleOptionsUiComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.1.3", ngImport: i0, type: RuleOptionsUiComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
1271
|
+
RuleOptionsUiComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.1.3", type: RuleOptionsUiComponent, selector: "aca-rule-options", inputs: { errorScriptConstraint: "errorScriptConstraint" }, host: { properties: { "class.read-only": "this.readOnly" }, classAttribute: "aca-rule-options" }, providers: [
|
|
1272
|
+
{
|
|
1273
|
+
provide: NG_VALUE_ACCESSOR,
|
|
1274
|
+
multi: true,
|
|
1275
|
+
useExisting: forwardRef(() => RuleOptionsUiComponent)
|
|
1276
|
+
}
|
|
1277
|
+
], ngImport: i0, template: "<ng-container [formGroup]=\"form\">\n <div class=\"aca-rule-options__option\" *ngIf=\"!readOnly || isAsynchronousChecked\">\n <mat-checkbox\n formControlName=\"isAsynchronous\"\n (change)=\"toggleErrorScriptDropdown($event)\"\n data-automation-id=\"rule-option-checkbox-asynchronous\">\n {{ 'ACA_FOLDER_RULES.RULE_DETAILS.OPTIONS.IS_ASYNCHRONOUS' | translate }}\n </mat-checkbox>\n\n <mat-form-field\n data-automation-id=\"rule-option-form-field-errorScript\"\n floatLabel=\"always\"\n [ngClass]=\"{ 'hide-error-script-dropdown': hideErrorScriptDropdown }\">\n\n <mat-select\n formControlName=\"errorScript\"\n placeholder=\"{{ 'ACA_FOLDER_RULES.RULE_DETAILS.OPTIONS.ERROR_SCRIPT' | translate}}\"\n data-automation-id=\"rule-option-select-errorScript\">\n\n <mat-option value=\"\">{{ 'ACA_FOLDER_RULES.RULE_DETAILS.OPTIONS.NO_SCRIPT' | translate }}</mat-option>\n <mat-option *ngFor=\"let option of errorScriptOptions\"\n [value]=\"option.value\">\n {{ option.label }}\n </mat-option>\n </mat-select>\n\n </mat-form-field>\n </div>\n\n\n <div class=\"aca-rule-options__option\" *ngIf=\"!readOnly || isInheritableChecked\">\n <mat-checkbox\n formControlName=\"isInheritable\"\n data-automation-id=\"rule-option-checkbox-inheritable\">\n {{ 'ACA_FOLDER_RULES.RULE_DETAILS.OPTIONS.IS_INHERITABLE' | translate }}\n </mat-checkbox>\n </div>\n\n <div class=\"aca-rule-options__option\" *ngIf=\"!readOnly\">\n <mat-checkbox\n formControlName=\"isDisabled\"\n data-automation-id=\"rule-option-checkbox-disabled\">\n {{ 'ACA_FOLDER_RULES.RULE_DETAILS.OPTIONS.DISABLE_RULE' | translate }}\n </mat-checkbox>\n </div>\n</ng-container>\n", styles: [".aca-rule-options{display:flex;flex-direction:row;gap:24px}.aca-rule-options__option{display:flex;flex-direction:column}.aca-rule-options.read-only .mat-checkbox-inner-container{display:none}.aca-rule-options .hide-error-script-dropdown{opacity:0}\n"], dependencies: [{ kind: "directive", type: i1$1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i1$1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i1$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i2$1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i2$1.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i2$1.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: i2$1.FormControlName, selector: "[formControlName]", inputs: ["formControlName", "disabled", "ngModel"], outputs: ["ngModelChange"] }, { kind: "component", type: i3$1.MatOption, selector: "mat-option", exportAs: ["matOption"] }, { kind: "component", type: i2$2.MatCheckbox, selector: "mat-checkbox", inputs: ["disableRipple", "color", "tabIndex"], exportAs: ["matCheckbox"] }, { kind: "component", type: i5.MatFormField, selector: "mat-form-field", inputs: ["color", "appearance", "hideRequiredMarker", "hintLabel", "floatLabel"], exportAs: ["matFormField"] }, { kind: "component", type: i7.MatSelect, selector: "mat-select", inputs: ["disabled", "disableRipple", "tabIndex"], exportAs: ["matSelect"] }, { kind: "pipe", type: i3.TranslatePipe, name: "translate" }], encapsulation: i0.ViewEncapsulation.None });
|
|
1278
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.1.3", ngImport: i0, type: RuleOptionsUiComponent, decorators: [{
|
|
1279
|
+
type: Component,
|
|
1280
|
+
args: [{ selector: 'aca-rule-options', encapsulation: ViewEncapsulation.None, host: { class: 'aca-rule-options' }, providers: [
|
|
1281
|
+
{
|
|
1282
|
+
provide: NG_VALUE_ACCESSOR,
|
|
1283
|
+
multi: true,
|
|
1284
|
+
useExisting: forwardRef(() => RuleOptionsUiComponent)
|
|
1285
|
+
}
|
|
1286
|
+
], template: "<ng-container [formGroup]=\"form\">\n <div class=\"aca-rule-options__option\" *ngIf=\"!readOnly || isAsynchronousChecked\">\n <mat-checkbox\n formControlName=\"isAsynchronous\"\n (change)=\"toggleErrorScriptDropdown($event)\"\n data-automation-id=\"rule-option-checkbox-asynchronous\">\n {{ 'ACA_FOLDER_RULES.RULE_DETAILS.OPTIONS.IS_ASYNCHRONOUS' | translate }}\n </mat-checkbox>\n\n <mat-form-field\n data-automation-id=\"rule-option-form-field-errorScript\"\n floatLabel=\"always\"\n [ngClass]=\"{ 'hide-error-script-dropdown': hideErrorScriptDropdown }\">\n\n <mat-select\n formControlName=\"errorScript\"\n placeholder=\"{{ 'ACA_FOLDER_RULES.RULE_DETAILS.OPTIONS.ERROR_SCRIPT' | translate}}\"\n data-automation-id=\"rule-option-select-errorScript\">\n\n <mat-option value=\"\">{{ 'ACA_FOLDER_RULES.RULE_DETAILS.OPTIONS.NO_SCRIPT' | translate }}</mat-option>\n <mat-option *ngFor=\"let option of errorScriptOptions\"\n [value]=\"option.value\">\n {{ option.label }}\n </mat-option>\n </mat-select>\n\n </mat-form-field>\n </div>\n\n\n <div class=\"aca-rule-options__option\" *ngIf=\"!readOnly || isInheritableChecked\">\n <mat-checkbox\n formControlName=\"isInheritable\"\n data-automation-id=\"rule-option-checkbox-inheritable\">\n {{ 'ACA_FOLDER_RULES.RULE_DETAILS.OPTIONS.IS_INHERITABLE' | translate }}\n </mat-checkbox>\n </div>\n\n <div class=\"aca-rule-options__option\" *ngIf=\"!readOnly\">\n <mat-checkbox\n formControlName=\"isDisabled\"\n data-automation-id=\"rule-option-checkbox-disabled\">\n {{ 'ACA_FOLDER_RULES.RULE_DETAILS.OPTIONS.DISABLE_RULE' | translate }}\n </mat-checkbox>\n </div>\n</ng-container>\n", styles: [".aca-rule-options{display:flex;flex-direction:row;gap:24px}.aca-rule-options__option{display:flex;flex-direction:column}.aca-rule-options.read-only .mat-checkbox-inner-container{display:none}.aca-rule-options .hide-error-script-dropdown{opacity:0}\n"] }]
|
|
1287
|
+
}], propDecorators: { errorScriptConstraint: [{
|
|
1288
|
+
type: Input
|
|
1289
|
+
}], readOnly: [{
|
|
1290
|
+
type: HostBinding,
|
|
1291
|
+
args: ['class.read-only']
|
|
1292
|
+
}] } });
|
|
1293
|
+
|
|
1294
|
+
/*!
|
|
1295
|
+
* Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved.
|
|
1296
|
+
*
|
|
1297
|
+
* Alfresco Example Content Application
|
|
1298
|
+
*
|
|
1299
|
+
* This file is part of the Alfresco Example Content Application.
|
|
1300
|
+
* If the software was purchased under a paid Alfresco license, the terms of
|
|
1301
|
+
* the paid license agreement will prevail. Otherwise, the software is
|
|
1302
|
+
* provided under the following open source license terms:
|
|
1303
|
+
*
|
|
1304
|
+
* The Alfresco Example Content Application is free software: you can redistribute it and/or modify
|
|
1305
|
+
* it under the terms of the GNU Lesser General Public License as published by
|
|
1306
|
+
* the Free Software Foundation, either version 3 of the License, or
|
|
1307
|
+
* (at your option) any later version.
|
|
1308
|
+
*
|
|
1309
|
+
* The Alfresco Example Content Application is distributed in the hope that it will be useful,
|
|
1310
|
+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
1311
|
+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
1312
|
+
* GNU Lesser General Public License for more details.
|
|
1313
|
+
*
|
|
1314
|
+
* You should have received a copy of the GNU Lesser General Public License
|
|
1315
|
+
* from Hyland Software. If not, see <http://www.gnu.org/licenses/>.
|
|
1316
|
+
*/
|
|
1317
|
+
class RuleDetailsUiComponent {
|
|
1318
|
+
constructor() {
|
|
1319
|
+
this._initialValue = FolderRulesService.emptyRuleForForm;
|
|
1320
|
+
this.actionDefinitions = [];
|
|
1321
|
+
this.parameterConstraints = [];
|
|
1322
|
+
this.nodeId = '';
|
|
1323
|
+
this.formValidationChanged = new EventEmitter();
|
|
1324
|
+
this.formValueChanged = new EventEmitter();
|
|
1325
|
+
this.onDestroy$ = new Subject();
|
|
1326
|
+
}
|
|
1327
|
+
get value() {
|
|
1328
|
+
var _a;
|
|
1329
|
+
let value = this.form ? this.form.value : this._initialValue;
|
|
1330
|
+
if (value.options) {
|
|
1331
|
+
value = Object.assign(Object.assign({}, value), ((_a = value.options) !== null && _a !== void 0 ? _a : FolderRulesService.emptyRuleOptions));
|
|
1332
|
+
delete value.options;
|
|
1333
|
+
}
|
|
1334
|
+
return value;
|
|
1335
|
+
}
|
|
1336
|
+
set value(newValue) {
|
|
1337
|
+
const newValueForForm = {
|
|
1338
|
+
id: newValue.id || FolderRulesService.emptyRule.id,
|
|
1339
|
+
name: newValue.name || FolderRulesService.emptyRule.name,
|
|
1340
|
+
description: newValue.description || FolderRulesService.emptyRule.description,
|
|
1341
|
+
triggers: newValue.triggers || FolderRulesService.emptyRule.triggers,
|
|
1342
|
+
conditions: newValue.conditions || FolderRulesService.emptyRule.conditions,
|
|
1343
|
+
actions: newValue.actions || FolderRulesService.emptyRule.actions,
|
|
1344
|
+
options: {
|
|
1345
|
+
isEnabled: typeof newValue.isInheritable == 'boolean' ? newValue.isEnabled : FolderRulesService.emptyRule.isEnabled,
|
|
1346
|
+
isInheritable: newValue.isInheritable || FolderRulesService.emptyRule.isInheritable,
|
|
1347
|
+
isAsynchronous: newValue.isAsynchronous || FolderRulesService.emptyRule.isAsynchronous,
|
|
1348
|
+
errorScript: newValue.errorScript || FolderRulesService.emptyRule.errorScript
|
|
1349
|
+
}
|
|
1350
|
+
};
|
|
1351
|
+
if (this.form) {
|
|
1352
|
+
this.form.setValue(newValueForForm);
|
|
1353
|
+
}
|
|
1354
|
+
else {
|
|
1355
|
+
this._initialValue = newValueForForm;
|
|
1356
|
+
}
|
|
1357
|
+
}
|
|
1358
|
+
get name() {
|
|
1359
|
+
return this.form.get('name');
|
|
1360
|
+
}
|
|
1361
|
+
get description() {
|
|
1362
|
+
return this.form.get('description');
|
|
1363
|
+
}
|
|
1364
|
+
get triggers() {
|
|
1365
|
+
return this.form.get('triggers');
|
|
1366
|
+
}
|
|
1367
|
+
get conditions() {
|
|
1368
|
+
return this.form.get('conditions');
|
|
1369
|
+
}
|
|
1370
|
+
get showOptionsSection() {
|
|
1371
|
+
return !this.readOnly || this.value.isAsynchronous || this.value.isInheritable;
|
|
1372
|
+
}
|
|
1373
|
+
ngOnInit() {
|
|
1374
|
+
this.form = new UntypedFormGroup({
|
|
1375
|
+
id: new UntypedFormControl(this.value.id),
|
|
1376
|
+
name: new UntypedFormControl(this.value.name || '', Validators.required),
|
|
1377
|
+
description: new UntypedFormControl(this.value.description || ''),
|
|
1378
|
+
triggers: new UntypedFormControl(this.value.triggers || ['inbound'], Validators.required),
|
|
1379
|
+
conditions: new UntypedFormControl(this.value.conditions || {
|
|
1380
|
+
inverted: false,
|
|
1381
|
+
booleanMode: 'and',
|
|
1382
|
+
compositeConditions: [],
|
|
1383
|
+
simpleConditions: []
|
|
1384
|
+
}, ruleCompositeConditionValidator()),
|
|
1385
|
+
actions: new UntypedFormControl(this.value.actions, [Validators.required, ruleActionsValidator(this.actionDefinitions)]),
|
|
1386
|
+
options: new UntypedFormControl({
|
|
1387
|
+
isEnabled: this.value.isEnabled,
|
|
1388
|
+
isInheritable: this.value.isInheritable,
|
|
1389
|
+
isAsynchronous: this.value.isAsynchronous,
|
|
1390
|
+
errorScript: this.value.errorScript
|
|
1391
|
+
})
|
|
1392
|
+
});
|
|
1393
|
+
this.form.statusChanges
|
|
1394
|
+
.pipe(map(() => this.form.valid), distinctUntilChanged(), takeUntil(this.onDestroy$))
|
|
1395
|
+
.subscribe((value) => {
|
|
1396
|
+
this.formValidationChanged.emit(value);
|
|
1397
|
+
});
|
|
1398
|
+
this.formValidationChanged.emit(this.form.valid);
|
|
1399
|
+
this.form.valueChanges.pipe(takeUntil(this.onDestroy$)).subscribe(() => {
|
|
1400
|
+
this.formValueChanged.emit(this.value);
|
|
1401
|
+
});
|
|
1402
|
+
if (this.readOnly) {
|
|
1403
|
+
this.form.disable();
|
|
1404
|
+
}
|
|
1405
|
+
else {
|
|
1406
|
+
this.form.enable();
|
|
1407
|
+
}
|
|
1408
|
+
this.descriptionPlaceHolder = this.readOnly
|
|
1409
|
+
? 'ACA_FOLDER_RULES.RULE_DETAILS.PLACEHOLDER.NO_DESCRIPTION'
|
|
1410
|
+
: 'ACA_FOLDER_RULES.RULE_DETAILS.PLACEHOLDER.DESCRIPTION';
|
|
1411
|
+
this.errorScriptConstraint = this.parameterConstraints.find((parameterConstraint) => parameterConstraint.name === 'script-ref');
|
|
1412
|
+
}
|
|
1413
|
+
ngOnDestroy() {
|
|
1414
|
+
this.onDestroy$.next();
|
|
1415
|
+
this.onDestroy$.complete();
|
|
1416
|
+
}
|
|
1417
|
+
}
|
|
1418
|
+
RuleDetailsUiComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.1.3", ngImport: i0, type: RuleDetailsUiComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
1419
|
+
RuleDetailsUiComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.1.3", type: RuleDetailsUiComponent, selector: "aca-rule-details", inputs: { readOnly: "readOnly", value: "value", preview: "preview", actionDefinitions: "actionDefinitions", parameterConstraints: "parameterConstraints", nodeId: "nodeId" }, outputs: { formValidationChanged: "formValidationChanged", formValueChanged: "formValueChanged" }, host: { classAttribute: "aca-rule-details" }, ngImport: i0, template: "<form class=\"aca-rule-details__form\" [ngClass]=\"{ 'read-only': readOnly }\" [formGroup]=\"form\">\n\n <ng-container *ngIf=\"!preview\">\n <div class=\"aca-rule-details__form__row aca-rule-details__form__name\">\n <label for=\"rule-details-name-input\">{{ 'ACA_FOLDER_RULES.RULE_DETAILS.LABEL.NAME' | translate }}</label>\n <div>\n <mat-form-field floatLabel='never'>\n <input\n id=\"rule-details-name-input\"\n matInput type=\"text\" formControlName=\"name\" data-automation-id=\"rule-details-name-input\"\n [placeholder]=\"'ACA_FOLDER_RULES.RULE_DETAILS.PLACEHOLDER.NAME' | translate\">\n <mat-error>{{ 'ACA_FOLDER_RULES.RULE_DETAILS.ERROR.REQUIRED' | translate }}</mat-error>\n </mat-form-field>\n </div>\n </div>\n\n <div class=\"aca-rule-details__form__row aca-rule-details__form__description\">\n <label for=\"rule-details-description-textarea\">{{ 'ACA_FOLDER_RULES.RULE_DETAILS.LABEL.DESCRIPTION' | translate }}</label>\n <div>\n <mat-form-field floatLabel='never'>\n <textarea\n id=\"rule-details-description-textarea\"\n matInput formControlName=\"description\" data-automation-id=\"rule-details-description-textarea\"\n [placeholder]=\"descriptionPlaceHolder | translate\">\n </textarea>\n </mat-form-field>\n </div>\n </div>\n </ng-container>\n\n <div class=\"aca-rule-details__form__row aca-rule-details__form__triggers\">\n <div class=\"label\">{{ 'ACA_FOLDER_RULES.RULE_DETAILS.LABEL.WHEN' | translate }}</div>\n <div>\n <aca-rule-triggers formControlName=\"triggers\" data-automation-id=\"rule-details-triggers-component\"></aca-rule-triggers>\n <mat-error class=\"rule-details-error\" *ngIf=\"triggers.hasError('required')\">{{ 'ACA_FOLDER_RULES.RULE_DETAILS.ERROR.INSUFFICIENT_TRIGGERS_SELECTED' | translate }}</mat-error>\n </div>\n </div>\n\n <div class=\"aca-rule-details__form__conditions\">\n <aca-rule-composite-condition formControlName=\"conditions\"></aca-rule-composite-condition>\n <mat-error class=\"rule-details-error\" *ngIf=\"conditions.hasError('ruleCompositeConditionInvalid')\">{{ 'ACA_FOLDER_RULES.RULE_DETAILS.ERROR.RULE_COMPOSITE_CONDITION_INVALID' | translate }}</mat-error>\n </div>\n\n <div class=\"aca-rule-details__form__row aca-rule-details__form__actions\">\n <div class=\"label\">{{ 'ACA_FOLDER_RULES.RULE_DETAILS.LABEL.PERFORM_ACTIONS' | translate }}</div>\n <aca-rule-action-list\n formControlName=\"actions\"\n [actionDefinitions]=\"actionDefinitions\"\n [parameterConstraints]=\"parameterConstraints\"\n [readOnly]=\"readOnly\"\n [nodeId]=\"nodeId\">\n </aca-rule-action-list>\n </div>\n\n <div class=\"aca-rule-details__form__row\" *ngIf=\"showOptionsSection\">\n <div class=\"label\">{{ 'ACA_FOLDER_RULES.RULE_DETAILS.LABEL.OPTIONS' | translate }}</div>\n <aca-rule-options\n formControlName=\"options\"\n data-automation-id=\"rule-details-options-component\"\n [errorScriptConstraint]=\"errorScriptConstraint\">\n </aca-rule-options>\n </div>\n\n</form>\n", styles: [".aca-rule-details__form{position:relative}.aca-rule-details__form>div{padding:8px 20px;width:100%;box-sizing:border-box;overflow-x:auto}.aca-rule-details__form>div.aca-rule-details__form__name{padding-bottom:0}.aca-rule-details__form>div.aca-rule-details__form__description{padding-top:0;border:none;align-items:flex-start}.aca-rule-details__form__row{display:flex;align-items:baseline;gap:8px}.aca-rule-details__form__row>label,.aca-rule-details__form__row>.label{font-weight:700;width:20%;min-width:100px;max-width:150px;padding:.75em 0}.aca-rule-details__form__row>div{flex-grow:1}.aca-rule-details__form__row>div mat-form-field{width:100%;max-width:400px;font-size:inherit}.aca-rule-details__form__row>div mat-form-field .mat-form-field-infix{border:none}.aca-rule-details__form:not(:nth-child(1)){border-top:1px solid var(--theme-border-color)}.aca-rule-details__form__conditions{width:100%}.aca-rule-details__form__conditions>.rule-details-error{margin-left:16px;color:inherit}.aca-rule-details__form textarea{min-height:4em}.aca-rule-details__form .rule-details-error{font-size:75%;height:1em}.aca-rule-details__form__actions .aca-rule-action-list{flex:1}.aca-rule-details__form.read-only .mat-form-field-underline,.aca-rule-details__form.read-only .mat-select-arrow-wrapper,.aca-rule-details__form .mat-form-field-disabled .mat-form-field-underline,.aca-rule-details__form .mat-form-field-disabled .mat-select-arrow-wrapper{display:none}.aca-rule-details__form.read-only *:disabled,.aca-rule-details__form.read-only .mat-select-disabled .mat-select-value,.aca-rule-details__form .mat-form-field-disabled *:disabled,.aca-rule-details__form .mat-form-field-disabled .mat-select-disabled .mat-select-value{color:inherit}\n"], dependencies: [{ kind: "directive", type: i1$1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i1$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i2$1.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { kind: "directive", type: i2$1.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i2$1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i2$1.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i2$1.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: i2$1.FormControlName, selector: "[formControlName]", inputs: ["formControlName", "disabled", "ngModel"], outputs: ["ngModelChange"] }, { kind: "directive", type: i5.MatError, selector: "mat-error", inputs: ["id"] }, { kind: "component", type: i5.MatFormField, selector: "mat-form-field", inputs: ["color", "appearance", "hideRequiredMarker", "hintLabel", "floatLabel"], exportAs: ["matFormField"] }, { kind: "directive", type: i6.MatInput, selector: "input[matInput], textarea[matInput], select[matNativeControl], input[matNativeControl], textarea[matNativeControl]", inputs: ["disabled", "id", "placeholder", "name", "required", "type", "errorStateMatcher", "aria-describedby", "value", "readonly"], exportAs: ["matInput"] }, { kind: "component", type: RuleActionListUiComponent, selector: "aca-rule-action-list", inputs: ["actionDefinitions", "readOnly", "parameterConstraints", "nodeId"] }, { kind: "component", type: RuleCompositeConditionUiComponent, selector: "aca-rule-composite-condition", inputs: ["secondaryBackground", "childCondition", "readOnly"] }, { kind: "component", type: RuleTriggersUiComponent, selector: "aca-rule-triggers" }, { kind: "component", type: RuleOptionsUiComponent, selector: "aca-rule-options", inputs: ["errorScriptConstraint"] }, { kind: "pipe", type: i3.TranslatePipe, name: "translate" }], encapsulation: i0.ViewEncapsulation.None });
|
|
1420
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.1.3", ngImport: i0, type: RuleDetailsUiComponent, decorators: [{
|
|
1421
|
+
type: Component,
|
|
1422
|
+
args: [{ selector: 'aca-rule-details', encapsulation: ViewEncapsulation.None, host: { class: 'aca-rule-details' }, template: "<form class=\"aca-rule-details__form\" [ngClass]=\"{ 'read-only': readOnly }\" [formGroup]=\"form\">\n\n <ng-container *ngIf=\"!preview\">\n <div class=\"aca-rule-details__form__row aca-rule-details__form__name\">\n <label for=\"rule-details-name-input\">{{ 'ACA_FOLDER_RULES.RULE_DETAILS.LABEL.NAME' | translate }}</label>\n <div>\n <mat-form-field floatLabel='never'>\n <input\n id=\"rule-details-name-input\"\n matInput type=\"text\" formControlName=\"name\" data-automation-id=\"rule-details-name-input\"\n [placeholder]=\"'ACA_FOLDER_RULES.RULE_DETAILS.PLACEHOLDER.NAME' | translate\">\n <mat-error>{{ 'ACA_FOLDER_RULES.RULE_DETAILS.ERROR.REQUIRED' | translate }}</mat-error>\n </mat-form-field>\n </div>\n </div>\n\n <div class=\"aca-rule-details__form__row aca-rule-details__form__description\">\n <label for=\"rule-details-description-textarea\">{{ 'ACA_FOLDER_RULES.RULE_DETAILS.LABEL.DESCRIPTION' | translate }}</label>\n <div>\n <mat-form-field floatLabel='never'>\n <textarea\n id=\"rule-details-description-textarea\"\n matInput formControlName=\"description\" data-automation-id=\"rule-details-description-textarea\"\n [placeholder]=\"descriptionPlaceHolder | translate\">\n </textarea>\n </mat-form-field>\n </div>\n </div>\n </ng-container>\n\n <div class=\"aca-rule-details__form__row aca-rule-details__form__triggers\">\n <div class=\"label\">{{ 'ACA_FOLDER_RULES.RULE_DETAILS.LABEL.WHEN' | translate }}</div>\n <div>\n <aca-rule-triggers formControlName=\"triggers\" data-automation-id=\"rule-details-triggers-component\"></aca-rule-triggers>\n <mat-error class=\"rule-details-error\" *ngIf=\"triggers.hasError('required')\">{{ 'ACA_FOLDER_RULES.RULE_DETAILS.ERROR.INSUFFICIENT_TRIGGERS_SELECTED' | translate }}</mat-error>\n </div>\n </div>\n\n <div class=\"aca-rule-details__form__conditions\">\n <aca-rule-composite-condition formControlName=\"conditions\"></aca-rule-composite-condition>\n <mat-error class=\"rule-details-error\" *ngIf=\"conditions.hasError('ruleCompositeConditionInvalid')\">{{ 'ACA_FOLDER_RULES.RULE_DETAILS.ERROR.RULE_COMPOSITE_CONDITION_INVALID' | translate }}</mat-error>\n </div>\n\n <div class=\"aca-rule-details__form__row aca-rule-details__form__actions\">\n <div class=\"label\">{{ 'ACA_FOLDER_RULES.RULE_DETAILS.LABEL.PERFORM_ACTIONS' | translate }}</div>\n <aca-rule-action-list\n formControlName=\"actions\"\n [actionDefinitions]=\"actionDefinitions\"\n [parameterConstraints]=\"parameterConstraints\"\n [readOnly]=\"readOnly\"\n [nodeId]=\"nodeId\">\n </aca-rule-action-list>\n </div>\n\n <div class=\"aca-rule-details__form__row\" *ngIf=\"showOptionsSection\">\n <div class=\"label\">{{ 'ACA_FOLDER_RULES.RULE_DETAILS.LABEL.OPTIONS' | translate }}</div>\n <aca-rule-options\n formControlName=\"options\"\n data-automation-id=\"rule-details-options-component\"\n [errorScriptConstraint]=\"errorScriptConstraint\">\n </aca-rule-options>\n </div>\n\n</form>\n", styles: [".aca-rule-details__form{position:relative}.aca-rule-details__form>div{padding:8px 20px;width:100%;box-sizing:border-box;overflow-x:auto}.aca-rule-details__form>div.aca-rule-details__form__name{padding-bottom:0}.aca-rule-details__form>div.aca-rule-details__form__description{padding-top:0;border:none;align-items:flex-start}.aca-rule-details__form__row{display:flex;align-items:baseline;gap:8px}.aca-rule-details__form__row>label,.aca-rule-details__form__row>.label{font-weight:700;width:20%;min-width:100px;max-width:150px;padding:.75em 0}.aca-rule-details__form__row>div{flex-grow:1}.aca-rule-details__form__row>div mat-form-field{width:100%;max-width:400px;font-size:inherit}.aca-rule-details__form__row>div mat-form-field .mat-form-field-infix{border:none}.aca-rule-details__form:not(:nth-child(1)){border-top:1px solid var(--theme-border-color)}.aca-rule-details__form__conditions{width:100%}.aca-rule-details__form__conditions>.rule-details-error{margin-left:16px;color:inherit}.aca-rule-details__form textarea{min-height:4em}.aca-rule-details__form .rule-details-error{font-size:75%;height:1em}.aca-rule-details__form__actions .aca-rule-action-list{flex:1}.aca-rule-details__form.read-only .mat-form-field-underline,.aca-rule-details__form.read-only .mat-select-arrow-wrapper,.aca-rule-details__form .mat-form-field-disabled .mat-form-field-underline,.aca-rule-details__form .mat-form-field-disabled .mat-select-arrow-wrapper{display:none}.aca-rule-details__form.read-only *:disabled,.aca-rule-details__form.read-only .mat-select-disabled .mat-select-value,.aca-rule-details__form .mat-form-field-disabled *:disabled,.aca-rule-details__form .mat-form-field-disabled .mat-select-disabled .mat-select-value{color:inherit}\n"] }]
|
|
1423
|
+
}], propDecorators: { readOnly: [{
|
|
1424
|
+
type: Input
|
|
1425
|
+
}], value: [{
|
|
1426
|
+
type: Input
|
|
1427
|
+
}], preview: [{
|
|
1428
|
+
type: Input
|
|
1429
|
+
}], actionDefinitions: [{
|
|
1430
|
+
type: Input
|
|
1431
|
+
}], parameterConstraints: [{
|
|
1432
|
+
type: Input
|
|
1433
|
+
}], nodeId: [{
|
|
1434
|
+
type: Input
|
|
1435
|
+
}], formValidationChanged: [{
|
|
1436
|
+
type: Output
|
|
1437
|
+
}], formValueChanged: [{
|
|
1438
|
+
type: Output
|
|
1439
|
+
}] } });
|
|
1440
|
+
|
|
1441
|
+
/*!
|
|
1442
|
+
* Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved.
|
|
1443
|
+
*
|
|
1444
|
+
* Alfresco Example Content Application
|
|
1445
|
+
*
|
|
1446
|
+
* This file is part of the Alfresco Example Content Application.
|
|
1447
|
+
* If the software was purchased under a paid Alfresco license, the terms of
|
|
1448
|
+
* the paid license agreement will prevail. Otherwise, the software is
|
|
1449
|
+
* provided under the following open source license terms:
|
|
1450
|
+
*
|
|
1451
|
+
* The Alfresco Example Content Application is free software: you can redistribute it and/or modify
|
|
1452
|
+
* it under the terms of the GNU Lesser General Public License as published by
|
|
1453
|
+
* the Free Software Foundation, either version 3 of the License, or
|
|
1454
|
+
* (at your option) any later version.
|
|
1455
|
+
*
|
|
1456
|
+
* The Alfresco Example Content Application is distributed in the hope that it will be useful,
|
|
1457
|
+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
1458
|
+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
1459
|
+
* GNU Lesser General Public License for more details.
|
|
1460
|
+
*
|
|
1461
|
+
* You should have received a copy of the GNU Lesser General Public License
|
|
1462
|
+
* from Hyland Software. If not, see <http://www.gnu.org/licenses/>.
|
|
1463
|
+
*/
|
|
1464
|
+
class EditRuleDialogUiComponent {
|
|
1465
|
+
constructor(data) {
|
|
1466
|
+
var _a, _b, _c, _d;
|
|
1467
|
+
this.data = data;
|
|
1468
|
+
this.formValid = false;
|
|
1469
|
+
this.nodeId = '';
|
|
1470
|
+
this.submitted = new EventEmitter();
|
|
1471
|
+
this.title = 'ACA_FOLDER_RULES.EDIT_RULE_DIALOG.' + (this.isUpdateMode ? 'UPDATE_TITLE' : 'CREATE_TITLE');
|
|
1472
|
+
this.submitLabel = 'ACA_FOLDER_RULES.EDIT_RULE_DIALOG.' + (this.isUpdateMode ? 'UPDATE' : 'CREATE');
|
|
1473
|
+
this.model = ((_a = this.data) === null || _a === void 0 ? void 0 : _a.model) || {};
|
|
1474
|
+
this.nodeId = (_b = this.data) === null || _b === void 0 ? void 0 : _b.nodeId;
|
|
1475
|
+
this.actionDefinitions$ = (_c = this.data) === null || _c === void 0 ? void 0 : _c.actionDefinitions$;
|
|
1476
|
+
this.parameterConstraints$ = (_d = this.data) === null || _d === void 0 ? void 0 : _d.parameterConstraints$;
|
|
1477
|
+
}
|
|
1478
|
+
get isUpdateMode() {
|
|
1479
|
+
var _a, _b;
|
|
1480
|
+
return !!((_b = (_a = this.data) === null || _a === void 0 ? void 0 : _a.model) === null || _b === void 0 ? void 0 : _b.id);
|
|
1481
|
+
}
|
|
1482
|
+
onSubmit() {
|
|
1483
|
+
this.submitted.emit(this.formValue);
|
|
1484
|
+
}
|
|
1485
|
+
onFormValidChange(isValid) {
|
|
1486
|
+
// setTimeout needed to avoid ExpressionChangedAfterItHasBeenCheckedError
|
|
1487
|
+
setTimeout(() => {
|
|
1488
|
+
this.formValid = isValid;
|
|
1489
|
+
}, 0);
|
|
1490
|
+
}
|
|
1491
|
+
}
|
|
1492
|
+
EditRuleDialogUiComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.1.3", ngImport: i0, type: EditRuleDialogUiComponent, deps: [{ token: MAT_DIALOG_DATA }], target: i0.ɵɵFactoryTarget.Component });
|
|
1493
|
+
EditRuleDialogUiComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.1.3", type: EditRuleDialogUiComponent, selector: "aca-edit-rule-dialog", outputs: { submitted: "submitted" }, host: { classAttribute: "aca-edit-rule-dialog" }, ngImport: i0, template: "<div mat-dialog-title class=\"aca-edit-rule-dialog__header\">\n <div class=\"aca-edit-rule-dialog__header__title\" data-automation-id=\"edit-rule-dialog-title\">\n {{ title | translate }}\n </div>\n <button mat-icon-button mat-dialog-close class=\"aca-edit-rule-dialog__header__close\" tabindex=\"-1\">\n <mat-icon>close</mat-icon>\n </button>\n</div>\n\n<mat-dialog-content class=\"aca-edit-rule-dialog__content\">\n <aca-rule-details\n [actionDefinitions]=\"actionDefinitions$ | async\"\n [parameterConstraints]=\"parameterConstraints$ | async\"\n [value]=\"model\"\n [nodeId]=\"nodeId\"\n (formValueChanged)=\"formValue = $event\"\n (formValidationChanged)=\"onFormValidChange($event)\">\n </aca-rule-details>\n</mat-dialog-content>\n\n<mat-dialog-actions align=\"end\" class=\"aca-edit-rule-dialog__footer\">\n <button mat-flat-button mat-dialog-close>{{ 'ACA_FOLDER_RULES.EDIT_RULE_DIALOG.CANCEL' | translate }}</button>\n <button mat-flat-button color=\"primary\" [disabled]=\"!formValid\" data-automation-id=\"edit-rule-dialog-submit\" (click)=\"onSubmit()\">{{ submitLabel | translate }}</button>\n</mat-dialog-actions>\n", styles: [".aca-edit-rule-dialog-container{--edit-rule-dialog-padding: 8px 20px}.aca-edit-rule-dialog-container .mat-dialog-container{padding:0}.aca-edit-rule-dialog__header{display:flex;align-items:center;margin:0;padding:var(--edit-rule-dialog-padding);box-sizing:border-box;border-bottom:1px solid var(--theme-border-color)}.aca-edit-rule-dialog__header__title{font-size:16px;font-weight:700;flex-grow:1}.aca-edit-rule-dialog__header__close mat-icon{font-size:18px}.aca-edit-rule-dialog__content{margin:0;padding:0}.aca-edit-rule-dialog__content__spinner{display:flex;align-items:center;justify-content:center;margin:20px 0}.aca-edit-rule-dialog__footer{margin:0;padding:var(--edit-rule-dialog-padding);box-sizing:border-box;border-top:1px solid var(--theme-border-color)}\n"], dependencies: [{ kind: "component", type: i3$2.MatButton, selector: "button[mat-button], button[mat-raised-button], button[mat-icon-button], button[mat-fab], button[mat-mini-fab], button[mat-stroked-button], button[mat-flat-button]", inputs: ["disabled", "disableRipple", "color"], exportAs: ["matButton"] }, { kind: "directive", type: i2.MatDialogClose, selector: "[mat-dialog-close], [matDialogClose]", inputs: ["aria-label", "type", "mat-dialog-close", "matDialogClose"], exportAs: ["matDialogClose"] }, { kind: "directive", type: i2.MatDialogTitle, selector: "[mat-dialog-title], [matDialogTitle]", inputs: ["id"], exportAs: ["matDialogTitle"] }, { kind: "directive", type: i2.MatDialogContent, selector: "[mat-dialog-content], mat-dialog-content, [matDialogContent]" }, { kind: "directive", type: i2.MatDialogActions, selector: "[mat-dialog-actions], mat-dialog-actions, [matDialogActions]", inputs: ["align"] }, { kind: "component", type: i4.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "component", type: RuleDetailsUiComponent, selector: "aca-rule-details", inputs: ["readOnly", "value", "preview", "actionDefinitions", "parameterConstraints", "nodeId"], outputs: ["formValidationChanged", "formValueChanged"] }, { kind: "pipe", type: i1$1.AsyncPipe, name: "async" }, { kind: "pipe", type: i3.TranslatePipe, name: "translate" }], encapsulation: i0.ViewEncapsulation.None });
|
|
1494
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.1.3", ngImport: i0, type: EditRuleDialogUiComponent, decorators: [{
|
|
1495
|
+
type: Component,
|
|
1496
|
+
args: [{ selector: 'aca-edit-rule-dialog', encapsulation: ViewEncapsulation.None, host: { class: 'aca-edit-rule-dialog' }, template: "<div mat-dialog-title class=\"aca-edit-rule-dialog__header\">\n <div class=\"aca-edit-rule-dialog__header__title\" data-automation-id=\"edit-rule-dialog-title\">\n {{ title | translate }}\n </div>\n <button mat-icon-button mat-dialog-close class=\"aca-edit-rule-dialog__header__close\" tabindex=\"-1\">\n <mat-icon>close</mat-icon>\n </button>\n</div>\n\n<mat-dialog-content class=\"aca-edit-rule-dialog__content\">\n <aca-rule-details\n [actionDefinitions]=\"actionDefinitions$ | async\"\n [parameterConstraints]=\"parameterConstraints$ | async\"\n [value]=\"model\"\n [nodeId]=\"nodeId\"\n (formValueChanged)=\"formValue = $event\"\n (formValidationChanged)=\"onFormValidChange($event)\">\n </aca-rule-details>\n</mat-dialog-content>\n\n<mat-dialog-actions align=\"end\" class=\"aca-edit-rule-dialog__footer\">\n <button mat-flat-button mat-dialog-close>{{ 'ACA_FOLDER_RULES.EDIT_RULE_DIALOG.CANCEL' | translate }}</button>\n <button mat-flat-button color=\"primary\" [disabled]=\"!formValid\" data-automation-id=\"edit-rule-dialog-submit\" (click)=\"onSubmit()\">{{ submitLabel | translate }}</button>\n</mat-dialog-actions>\n", styles: [".aca-edit-rule-dialog-container{--edit-rule-dialog-padding: 8px 20px}.aca-edit-rule-dialog-container .mat-dialog-container{padding:0}.aca-edit-rule-dialog__header{display:flex;align-items:center;margin:0;padding:var(--edit-rule-dialog-padding);box-sizing:border-box;border-bottom:1px solid var(--theme-border-color)}.aca-edit-rule-dialog__header__title{font-size:16px;font-weight:700;flex-grow:1}.aca-edit-rule-dialog__header__close mat-icon{font-size:18px}.aca-edit-rule-dialog__content{margin:0;padding:0}.aca-edit-rule-dialog__content__spinner{display:flex;align-items:center;justify-content:center;margin:20px 0}.aca-edit-rule-dialog__footer{margin:0;padding:var(--edit-rule-dialog-padding);box-sizing:border-box;border-top:1px solid var(--theme-border-color)}\n"] }]
|
|
1497
|
+
}], ctorParameters: function () {
|
|
1498
|
+
return [{ type: undefined, decorators: [{
|
|
1499
|
+
type: Inject,
|
|
1500
|
+
args: [MAT_DIALOG_DATA]
|
|
1501
|
+
}] }];
|
|
1502
|
+
}, propDecorators: { submitted: [{
|
|
1503
|
+
type: Output
|
|
1504
|
+
}] } });
|
|
1505
|
+
|
|
1506
|
+
class FolderRuleSetsService {
|
|
1507
|
+
constructor(apiService, contentApi, folderRulesService) {
|
|
1508
|
+
this.apiService = apiService;
|
|
1509
|
+
this.contentApi = contentApi;
|
|
1510
|
+
this.folderRulesService = folderRulesService;
|
|
1511
|
+
this.currentFolder = null;
|
|
1512
|
+
this.mainRuleSet = null;
|
|
1513
|
+
this.inheritedRuleSets = [];
|
|
1514
|
+
this.hasMoreRuleSets = true;
|
|
1515
|
+
this.mainRuleSetSource = new BehaviorSubject(null);
|
|
1516
|
+
this.inheritedRuleSetsSource = new BehaviorSubject([]);
|
|
1517
|
+
this.hasMoreRuleSetsSource = new BehaviorSubject(true);
|
|
1518
|
+
this.folderInfoSource = new BehaviorSubject(null);
|
|
1519
|
+
this.isLoadingSource = new BehaviorSubject(false);
|
|
1520
|
+
this.mainRuleSet$ = this.mainRuleSetSource.asObservable();
|
|
1521
|
+
this.inheritedRuleSets$ = this.inheritedRuleSetsSource.asObservable();
|
|
1522
|
+
this.hasMoreRuleSets$ = this.hasMoreRuleSetsSource.asObservable();
|
|
1523
|
+
this.folderInfo$ = this.folderInfoSource.asObservable();
|
|
1524
|
+
this.isLoading$ = this.isLoadingSource.asObservable();
|
|
1525
|
+
this.selectedRuleSet$ = this.folderRulesService.selectedRule$.pipe(map((rule) => {
|
|
1526
|
+
var _a, _b;
|
|
1527
|
+
if (rule === null) {
|
|
1528
|
+
return null;
|
|
1529
|
+
}
|
|
1530
|
+
if (((_a = this.mainRuleSet) === null || _a === void 0 ? void 0 : _a.rules.findIndex((r) => r.id === rule.id)) > -1) {
|
|
1531
|
+
return this.mainRuleSet;
|
|
1532
|
+
}
|
|
1533
|
+
return (_b = this.inheritedRuleSets.find((ruleSet) => ruleSet.rules.findIndex((r) => r.id === rule.id) > -1)) !== null && _b !== void 0 ? _b : null;
|
|
1534
|
+
}));
|
|
1535
|
+
}
|
|
1536
|
+
static isOwnedRuleSet(ruleSet, nodeId) {
|
|
1537
|
+
var _a;
|
|
1538
|
+
return ((_a = ruleSet === null || ruleSet === void 0 ? void 0 : ruleSet.owningFolder) === null || _a === void 0 ? void 0 : _a.id) === nodeId;
|
|
1539
|
+
}
|
|
1540
|
+
static isLinkedRuleSet(ruleSet, nodeId) {
|
|
1541
|
+
return (ruleSet === null || ruleSet === void 0 ? void 0 : ruleSet.linkedToBy.indexOf(nodeId)) > -1;
|
|
1542
|
+
}
|
|
1543
|
+
static isMainRuleSet(ruleSet, nodeId) {
|
|
1544
|
+
return this.isOwnedRuleSet(ruleSet, nodeId) || this.isLinkedRuleSet(ruleSet, nodeId);
|
|
1545
|
+
}
|
|
1546
|
+
static isInheritedRuleSet(ruleSet, nodeId) {
|
|
1547
|
+
return !this.isMainRuleSet(ruleSet, nodeId);
|
|
1548
|
+
}
|
|
1549
|
+
callApi(path, httpMethod, body = {}) {
|
|
1550
|
+
// APIs used by this service are still private and not yet available for public use
|
|
1551
|
+
const params = [{}, {}, {}, {}, body, ['application/json'], ['application/json']];
|
|
1552
|
+
return this.apiService.getInstance().contentPrivateClient.callApi(path, httpMethod, ...params);
|
|
1553
|
+
}
|
|
1554
|
+
getMainRuleSet(nodeId) {
|
|
1555
|
+
return from(this.callApi(`/nodes/${nodeId}/rule-sets/-default-?include=isLinkedTo,owningFolder,linkedToBy`, 'GET')).pipe(catchError((error) => {
|
|
1556
|
+
if (error.status === 404) {
|
|
1557
|
+
return of({ entry: null });
|
|
1558
|
+
}
|
|
1559
|
+
return of(error);
|
|
1560
|
+
}), switchMap((res) => this.formatRuleSet(res.entry)));
|
|
1561
|
+
}
|
|
1562
|
+
getInheritedRuleSets(nodeId, skipCount = 0) {
|
|
1563
|
+
return from(this.callApi(`/nodes/${nodeId}/rule-sets?include=isLinkedTo,owningFolder,linkedToBy&skipCount=${skipCount}&maxItems=${FolderRuleSetsService.MAX_RULE_SETS_PER_GET}`, 'GET')).pipe(tap((res) => {
|
|
1564
|
+
var _a;
|
|
1565
|
+
if ((_a = res === null || res === void 0 ? void 0 : res.list) === null || _a === void 0 ? void 0 : _a.pagination) {
|
|
1566
|
+
this.hasMoreRuleSets = res.list.pagination.hasMoreItems;
|
|
1567
|
+
}
|
|
1568
|
+
}), switchMap((res) => this.formatRuleSets(res)), map((ruleSets) => ruleSets.filter((ruleSet) => FolderRuleSetsService.isInheritedRuleSet(ruleSet, this.currentFolder.id))));
|
|
1569
|
+
}
|
|
1570
|
+
loadRuleSets(nodeId, loadInheritedRuleSets = true) {
|
|
1571
|
+
this.isLoadingSource.next(true);
|
|
1572
|
+
this.mainRuleSet = null;
|
|
1573
|
+
this.inheritedRuleSets = [];
|
|
1574
|
+
this.hasMoreRuleSets = true;
|
|
1575
|
+
this.currentFolder = null;
|
|
1576
|
+
this.mainRuleSetSource.next(this.mainRuleSet);
|
|
1577
|
+
this.inheritedRuleSetsSource.next(this.inheritedRuleSets);
|
|
1578
|
+
this.hasMoreRuleSetsSource.next(this.hasMoreRuleSets);
|
|
1579
|
+
this.getNodeInfo(nodeId)
|
|
1580
|
+
.pipe(tap((nodeInfo) => {
|
|
1581
|
+
this.currentFolder = nodeInfo;
|
|
1582
|
+
this.folderInfoSource.next(this.currentFolder);
|
|
1583
|
+
}), switchMap(() => combineLatest(this.getMainRuleSet(nodeId), loadInheritedRuleSets ? this.getInheritedRuleSets(nodeId) : of([]))), finalize(() => this.isLoadingSource.next(false)))
|
|
1584
|
+
.subscribe(([mainRuleSet, inheritedRuleSets]) => {
|
|
1585
|
+
var _a;
|
|
1586
|
+
this.mainRuleSet = mainRuleSet;
|
|
1587
|
+
this.inheritedRuleSets = inheritedRuleSets;
|
|
1588
|
+
this.mainRuleSetSource.next(mainRuleSet);
|
|
1589
|
+
this.inheritedRuleSetsSource.next(inheritedRuleSets);
|
|
1590
|
+
this.hasMoreRuleSetsSource.next(this.hasMoreRuleSets);
|
|
1591
|
+
const ruleToSelect = (_a = mainRuleSet === null || mainRuleSet === void 0 ? void 0 : mainRuleSet.rules.find((r) => FolderRuleSetsService.isOwnedRuleSet(mainRuleSet, nodeId) || r.isEnabled)) !== null && _a !== void 0 ? _a : inheritedRuleSets.reduce((foundRule, ruleSet) => foundRule !== null && foundRule !== void 0 ? foundRule : ruleSet.rules.find((r) => r.isEnabled), null);
|
|
1592
|
+
this.folderRulesService.selectRule(ruleToSelect);
|
|
1593
|
+
});
|
|
1594
|
+
}
|
|
1595
|
+
loadMoreInheritedRuleSets() {
|
|
1596
|
+
this.isLoadingSource.next(true);
|
|
1597
|
+
this.getInheritedRuleSets(this.currentFolder.id, this.inheritedRuleSets.length)
|
|
1598
|
+
.pipe(finalize(() => this.isLoadingSource.next(false)))
|
|
1599
|
+
.subscribe((ruleSets) => {
|
|
1600
|
+
this.inheritedRuleSets.push(...ruleSets);
|
|
1601
|
+
this.inheritedRuleSetsSource.next(this.inheritedRuleSets);
|
|
1602
|
+
this.hasMoreRuleSetsSource.next(this.hasMoreRuleSets);
|
|
1603
|
+
});
|
|
1604
|
+
}
|
|
1605
|
+
getNodeInfo(nodeId) {
|
|
1606
|
+
if (nodeId) {
|
|
1607
|
+
return this.contentApi.getNode(nodeId).pipe(catchError((error) => {
|
|
1608
|
+
if (error.status === 404) {
|
|
1609
|
+
return of({ entry: null });
|
|
1610
|
+
}
|
|
1611
|
+
return of(error);
|
|
1612
|
+
}), map((entry) => entry.entry));
|
|
1613
|
+
}
|
|
1614
|
+
else {
|
|
1615
|
+
return of(null);
|
|
1616
|
+
}
|
|
1617
|
+
}
|
|
1618
|
+
formatRuleSets(res) {
|
|
1619
|
+
var _a;
|
|
1620
|
+
return ((_a = res === null || res === void 0 ? void 0 : res.list) === null || _a === void 0 ? void 0 : _a.entries) && res.list.entries instanceof Array
|
|
1621
|
+
? combineLatest(res.list.entries.map((entry) => this.formatRuleSet(entry.entry)))
|
|
1622
|
+
: of([]);
|
|
1623
|
+
}
|
|
1624
|
+
formatRuleSet(entry) {
|
|
1625
|
+
var _a;
|
|
1626
|
+
if (!entry) {
|
|
1627
|
+
return of(null);
|
|
1628
|
+
}
|
|
1629
|
+
return combineLatest(((_a = this.currentFolder) === null || _a === void 0 ? void 0 : _a.id) === entry.owningFolder ? of(this.currentFolder) : this.getNodeInfo(entry.owningFolder || ''), this.folderRulesService.getRules(this.currentFolder.id || '', entry.id)).pipe(map(([owningFolderNodeInfo, getRulesRes]) => ({
|
|
1630
|
+
id: entry.id,
|
|
1631
|
+
isLinkedTo: entry.isLinkedTo || false,
|
|
1632
|
+
owningFolder: owningFolderNodeInfo,
|
|
1633
|
+
linkedToBy: entry.linkedToBy || [],
|
|
1634
|
+
rules: getRulesRes.rules,
|
|
1635
|
+
hasMoreRules: getRulesRes.hasMoreRules,
|
|
1636
|
+
loadingRules: false
|
|
1637
|
+
})));
|
|
1638
|
+
}
|
|
1639
|
+
removeRuleFromMainRuleSet(ruleId) {
|
|
1640
|
+
var _a, _b, _c, _d;
|
|
1641
|
+
if (this.mainRuleSet) {
|
|
1642
|
+
const index = this.mainRuleSet.rules.findIndex((rule) => rule.id === ruleId);
|
|
1643
|
+
if (index > -1) {
|
|
1644
|
+
if (this.mainRuleSet.rules.length > 1) {
|
|
1645
|
+
this.mainRuleSet.rules.splice(index, 1);
|
|
1646
|
+
}
|
|
1647
|
+
else {
|
|
1648
|
+
this.mainRuleSet = null;
|
|
1649
|
+
this.mainRuleSetSource.next(this.mainRuleSet);
|
|
1650
|
+
}
|
|
1651
|
+
this.folderRulesService.selectRule((_d = (_b = (_a = this.mainRuleSet) === null || _a === void 0 ? void 0 : _a.rules[0]) !== null && _b !== void 0 ? _b : (_c = this.inheritedRuleSets[0]) === null || _c === void 0 ? void 0 : _c.rules[0]) !== null && _d !== void 0 ? _d : null);
|
|
1652
|
+
}
|
|
1653
|
+
}
|
|
1654
|
+
}
|
|
1655
|
+
addOrUpdateRuleInMainRuleSet(newRule) {
|
|
1656
|
+
if (this.mainRuleSet) {
|
|
1657
|
+
const index = this.mainRuleSet.rules.findIndex((rule) => rule.id === newRule.id);
|
|
1658
|
+
if (index > -1) {
|
|
1659
|
+
this.mainRuleSet.rules.splice(index, 1, newRule);
|
|
1660
|
+
}
|
|
1661
|
+
else {
|
|
1662
|
+
this.mainRuleSet.rules.push(newRule);
|
|
1663
|
+
}
|
|
1664
|
+
this.folderRulesService.selectRule(newRule);
|
|
1665
|
+
}
|
|
1666
|
+
else {
|
|
1667
|
+
this.refreshMainRuleSet(newRule);
|
|
1668
|
+
}
|
|
1669
|
+
}
|
|
1670
|
+
refreshMainRuleSet(ruleToSelect = null) {
|
|
1671
|
+
this.getMainRuleSet(this.currentFolder.id).subscribe((mainRuleSet) => {
|
|
1672
|
+
this.mainRuleSet = Object.assign({}, mainRuleSet);
|
|
1673
|
+
this.mainRuleSetSource.next(this.mainRuleSet);
|
|
1674
|
+
if (mainRuleSet) {
|
|
1675
|
+
const ruleToSelectInRuleSet = ruleToSelect ? mainRuleSet.rules.find((rule) => rule.id === ruleToSelect.id) : mainRuleSet.rules[0];
|
|
1676
|
+
this.folderRulesService.selectRule(ruleToSelectInRuleSet);
|
|
1677
|
+
}
|
|
1678
|
+
});
|
|
1679
|
+
}
|
|
1680
|
+
createRuleSetLink(folderIdToCreateLink, folderIdToLinkFrom) {
|
|
1681
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
1682
|
+
const data = {
|
|
1683
|
+
id: folderIdToLinkFrom
|
|
1684
|
+
};
|
|
1685
|
+
return this.callApi(`/nodes/${folderIdToCreateLink}/rule-set-links`, 'POST', data);
|
|
1686
|
+
});
|
|
1687
|
+
}
|
|
1688
|
+
deleteRuleSetLink(folderIdToDeleteLink, ruleSetIdToDelete) {
|
|
1689
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
1690
|
+
return this.callApi(`/nodes/${folderIdToDeleteLink}/rule-set-links/${ruleSetIdToDelete}`, 'DELETE');
|
|
1691
|
+
});
|
|
1692
|
+
}
|
|
1693
|
+
}
|
|
1694
|
+
FolderRuleSetsService.MAX_RULE_SETS_PER_GET = 100;
|
|
1695
|
+
FolderRuleSetsService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.1.3", ngImport: i0, type: FolderRuleSetsService, deps: [{ token: i1.AlfrescoApiService }, { token: i13.ContentApiService }, { token: FolderRulesService }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
1696
|
+
FolderRuleSetsService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.1.3", ngImport: i0, type: FolderRuleSetsService, providedIn: 'root' });
|
|
1697
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.1.3", ngImport: i0, type: FolderRuleSetsService, decorators: [{
|
|
1698
|
+
type: Injectable,
|
|
1699
|
+
args: [{
|
|
1700
|
+
providedIn: 'root'
|
|
1701
|
+
}]
|
|
1702
|
+
}], ctorParameters: function () { return [{ type: i1.AlfrescoApiService }, { type: i13.ContentApiService }, { type: FolderRulesService }]; } });
|
|
1703
|
+
|
|
1704
|
+
/*!
|
|
1705
|
+
* Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved.
|
|
1706
|
+
*
|
|
1707
|
+
* Alfresco Example Content Application
|
|
1708
|
+
*
|
|
1709
|
+
* This file is part of the Alfresco Example Content Application.
|
|
1710
|
+
* If the software was purchased under a paid Alfresco license, the terms of
|
|
1711
|
+
* the paid license agreement will prevail. Otherwise, the software is
|
|
1712
|
+
* provided under the following open source license terms:
|
|
1713
|
+
*
|
|
1714
|
+
* The Alfresco Example Content Application is free software: you can redistribute it and/or modify
|
|
1715
|
+
* it under the terms of the GNU Lesser General Public License as published by
|
|
1716
|
+
* the Free Software Foundation, either version 3 of the License, or
|
|
1717
|
+
* (at your option) any later version.
|
|
1718
|
+
*
|
|
1719
|
+
* The Alfresco Example Content Application is distributed in the hope that it will be useful,
|
|
1720
|
+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
1721
|
+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
1722
|
+
* GNU Lesser General Public License for more details.
|
|
1723
|
+
*
|
|
1724
|
+
* You should have received a copy of the GNU Lesser General Public License
|
|
1725
|
+
* from Hyland Software. If not, see <http://www.gnu.org/licenses/>.
|
|
1726
|
+
*/
|
|
1727
|
+
class RuleListItemUiComponent {
|
|
1728
|
+
constructor() {
|
|
1729
|
+
this.showEnabledToggle = false;
|
|
1730
|
+
this.enabledChanged = new EventEmitter();
|
|
1731
|
+
}
|
|
1732
|
+
onToggleClick(isEnabled, event) {
|
|
1733
|
+
event.stopPropagation();
|
|
1734
|
+
this.rule.isEnabled = !this.rule.isEnabled;
|
|
1735
|
+
this.enabledChanged.emit(isEnabled);
|
|
1736
|
+
}
|
|
1737
|
+
}
|
|
1738
|
+
RuleListItemUiComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.1.3", ngImport: i0, type: RuleListItemUiComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
1739
|
+
RuleListItemUiComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.1.3", type: RuleListItemUiComponent, selector: "aca-rule-list-item", inputs: { rule: "rule", isSelected: "isSelected", showEnabledToggle: "showEnabledToggle" }, outputs: { enabledChanged: "enabledChanged" }, host: { properties: { "class.selected": "this.isSelected" }, classAttribute: "aca-rule-list-item" }, ngImport: i0, template: "<div class=\"aca-rule-list-item__header\">\n\n <span class=\"aca-rule-list-item__header__name\">{{ rule.name }}</span>\n\n <mat-slide-toggle\n *ngIf=\"showEnabledToggle\"\n [checked]=\"rule.isEnabled\"\n (click)=\"onToggleClick(!rule.isEnabled, $event)\">\n </mat-slide-toggle>\n\n</div>\n<div class=\"aca-rule-list-item__description\">{{ rule.description }}</div>\n", styles: [".aca-rule-list-item{display:flex;flex-direction:column;gap:4px;padding:12px 20px;cursor:pointer}.aca-rule-list-item p{margin:6px 0 0;color:#212328b3;font-style:normal;font-weight:400;font-size:12px;line-height:16px}.aca-rule-list-item__header{display:flex;justify-content:space-between;align-items:flex-end}.aca-rule-list-item__header__name{font-size:1.2em;font-weight:700;overflow:hidden;text-overflow:ellipsis}.aca-rule-list-item__description{font-size:.8em;font-style:italic;overflow:hidden;text-overflow:ellipsis}.aca-rule-list-item.selected{background:var(--theme-selected-button-bg-color)}\n"], dependencies: [{ kind: "directive", type: i1$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: i2$3.MatSlideToggle, selector: "mat-slide-toggle", inputs: ["disabled", "disableRipple", "color", "tabIndex"], exportAs: ["matSlideToggle"] }], encapsulation: i0.ViewEncapsulation.None });
|
|
1740
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.1.3", ngImport: i0, type: RuleListItemUiComponent, decorators: [{
|
|
1741
|
+
type: Component,
|
|
1742
|
+
args: [{ selector: 'aca-rule-list-item', encapsulation: ViewEncapsulation.None, host: { class: 'aca-rule-list-item' }, template: "<div class=\"aca-rule-list-item__header\">\n\n <span class=\"aca-rule-list-item__header__name\">{{ rule.name }}</span>\n\n <mat-slide-toggle\n *ngIf=\"showEnabledToggle\"\n [checked]=\"rule.isEnabled\"\n (click)=\"onToggleClick(!rule.isEnabled, $event)\">\n </mat-slide-toggle>\n\n</div>\n<div class=\"aca-rule-list-item__description\">{{ rule.description }}</div>\n", styles: [".aca-rule-list-item{display:flex;flex-direction:column;gap:4px;padding:12px 20px;cursor:pointer}.aca-rule-list-item p{margin:6px 0 0;color:#212328b3;font-style:normal;font-weight:400;font-size:12px;line-height:16px}.aca-rule-list-item__header{display:flex;justify-content:space-between;align-items:flex-end}.aca-rule-list-item__header__name{font-size:1.2em;font-weight:700;overflow:hidden;text-overflow:ellipsis}.aca-rule-list-item__description{font-size:.8em;font-style:italic;overflow:hidden;text-overflow:ellipsis}.aca-rule-list-item.selected{background:var(--theme-selected-button-bg-color)}\n"] }]
|
|
1743
|
+
}], propDecorators: { rule: [{
|
|
1744
|
+
type: Input
|
|
1745
|
+
}], isSelected: [{
|
|
1746
|
+
type: Input
|
|
1747
|
+
}, {
|
|
1748
|
+
type: HostBinding,
|
|
1749
|
+
args: ['class.selected']
|
|
1750
|
+
}], showEnabledToggle: [{
|
|
1751
|
+
type: Input
|
|
1752
|
+
}], enabledChanged: [{
|
|
1753
|
+
type: Output
|
|
1754
|
+
}] } });
|
|
1755
|
+
|
|
1756
|
+
/*!
|
|
1757
|
+
* Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved.
|
|
1758
|
+
*
|
|
1759
|
+
* Alfresco Example Content Application
|
|
1760
|
+
*
|
|
1761
|
+
* This file is part of the Alfresco Example Content Application.
|
|
1762
|
+
* If the software was purchased under a paid Alfresco license, the terms of
|
|
1763
|
+
* the paid license agreement will prevail. Otherwise, the software is
|
|
1764
|
+
* provided under the following open source license terms:
|
|
1765
|
+
*
|
|
1766
|
+
* The Alfresco Example Content Application is free software: you can redistribute it and/or modify
|
|
1767
|
+
* it under the terms of the GNU Lesser General Public License as published by
|
|
1768
|
+
* the Free Software Foundation, either version 3 of the License, or
|
|
1769
|
+
* (at your option) any later version.
|
|
1770
|
+
*
|
|
1771
|
+
* The Alfresco Example Content Application is distributed in the hope that it will be useful,
|
|
1772
|
+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
1773
|
+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
1774
|
+
* GNU Lesser General Public License for more details.
|
|
1775
|
+
*
|
|
1776
|
+
* You should have received a copy of the GNU Lesser General Public License
|
|
1777
|
+
* from Hyland Software. If not, see <http://www.gnu.org/licenses/>.
|
|
1778
|
+
*/
|
|
1779
|
+
class RuleSetPickerSmartComponent {
|
|
1780
|
+
constructor(data, folderRuleSetsService, dialogRef, notificationService) {
|
|
1781
|
+
var _a, _b, _c, _d, _e, _f;
|
|
1782
|
+
this.data = data;
|
|
1783
|
+
this.folderRuleSetsService = folderRuleSetsService;
|
|
1784
|
+
this.dialogRef = dialogRef;
|
|
1785
|
+
this.notificationService = notificationService;
|
|
1786
|
+
this.nodeId = '-root-';
|
|
1787
|
+
this.defaultNodeId = '-root-';
|
|
1788
|
+
this.isBusy = false;
|
|
1789
|
+
this.existingRuleSet = null;
|
|
1790
|
+
this.hasOwnedRules = false;
|
|
1791
|
+
this.selectedNodeId = '';
|
|
1792
|
+
this.folderLoading$ = new BehaviorSubject(true);
|
|
1793
|
+
this.mainRuleSet$ = this.folderRuleSetsService.mainRuleSet$;
|
|
1794
|
+
this.rulesLoading$ = combineLatest(this.folderRuleSetsService.isLoading$, this.folderLoading$).pipe(map(([rulesLoading, folderLoading]) => rulesLoading || folderLoading));
|
|
1795
|
+
this.onDestroy$ = new Subject();
|
|
1796
|
+
this.nodeId = (_b = (_a = this.data) === null || _a === void 0 ? void 0 : _a.nodeId) !== null && _b !== void 0 ? _b : '-root-';
|
|
1797
|
+
this.defaultNodeId = (_d = (_c = this.data) === null || _c === void 0 ? void 0 : _c.defaultNodeId) !== null && _d !== void 0 ? _d : '-root-';
|
|
1798
|
+
this.existingRuleSet = (_f = (_e = this.data) === null || _e === void 0 ? void 0 : _e.existingRuleSet) !== null && _f !== void 0 ? _f : null;
|
|
1799
|
+
}
|
|
1800
|
+
ngOnInit() {
|
|
1801
|
+
this.mainRuleSet$.pipe(takeUntil(this.onDestroy$)).subscribe((mainRuleSet) => {
|
|
1802
|
+
this.hasOwnedRules = (mainRuleSet === null || mainRuleSet === void 0 ? void 0 : mainRuleSet.rules.length) > 0 && FolderRuleSetsService.isOwnedRuleSet(mainRuleSet, this.selectedNodeId);
|
|
1803
|
+
});
|
|
1804
|
+
}
|
|
1805
|
+
ngOnDestroy() {
|
|
1806
|
+
this.onDestroy$.next();
|
|
1807
|
+
this.onDestroy$.complete();
|
|
1808
|
+
}
|
|
1809
|
+
onNodeSelect(nodes) {
|
|
1810
|
+
if ((nodes === null || nodes === void 0 ? void 0 : nodes.length) && nodes[0].isFolder && nodes[0].id !== this.selectedNodeId) {
|
|
1811
|
+
this.selectedNodeId = nodes[0].id;
|
|
1812
|
+
this.folderRuleSetsService.loadRuleSets(this.selectedNodeId, false);
|
|
1813
|
+
}
|
|
1814
|
+
}
|
|
1815
|
+
setFolderLoading(isLoading) {
|
|
1816
|
+
this.folderLoading$.next(isLoading);
|
|
1817
|
+
}
|
|
1818
|
+
onSubmit() {
|
|
1819
|
+
this.isBusy = true;
|
|
1820
|
+
from(this.existingRuleSet ? this.folderRuleSetsService.deleteRuleSetLink(this.nodeId, this.existingRuleSet.id) : of(null))
|
|
1821
|
+
.pipe(switchMap(() => from(this.folderRuleSetsService.createRuleSetLink(this.nodeId, this.selectedNodeId))), finalize(() => {
|
|
1822
|
+
this.isBusy = false;
|
|
1823
|
+
}))
|
|
1824
|
+
.subscribe(() => {
|
|
1825
|
+
this.dialogRef.close(true);
|
|
1826
|
+
}, () => {
|
|
1827
|
+
this.handleError();
|
|
1828
|
+
});
|
|
1829
|
+
}
|
|
1830
|
+
handleError() {
|
|
1831
|
+
this.notificationService.showError('ACA_FOLDER_RULES.LINK_RULES_DIALOG.ERRORS.REQUEST_FAILED');
|
|
1832
|
+
}
|
|
1833
|
+
}
|
|
1834
|
+
RuleSetPickerSmartComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.1.3", ngImport: i0, type: RuleSetPickerSmartComponent, deps: [{ token: MAT_DIALOG_DATA }, { token: FolderRuleSetsService }, { token: i2.MatDialogRef }, { token: i1.NotificationService }], target: i0.ɵɵFactoryTarget.Component });
|
|
1835
|
+
RuleSetPickerSmartComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.1.3", type: RuleSetPickerSmartComponent, selector: "aca-rule-set-picker", host: { classAttribute: "aca-rule-set-picker" }, providers: [FolderRuleSetsService], ngImport: i0, template: "<div mat-dialog-title class=\"aca-rule-set-picker__header\">\n <div class=\"aca-rule-set-picker__header__title\">\n {{ 'ACA_FOLDER_RULES.LINK_RULES_DIALOG.TITLE' | translate }}\n </div>\n <button mat-icon-button mat-dialog-close class=\"aca-rule-set-picker__header__close\" tabindex=\"-1\">\n <mat-icon>close</mat-icon>\n </button>\n</div>\n\n<mat-dialog-content class=\"aca-rule-set-picker__content\">\n <adf-content-node-selector-panel\n class=\"aca-rule-set-picker__content__node-selector\"\n [currentFolderId]=\"defaultNodeId\"\n (select)=\"onNodeSelect($event)\"\n (folderLoaded)=\"setFolderLoading(false)\"\n (navigationChange)=\"setFolderLoading(true)\"\n (siteChange)=\"setFolderLoading(true)\">\n </adf-content-node-selector-panel>\n\n <div class=\"aca-rule-set-picker__content__rule-list\" [ngClass]=\"{ justify: rulesLoading$ | async }\">\n <ng-container *ngIf=\"rulesLoading$ | async; else rulesLoaded\">\n <mat-progress-spinner color=\"primary\" mode=\"indeterminate\"></mat-progress-spinner>\n </ng-container>\n\n <ng-template #rulesLoaded>\n <ng-container *ngIf=\"hasOwnedRules; else noOwnedRules\">\n <div class=\"aca-rule-set-picker__content__rule-list__header\">\n {{ 'ACA_FOLDER_RULES.LINK_RULES_DIALOG.LIST_OF_RULES_TO_LINK' | translate }}\n </div>\n\n <aca-rule-list-item\n *ngFor=\"let rule of (mainRuleSet$ | async).rules\"\n [rule]=\"rule\">\n </aca-rule-list-item>\n </ng-container>\n\n <ng-template #noOwnedRules>\n <adf-empty-content\n icon=\"library_books\"\n [title]=\"'ACA_FOLDER_RULES.LINK_RULES_DIALOG.EMPTY_RULES_LIST.TITLE' | translate\"\n [subtitle]=\"'ACA_FOLDER_RULES.LINK_RULES_DIALOG.EMPTY_RULES_LIST.SUBTITLE' | translate\">\n </adf-empty-content>\n </ng-template>\n </ng-template>\n </div>\n</mat-dialog-content>\n\n<mat-dialog-actions align=\"end\" class=\"aca-rule-set-picker__footer\">\n <button mat-flat-button mat-dialog-close>\n {{ 'ACA_FOLDER_RULES.LINK_RULES_DIALOG.CANCEL' | translate }}\n </button>\n\n <button\n mat-flat-button color=\"primary\"\n [disabled]=\"!hasOwnedRules || isBusy\"\n (click)=\"onSubmit()\">\n {{ 'ACA_FOLDER_RULES.LINK_RULES_DIALOG.SUBMIT' | translate }}\n </button>\n</mat-dialog-actions>\n", styles: [".aca-rule-set-picker-container{--rule-set-picker-padding: 8px 20px}.aca-rule-set-picker-container .mat-dialog-container{padding:0}.aca-rule-set-picker__header{display:flex;align-items:center;margin:0;padding:var(--rule-set-picker-padding);box-sizing:border-box;border-bottom:1px solid var(--theme-border-color)}.aca-rule-set-picker__header__title{font-size:16px;font-weight:700;flex-grow:1}.aca-rule-set-picker__header__close mat-icon{font-size:18px}.aca-rule-set-picker__content{position:relative;height:80vh;margin:0;padding:0;display:grid;grid-template-columns:2fr minmax(250px,1fr)}.aca-rule-set-picker__content__node-selector{padding:0 20px;box-sizing:border-box}.aca-rule-set-picker__content__rule-list{padding:0 20px 0 0;display:flex;align-items:stretch;flex-direction:column;max-height:100%;overflow-y:auto;overflow-x:hidden}.aca-rule-set-picker__content__rule-list.justify{align-items:center;justify-content:center}.aca-rule-set-picker__content__rule-list__header{color:var(--theme-text-color);font-size:.9em;margin:8px 0}.aca-rule-set-picker__content__rule-list .aca-rule-list-item{cursor:default}.aca-rule-set-picker__footer{margin:0;padding:var(--rule-set-picker-padding);box-sizing:border-box;border-top:1px solid var(--theme-border-color)}\n"], dependencies: [{ kind: "directive", type: i1$1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i1$1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i1$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: i3$2.MatButton, selector: "button[mat-button], button[mat-raised-button], button[mat-icon-button], button[mat-fab], button[mat-mini-fab], button[mat-stroked-button], button[mat-flat-button]", inputs: ["disabled", "disableRipple", "color"], exportAs: ["matButton"] }, { kind: "directive", type: i2.MatDialogClose, selector: "[mat-dialog-close], [matDialogClose]", inputs: ["aria-label", "type", "mat-dialog-close", "matDialogClose"], exportAs: ["matDialogClose"] }, { kind: "directive", type: i2.MatDialogTitle, selector: "[mat-dialog-title], [matDialogTitle]", inputs: ["id"], exportAs: ["matDialogTitle"] }, { kind: "directive", type: i2.MatDialogContent, selector: "[mat-dialog-content], mat-dialog-content, [matDialogContent]" }, { kind: "directive", type: i2.MatDialogActions, selector: "[mat-dialog-actions], mat-dialog-actions, [matDialogActions]", inputs: ["align"] }, { kind: "component", type: i4.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "component", type: i7$1.MatProgressSpinner, selector: "mat-progress-spinner, mat-spinner", inputs: ["color", "diameter", "strokeWidth", "mode", "value"], exportAs: ["matProgressSpinner"] }, { kind: "component", type: i1.EmptyContentComponent, selector: "adf-empty-content", inputs: ["icon", "title", "subtitle"] }, { kind: "component", type: i8.ContentNodeSelectorPanelComponent, selector: "adf-content-node-selector-panel", inputs: ["restrictRootToCurrentFolderId", "currentFolderId", "dropdownHideMyFiles", "dropdownSiteList", "where", "rowFilter", "excludeSiteContent", "imageResolver", "pageSize", "selectionMode", "isSelectionValid", "breadcrumbTransform", "showSearch", "showDropdownSiteList", "showFilesInResult", "showNodeCounter"], outputs: ["select", "navigationChange", "siteChange", "showingSearch", "currentFolder", "folderLoaded"] }, { kind: "component", type: RuleListItemUiComponent, selector: "aca-rule-list-item", inputs: ["rule", "isSelected", "showEnabledToggle"], outputs: ["enabledChanged"] }, { kind: "pipe", type: i1$1.AsyncPipe, name: "async" }, { kind: "pipe", type: i3.TranslatePipe, name: "translate" }], encapsulation: i0.ViewEncapsulation.None });
|
|
1836
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.1.3", ngImport: i0, type: RuleSetPickerSmartComponent, decorators: [{
|
|
1837
|
+
type: Component,
|
|
1838
|
+
args: [{ selector: 'aca-rule-set-picker', encapsulation: ViewEncapsulation.None, host: { class: 'aca-rule-set-picker' }, providers: [FolderRuleSetsService], template: "<div mat-dialog-title class=\"aca-rule-set-picker__header\">\n <div class=\"aca-rule-set-picker__header__title\">\n {{ 'ACA_FOLDER_RULES.LINK_RULES_DIALOG.TITLE' | translate }}\n </div>\n <button mat-icon-button mat-dialog-close class=\"aca-rule-set-picker__header__close\" tabindex=\"-1\">\n <mat-icon>close</mat-icon>\n </button>\n</div>\n\n<mat-dialog-content class=\"aca-rule-set-picker__content\">\n <adf-content-node-selector-panel\n class=\"aca-rule-set-picker__content__node-selector\"\n [currentFolderId]=\"defaultNodeId\"\n (select)=\"onNodeSelect($event)\"\n (folderLoaded)=\"setFolderLoading(false)\"\n (navigationChange)=\"setFolderLoading(true)\"\n (siteChange)=\"setFolderLoading(true)\">\n </adf-content-node-selector-panel>\n\n <div class=\"aca-rule-set-picker__content__rule-list\" [ngClass]=\"{ justify: rulesLoading$ | async }\">\n <ng-container *ngIf=\"rulesLoading$ | async; else rulesLoaded\">\n <mat-progress-spinner color=\"primary\" mode=\"indeterminate\"></mat-progress-spinner>\n </ng-container>\n\n <ng-template #rulesLoaded>\n <ng-container *ngIf=\"hasOwnedRules; else noOwnedRules\">\n <div class=\"aca-rule-set-picker__content__rule-list__header\">\n {{ 'ACA_FOLDER_RULES.LINK_RULES_DIALOG.LIST_OF_RULES_TO_LINK' | translate }}\n </div>\n\n <aca-rule-list-item\n *ngFor=\"let rule of (mainRuleSet$ | async).rules\"\n [rule]=\"rule\">\n </aca-rule-list-item>\n </ng-container>\n\n <ng-template #noOwnedRules>\n <adf-empty-content\n icon=\"library_books\"\n [title]=\"'ACA_FOLDER_RULES.LINK_RULES_DIALOG.EMPTY_RULES_LIST.TITLE' | translate\"\n [subtitle]=\"'ACA_FOLDER_RULES.LINK_RULES_DIALOG.EMPTY_RULES_LIST.SUBTITLE' | translate\">\n </adf-empty-content>\n </ng-template>\n </ng-template>\n </div>\n</mat-dialog-content>\n\n<mat-dialog-actions align=\"end\" class=\"aca-rule-set-picker__footer\">\n <button mat-flat-button mat-dialog-close>\n {{ 'ACA_FOLDER_RULES.LINK_RULES_DIALOG.CANCEL' | translate }}\n </button>\n\n <button\n mat-flat-button color=\"primary\"\n [disabled]=\"!hasOwnedRules || isBusy\"\n (click)=\"onSubmit()\">\n {{ 'ACA_FOLDER_RULES.LINK_RULES_DIALOG.SUBMIT' | translate }}\n </button>\n</mat-dialog-actions>\n", styles: [".aca-rule-set-picker-container{--rule-set-picker-padding: 8px 20px}.aca-rule-set-picker-container .mat-dialog-container{padding:0}.aca-rule-set-picker__header{display:flex;align-items:center;margin:0;padding:var(--rule-set-picker-padding);box-sizing:border-box;border-bottom:1px solid var(--theme-border-color)}.aca-rule-set-picker__header__title{font-size:16px;font-weight:700;flex-grow:1}.aca-rule-set-picker__header__close mat-icon{font-size:18px}.aca-rule-set-picker__content{position:relative;height:80vh;margin:0;padding:0;display:grid;grid-template-columns:2fr minmax(250px,1fr)}.aca-rule-set-picker__content__node-selector{padding:0 20px;box-sizing:border-box}.aca-rule-set-picker__content__rule-list{padding:0 20px 0 0;display:flex;align-items:stretch;flex-direction:column;max-height:100%;overflow-y:auto;overflow-x:hidden}.aca-rule-set-picker__content__rule-list.justify{align-items:center;justify-content:center}.aca-rule-set-picker__content__rule-list__header{color:var(--theme-text-color);font-size:.9em;margin:8px 0}.aca-rule-set-picker__content__rule-list .aca-rule-list-item{cursor:default}.aca-rule-set-picker__footer{margin:0;padding:var(--rule-set-picker-padding);box-sizing:border-box;border-top:1px solid var(--theme-border-color)}\n"] }]
|
|
1839
|
+
}], ctorParameters: function () {
|
|
1840
|
+
return [{ type: undefined, decorators: [{
|
|
1841
|
+
type: Inject,
|
|
1842
|
+
args: [MAT_DIALOG_DATA]
|
|
1843
|
+
}] }, { type: FolderRuleSetsService }, { type: i2.MatDialogRef }, { type: i1.NotificationService }];
|
|
1844
|
+
} });
|
|
1845
|
+
|
|
1846
|
+
/*!
|
|
1847
|
+
* Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved.
|
|
1848
|
+
*
|
|
1849
|
+
* Alfresco Example Content Application
|
|
1850
|
+
*
|
|
1851
|
+
* This file is part of the Alfresco Example Content Application.
|
|
1852
|
+
* If the software was purchased under a paid Alfresco license, the terms of
|
|
1853
|
+
* the paid license agreement will prevail. Otherwise, the software is
|
|
1854
|
+
* provided under the following open source license terms:
|
|
1855
|
+
*
|
|
1856
|
+
* The Alfresco Example Content Application is free software: you can redistribute it and/or modify
|
|
1857
|
+
* it under the terms of the GNU Lesser General Public License as published by
|
|
1858
|
+
* the Free Software Foundation, either version 3 of the License, or
|
|
1859
|
+
* (at your option) any later version.
|
|
1860
|
+
*
|
|
1861
|
+
* The Alfresco Example Content Application is distributed in the hope that it will be useful,
|
|
1862
|
+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
1863
|
+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
1864
|
+
* GNU Lesser General Public License for more details.
|
|
1865
|
+
*
|
|
1866
|
+
* You should have received a copy of the GNU Lesser General Public License
|
|
1867
|
+
* from Hyland Software. If not, see <http://www.gnu.org/licenses/>.
|
|
1868
|
+
*/
|
|
1869
|
+
class ActionsService {
|
|
1870
|
+
constructor(apiService) {
|
|
1871
|
+
this.apiService = apiService;
|
|
1872
|
+
this.actionDefinitionsListingSource = new BehaviorSubject([]);
|
|
1873
|
+
this.actionDefinitionsListing$ = this.actionDefinitionsListingSource.asObservable();
|
|
1874
|
+
this.loadingSource = new BehaviorSubject(false);
|
|
1875
|
+
this.loading$ = this.loadingSource.asObservable();
|
|
1876
|
+
this.parameterConstraintsSource = new BehaviorSubject([]);
|
|
1877
|
+
this.parameterConstraints$ = this.parameterConstraintsSource.asObservable();
|
|
1878
|
+
}
|
|
1879
|
+
get actionsApi() {
|
|
1880
|
+
if (!this._actionsApi) {
|
|
1881
|
+
this._actionsApi = new ActionsApi(this.apiService.getInstance());
|
|
1882
|
+
}
|
|
1883
|
+
return this._actionsApi;
|
|
1884
|
+
}
|
|
1885
|
+
loadActionDefinitions() {
|
|
1886
|
+
this.loadingSource.next(true);
|
|
1887
|
+
from(this.actionsApi.listActions())
|
|
1888
|
+
.pipe(map((list) => list.list.entries.map((entry) => this.transformActionDefinition(entry))), finalize(() => this.loadingSource.next(false)))
|
|
1889
|
+
.subscribe((obj) => {
|
|
1890
|
+
this.actionDefinitionsListingSource.next(obj);
|
|
1891
|
+
});
|
|
1892
|
+
}
|
|
1893
|
+
getParameterConstraints(constraintName) {
|
|
1894
|
+
return from(this.publicApiCall(`/action-parameter-constraints/${constraintName}`, 'GET', [{}, {}, {}, {}, {}, ['application/json'], ['application/json']])).pipe(map((res) => res.entry.constraintValues.map((entry) => this.formatConstraint(entry))));
|
|
1895
|
+
}
|
|
1896
|
+
transformActionDefinition(obj) {
|
|
1897
|
+
var _a, _b, _c, _d, _e, _f, _g;
|
|
1898
|
+
if (this.isActionDefinitionEntry(obj)) {
|
|
1899
|
+
obj = obj.entry;
|
|
1900
|
+
}
|
|
1901
|
+
return {
|
|
1902
|
+
id: obj.id,
|
|
1903
|
+
name: (_a = obj.name) !== null && _a !== void 0 ? _a : '',
|
|
1904
|
+
description: (_b = obj.description) !== null && _b !== void 0 ? _b : '',
|
|
1905
|
+
title: (_d = (_c = obj.title) !== null && _c !== void 0 ? _c : obj.name) !== null && _d !== void 0 ? _d : '',
|
|
1906
|
+
applicableTypes: (_e = obj.applicableTypes) !== null && _e !== void 0 ? _e : [],
|
|
1907
|
+
trackStatus: (_f = obj.trackStatus) !== null && _f !== void 0 ? _f : false,
|
|
1908
|
+
parameterDefinitions: ((_g = obj.parameterDefinitions) !== null && _g !== void 0 ? _g : []).map((paramDef) => this.transformActionParameterDefinition(paramDef))
|
|
1909
|
+
};
|
|
1910
|
+
}
|
|
1911
|
+
transformActionParameterDefinition(obj) {
|
|
1912
|
+
var _a, _b, _c, _d, _e, _f, _g;
|
|
1913
|
+
return {
|
|
1914
|
+
name: (_a = obj.name) !== null && _a !== void 0 ? _a : '',
|
|
1915
|
+
type: (_b = obj.type) !== null && _b !== void 0 ? _b : '',
|
|
1916
|
+
multiValued: (_c = obj.multiValued) !== null && _c !== void 0 ? _c : false,
|
|
1917
|
+
mandatory: (_d = obj.mandatory) !== null && _d !== void 0 ? _d : false,
|
|
1918
|
+
displayLabel: (_f = (_e = obj.displayLabel) !== null && _e !== void 0 ? _e : obj.name) !== null && _f !== void 0 ? _f : '',
|
|
1919
|
+
parameterConstraintName: (_g = obj.parameterConstraintName) !== null && _g !== void 0 ? _g : ''
|
|
1920
|
+
};
|
|
1921
|
+
}
|
|
1922
|
+
isActionDefinitionEntry(obj) {
|
|
1923
|
+
return typeof obj.entry !== 'undefined';
|
|
1924
|
+
}
|
|
1925
|
+
publicApiCall(path, httpMethod, params) {
|
|
1926
|
+
return this.apiService.getInstance().contentClient.callApi(path, httpMethod, ...params);
|
|
1927
|
+
}
|
|
1928
|
+
formatConstraint(constraint) {
|
|
1929
|
+
var _a, _b;
|
|
1930
|
+
return {
|
|
1931
|
+
value: (_a = constraint.value) !== null && _a !== void 0 ? _a : '',
|
|
1932
|
+
label: (_b = constraint.label) !== null && _b !== void 0 ? _b : ''
|
|
1933
|
+
};
|
|
1934
|
+
}
|
|
1935
|
+
loadActionParameterConstraints(actionDefinitions) {
|
|
1936
|
+
of(actionDefinitions)
|
|
1937
|
+
.pipe(map((actionDefinition) => actionDefinition
|
|
1938
|
+
.map((obj) => obj.parameterDefinitions)
|
|
1939
|
+
.flat()
|
|
1940
|
+
.filter((parameterDefinition) => parameterDefinition.parameterConstraintName.length > 0)
|
|
1941
|
+
.map((parameterDefinition) => ({
|
|
1942
|
+
name: parameterDefinition.name,
|
|
1943
|
+
parameterConstraintName: parameterDefinition.parameterConstraintName,
|
|
1944
|
+
constraints: null
|
|
1945
|
+
}))), switchMap((parameterDefinitions) => forkJoin(...parameterDefinitions.map((parameterDefinition) => this.getParameterConstraints(parameterDefinition.parameterConstraintName).pipe(map((constraints) => ({ name: parameterDefinition.name, constraints })))))))
|
|
1946
|
+
.subscribe((res) => this.parameterConstraintsSource.next(res));
|
|
1947
|
+
}
|
|
1948
|
+
}
|
|
1949
|
+
ActionsService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.1.3", ngImport: i0, type: ActionsService, deps: [{ token: i1.AlfrescoApiService }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
1950
|
+
ActionsService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.1.3", ngImport: i0, type: ActionsService, providedIn: 'root' });
|
|
1951
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.1.3", ngImport: i0, type: ActionsService, decorators: [{
|
|
1952
|
+
type: Injectable,
|
|
1953
|
+
args: [{ providedIn: 'root' }]
|
|
1954
|
+
}], ctorParameters: function () { return [{ type: i1.AlfrescoApiService }]; } });
|
|
1955
|
+
|
|
1956
|
+
/*!
|
|
1957
|
+
* Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved.
|
|
1958
|
+
*
|
|
1959
|
+
* Alfresco Example Content Application
|
|
1960
|
+
*
|
|
1961
|
+
* This file is part of the Alfresco Example Content Application.
|
|
1962
|
+
* If the software was purchased under a paid Alfresco license, the terms of
|
|
1963
|
+
* the paid license agreement will prevail. Otherwise, the software is
|
|
1964
|
+
* provided under the following open source license terms:
|
|
1965
|
+
*
|
|
1966
|
+
* The Alfresco Example Content Application is free software: you can redistribute it and/or modify
|
|
1967
|
+
* it under the terms of the GNU Lesser General Public License as published by
|
|
1968
|
+
* the Free Software Foundation, either version 3 of the License, or
|
|
1969
|
+
* (at your option) any later version.
|
|
1970
|
+
*
|
|
1971
|
+
* The Alfresco Example Content Application is distributed in the hope that it will be useful,
|
|
1972
|
+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
1973
|
+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
1974
|
+
* GNU Lesser General Public License for more details.
|
|
1975
|
+
*
|
|
1976
|
+
* You should have received a copy of the GNU Lesser General Public License
|
|
1977
|
+
* from Hyland Software. If not, see <http://www.gnu.org/licenses/>.
|
|
1978
|
+
*/
|
|
1979
|
+
class RuleListGroupingUiComponent {
|
|
1980
|
+
constructor() {
|
|
1981
|
+
this.items = [];
|
|
1982
|
+
this.selectedRule = null;
|
|
1983
|
+
this.showEnabledToggles = false;
|
|
1984
|
+
this.selectRule = new EventEmitter();
|
|
1985
|
+
this.ruleEnabledChanged = new EventEmitter();
|
|
1986
|
+
this.loadMoreRules = new EventEmitter();
|
|
1987
|
+
this.loadMoreRuleSets = new EventEmitter();
|
|
1988
|
+
}
|
|
1989
|
+
onRuleClicked(rule) {
|
|
1990
|
+
this.selectRule.emit(rule);
|
|
1991
|
+
}
|
|
1992
|
+
isSelected(rule) {
|
|
1993
|
+
var _a;
|
|
1994
|
+
return rule.id === ((_a = this.selectedRule) === null || _a === void 0 ? void 0 : _a.id);
|
|
1995
|
+
}
|
|
1996
|
+
onEnabledChanged(rule, isEnabled) {
|
|
1997
|
+
this.ruleEnabledChanged.emit([rule, isEnabled]);
|
|
1998
|
+
}
|
|
1999
|
+
onClickLoadMoreRules(ruleSet) {
|
|
2000
|
+
this.loadMoreRules.emit(ruleSet);
|
|
2001
|
+
}
|
|
2002
|
+
onClickLoadMoreRuleSets() {
|
|
2003
|
+
this.loadMoreRuleSets.emit();
|
|
2004
|
+
}
|
|
2005
|
+
}
|
|
2006
|
+
RuleListGroupingUiComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.1.3", ngImport: i0, type: RuleListGroupingUiComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
2007
|
+
RuleListGroupingUiComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.1.3", type: RuleListGroupingUiComponent, selector: "aca-rule-list-grouping", inputs: { items: "items", selectedRule: "selectedRule", showEnabledToggles: "showEnabledToggles" }, outputs: { selectRule: "selectRule", ruleEnabledChanged: "ruleEnabledChanged", loadMoreRules: "loadMoreRules", loadMoreRuleSets: "loadMoreRuleSets" }, host: { classAttribute: "aca-rule-list-grouping" }, ngImport: i0, template: "<ng-container *ngFor=\"let item of items\">\n\n <aca-rule-list-item\n *ngIf=\"item.type === 'rule'; else loadMoreRules\"\n matRipple matRippleColor=\"hsla(0,0%,0%,0.05)\"\n tabindex=\"0\"\n [rule]=\"item.rule\"\n [isSelected]=\"item.rule.id === this.selectedRule?.id\"\n [showEnabledToggle]=\"showEnabledToggles\"\n (click)=\"onRuleClicked(item.rule)\"\n (enabledChanged)=\"onEnabledChanged(item.rule, $event)\">\n </aca-rule-list-item>\n\n <ng-template #loadMoreRules>\n <div\n *ngIf=\"item.type === 'load-more-rules'; else loadMoreRuleSets\"\n tabindex=\"0\"\n class=\"aca-rule-list-grouping__non-rule-item load-more\"\n matRipple matRippleColor=\"hsla(0,0%,0%,0.05)\"\n (click)=\"onClickLoadMoreRules(item.ruleSet)\"\n (keyup.enter)=\"onClickLoadMoreRules(item.ruleSet)\">\n {{ 'ACA_FOLDER_RULES.RULE_LIST.LOAD_MORE_RULES' | translate }}\n </div>\n </ng-template>\n\n <ng-template #loadMoreRuleSets>\n <div\n *ngIf=\"item.type === 'load-more-rule-sets'; else loadingRules\"\n tabindex=\"0\"\n class=\"aca-rule-list-grouping__non-rule-item load-more\"\n matRipple matRippleColor=\"hsla(0,0%,0%,0.05)\"\n (click)=\"onClickLoadMoreRuleSets()\"\n (keyup.enter)=\"onClickLoadMoreRuleSets()\">\n {{ 'ACA_FOLDER_RULES.RULE_LIST.LOAD_MORE_RULE_SETS' | translate }}\n </div>\n </ng-template>\n\n <ng-template #loadingRules>\n <div\n tabindex=\"0\"\n class=\"aca-rule-list-grouping__non-rule-item\"\n matRipple matRippleColor=\"hsla(0,0%,0%,0.05)\">\n <mat-spinner mode=\"indeterminate\" [diameter]=\"16\"></mat-spinner>\n {{ 'ACA_FOLDER_RULES.RULE_LIST.LOADING_RULES' | translate }}\n </div>\n </ng-template>\n\n</ng-container>\n", styles: [".aca-rule-list-grouping{display:flex;flex-direction:column}.aca-rule-list-grouping__non-rule-item{display:flex;flex-direction:row;justify-content:center;align-items:center;color:var(--theme-disabled-text-color);font-style:italic;text-align:center;padding:.5em 0}.aca-rule-list-grouping__non-rule-item.load-more{cursor:pointer}.aca-rule-list-grouping__non-rule-item:not(:last-child){border-bottom:1px solid var(--theme-border-color)}.aca-rule-list-grouping__non-rule-item .mat-spinner{margin-right:.5em}\n"], dependencies: [{ kind: "directive", type: i1$1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i1$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: i7$1.MatProgressSpinner, selector: "mat-progress-spinner, mat-spinner", inputs: ["color", "diameter", "strokeWidth", "mode", "value"], exportAs: ["matProgressSpinner"] }, { kind: "directive", type: i3$1.MatRipple, selector: "[mat-ripple], [matRipple]", inputs: ["matRippleColor", "matRippleUnbounded", "matRippleCentered", "matRippleRadius", "matRippleAnimation", "matRippleDisabled", "matRippleTrigger"], exportAs: ["matRipple"] }, { kind: "component", type: RuleListItemUiComponent, selector: "aca-rule-list-item", inputs: ["rule", "isSelected", "showEnabledToggle"], outputs: ["enabledChanged"] }, { kind: "pipe", type: i3.TranslatePipe, name: "translate" }], encapsulation: i0.ViewEncapsulation.None });
|
|
2008
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.1.3", ngImport: i0, type: RuleListGroupingUiComponent, decorators: [{
|
|
2009
|
+
type: Component,
|
|
2010
|
+
args: [{ selector: 'aca-rule-list-grouping', encapsulation: ViewEncapsulation.None, host: { class: 'aca-rule-list-grouping' }, template: "<ng-container *ngFor=\"let item of items\">\n\n <aca-rule-list-item\n *ngIf=\"item.type === 'rule'; else loadMoreRules\"\n matRipple matRippleColor=\"hsla(0,0%,0%,0.05)\"\n tabindex=\"0\"\n [rule]=\"item.rule\"\n [isSelected]=\"item.rule.id === this.selectedRule?.id\"\n [showEnabledToggle]=\"showEnabledToggles\"\n (click)=\"onRuleClicked(item.rule)\"\n (enabledChanged)=\"onEnabledChanged(item.rule, $event)\">\n </aca-rule-list-item>\n\n <ng-template #loadMoreRules>\n <div\n *ngIf=\"item.type === 'load-more-rules'; else loadMoreRuleSets\"\n tabindex=\"0\"\n class=\"aca-rule-list-grouping__non-rule-item load-more\"\n matRipple matRippleColor=\"hsla(0,0%,0%,0.05)\"\n (click)=\"onClickLoadMoreRules(item.ruleSet)\"\n (keyup.enter)=\"onClickLoadMoreRules(item.ruleSet)\">\n {{ 'ACA_FOLDER_RULES.RULE_LIST.LOAD_MORE_RULES' | translate }}\n </div>\n </ng-template>\n\n <ng-template #loadMoreRuleSets>\n <div\n *ngIf=\"item.type === 'load-more-rule-sets'; else loadingRules\"\n tabindex=\"0\"\n class=\"aca-rule-list-grouping__non-rule-item load-more\"\n matRipple matRippleColor=\"hsla(0,0%,0%,0.05)\"\n (click)=\"onClickLoadMoreRuleSets()\"\n (keyup.enter)=\"onClickLoadMoreRuleSets()\">\n {{ 'ACA_FOLDER_RULES.RULE_LIST.LOAD_MORE_RULE_SETS' | translate }}\n </div>\n </ng-template>\n\n <ng-template #loadingRules>\n <div\n tabindex=\"0\"\n class=\"aca-rule-list-grouping__non-rule-item\"\n matRipple matRippleColor=\"hsla(0,0%,0%,0.05)\">\n <mat-spinner mode=\"indeterminate\" [diameter]=\"16\"></mat-spinner>\n {{ 'ACA_FOLDER_RULES.RULE_LIST.LOADING_RULES' | translate }}\n </div>\n </ng-template>\n\n</ng-container>\n", styles: [".aca-rule-list-grouping{display:flex;flex-direction:column}.aca-rule-list-grouping__non-rule-item{display:flex;flex-direction:row;justify-content:center;align-items:center;color:var(--theme-disabled-text-color);font-style:italic;text-align:center;padding:.5em 0}.aca-rule-list-grouping__non-rule-item.load-more{cursor:pointer}.aca-rule-list-grouping__non-rule-item:not(:last-child){border-bottom:1px solid var(--theme-border-color)}.aca-rule-list-grouping__non-rule-item .mat-spinner{margin-right:.5em}\n"] }]
|
|
2011
|
+
}], propDecorators: { items: [{
|
|
2012
|
+
type: Input
|
|
2013
|
+
}], selectedRule: [{
|
|
2014
|
+
type: Input
|
|
2015
|
+
}], showEnabledToggles: [{
|
|
2016
|
+
type: Input
|
|
2017
|
+
}], selectRule: [{
|
|
2018
|
+
type: Output
|
|
2019
|
+
}], ruleEnabledChanged: [{
|
|
2020
|
+
type: Output
|
|
2021
|
+
}], loadMoreRules: [{
|
|
2022
|
+
type: Output
|
|
2023
|
+
}], loadMoreRuleSets: [{
|
|
2024
|
+
type: Output
|
|
2025
|
+
}] } });
|
|
2026
|
+
|
|
2027
|
+
/*!
|
|
2028
|
+
* Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved.
|
|
2029
|
+
*
|
|
2030
|
+
* Alfresco Example Content Application
|
|
2031
|
+
*
|
|
2032
|
+
* This file is part of the Alfresco Example Content Application.
|
|
2033
|
+
* If the software was purchased under a paid Alfresco license, the terms of
|
|
2034
|
+
* the paid license agreement will prevail. Otherwise, the software is
|
|
2035
|
+
* provided under the following open source license terms:
|
|
2036
|
+
*
|
|
2037
|
+
* The Alfresco Example Content Application is free software: you can redistribute it and/or modify
|
|
2038
|
+
* it under the terms of the GNU Lesser General Public License as published by
|
|
2039
|
+
* the Free Software Foundation, either version 3 of the License, or
|
|
2040
|
+
* (at your option) any later version.
|
|
2041
|
+
*
|
|
2042
|
+
* The Alfresco Example Content Application is distributed in the hope that it will be useful,
|
|
2043
|
+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
2044
|
+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
2045
|
+
* GNU Lesser General Public License for more details.
|
|
2046
|
+
*
|
|
2047
|
+
* You should have received a copy of the GNU Lesser General Public License
|
|
2048
|
+
* from Hyland Software. If not, see <http://www.gnu.org/licenses/>.
|
|
2049
|
+
*/
|
|
2050
|
+
class RuleListUiComponent {
|
|
2051
|
+
constructor() {
|
|
2052
|
+
this.mainRuleSet = null;
|
|
2053
|
+
this.inheritedRuleSets = [];
|
|
2054
|
+
this.hasMoreRuleSets = false;
|
|
2055
|
+
this.ruleSetsLoading = false;
|
|
2056
|
+
this.selectedRule = null;
|
|
2057
|
+
this.loadMoreRuleSets = new EventEmitter();
|
|
2058
|
+
this.loadMoreRules = new EventEmitter();
|
|
2059
|
+
this.selectRule = new EventEmitter();
|
|
2060
|
+
this.ruleEnabledChanged = new EventEmitter();
|
|
2061
|
+
this.ruleSetEditLinkClicked = new EventEmitter();
|
|
2062
|
+
this.ruleSetUnlinkClicked = new EventEmitter();
|
|
2063
|
+
this.inheritedRuleSetsExpanded = true;
|
|
2064
|
+
this.mainRuleSetExpanded = true;
|
|
2065
|
+
}
|
|
2066
|
+
get isMainRuleSetOwned() {
|
|
2067
|
+
return FolderRuleSetsService.isOwnedRuleSet(this.mainRuleSet, this.folderId);
|
|
2068
|
+
}
|
|
2069
|
+
get isMainRuleSetLinked() {
|
|
2070
|
+
return FolderRuleSetsService.isLinkedRuleSet(this.mainRuleSet, this.folderId);
|
|
2071
|
+
}
|
|
2072
|
+
get mainRuleSetGroupingItems() {
|
|
2073
|
+
return this.mainRuleSet ? this.getRuleSetGroupingItems(this.mainRuleSet, !this.isMainRuleSetOwned) : [];
|
|
2074
|
+
}
|
|
2075
|
+
get inheritedRuleSetGroupingItems() {
|
|
2076
|
+
const items = this.inheritedRuleSets.reduce((accumulator, currentRuleSet) => {
|
|
2077
|
+
accumulator.push(...this.getRuleSetGroupingItems(currentRuleSet, true));
|
|
2078
|
+
return accumulator;
|
|
2079
|
+
}, []);
|
|
2080
|
+
if (this.ruleSetsLoading || this.hasMoreRuleSets) {
|
|
2081
|
+
items.push({
|
|
2082
|
+
type: this.ruleSetsLoading ? 'loading' : 'load-more-rule-sets'
|
|
2083
|
+
});
|
|
2084
|
+
}
|
|
2085
|
+
return items;
|
|
2086
|
+
}
|
|
2087
|
+
getRuleSetGroupingItems(ruleSet, filterOutDisabledRules) {
|
|
2088
|
+
const items = ruleSet.rules
|
|
2089
|
+
.filter((rule) => rule.isEnabled || !filterOutDisabledRules)
|
|
2090
|
+
.map((rule) => ({
|
|
2091
|
+
type: 'rule',
|
|
2092
|
+
rule
|
|
2093
|
+
}));
|
|
2094
|
+
if (ruleSet.loadingRules || ruleSet.hasMoreRules) {
|
|
2095
|
+
items.push(ruleSet.loadingRules
|
|
2096
|
+
? {
|
|
2097
|
+
type: 'loading'
|
|
2098
|
+
}
|
|
2099
|
+
: {
|
|
2100
|
+
type: 'load-more-rules',
|
|
2101
|
+
ruleSet
|
|
2102
|
+
});
|
|
2103
|
+
}
|
|
2104
|
+
return items;
|
|
2105
|
+
}
|
|
2106
|
+
onLoadMoreRuleSets() {
|
|
2107
|
+
this.loadMoreRuleSets.emit();
|
|
2108
|
+
}
|
|
2109
|
+
onLoadMoreRules(ruleSet) {
|
|
2110
|
+
this.loadMoreRules.emit(ruleSet);
|
|
2111
|
+
}
|
|
2112
|
+
onSelectRule(rule) {
|
|
2113
|
+
this.selectRule.emit(rule);
|
|
2114
|
+
}
|
|
2115
|
+
onRuleEnabledChanged(event) {
|
|
2116
|
+
this.ruleEnabledChanged.emit(event);
|
|
2117
|
+
}
|
|
2118
|
+
onRuleSetEditLinkClicked(event) {
|
|
2119
|
+
event.stopPropagation();
|
|
2120
|
+
this.ruleSetEditLinkClicked.emit(this.mainRuleSet);
|
|
2121
|
+
}
|
|
2122
|
+
onRuleSetUnlinkClicked(event) {
|
|
2123
|
+
event.stopPropagation();
|
|
2124
|
+
this.ruleSetUnlinkClicked.emit(this.mainRuleSet);
|
|
2125
|
+
}
|
|
2126
|
+
}
|
|
2127
|
+
RuleListUiComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.1.3", ngImport: i0, type: RuleListUiComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
2128
|
+
RuleListUiComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.1.3", type: RuleListUiComponent, selector: "aca-rule-list", inputs: { mainRuleSet: "mainRuleSet", folderId: "folderId", inheritedRuleSets: "inheritedRuleSets", hasMoreRuleSets: "hasMoreRuleSets", ruleSetsLoading: "ruleSetsLoading", selectedRule: "selectedRule" }, outputs: { loadMoreRuleSets: "loadMoreRuleSets", loadMoreRules: "loadMoreRules", selectRule: "selectRule", ruleEnabledChanged: "ruleEnabledChanged", ruleSetEditLinkClicked: "ruleSetEditLinkClicked", ruleSetUnlinkClicked: "ruleSetUnlinkClicked" }, host: { classAttribute: "aca-rule-list" }, ngImport: i0, template: "<div\n *ngIf=\"inheritedRuleSetGroupingItems.length > 0\"\n class=\"aca-rule-list__item\"\n data-automation-id=\"rule-list-item\"\n [ngClass]=\"{ expanded: inheritedRuleSetsExpanded }\">\n\n <div\n tabindex=\"0\"\n class=\"aca-rule-list__item__header\"\n matRipple matRippleColor=\"hsla(0,0%,0%,0.05)\"\n (click)=\"inheritedRuleSetsExpanded = !inheritedRuleSetsExpanded\"\n (keyup.enter)=\"inheritedRuleSetsExpanded = !inheritedRuleSetsExpanded\">\n\n <span class=\"aca-rule-list__item__header__title\">\n {{ 'ACA_FOLDER_RULES.RULE_LIST.INHERITED_RULES' | translate }}\n <mat-icon [matTooltip]=\"'ACA_FOLDER_RULES.RULE_LIST.INHERITED_RULES_WILL_BE_RUN_FIRST' | translate\">\n info\n </mat-icon>\n </span>\n <mat-icon class=\"aca-rule-list__item__header__icon\">\n {{ inheritedRuleSetsExpanded ? 'expand_more' : 'chevron_right' }}\n </mat-icon>\n </div>\n\n <aca-rule-list-grouping\n *ngIf=\"inheritedRuleSetsExpanded\"\n [items]=\"inheritedRuleSetGroupingItems\"\n [selectedRule]=\"selectedRule\"\n (selectRule)=\"onSelectRule($event)\"\n (ruleEnabledChanged)=\"onRuleEnabledChanged($event)\"\n (loadMoreRules)=\"onLoadMoreRules($event)\"\n (loadMoreRuleSets)=\"onLoadMoreRuleSets()\">\n </aca-rule-list-grouping>\n\n</div>\n\n<div\n *ngIf=\"mainRuleSetGroupingItems.length > 0 || isMainRuleSetLinked\"\n class=\"aca-rule-list__item\"\n data-automation-id=\"rule-list-item\"\n [ngClass]=\"{ expanded: mainRuleSetExpanded }\">\n\n <div\n tabindex=\"0\"\n class=\"aca-rule-list__item__header\"\n matRipple matRippleColor=\"hsla(0,0%,0%,0.05)\"\n (click)=\"mainRuleSetExpanded = !mainRuleSetExpanded\"\n (keyup.enter)=\"mainRuleSetExpanded = !mainRuleSetExpanded\">\n\n <span class=\"aca-rule-list__item__header__title\" data-automation-id=\"main-rule-set-title\">\n <ng-container *ngIf=\"isMainRuleSetOwned; else linkedRuleSet\">\n {{ 'ACA_FOLDER_RULES.RULE_LIST.OWNED_RULES' | translate }}\n </ng-container>\n <ng-template #linkedRuleSet>\n {{ 'ACA_FOLDER_RULES.RULE_LIST.LINKED_RULES' | translate }}\n </ng-template>\n </span>\n\n <ng-container *ngIf=\"!isMainRuleSetOwned\">\n <mat-icon class=\"aca-rule-list__item__header__icon\" (click)=\"onRuleSetEditLinkClicked($event)\">edit</mat-icon>\n <mat-icon class=\"aca-rule-list__item__header__icon\" (click)=\"onRuleSetUnlinkClicked($event)\">link_off</mat-icon>\n </ng-container>\n\n <mat-icon class=\"aca-rule-list__item__header__icon\">\n {{ mainRuleSetExpanded ? 'expand_more' : 'chevron_right' }}\n </mat-icon>\n </div>\n\n <ng-container *ngIf=\"mainRuleSetExpanded\">\n <aca-rule-list-grouping\n *ngIf=\"mainRuleSetGroupingItems.length > 0; else emptyLinkedRuleSet\"\n [items]=\"mainRuleSetGroupingItems\"\n [selectedRule]=\"selectedRule\"\n [showEnabledToggles]=\"isMainRuleSetOwned\"\n (selectRule)=\"onSelectRule($event)\"\n (ruleEnabledChanged)=\"onRuleEnabledChanged($event)\"\n (loadMoreRules)=\"onLoadMoreRules($event)\">\n </aca-rule-list-grouping>\n\n <ng-template #emptyLinkedRuleSet>\n <div class=\"aca-rule-list__item__all-linked-rules-are-disabled\">\n {{ 'ACA_FOLDER_RULES.RULE_LIST.ALL_LINKED_RULES_ARE_DISABLED' | translate }}\n <button mat-stroked-button [routerLink]=\"['/nodes', mainRuleSet.owningFolder.id, 'rules']\">\n {{ 'ACA_FOLDER_RULES.MANAGE_RULES.TOOLBAR.ACTIONS.SEE_IN_FOLDER' | translate }}\n </button>\n </div>\n </ng-template>\n </ng-container>\n\n</div>\n", styles: [".aca-rule-list{display:flex;flex-direction:column;overflow-y:auto;gap:8px}.aca-rule-list__item{display:flex;flex-direction:column;border:1px solid var(--theme-border-color);border-radius:12px;overflow:hidden}.aca-rule-list__item__header{display:flex;flex-direction:row;gap:4px;align-items:stretch;cursor:pointer;color:var(--theme-text-color);-webkit-user-select:none;user-select:none;font-size:.9em;padding:.5em 1em}.aca-rule-list__item__header>*{display:flex;flex-direction:row;align-items:center}.aca-rule-list__item__header__title{display:flex;flex-direction:row;align-items:center;justify-content:flex-start;flex:1}.aca-rule-list__item__header__title .mat-icon{transform:scale(.8)}.aca-rule-list__item.expanded .aca-rule-list__item__header{border-bottom:1px solid var(--theme-border-color)}.aca-rule-list__item__all-linked-rules-are-disabled{display:flex;flex-direction:column;justify-content:center;align-items:center;gap:4px;color:var(--theme-disabled-text-color);font-style:italic;text-align:center;padding:.5em 0;font-size:.9em}\n"], dependencies: [{ kind: "directive", type: i1$1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i1$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i3$3.RouterLink, selector: ":not(a):not(area)[routerLink]", inputs: ["queryParams", "fragment", "queryParamsHandling", "preserveFragment", "skipLocationChange", "replaceUrl", "state", "relativeTo", "routerLink"] }, { kind: "component", type: i3$2.MatButton, selector: "button[mat-button], button[mat-raised-button], button[mat-icon-button], button[mat-fab], button[mat-mini-fab], button[mat-stroked-button], button[mat-flat-button]", inputs: ["disabled", "disableRipple", "color"], exportAs: ["matButton"] }, { kind: "component", type: i4.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "directive", type: i3$1.MatRipple, selector: "[mat-ripple], [matRipple]", inputs: ["matRippleColor", "matRippleUnbounded", "matRippleCentered", "matRippleRadius", "matRippleAnimation", "matRippleDisabled", "matRippleTrigger"], exportAs: ["matRipple"] }, { kind: "directive", type: i6$1.MatTooltip, selector: "[matTooltip]", exportAs: ["matTooltip"] }, { kind: "component", type: RuleListGroupingUiComponent, selector: "aca-rule-list-grouping", inputs: ["items", "selectedRule", "showEnabledToggles"], outputs: ["selectRule", "ruleEnabledChanged", "loadMoreRules", "loadMoreRuleSets"] }, { kind: "pipe", type: i3.TranslatePipe, name: "translate" }], encapsulation: i0.ViewEncapsulation.None });
|
|
2129
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.1.3", ngImport: i0, type: RuleListUiComponent, decorators: [{
|
|
2130
|
+
type: Component,
|
|
2131
|
+
args: [{ selector: 'aca-rule-list', encapsulation: ViewEncapsulation.None, host: { class: 'aca-rule-list' }, template: "<div\n *ngIf=\"inheritedRuleSetGroupingItems.length > 0\"\n class=\"aca-rule-list__item\"\n data-automation-id=\"rule-list-item\"\n [ngClass]=\"{ expanded: inheritedRuleSetsExpanded }\">\n\n <div\n tabindex=\"0\"\n class=\"aca-rule-list__item__header\"\n matRipple matRippleColor=\"hsla(0,0%,0%,0.05)\"\n (click)=\"inheritedRuleSetsExpanded = !inheritedRuleSetsExpanded\"\n (keyup.enter)=\"inheritedRuleSetsExpanded = !inheritedRuleSetsExpanded\">\n\n <span class=\"aca-rule-list__item__header__title\">\n {{ 'ACA_FOLDER_RULES.RULE_LIST.INHERITED_RULES' | translate }}\n <mat-icon [matTooltip]=\"'ACA_FOLDER_RULES.RULE_LIST.INHERITED_RULES_WILL_BE_RUN_FIRST' | translate\">\n info\n </mat-icon>\n </span>\n <mat-icon class=\"aca-rule-list__item__header__icon\">\n {{ inheritedRuleSetsExpanded ? 'expand_more' : 'chevron_right' }}\n </mat-icon>\n </div>\n\n <aca-rule-list-grouping\n *ngIf=\"inheritedRuleSetsExpanded\"\n [items]=\"inheritedRuleSetGroupingItems\"\n [selectedRule]=\"selectedRule\"\n (selectRule)=\"onSelectRule($event)\"\n (ruleEnabledChanged)=\"onRuleEnabledChanged($event)\"\n (loadMoreRules)=\"onLoadMoreRules($event)\"\n (loadMoreRuleSets)=\"onLoadMoreRuleSets()\">\n </aca-rule-list-grouping>\n\n</div>\n\n<div\n *ngIf=\"mainRuleSetGroupingItems.length > 0 || isMainRuleSetLinked\"\n class=\"aca-rule-list__item\"\n data-automation-id=\"rule-list-item\"\n [ngClass]=\"{ expanded: mainRuleSetExpanded }\">\n\n <div\n tabindex=\"0\"\n class=\"aca-rule-list__item__header\"\n matRipple matRippleColor=\"hsla(0,0%,0%,0.05)\"\n (click)=\"mainRuleSetExpanded = !mainRuleSetExpanded\"\n (keyup.enter)=\"mainRuleSetExpanded = !mainRuleSetExpanded\">\n\n <span class=\"aca-rule-list__item__header__title\" data-automation-id=\"main-rule-set-title\">\n <ng-container *ngIf=\"isMainRuleSetOwned; else linkedRuleSet\">\n {{ 'ACA_FOLDER_RULES.RULE_LIST.OWNED_RULES' | translate }}\n </ng-container>\n <ng-template #linkedRuleSet>\n {{ 'ACA_FOLDER_RULES.RULE_LIST.LINKED_RULES' | translate }}\n </ng-template>\n </span>\n\n <ng-container *ngIf=\"!isMainRuleSetOwned\">\n <mat-icon class=\"aca-rule-list__item__header__icon\" (click)=\"onRuleSetEditLinkClicked($event)\">edit</mat-icon>\n <mat-icon class=\"aca-rule-list__item__header__icon\" (click)=\"onRuleSetUnlinkClicked($event)\">link_off</mat-icon>\n </ng-container>\n\n <mat-icon class=\"aca-rule-list__item__header__icon\">\n {{ mainRuleSetExpanded ? 'expand_more' : 'chevron_right' }}\n </mat-icon>\n </div>\n\n <ng-container *ngIf=\"mainRuleSetExpanded\">\n <aca-rule-list-grouping\n *ngIf=\"mainRuleSetGroupingItems.length > 0; else emptyLinkedRuleSet\"\n [items]=\"mainRuleSetGroupingItems\"\n [selectedRule]=\"selectedRule\"\n [showEnabledToggles]=\"isMainRuleSetOwned\"\n (selectRule)=\"onSelectRule($event)\"\n (ruleEnabledChanged)=\"onRuleEnabledChanged($event)\"\n (loadMoreRules)=\"onLoadMoreRules($event)\">\n </aca-rule-list-grouping>\n\n <ng-template #emptyLinkedRuleSet>\n <div class=\"aca-rule-list__item__all-linked-rules-are-disabled\">\n {{ 'ACA_FOLDER_RULES.RULE_LIST.ALL_LINKED_RULES_ARE_DISABLED' | translate }}\n <button mat-stroked-button [routerLink]=\"['/nodes', mainRuleSet.owningFolder.id, 'rules']\">\n {{ 'ACA_FOLDER_RULES.MANAGE_RULES.TOOLBAR.ACTIONS.SEE_IN_FOLDER' | translate }}\n </button>\n </div>\n </ng-template>\n </ng-container>\n\n</div>\n", styles: [".aca-rule-list{display:flex;flex-direction:column;overflow-y:auto;gap:8px}.aca-rule-list__item{display:flex;flex-direction:column;border:1px solid var(--theme-border-color);border-radius:12px;overflow:hidden}.aca-rule-list__item__header{display:flex;flex-direction:row;gap:4px;align-items:stretch;cursor:pointer;color:var(--theme-text-color);-webkit-user-select:none;user-select:none;font-size:.9em;padding:.5em 1em}.aca-rule-list__item__header>*{display:flex;flex-direction:row;align-items:center}.aca-rule-list__item__header__title{display:flex;flex-direction:row;align-items:center;justify-content:flex-start;flex:1}.aca-rule-list__item__header__title .mat-icon{transform:scale(.8)}.aca-rule-list__item.expanded .aca-rule-list__item__header{border-bottom:1px solid var(--theme-border-color)}.aca-rule-list__item__all-linked-rules-are-disabled{display:flex;flex-direction:column;justify-content:center;align-items:center;gap:4px;color:var(--theme-disabled-text-color);font-style:italic;text-align:center;padding:.5em 0;font-size:.9em}\n"] }]
|
|
2132
|
+
}], propDecorators: { mainRuleSet: [{
|
|
2133
|
+
type: Input
|
|
2134
|
+
}], folderId: [{
|
|
2135
|
+
type: Input
|
|
2136
|
+
}], inheritedRuleSets: [{
|
|
2137
|
+
type: Input
|
|
2138
|
+
}], hasMoreRuleSets: [{
|
|
2139
|
+
type: Input
|
|
2140
|
+
}], ruleSetsLoading: [{
|
|
2141
|
+
type: Input
|
|
2142
|
+
}], selectedRule: [{
|
|
2143
|
+
type: Input
|
|
2144
|
+
}], loadMoreRuleSets: [{
|
|
2145
|
+
type: Output
|
|
2146
|
+
}], loadMoreRules: [{
|
|
2147
|
+
type: Output
|
|
2148
|
+
}], selectRule: [{
|
|
2149
|
+
type: Output
|
|
2150
|
+
}], ruleEnabledChanged: [{
|
|
2151
|
+
type: Output
|
|
2152
|
+
}], ruleSetEditLinkClicked: [{
|
|
2153
|
+
type: Output
|
|
2154
|
+
}], ruleSetUnlinkClicked: [{
|
|
2155
|
+
type: Output
|
|
2156
|
+
}] } });
|
|
2157
|
+
|
|
2158
|
+
class ManageRulesSmartComponent {
|
|
2159
|
+
constructor(location, folderRulesService, route, matDialogService, notificationService, actionsService, folderRuleSetsService) {
|
|
2160
|
+
this.location = location;
|
|
2161
|
+
this.folderRulesService = folderRulesService;
|
|
2162
|
+
this.route = route;
|
|
2163
|
+
this.matDialogService = matDialogService;
|
|
2164
|
+
this.notificationService = notificationService;
|
|
2165
|
+
this.actionsService = actionsService;
|
|
2166
|
+
this.folderRuleSetsService = folderRuleSetsService;
|
|
2167
|
+
this.nodeId = '';
|
|
2168
|
+
this.isInheritanceEnabled = true;
|
|
2169
|
+
this.isInheritanceToggleDisabled = false;
|
|
2170
|
+
this.canEditMainRule = false;
|
|
2171
|
+
this.canEditSelectedRule = false;
|
|
2172
|
+
this.isMainRuleSetNotEmpty = false;
|
|
2173
|
+
this.isInheritedRuleSetsNotEmpty = false;
|
|
2174
|
+
this.destroyed$ = new Subject();
|
|
2175
|
+
}
|
|
2176
|
+
ngOnInit() {
|
|
2177
|
+
this.mainRuleSet$ = this.folderRuleSetsService.mainRuleSet$;
|
|
2178
|
+
this.inheritedRuleSets$ = this.folderRuleSetsService.inheritedRuleSets$;
|
|
2179
|
+
this.selectedRule$ = this.folderRulesService.selectedRule$;
|
|
2180
|
+
this.selectedRuleSet$ = this.folderRuleSetsService.selectedRuleSet$;
|
|
2181
|
+
this.hasMoreRuleSets$ = this.folderRuleSetsService.hasMoreRuleSets$;
|
|
2182
|
+
this.ruleSetsLoading$ = this.folderRuleSetsService.isLoading$;
|
|
2183
|
+
this.folderInfo$ = this.folderRuleSetsService.folderInfo$;
|
|
2184
|
+
this.actionsLoading$ = this.actionsService.loading$.pipe(delay(0));
|
|
2185
|
+
this.actionDefinitions$ = this.actionsService.actionDefinitionsListing$;
|
|
2186
|
+
this.parameterConstraints$ = this.actionsService.parameterConstraints$;
|
|
2187
|
+
this.folderRulesService.deletedRuleId$.pipe(takeUntil(this.destroyed$)).subscribe((deletedRuleId) => this.onRuleDelete(deletedRuleId));
|
|
2188
|
+
this.actionsService.loadActionDefinitions();
|
|
2189
|
+
this.route.params.subscribe((params) => {
|
|
2190
|
+
this.nodeId = params.nodeId;
|
|
2191
|
+
if (this.nodeId) {
|
|
2192
|
+
this.folderRulesService.getRuleSettings(this.nodeId).then((ruleSettings) => {
|
|
2193
|
+
this.isInheritanceEnabled = ruleSettings.value;
|
|
2194
|
+
});
|
|
2195
|
+
this.folderRuleSetsService.loadRuleSets(this.nodeId);
|
|
2196
|
+
}
|
|
2197
|
+
});
|
|
2198
|
+
this._actionDefinitionsSub = this.actionDefinitions$.subscribe((actionDefinitions) => this.actionsService.loadActionParameterConstraints(actionDefinitions));
|
|
2199
|
+
this.mainRuleSet$.pipe(takeUntil(this.destroyed$)).subscribe((ruleSet) => {
|
|
2200
|
+
this.canEditMainRule = this.canEditRule(ruleSet);
|
|
2201
|
+
this.isMainRuleSetNotEmpty = !!ruleSet;
|
|
2202
|
+
});
|
|
2203
|
+
this.inheritedRuleSets$.pipe(takeUntil(this.destroyed$)).subscribe((inheritedRuleSet) => {
|
|
2204
|
+
this.isInheritedRuleSetsNotEmpty = inheritedRuleSet.some((ruleSet) => ruleSet.rules.some((rule) => rule.isEnabled));
|
|
2205
|
+
});
|
|
2206
|
+
this.selectedRuleSet$.pipe(takeUntil(this.destroyed$)).subscribe((ruleSet) => {
|
|
2207
|
+
this.canEditSelectedRule = this.canEditRule(ruleSet);
|
|
2208
|
+
});
|
|
2209
|
+
}
|
|
2210
|
+
ngOnDestroy() {
|
|
2211
|
+
this.destroyed$.next();
|
|
2212
|
+
this.destroyed$.complete();
|
|
2213
|
+
this._actionDefinitionsSub.unsubscribe();
|
|
2214
|
+
}
|
|
2215
|
+
goBack() {
|
|
2216
|
+
this.location.back();
|
|
2217
|
+
}
|
|
2218
|
+
onSelectRule(rule) {
|
|
2219
|
+
this.folderRulesService.selectRule(rule);
|
|
2220
|
+
}
|
|
2221
|
+
openCreateUpdateRuleDialog(model = {}) {
|
|
2222
|
+
const dialogRef = this.matDialogService.open(EditRuleDialogUiComponent, {
|
|
2223
|
+
width: '90%',
|
|
2224
|
+
panelClass: 'aca-edit-rule-dialog-container',
|
|
2225
|
+
data: {
|
|
2226
|
+
model,
|
|
2227
|
+
nodeId: this.nodeId,
|
|
2228
|
+
parameterConstraints$: this.parameterConstraints$,
|
|
2229
|
+
actionDefinitions$: this.actionDefinitions$
|
|
2230
|
+
}
|
|
2231
|
+
});
|
|
2232
|
+
this.onSubmitRuleDialog(dialogRef);
|
|
2233
|
+
}
|
|
2234
|
+
onSubmitRuleDialog(dialogRef) {
|
|
2235
|
+
dialogRef.componentInstance.submitted.subscribe((rule) => __awaiter(this, void 0, void 0, function* () {
|
|
2236
|
+
try {
|
|
2237
|
+
if (rule.id) {
|
|
2238
|
+
yield this.onRuleUpdate(rule);
|
|
2239
|
+
}
|
|
2240
|
+
else {
|
|
2241
|
+
yield this.onRuleCreate(rule);
|
|
2242
|
+
}
|
|
2243
|
+
dialogRef.close();
|
|
2244
|
+
}
|
|
2245
|
+
catch (error) {
|
|
2246
|
+
this.notificationService.showError(error.response.body.error.errorKey);
|
|
2247
|
+
}
|
|
2248
|
+
}));
|
|
2249
|
+
}
|
|
2250
|
+
onRuleUpdate(rule) {
|
|
2251
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
2252
|
+
const newRule = yield this.folderRulesService.updateRule(this.nodeId, rule.id, rule);
|
|
2253
|
+
this.folderRuleSetsService.addOrUpdateRuleInMainRuleSet(newRule);
|
|
2254
|
+
});
|
|
2255
|
+
}
|
|
2256
|
+
onRuleCreate(ruleCreateParams) {
|
|
2257
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
2258
|
+
const newRule = yield this.folderRulesService.createRule(this.nodeId, ruleCreateParams);
|
|
2259
|
+
this.folderRuleSetsService.addOrUpdateRuleInMainRuleSet(newRule);
|
|
2260
|
+
});
|
|
2261
|
+
}
|
|
2262
|
+
onRuleEnabledToggle(rule, isEnabled) {
|
|
2263
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
2264
|
+
yield this.folderRulesService.updateRule(this.nodeId, rule.id, Object.assign(Object.assign({}, rule), { isEnabled }));
|
|
2265
|
+
});
|
|
2266
|
+
}
|
|
2267
|
+
onInheritanceToggleChange(event) {
|
|
2268
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
2269
|
+
this.isInheritanceToggleDisabled = true;
|
|
2270
|
+
const ruleSettings = yield this.folderRulesService.updateRuleSettings(this.nodeId, '-isInheritanceEnabled-', { value: event.checked });
|
|
2271
|
+
this.isInheritanceEnabled = ruleSettings.value;
|
|
2272
|
+
this.folderRuleSetsService.loadRuleSets(this.nodeId);
|
|
2273
|
+
this.isInheritanceToggleDisabled = false;
|
|
2274
|
+
});
|
|
2275
|
+
}
|
|
2276
|
+
onRuleDeleteButtonClicked(rule) {
|
|
2277
|
+
this.matDialogService
|
|
2278
|
+
.open(ConfirmDialogComponent, {
|
|
2279
|
+
data: {
|
|
2280
|
+
title: 'ACA_FOLDER_RULES.CONFIRMATION_DIALOG.DELETE_RULE.TITLE',
|
|
2281
|
+
message: 'ACA_FOLDER_RULES.CONFIRMATION_DIALOG.DELETE_RULE.MESSAGE'
|
|
2282
|
+
},
|
|
2283
|
+
minWidth: '346px'
|
|
2284
|
+
})
|
|
2285
|
+
.afterClosed()
|
|
2286
|
+
.subscribe((result) => {
|
|
2287
|
+
if (result) {
|
|
2288
|
+
this.folderRulesService.deleteRule(this.nodeId, rule.id);
|
|
2289
|
+
}
|
|
2290
|
+
});
|
|
2291
|
+
}
|
|
2292
|
+
onRuleDelete(deletedRuleId) {
|
|
2293
|
+
this.folderRuleSetsService.removeRuleFromMainRuleSet(deletedRuleId);
|
|
2294
|
+
}
|
|
2295
|
+
onLoadMoreRuleSets() {
|
|
2296
|
+
this.folderRuleSetsService.loadMoreInheritedRuleSets();
|
|
2297
|
+
}
|
|
2298
|
+
onLoadMoreRules(ruleSet) {
|
|
2299
|
+
this.folderRulesService.loadRules(ruleSet);
|
|
2300
|
+
}
|
|
2301
|
+
canEditRule(ruleSet) {
|
|
2302
|
+
return !ruleSet || FolderRuleSetsService.isOwnedRuleSet(ruleSet, this.nodeId);
|
|
2303
|
+
}
|
|
2304
|
+
openLinkRulesDialog(existingRuleSet) {
|
|
2305
|
+
this.matDialogService
|
|
2306
|
+
.open(RuleSetPickerSmartComponent, {
|
|
2307
|
+
width: '90%',
|
|
2308
|
+
panelClass: 'aca-rule-set-picker-container',
|
|
2309
|
+
data: {
|
|
2310
|
+
nodeId: this.nodeId,
|
|
2311
|
+
defaultNodeId: this.nodeId,
|
|
2312
|
+
existingRuleSet
|
|
2313
|
+
}
|
|
2314
|
+
})
|
|
2315
|
+
.afterClosed()
|
|
2316
|
+
.subscribe((result) => {
|
|
2317
|
+
if (result) {
|
|
2318
|
+
this.folderRuleSetsService.refreshMainRuleSet();
|
|
2319
|
+
}
|
|
2320
|
+
});
|
|
2321
|
+
}
|
|
2322
|
+
onRuleSetUnlinkClicked(linkedRuleSet) {
|
|
2323
|
+
this.matDialogService
|
|
2324
|
+
.open(ConfirmDialogComponent, {
|
|
2325
|
+
data: {
|
|
2326
|
+
title: 'ACA_FOLDER_RULES.CONFIRMATION_DIALOG.DELETE_RULE_SET_LINK.TITLE',
|
|
2327
|
+
message: 'ACA_FOLDER_RULES.CONFIRMATION_DIALOG.DELETE_RULE_SET_LINK.MESSAGE'
|
|
2328
|
+
},
|
|
2329
|
+
minWidth: '346px'
|
|
2330
|
+
})
|
|
2331
|
+
.afterClosed()
|
|
2332
|
+
.subscribe((result) => __awaiter(this, void 0, void 0, function* () {
|
|
2333
|
+
if (result) {
|
|
2334
|
+
try {
|
|
2335
|
+
yield this.folderRuleSetsService.deleteRuleSetLink(this.nodeId, linkedRuleSet.id);
|
|
2336
|
+
this.folderRuleSetsService.refreshMainRuleSet();
|
|
2337
|
+
}
|
|
2338
|
+
catch (error) {
|
|
2339
|
+
this.notificationService.showError('ACA_FOLDER_RULES.ERRORS.DELETE_RULE_SET_LINK_FAILED');
|
|
2340
|
+
}
|
|
2341
|
+
}
|
|
2342
|
+
}));
|
|
2343
|
+
}
|
|
2344
|
+
}
|
|
2345
|
+
ManageRulesSmartComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.1.3", ngImport: i0, type: ManageRulesSmartComponent, deps: [{ token: i1$1.Location }, { token: FolderRulesService }, { token: i3$3.ActivatedRoute }, { token: i2.MatDialog }, { token: i1.NotificationService }, { token: ActionsService }, { token: FolderRuleSetsService }], target: i0.ɵɵFactoryTarget.Component });
|
|
2346
|
+
ManageRulesSmartComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.1.3", type: ManageRulesSmartComponent, selector: "aca-manage-rules", host: { classAttribute: "aca-manage-rules" }, ngImport: i0, template: "<aca-page-layout>\n\n <aca-page-layout-header>\n <adf-toolbar class=\"adf-toolbar--inline\">\n <button mat-icon-button (click)=\"goBack()\">\n <mat-icon>arrow_back</mat-icon>\n </button>\n </adf-toolbar>\n <adf-breadcrumb root=\"{{'ACA_FOLDER_RULES.ACTIONS.MANAGE_RULES' | translate}}\"></adf-breadcrumb>\n </aca-page-layout-header>\n\n <aca-page-layout-content>\n <div class=\"main-content\">\n\n <ng-container *ngIf=\"((ruleSetsLoading$ | async) && (inheritedRuleSets$ | async).length === 0) || (actionsLoading$ | async); else onLoaded\">\n <mat-progress-bar color=\"primary\" mode=\"indeterminate\"></mat-progress-bar>\n </ng-container>\n\n <ng-template #onLoaded>\n <ng-container *ngIf=\"folderInfo$ | async; else genericError\">\n <adf-toolbar class=\"adf-toolbar--inline aca-manage-rules__actions-bar\">\n\n <adf-toolbar-title class=\"aca-manage-rules__actions-bar__title\">\n <mat-icon class=\"icon-aligner\">folder</mat-icon>\n <adf-breadcrumb root=\"{{ (folderInfo$ | async).name }}:{{'ACA_FOLDER_RULES.MANAGE_RULES.TOOLBAR.BREADCRUMB.RULES' | translate}}\"\n class=\"aca-manage-rules__actions-bar__title__breadcrumb\"></adf-breadcrumb>\n </adf-toolbar-title>\n\n <mat-slide-toggle\n data-automation-id=\"manage-rules-inheritance-toggle-button\"\n [checked]=\"isInheritanceEnabled\"\n (change)=\"onInheritanceToggleChange($event)\"\n [disabled]=\"isInheritanceToggleDisabled\"\n [labelPosition]=\"'before'\">\n {{ 'ACA_FOLDER_RULES.MANAGE_RULES.TOOLBAR.ACTIONS.INHERIT_RULES' | translate }}\n </mat-slide-toggle>\n\n <mat-divider vertical class=\"vertical-divider\"></mat-divider>\n\n <div class=\"aca-manage-rules__actions-bar__buttons\">\n <button\n *ngIf=\"!(mainRuleSet$ | async)\"\n data-automation-id=\"manage-rules-link-button\"\n mat-stroked-button\n (click)=\"openLinkRulesDialog()\">\n {{ 'ACA_FOLDER_RULES.MANAGE_RULES.TOOLBAR.ACTIONS.LINK_RULES' | translate }}\n </button>\n\n <button\n *ngIf=\"canEditMainRule\"\n data-automation-id=\"manage-rules-create-button\"\n mat-flat-button color=\"primary\"\n (click)=\"openCreateUpdateRuleDialog()\">\n {{ 'ACA_FOLDER_RULES.MANAGE_RULES.TOOLBAR.ACTIONS.CREATE_RULE' | translate }}\n </button>\n </div>\n\n </adf-toolbar>\n <mat-divider></mat-divider>\n\n <div class=\"aca-manage-rules__container\" *ngIf=\"isMainRuleSetNotEmpty || isInheritedRuleSetsNotEmpty; else emptyContent\">\n <aca-rule-list\n [mainRuleSet]=\"mainRuleSet$ | async\"\n [folderId]=\"nodeId\"\n [inheritedRuleSets]=\"inheritedRuleSets$ | async\"\n [hasMoreRuleSets]=\"hasMoreRuleSets$ | async\"\n [ruleSetsLoading]=\"ruleSetsLoading$ | async\"\n [selectedRule]=\"selectedRule$ | async\"\n (loadMoreRuleSets)=\"onLoadMoreRuleSets()\"\n (loadMoreRules)=\"onLoadMoreRules($event)\"\n (selectRule)=\"onSelectRule($event)\"\n (ruleEnabledChanged)=\"onRuleEnabledToggle($event[0], $event[1])\"\n (ruleSetEditLinkClicked)=\"openLinkRulesDialog($event)\"\n (ruleSetUnlinkClicked)=\"onRuleSetUnlinkClicked($event)\">\n </aca-rule-list>\n\n <div class=\"aca-manage-rules__container__rule-details\">\n\n <div class=\"aca-manage-rules__container__rule-details__header\" *ngIf=\"(selectedRule$ | async) as selectedRule\">\n <div class=\"aca-manage-rules__container__rule-details__header__title\">\n <div class=\"aca-manage-rules__container__rule-details__header__title__name\">\n {{ selectedRule.name }}\n </div>\n <div class=\"aca-manage-rules__container__rule-details__header__title__description\">\n {{ selectedRule.description }}\n </div>\n </div>\n\n <div class=\"aca-manage-rules__container__rule-details__header__buttons\">\n <ng-container *ngIf=\"canEditSelectedRule; else goToFolderButton\">\n <button mat-stroked-button (click)=\"onRuleDeleteButtonClicked(selectedRule)\" id=\"delete-rule-btn\">\n <mat-icon>delete_outline</mat-icon>\n </button>\n <button mat-stroked-button (click)=\"openCreateUpdateRuleDialog(selectedRule)\" id=\"edit-rule-btn\">\n {{ 'ACA_FOLDER_RULES.MANAGE_RULES.TOOLBAR.ACTIONS.EDIT_RULE' | translate }}\n </button>\n </ng-container>\n\n <ng-template #goToFolderButton>\n <button mat-stroked-button [routerLink]=\"['/nodes', (selectedRuleSet$ | async).owningFolder.id, 'rules']\">\n {{ 'ACA_FOLDER_RULES.MANAGE_RULES.TOOLBAR.ACTIONS.SEE_IN_FOLDER' | translate }}\n </button>\n </ng-template>\n </div>\n </div>\n\n <div class=\"aca-manage-rules__container__rule-details__content\" *ngIf=\"(selectedRule$ | async) as selectedRule\">\n <aca-rule-details\n [actionDefinitions]=\"actionDefinitions$ | async\"\n [readOnly]=\"true\"\n [preview]=\"true\"\n [value]=\"selectedRule\"\n [nodeId]=\"nodeId\">\n </aca-rule-details>\n </div>\n </div>\n </div>\n\n <ng-template #emptyContent>\n <adf-empty-content\n icon=\"library_books\"\n [title]=\"'ACA_FOLDER_RULES.MANAGE_RULES.EMPTY_RULES_LIST.TITLE' | translate\"\n [subtitle]=\"'ACA_FOLDER_RULES.MANAGE_RULES.EMPTY_RULES_LIST.SUBTITLE' | translate\"\n >\n </adf-empty-content>\n </ng-template>\n </ng-container>\n\n <ng-template #genericError>\n <aca-page-layout-error>\n <aca-generic-error></aca-generic-error>\n </aca-page-layout-error>\n </ng-template>\n\n </ng-template>\n\n </div>\n </aca-page-layout-content>\n\n</aca-page-layout>\n", styles: [".aca-manage-rules__actions-bar{padding:0 30px;display:flex;align-items:center}.aca-manage-rules__actions-bar__title{align-items:center;width:unset!important;flex:1}.aca-manage-rules__actions-bar__title__breadcrumb{margin-left:18px}.aca-manage-rules__actions-bar__buttons{display:flex;align-items:stretch;gap:12px}.aca-manage-rules__actions-bar .mat-slide-toggle-label{font-weight:600;font-size:14px;color:var(--adf-breadcrumb-item-active-color)}.aca-manage-rules__actions-bar .vertical-divider{height:50%;margin:0 12px}.aca-manage-rules__container{display:grid;grid-template-columns:minmax(250px,1fr) 3fr;padding:20px;gap:12px;overflow-y:auto;flex:1}.aca-manage-rules__container__rule-details{border:1px solid var(--theme-border-color);border-radius:12px;overflow-y:auto}.aca-manage-rules__container__rule-details__header{position:sticky;top:0;z-index:1;display:flex;flex-direction:row;align-items:flex-start;overflow-x:auto;justify-content:space-between;padding:12px 20px;border-bottom:1px solid var(--theme-border-color);background-color:var(--theme-background-color);column-gap:20px}.aca-manage-rules__container__rule-details__header__title{display:flex;flex-direction:column;gap:4px;word-wrap:break-word;min-width:100px}.aca-manage-rules__container__rule-details__header__title__name{font-size:1.2em;font-weight:700}.aca-manage-rules__container__rule-details__header__title__description{font-size:.8em;font-style:italic}.aca-manage-rules__container__rule-details__header__buttons{display:flex;flex-direction:row;align-items:stretch;gap:4px}.aca-manage-rules__container__rule-details__header__buttons button{color:var(--theme-text-color)}.aca-manage-rules__container__rule-details__header__buttons button#delete-rule-btn{padding:0 8px;min-width:unset}.aca-manage-rules__container__rule-details__header__buttons button .mat-icon{overflow:hidden!important}\n"], dependencies: [{ kind: "directive", type: i1$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i3$3.RouterLink, selector: ":not(a):not(area)[routerLink]", inputs: ["queryParams", "fragment", "queryParamsHandling", "preserveFragment", "skipLocationChange", "replaceUrl", "state", "relativeTo", "routerLink"] }, { kind: "component", type: i3$2.MatButton, selector: "button[mat-button], button[mat-raised-button], button[mat-icon-button], button[mat-fab], button[mat-mini-fab], button[mat-stroked-button], button[mat-flat-button]", inputs: ["disabled", "disableRipple", "color"], exportAs: ["matButton"] }, { kind: "component", type: i4.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "component", type: i10.MatDivider, selector: "mat-divider", inputs: ["vertical", "inset"] }, { kind: "component", type: i2$3.MatSlideToggle, selector: "mat-slide-toggle", inputs: ["disabled", "disableRipple", "color", "tabIndex"], exportAs: ["matSlideToggle"] }, { kind: "component", type: i12.MatProgressBar, selector: "mat-progress-bar", inputs: ["color", "value", "bufferValue", "mode"], outputs: ["animationEnd"], exportAs: ["matProgressBar"] }, { kind: "component", type: i1.ToolbarComponent, selector: "adf-toolbar", inputs: ["title", "color"] }, { kind: "component", type: i1.ToolbarTitleComponent, selector: "adf-toolbar-title" }, { kind: "component", type: i1.EmptyContentComponent, selector: "adf-empty-content", inputs: ["icon", "title", "subtitle"] }, { kind: "component", type: i13.PageLayoutContentComponent, selector: "aca-page-layout-content", inputs: ["scrollable"] }, { kind: "component", type: i13.PageLayoutErrorComponent, selector: "aca-page-layout-error" }, { kind: "component", type: i13.PageLayoutHeaderComponent, selector: "aca-page-layout-header" }, { kind: "component", type: i13.PageLayoutComponent, selector: "aca-page-layout", inputs: ["hasError"] }, { kind: "component", type: i8.BreadcrumbComponent, selector: "adf-breadcrumb", inputs: ["folderNode", "root", "rootId", "target", "transform", "maxItems", "readOnly"], outputs: ["navigate"] }, { kind: "component", type: i13.GenericErrorComponent, selector: "aca-generic-error", inputs: ["text"] }, { kind: "component", type: RuleDetailsUiComponent, selector: "aca-rule-details", inputs: ["readOnly", "value", "preview", "actionDefinitions", "parameterConstraints", "nodeId"], outputs: ["formValidationChanged", "formValueChanged"] }, { kind: "component", type: RuleListUiComponent, selector: "aca-rule-list", inputs: ["mainRuleSet", "folderId", "inheritedRuleSets", "hasMoreRuleSets", "ruleSetsLoading", "selectedRule"], outputs: ["loadMoreRuleSets", "loadMoreRules", "selectRule", "ruleEnabledChanged", "ruleSetEditLinkClicked", "ruleSetUnlinkClicked"] }, { kind: "pipe", type: i1$1.AsyncPipe, name: "async" }, { kind: "pipe", type: i3.TranslatePipe, name: "translate" }], changeDetection: i0.ChangeDetectionStrategy.Default, encapsulation: i0.ViewEncapsulation.None });
|
|
2347
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.1.3", ngImport: i0, type: ManageRulesSmartComponent, decorators: [{
|
|
2348
|
+
type: Component,
|
|
2349
|
+
args: [{ selector: 'aca-manage-rules', encapsulation: ViewEncapsulation.None, changeDetection: ChangeDetectionStrategy.Default, host: { class: 'aca-manage-rules' }, template: "<aca-page-layout>\n\n <aca-page-layout-header>\n <adf-toolbar class=\"adf-toolbar--inline\">\n <button mat-icon-button (click)=\"goBack()\">\n <mat-icon>arrow_back</mat-icon>\n </button>\n </adf-toolbar>\n <adf-breadcrumb root=\"{{'ACA_FOLDER_RULES.ACTIONS.MANAGE_RULES' | translate}}\"></adf-breadcrumb>\n </aca-page-layout-header>\n\n <aca-page-layout-content>\n <div class=\"main-content\">\n\n <ng-container *ngIf=\"((ruleSetsLoading$ | async) && (inheritedRuleSets$ | async).length === 0) || (actionsLoading$ | async); else onLoaded\">\n <mat-progress-bar color=\"primary\" mode=\"indeterminate\"></mat-progress-bar>\n </ng-container>\n\n <ng-template #onLoaded>\n <ng-container *ngIf=\"folderInfo$ | async; else genericError\">\n <adf-toolbar class=\"adf-toolbar--inline aca-manage-rules__actions-bar\">\n\n <adf-toolbar-title class=\"aca-manage-rules__actions-bar__title\">\n <mat-icon class=\"icon-aligner\">folder</mat-icon>\n <adf-breadcrumb root=\"{{ (folderInfo$ | async).name }}:{{'ACA_FOLDER_RULES.MANAGE_RULES.TOOLBAR.BREADCRUMB.RULES' | translate}}\"\n class=\"aca-manage-rules__actions-bar__title__breadcrumb\"></adf-breadcrumb>\n </adf-toolbar-title>\n\n <mat-slide-toggle\n data-automation-id=\"manage-rules-inheritance-toggle-button\"\n [checked]=\"isInheritanceEnabled\"\n (change)=\"onInheritanceToggleChange($event)\"\n [disabled]=\"isInheritanceToggleDisabled\"\n [labelPosition]=\"'before'\">\n {{ 'ACA_FOLDER_RULES.MANAGE_RULES.TOOLBAR.ACTIONS.INHERIT_RULES' | translate }}\n </mat-slide-toggle>\n\n <mat-divider vertical class=\"vertical-divider\"></mat-divider>\n\n <div class=\"aca-manage-rules__actions-bar__buttons\">\n <button\n *ngIf=\"!(mainRuleSet$ | async)\"\n data-automation-id=\"manage-rules-link-button\"\n mat-stroked-button\n (click)=\"openLinkRulesDialog()\">\n {{ 'ACA_FOLDER_RULES.MANAGE_RULES.TOOLBAR.ACTIONS.LINK_RULES' | translate }}\n </button>\n\n <button\n *ngIf=\"canEditMainRule\"\n data-automation-id=\"manage-rules-create-button\"\n mat-flat-button color=\"primary\"\n (click)=\"openCreateUpdateRuleDialog()\">\n {{ 'ACA_FOLDER_RULES.MANAGE_RULES.TOOLBAR.ACTIONS.CREATE_RULE' | translate }}\n </button>\n </div>\n\n </adf-toolbar>\n <mat-divider></mat-divider>\n\n <div class=\"aca-manage-rules__container\" *ngIf=\"isMainRuleSetNotEmpty || isInheritedRuleSetsNotEmpty; else emptyContent\">\n <aca-rule-list\n [mainRuleSet]=\"mainRuleSet$ | async\"\n [folderId]=\"nodeId\"\n [inheritedRuleSets]=\"inheritedRuleSets$ | async\"\n [hasMoreRuleSets]=\"hasMoreRuleSets$ | async\"\n [ruleSetsLoading]=\"ruleSetsLoading$ | async\"\n [selectedRule]=\"selectedRule$ | async\"\n (loadMoreRuleSets)=\"onLoadMoreRuleSets()\"\n (loadMoreRules)=\"onLoadMoreRules($event)\"\n (selectRule)=\"onSelectRule($event)\"\n (ruleEnabledChanged)=\"onRuleEnabledToggle($event[0], $event[1])\"\n (ruleSetEditLinkClicked)=\"openLinkRulesDialog($event)\"\n (ruleSetUnlinkClicked)=\"onRuleSetUnlinkClicked($event)\">\n </aca-rule-list>\n\n <div class=\"aca-manage-rules__container__rule-details\">\n\n <div class=\"aca-manage-rules__container__rule-details__header\" *ngIf=\"(selectedRule$ | async) as selectedRule\">\n <div class=\"aca-manage-rules__container__rule-details__header__title\">\n <div class=\"aca-manage-rules__container__rule-details__header__title__name\">\n {{ selectedRule.name }}\n </div>\n <div class=\"aca-manage-rules__container__rule-details__header__title__description\">\n {{ selectedRule.description }}\n </div>\n </div>\n\n <div class=\"aca-manage-rules__container__rule-details__header__buttons\">\n <ng-container *ngIf=\"canEditSelectedRule; else goToFolderButton\">\n <button mat-stroked-button (click)=\"onRuleDeleteButtonClicked(selectedRule)\" id=\"delete-rule-btn\">\n <mat-icon>delete_outline</mat-icon>\n </button>\n <button mat-stroked-button (click)=\"openCreateUpdateRuleDialog(selectedRule)\" id=\"edit-rule-btn\">\n {{ 'ACA_FOLDER_RULES.MANAGE_RULES.TOOLBAR.ACTIONS.EDIT_RULE' | translate }}\n </button>\n </ng-container>\n\n <ng-template #goToFolderButton>\n <button mat-stroked-button [routerLink]=\"['/nodes', (selectedRuleSet$ | async).owningFolder.id, 'rules']\">\n {{ 'ACA_FOLDER_RULES.MANAGE_RULES.TOOLBAR.ACTIONS.SEE_IN_FOLDER' | translate }}\n </button>\n </ng-template>\n </div>\n </div>\n\n <div class=\"aca-manage-rules__container__rule-details__content\" *ngIf=\"(selectedRule$ | async) as selectedRule\">\n <aca-rule-details\n [actionDefinitions]=\"actionDefinitions$ | async\"\n [readOnly]=\"true\"\n [preview]=\"true\"\n [value]=\"selectedRule\"\n [nodeId]=\"nodeId\">\n </aca-rule-details>\n </div>\n </div>\n </div>\n\n <ng-template #emptyContent>\n <adf-empty-content\n icon=\"library_books\"\n [title]=\"'ACA_FOLDER_RULES.MANAGE_RULES.EMPTY_RULES_LIST.TITLE' | translate\"\n [subtitle]=\"'ACA_FOLDER_RULES.MANAGE_RULES.EMPTY_RULES_LIST.SUBTITLE' | translate\"\n >\n </adf-empty-content>\n </ng-template>\n </ng-container>\n\n <ng-template #genericError>\n <aca-page-layout-error>\n <aca-generic-error></aca-generic-error>\n </aca-page-layout-error>\n </ng-template>\n\n </ng-template>\n\n </div>\n </aca-page-layout-content>\n\n</aca-page-layout>\n", styles: [".aca-manage-rules__actions-bar{padding:0 30px;display:flex;align-items:center}.aca-manage-rules__actions-bar__title{align-items:center;width:unset!important;flex:1}.aca-manage-rules__actions-bar__title__breadcrumb{margin-left:18px}.aca-manage-rules__actions-bar__buttons{display:flex;align-items:stretch;gap:12px}.aca-manage-rules__actions-bar .mat-slide-toggle-label{font-weight:600;font-size:14px;color:var(--adf-breadcrumb-item-active-color)}.aca-manage-rules__actions-bar .vertical-divider{height:50%;margin:0 12px}.aca-manage-rules__container{display:grid;grid-template-columns:minmax(250px,1fr) 3fr;padding:20px;gap:12px;overflow-y:auto;flex:1}.aca-manage-rules__container__rule-details{border:1px solid var(--theme-border-color);border-radius:12px;overflow-y:auto}.aca-manage-rules__container__rule-details__header{position:sticky;top:0;z-index:1;display:flex;flex-direction:row;align-items:flex-start;overflow-x:auto;justify-content:space-between;padding:12px 20px;border-bottom:1px solid var(--theme-border-color);background-color:var(--theme-background-color);column-gap:20px}.aca-manage-rules__container__rule-details__header__title{display:flex;flex-direction:column;gap:4px;word-wrap:break-word;min-width:100px}.aca-manage-rules__container__rule-details__header__title__name{font-size:1.2em;font-weight:700}.aca-manage-rules__container__rule-details__header__title__description{font-size:.8em;font-style:italic}.aca-manage-rules__container__rule-details__header__buttons{display:flex;flex-direction:row;align-items:stretch;gap:4px}.aca-manage-rules__container__rule-details__header__buttons button{color:var(--theme-text-color)}.aca-manage-rules__container__rule-details__header__buttons button#delete-rule-btn{padding:0 8px;min-width:unset}.aca-manage-rules__container__rule-details__header__buttons button .mat-icon{overflow:hidden!important}\n"] }]
|
|
2350
|
+
}], ctorParameters: function () { return [{ type: i1$1.Location }, { type: FolderRulesService }, { type: i3$3.ActivatedRoute }, { type: i2.MatDialog }, { type: i1.NotificationService }, { type: ActionsService }, { type: FolderRuleSetsService }]; } });
|
|
2351
|
+
|
|
2352
|
+
/*!
|
|
2353
|
+
* Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved.
|
|
2354
|
+
*
|
|
2355
|
+
* Alfresco Example Content Application
|
|
2356
|
+
*
|
|
2357
|
+
* This file is part of the Alfresco Example Content Application.
|
|
2358
|
+
* If the software was purchased under a paid Alfresco license, the terms of
|
|
2359
|
+
* the paid license agreement will prevail. Otherwise, the software is
|
|
2360
|
+
* provided under the following open source license terms:
|
|
2361
|
+
*
|
|
2362
|
+
* The Alfresco Example Content Application is free software: you can redistribute it and/or modify
|
|
2363
|
+
* it under the terms of the GNU Lesser General Public License as published by
|
|
2364
|
+
* the Free Software Foundation, either version 3 of the License, or
|
|
2365
|
+
* (at your option) any later version.
|
|
2366
|
+
*
|
|
2367
|
+
* The Alfresco Example Content Application is distributed in the hope that it will be useful,
|
|
2368
|
+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
2369
|
+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
2370
|
+
* GNU Lesser General Public License for more details.
|
|
2371
|
+
*
|
|
2372
|
+
* You should have received a copy of the GNU Lesser General Public License
|
|
2373
|
+
* from Hyland Software. If not, see <http://www.gnu.org/licenses/>.
|
|
2374
|
+
*/
|
|
2375
|
+
const routes = [
|
|
2376
|
+
{
|
|
2377
|
+
path: 'rules',
|
|
2378
|
+
component: ManageRulesSmartComponent
|
|
2379
|
+
}
|
|
2380
|
+
];
|
|
2381
|
+
class AcaFolderRulesModule {
|
|
2382
|
+
constructor(translation, extensions) {
|
|
2383
|
+
translation.addTranslationFolder('folder-rules', 'assets/folder-rules');
|
|
2384
|
+
extensions.setEvaluators({
|
|
2385
|
+
'rules.canManageFolderRules': canManageFolderRules
|
|
2386
|
+
});
|
|
2387
|
+
}
|
|
2388
|
+
}
|
|
2389
|
+
AcaFolderRulesModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.1.3", ngImport: i0, type: AcaFolderRulesModule, deps: [{ token: i1.TranslationService }, { token: i2$4.ExtensionService }], target: i0.ɵɵFactoryTarget.NgModule });
|
|
2390
|
+
AcaFolderRulesModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "14.1.3", ngImport: i0, type: AcaFolderRulesModule, declarations: [EditRuleDialogUiComponent,
|
|
2391
|
+
ManageRulesSmartComponent,
|
|
2392
|
+
RuleActionListUiComponent,
|
|
2393
|
+
RuleActionUiComponent,
|
|
2394
|
+
RuleCompositeConditionUiComponent,
|
|
2395
|
+
RuleDetailsUiComponent,
|
|
2396
|
+
RuleListGroupingUiComponent,
|
|
2397
|
+
RuleListItemUiComponent,
|
|
2398
|
+
RuleListUiComponent,
|
|
2399
|
+
RuleSetPickerSmartComponent,
|
|
2400
|
+
RuleSimpleConditionUiComponent,
|
|
2401
|
+
RuleTriggersUiComponent,
|
|
2402
|
+
RuleOptionsUiComponent], imports: [CommonModule, i3$3.RouterModule, i1.CoreModule, PageLayoutModule,
|
|
2403
|
+
BreadcrumbModule,
|
|
2404
|
+
DocumentListModule,
|
|
2405
|
+
ExtensionsModule,
|
|
2406
|
+
ContentNodeSelectorModule,
|
|
2407
|
+
GenericErrorComponent] });
|
|
2408
|
+
AcaFolderRulesModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "14.1.3", ngImport: i0, type: AcaFolderRulesModule, providers: [provideExtensionConfig(['folder-rules.plugin.json'])], imports: [CommonModule,
|
|
2409
|
+
RouterModule.forChild(routes),
|
|
2410
|
+
CoreModule.forChild(),
|
|
2411
|
+
PageLayoutModule,
|
|
2412
|
+
BreadcrumbModule,
|
|
2413
|
+
DocumentListModule,
|
|
2414
|
+
ExtensionsModule,
|
|
2415
|
+
ContentNodeSelectorModule,
|
|
2416
|
+
GenericErrorComponent] });
|
|
2417
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.1.3", ngImport: i0, type: AcaFolderRulesModule, decorators: [{
|
|
2418
|
+
type: NgModule,
|
|
2419
|
+
args: [{
|
|
2420
|
+
providers: [provideExtensionConfig(['folder-rules.plugin.json'])],
|
|
2421
|
+
imports: [
|
|
2422
|
+
CommonModule,
|
|
2423
|
+
RouterModule.forChild(routes),
|
|
2424
|
+
CoreModule.forChild(),
|
|
2425
|
+
PageLayoutModule,
|
|
2426
|
+
BreadcrumbModule,
|
|
2427
|
+
DocumentListModule,
|
|
2428
|
+
ExtensionsModule,
|
|
2429
|
+
ContentNodeSelectorModule,
|
|
2430
|
+
GenericErrorComponent
|
|
2431
|
+
],
|
|
2432
|
+
declarations: [
|
|
2433
|
+
EditRuleDialogUiComponent,
|
|
2434
|
+
ManageRulesSmartComponent,
|
|
2435
|
+
RuleActionListUiComponent,
|
|
2436
|
+
RuleActionUiComponent,
|
|
2437
|
+
RuleCompositeConditionUiComponent,
|
|
2438
|
+
RuleDetailsUiComponent,
|
|
2439
|
+
RuleListGroupingUiComponent,
|
|
2440
|
+
RuleListItemUiComponent,
|
|
2441
|
+
RuleListUiComponent,
|
|
2442
|
+
RuleSetPickerSmartComponent,
|
|
2443
|
+
RuleSimpleConditionUiComponent,
|
|
2444
|
+
RuleTriggersUiComponent,
|
|
2445
|
+
RuleOptionsUiComponent
|
|
2446
|
+
]
|
|
2447
|
+
}]
|
|
2448
|
+
}], ctorParameters: function () { return [{ type: i1.TranslationService }, { type: i2$4.ExtensionService }]; } });
|
|
2449
|
+
|
|
2450
|
+
/*!
|
|
2451
|
+
* Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved.
|
|
2452
|
+
*
|
|
2453
|
+
* Alfresco Example Content Application
|
|
2454
|
+
*
|
|
2455
|
+
* This file is part of the Alfresco Example Content Application.
|
|
2456
|
+
* If the software was purchased under a paid Alfresco license, the terms of
|
|
2457
|
+
* the paid license agreement will prevail. Otherwise, the software is
|
|
2458
|
+
* provided under the following open source license terms:
|
|
2459
|
+
*
|
|
2460
|
+
* The Alfresco Example Content Application is free software: you can redistribute it and/or modify
|
|
2461
|
+
* it under the terms of the GNU Lesser General Public License as published by
|
|
2462
|
+
* the Free Software Foundation, either version 3 of the License, or
|
|
2463
|
+
* (at your option) any later version.
|
|
2464
|
+
*
|
|
2465
|
+
* The Alfresco Example Content Application is distributed in the hope that it will be useful,
|
|
2466
|
+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
2467
|
+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
2468
|
+
* GNU Lesser General Public License for more details.
|
|
2469
|
+
*
|
|
2470
|
+
* You should have received a copy of the GNU Lesser General Public License
|
|
2471
|
+
* from Hyland Software. If not, see <http://www.gnu.org/licenses/>.
|
|
2472
|
+
*/
|
|
2473
|
+
|
|
2474
|
+
/**
|
|
2475
|
+
* Generated bundle index. Do not edit.
|
|
2476
|
+
*/
|
|
2477
|
+
|
|
2478
|
+
export { AcaFolderRulesModule, ManageRulesSmartComponent };
|
|
2479
|
+
//# sourceMappingURL=alfresco-aca-content-folder-rules.mjs.map
|