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