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