@alfresco/aca-shared 1.12.0 → 4.0.0-A.2-9919
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/README.md +2 -1
- package/esm2020/alfresco-aca-shared.mjs +5 -0
- package/esm2020/lib/adf-extensions/extensions-data-loader.guard.mjs +74 -0
- package/esm2020/lib/components/document-base-page/document-base-page.component.mjs +160 -0
- package/esm2020/lib/components/document-base-page/document-base-page.service.mjs +10 -0
- package/esm2020/lib/components/generic-error/generic-error.component.mjs +42 -0
- package/esm2020/lib/components/generic-error/generic-error.module.mjs +45 -0
- package/esm2020/lib/components/info-drawer/info-drawer.component.mjs +124 -0
- package/esm2020/lib/components/info-drawer/shared-info-drawer.module.mjs +47 -0
- package/esm2020/lib/components/locked-by/locked-by.component.mjs +53 -0
- package/esm2020/lib/components/locked-by/locked-by.module.mjs +45 -0
- package/esm2020/lib/components/page-layout/page-layout-content.component.mjs +49 -0
- package/{esm2015/lib/models/types.js → esm2020/lib/components/page-layout/page-layout-error.component.mjs} +16 -42
- package/esm2020/lib/components/page-layout/page-layout-header.component.mjs +41 -0
- package/esm2020/lib/components/page-layout/page-layout.component.mjs +41 -0
- package/esm2020/lib/components/page-layout/page-layout.module.mjs +45 -0
- package/esm2020/lib/components/tool-bar/shared-toolbar.module.mjs +47 -0
- package/esm2020/lib/components/tool-bar/toolbar-action/toolbar-action.component.mjs +58 -0
- package/esm2020/lib/components/tool-bar/toolbar-button/toolbar-button.component.mjs +67 -0
- package/esm2020/lib/components/tool-bar/toolbar-menu/toolbar-menu.component.mjs +78 -0
- package/esm2020/lib/components/tool-bar/toolbar-menu-item/toolbar-menu-item.component.mjs +69 -0
- package/esm2020/lib/directives/contextmenu/contextmenu.directive.mjs +107 -0
- package/{esm2015/lib/components/locked-by/locked-by.module.js → esm2020/lib/directives/contextmenu/contextmenu.module.mjs} +17 -16
- package/esm2020/lib/directives/pagination.directive.mjs +55 -0
- package/esm2020/lib/directives/shared.directives.module.mjs +42 -0
- package/esm2020/lib/models/modal-configuration.mjs +2 -0
- package/esm2020/lib/models/types.mjs +26 -0
- package/esm2020/lib/models/viewer.rules.mjs +26 -0
- package/esm2020/lib/routing/shared.guard.mjs +49 -0
- package/esm2020/lib/services/alfresco-office-extension.service.mjs +64 -0
- package/esm2020/lib/services/app-hook.service.mjs +88 -0
- package/esm2020/lib/services/app.extension.service.mjs +453 -0
- package/esm2020/lib/services/app.service.mjs +213 -0
- package/esm2020/lib/services/content-api.service.mjs +268 -0
- package/esm2020/lib/services/node-permission.service.mjs +90 -0
- package/esm2020/lib/services/router.extension.service.mjs +106 -0
- package/esm2020/lib/shared.module.mjs +49 -0
- package/esm2020/lib/testing/lib-testing-module.mjs +118 -0
- package/esm2020/lib/testing/translation.service.mjs +45 -0
- package/esm2020/lib/utils/node.utils.mjs +34 -0
- package/esm2020/public-api.mjs +63 -0
- package/esm2020/rules/alfresco-aca-shared-rules.mjs +5 -0
- package/esm2020/rules/app.rules.mjs +503 -0
- package/esm2020/rules/navigation.rules.mjs +152 -0
- package/{esm5/store/store.module.js → esm2020/rules/public-api.mjs} +5 -23
- package/{esm5/store/actions/metadata-aspect.actions.js → esm2020/rules/repository.rules.mjs} +9 -20
- package/{esm2015/rules/repository.rules.js → esm2020/rules/user.rules.mjs} +4 -12
- package/esm2020/store/actions/app-action-types.mjs +48 -0
- package/esm2020/store/actions/app.actions.mjs +135 -0
- package/esm2020/store/actions/context-menu-action-types.mjs +29 -0
- package/esm2020/store/actions/contextmenu.actions.mjs +32 -0
- package/esm2020/store/actions/library.actions.mjs +64 -0
- package/{esm5/lib/components/locked-by/locked-by.module.js → esm2020/store/actions/metadata-aspect.actions.mjs} +7 -21
- package/esm2020/store/actions/node.actions.mjs +189 -0
- package/esm2020/store/actions/router-action-types.mjs +33 -0
- package/esm2020/store/actions/router.actions.mjs +55 -0
- package/{esm2015/lib/components/page-layout/page-layout-content.component.js → esm2020/store/actions/search.actions.mjs} +10 -27
- package/esm2020/store/actions/snackbar.actions.mjs +58 -0
- package/esm2020/store/actions/template-action-types.mjs +32 -0
- package/esm2020/store/actions/template.actions.mjs +48 -0
- package/esm2020/store/actions/upload.actions.mjs +50 -0
- package/esm2020/store/actions/viewer.actions.mjs +82 -0
- package/esm2020/store/alfresco-aca-shared-store.mjs +5 -0
- package/esm2020/store/effects/dialog.effects.mjs +45 -0
- package/esm2020/store/effects/router.effects.mjs +117 -0
- package/esm2020/store/effects/snackbar.effects.mjs +86 -0
- package/esm2020/store/models/delete-status.model.mjs +26 -0
- package/esm2020/store/models/deleted-node-info.model.mjs +26 -0
- package/esm2020/store/models/modal-configuration.mjs +2 -0
- package/{esm2015/lib/components/page-layout/page-layout-error.component.js → esm2020/store/models/node-info.model.mjs} +2 -19
- package/{esm5/lib/components/page-layout/page-layout-error.component.js → esm2020/store/models/search-option.model.mjs} +7 -21
- package/esm2020/store/public-api.mjs +50 -0
- package/esm2020/store/selectors/app.selectors.mjs +60 -0
- package/{esm5/lib/directives/shared.directives.module.js → esm2020/store/states/app.state.mjs} +3 -21
- package/esm2020/store/store.module.mjs +43 -0
- package/fesm2015/alfresco-aca-shared-rules.mjs +751 -0
- package/fesm2015/alfresco-aca-shared-rules.mjs.map +1 -0
- package/fesm2015/alfresco-aca-shared-store.mjs +1327 -0
- package/fesm2015/alfresco-aca-shared-store.mjs.map +1 -0
- package/fesm2015/alfresco-aca-shared.mjs +2726 -0
- package/fesm2015/alfresco-aca-shared.mjs.map +1 -0
- package/{fesm2015/alfresco-aca-shared-rules.js → fesm2020/alfresco-aca-shared-rules.mjs} +273 -353
- package/fesm2020/alfresco-aca-shared-rules.mjs.map +1 -0
- package/fesm2020/alfresco-aca-shared-store.mjs +1406 -0
- package/fesm2020/alfresco-aca-shared-store.mjs.map +1 -0
- package/fesm2020/alfresco-aca-shared.mjs +2841 -0
- package/fesm2020/alfresco-aca-shared.mjs.map +1 -0
- package/{rules/alfresco-aca-shared-rules.d.ts → index.d.ts} +1 -0
- package/lib/adf-extensions/extensions-data-loader.guard.d.ts +4 -1
- package/lib/components/document-base-page/document-base-page.component.d.ts +74 -0
- package/lib/components/document-base-page/document-base-page.service.d.ts +5 -0
- package/lib/components/generic-error/generic-error.component.d.ts +3 -24
- package/lib/components/generic-error/generic-error.module.d.ts +8 -24
- package/lib/components/info-drawer/info-drawer.component.d.ts +6 -0
- package/lib/components/info-drawer/shared-info-drawer.module.d.ts +11 -24
- package/lib/components/locked-by/locked-by.component.d.ts +5 -30
- package/lib/components/locked-by/locked-by.module.d.ts +8 -24
- package/lib/components/page-layout/page-layout-content.component.d.ts +3 -24
- package/lib/components/page-layout/page-layout-error.component.d.ts +3 -24
- package/lib/components/page-layout/page-layout-header.component.d.ts +3 -24
- package/lib/components/page-layout/page-layout.component.d.ts +3 -24
- package/lib/components/page-layout/page-layout.module.d.ts +9 -24
- package/lib/components/tool-bar/shared-toolbar.module.d.ts +11 -24
- package/lib/components/tool-bar/toolbar-action/toolbar-action.component.d.ts +7 -2
- package/lib/components/tool-bar/toolbar-button/toolbar-button.component.d.ts +5 -25
- package/lib/components/tool-bar/toolbar-menu/toolbar-menu.component.d.ts +15 -6
- package/lib/components/tool-bar/toolbar-menu-item/toolbar-menu-item.component.d.ts +7 -27
- package/lib/directives/contextmenu/contextmenu.directive.d.ts +5 -1
- package/lib/directives/contextmenu/contextmenu.module.d.ts +5 -24
- package/lib/directives/pagination.directive.d.ts +3 -0
- package/lib/directives/shared.directives.module.d.ts +6 -24
- package/lib/models/modal-configuration.d.ts +3 -0
- package/lib/models/viewer.rules.d.ts +4 -0
- package/lib/routing/shared.guard.d.ts +3 -24
- package/lib/services/alfresco-office-extension.service.d.ts +11 -0
- package/lib/services/app-hook.service.d.ts +55 -0
- package/lib/services/app.extension.service.d.ts +31 -53
- package/lib/services/app.service.d.ts +43 -7
- package/lib/services/content-api.service.d.ts +35 -25
- package/lib/services/node-permission.service.d.ts +3 -24
- package/lib/services/router.extension.service.d.ts +21 -0
- package/lib/shared.module.d.ts +6 -1
- package/lib/testing/lib-testing-module.d.ts +43 -0
- package/lib/testing/translation.service.d.ts +10 -0
- package/package.json +58 -21
- package/public-api.d.ts +19 -5
- package/rules/app.rules.d.ts +104 -30
- package/{store/alfresco-aca-shared-store.d.ts → rules/index.d.ts} +1 -0
- package/rules/navigation.rules.d.ts +6 -6
- package/rules/repository.rules.d.ts +2 -1
- package/rules/user.rules.d.ts +1 -1
- package/store/actions/app-action-types.d.ts +46 -0
- package/store/actions/app.actions.d.ts +25 -18
- package/{lib/routing/app.routes.strategy.d.ts → store/actions/context-menu-action-types.d.ts} +2 -15
- package/store/actions/contextmenu.actions.d.ts +1 -3
- package/store/actions/library.actions.d.ts +3 -1
- package/store/actions/node.actions.d.ts +33 -7
- package/store/actions/router-action-types.d.ts +31 -0
- package/store/actions/router.actions.d.ts +5 -6
- package/store/actions/search.actions.d.ts +1 -13
- package/store/actions/snackbar.actions.d.ts +8 -11
- package/store/actions/template-action-types.d.ts +30 -0
- package/store/actions/template.actions.d.ts +1 -6
- package/store/actions/upload.actions.d.ts +3 -1
- package/store/actions/viewer.actions.d.ts +22 -1
- package/store/effects/dialog.effects.d.ts +4 -1
- package/store/effects/router.effects.d.ts +11 -29
- package/store/effects/snackbar.effects.d.ts +6 -3
- package/store/index.d.ts +5 -0
- package/store/models/modal-configuration.d.ts +3 -0
- package/store/public-api.d.ts +4 -0
- package/store/selectors/app.selectors.d.ts +33 -19
- package/store/states/app.state.d.ts +10 -2
- package/store/store.module.d.ts +5 -24
- package/alfresco-aca-shared.d.ts +0 -11
- package/alfresco-aca-shared.metadata.json +0 -1
- package/bundles/alfresco-aca-shared-rules.umd.js +0 -895
- package/bundles/alfresco-aca-shared-rules.umd.js.map +0 -1
- package/bundles/alfresco-aca-shared-rules.umd.min.js +0 -75
- package/bundles/alfresco-aca-shared-rules.umd.min.js.map +0 -1
- package/bundles/alfresco-aca-shared-store.umd.js +0 -1399
- package/bundles/alfresco-aca-shared-store.umd.js.map +0 -1
- package/bundles/alfresco-aca-shared-store.umd.min.js +0 -26
- package/bundles/alfresco-aca-shared-store.umd.min.js.map +0 -1
- package/bundles/alfresco-aca-shared.umd.js +0 -2845
- package/bundles/alfresco-aca-shared.umd.js.map +0 -1
- package/bundles/alfresco-aca-shared.umd.min.js +0 -27
- package/bundles/alfresco-aca-shared.umd.min.js.map +0 -1
- package/esm2015/alfresco-aca-shared.js +0 -16
- package/esm2015/lib/adf-extensions/extensions-data-loader.guard.js +0 -106
- package/esm2015/lib/components/generic-error/generic-error.component.js +0 -52
- package/esm2015/lib/components/generic-error/generic-error.module.js +0 -43
- package/esm2015/lib/components/info-drawer/info-drawer.component.js +0 -179
- package/esm2015/lib/components/info-drawer/shared-info-drawer.module.js +0 -52
- package/esm2015/lib/components/locked-by/locked-by.component.js +0 -74
- package/esm2015/lib/components/page-layout/page-layout-header.component.js +0 -41
- package/esm2015/lib/components/page-layout/page-layout.component.js +0 -52
- package/esm2015/lib/components/page-layout/page-layout.module.js +0 -54
- package/esm2015/lib/components/tool-bar/shared-toolbar.module.js +0 -56
- package/esm2015/lib/components/tool-bar/toolbar-action/toolbar-action.component.js +0 -81
- package/esm2015/lib/components/tool-bar/toolbar-button/toolbar-button.component.js +0 -96
- package/esm2015/lib/components/tool-bar/toolbar-menu/toolbar-menu.component.js +0 -69
- package/esm2015/lib/components/tool-bar/toolbar-menu-item/toolbar-menu-item.component.js +0 -95
- package/esm2015/lib/directives/contextmenu/contextmenu.directive.js +0 -156
- package/esm2015/lib/directives/contextmenu/contextmenu.module.js +0 -42
- package/esm2015/lib/directives/pagination.directive.js +0 -93
- package/esm2015/lib/directives/shared.directives.module.js +0 -41
- package/esm2015/lib/models/viewer.rules.js +0 -40
- package/esm2015/lib/routing/app.routes.strategy.js +0 -207
- package/esm2015/lib/routing/shared.guard.js +0 -70
- package/esm2015/lib/services/app.extension.service.js +0 -686
- package/esm2015/lib/services/app.service.js +0 -95
- package/esm2015/lib/services/content-api.service.js +0 -331
- package/esm2015/lib/services/node-permission.service.js +0 -133
- package/esm2015/lib/shared.module.js +0 -51
- package/esm2015/lib/utils/node.utils.js +0 -53
- package/esm2015/public-api.js +0 -53
- package/esm2015/rules/alfresco-aca-shared-rules.js +0 -9
- package/esm2015/rules/app.rules.js +0 -563
- package/esm2015/rules/navigation.rules.js +0 -211
- package/esm2015/rules/public-api.js +0 -33
- package/esm2015/rules/user.rules.js +0 -38
- package/esm2015/store/actions/app.actions.js +0 -234
- package/esm2015/store/actions/contextmenu.actions.js +0 -49
- package/esm2015/store/actions/library.actions.js +0 -111
- package/esm2015/store/actions/metadata-aspect.actions.js +0 -46
- package/esm2015/store/actions/node.actions.js +0 -337
- package/esm2015/store/actions/router.actions.js +0 -97
- package/esm2015/store/actions/search.actions.js +0 -83
- package/esm2015/store/actions/snackbar.actions.js +0 -138
- package/esm2015/store/actions/template.actions.js +0 -85
- package/esm2015/store/actions/upload.actions.js +0 -81
- package/esm2015/store/actions/viewer.actions.js +0 -115
- package/esm2015/store/alfresco-aca-shared-store.js +0 -9
- package/esm2015/store/effects/dialog.effects.js +0 -72
- package/esm2015/store/effects/router.effects.js +0 -192
- package/esm2015/store/effects/snackbar.effects.js +0 -144
- package/esm2015/store/models/delete-status.model.js +0 -55
- package/esm2015/store/models/deleted-node-info.model.js +0 -41
- package/esm2015/store/models/node-info.model.js +0 -45
- package/esm2015/store/models/search-option.model.js +0 -52
- package/esm2015/store/public-api.js +0 -50
- package/esm2015/store/selectors/app.selectors.js +0 -82
- package/esm2015/store/states/app.state.js +0 -71
- package/esm2015/store/store.module.js +0 -43
- package/esm5/alfresco-aca-shared.js +0 -16
- package/esm5/lib/adf-extensions/extensions-data-loader.guard.js +0 -115
- package/esm5/lib/components/generic-error/generic-error.component.js +0 -54
- package/esm5/lib/components/generic-error/generic-error.module.js +0 -47
- package/esm5/lib/components/info-drawer/info-drawer.component.js +0 -209
- package/esm5/lib/components/info-drawer/shared-info-drawer.module.js +0 -56
- package/esm5/lib/components/locked-by/locked-by.component.js +0 -80
- package/esm5/lib/components/page-layout/page-layout-content.component.js +0 -53
- package/esm5/lib/components/page-layout/page-layout-header.component.js +0 -45
- package/esm5/lib/components/page-layout/page-layout.component.js +0 -54
- package/esm5/lib/components/page-layout/page-layout.module.js +0 -58
- package/esm5/lib/components/tool-bar/shared-toolbar.module.js +0 -60
- package/esm5/lib/components/tool-bar/toolbar-action/toolbar-action.component.js +0 -88
- package/esm5/lib/components/tool-bar/toolbar-button/toolbar-button.component.js +0 -103
- package/esm5/lib/components/tool-bar/toolbar-menu/toolbar-menu.component.js +0 -80
- package/esm5/lib/components/tool-bar/toolbar-menu-item/toolbar-menu-item.component.js +0 -103
- package/esm5/lib/directives/contextmenu/contextmenu.directive.js +0 -187
- package/esm5/lib/directives/contextmenu/contextmenu.module.js +0 -46
- package/esm5/lib/directives/pagination.directive.js +0 -97
- package/esm5/lib/models/types.js +0 -67
- package/esm5/lib/models/viewer.rules.js +0 -40
- package/esm5/lib/routing/app.routes.strategy.js +0 -268
- package/esm5/lib/routing/shared.guard.js +0 -77
- package/esm5/lib/services/app.extension.service.js +0 -835
- package/esm5/lib/services/app.service.js +0 -100
- package/esm5/lib/services/content-api.service.js +0 -495
- package/esm5/lib/services/node-permission.service.js +0 -161
- package/esm5/lib/shared.module.js +0 -58
- package/esm5/lib/utils/node.utils.js +0 -53
- package/esm5/public-api.js +0 -53
- package/esm5/rules/alfresco-aca-shared-rules.js +0 -9
- package/esm5/rules/app.rules.js +0 -563
- package/esm5/rules/navigation.rules.js +0 -211
- package/esm5/rules/public-api.js +0 -33
- package/esm5/rules/repository.rules.js +0 -38
- package/esm5/rules/user.rules.js +0 -38
- package/esm5/store/actions/app.actions.js +0 -232
- package/esm5/store/actions/contextmenu.actions.js +0 -48
- package/esm5/store/actions/library.actions.js +0 -108
- package/esm5/store/actions/node.actions.js +0 -322
- package/esm5/store/actions/router.actions.js +0 -93
- package/esm5/store/actions/search.actions.js +0 -87
- package/esm5/store/actions/snackbar.actions.js +0 -130
- package/esm5/store/actions/template.actions.js +0 -87
- package/esm5/store/actions/upload.actions.js +0 -78
- package/esm5/store/actions/viewer.actions.js +0 -109
- package/esm5/store/alfresco-aca-shared-store.js +0 -9
- package/esm5/store/effects/dialog.effects.js +0 -71
- package/esm5/store/effects/router.effects.js +0 -207
- package/esm5/store/effects/snackbar.effects.js +0 -154
- package/esm5/store/models/delete-status.model.js +0 -55
- package/esm5/store/models/deleted-node-info.model.js +0 -41
- package/esm5/store/models/node-info.model.js +0 -45
- package/esm5/store/models/search-option.model.js +0 -52
- package/esm5/store/public-api.js +0 -50
- package/esm5/store/selectors/app.selectors.js +0 -82
- package/esm5/store/states/app.state.js +0 -71
- package/fesm2015/alfresco-aca-shared-rules.js.map +0 -1
- package/fesm2015/alfresco-aca-shared-store.js +0 -1354
- package/fesm2015/alfresco-aca-shared-store.js.map +0 -1
- package/fesm2015/alfresco-aca-shared.js +0 -2096
- package/fesm2015/alfresco-aca-shared.js.map +0 -1
- package/fesm5/alfresco-aca-shared-rules.js +0 -827
- package/fesm5/alfresco-aca-shared-rules.js.map +0 -1
- package/fesm5/alfresco-aca-shared-store.js +0 -1278
- package/fesm5/alfresco-aca-shared-store.js.map +0 -1
- package/fesm5/alfresco-aca-shared.js +0 -2637
- package/fesm5/alfresco-aca-shared.js.map +0 -1
- package/rules/alfresco-aca-shared-rules.metadata.json +0 -1
- package/rules/package.json +0 -13
- package/store/alfresco-aca-shared-store.metadata.json +0 -1
- package/store/package.json +0 -13
|
@@ -1,2096 +0,0 @@
|
|
|
1
|
-
import { __awaiter } from 'tslib';
|
|
2
|
-
import { DomSanitizer } from '@angular/platform-browser';
|
|
3
|
-
import '@alfresco/js-api';
|
|
4
|
-
import { ContentActionType, ExtensionLoaderService, sortByOrder, reduceSeparators, reduceEmptyMenus, ExtensionService, mergeObjects, ExtensionsModule } from '@alfresco/adf-extensions';
|
|
5
|
-
import { MatProgressBarModule } from '@angular/material';
|
|
6
|
-
import { RouteReuseStrategy } from '@angular/router';
|
|
7
|
-
import { SearchQueryBuilderService } from '@alfresco/adf-content-services';
|
|
8
|
-
import { MatIconModule, MatIconRegistry } from '@angular/material/icon';
|
|
9
|
-
import { CommonModule } from '@angular/common';
|
|
10
|
-
import { TranslateModule } from '@ngx-translate/core';
|
|
11
|
-
import { map, catchError, takeUntil, debounceTime } from 'rxjs/operators';
|
|
12
|
-
import { forkJoin, of, BehaviorSubject, from, Subject } from 'rxjs';
|
|
13
|
-
import { Store } from '@ngrx/store';
|
|
14
|
-
import { getRuleContext, getLanguagePickerState, getAppSelection, SetInfoDrawerStateAction, ToggleInfoDrawerAction, isQuickShareEnabled, ContextMenu } from '@alfresco/aca-shared/store';
|
|
15
|
-
import { AppConfigService, AuthenticationService, LogService, PaginationComponent, UserPreferencesService, CoreModule, InfoDrawerModule, ToolbarModule, AlfrescoApiService } from '@alfresco/adf-core';
|
|
16
|
-
import { Injectable, InjectionToken, Inject, Directive, HostListener, Input, Component, ViewEncapsulation, ChangeDetectionStrategy, ChangeDetectorRef, NgModule, HostBinding, defineInjectable, inject } from '@angular/core';
|
|
17
|
-
|
|
18
|
-
/**
|
|
19
|
-
* @fileoverview added by tsickle
|
|
20
|
-
* @suppress {checkTypes,extraRequire,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
21
|
-
*/
|
|
22
|
-
/**
|
|
23
|
-
* @return {?}
|
|
24
|
-
*/
|
|
25
|
-
function DefaultExtensionLoaderFactory() {
|
|
26
|
-
return [];
|
|
27
|
-
}
|
|
28
|
-
/** @type {?} */
|
|
29
|
-
const EXTENSION_DATA_LOADERS = new InjectionToken('EXTENSION_DATA_LOADERS', {
|
|
30
|
-
providedIn: 'root',
|
|
31
|
-
factory: DefaultExtensionLoaderFactory
|
|
32
|
-
});
|
|
33
|
-
class ExtensionsDataLoaderGuard {
|
|
34
|
-
/**
|
|
35
|
-
* @param {?} extensionDataLoaders
|
|
36
|
-
*/
|
|
37
|
-
constructor(extensionDataLoaders) {
|
|
38
|
-
this.extensionDataLoaders = extensionDataLoaders;
|
|
39
|
-
this.invoked = false;
|
|
40
|
-
}
|
|
41
|
-
/**
|
|
42
|
-
* @param {?} route
|
|
43
|
-
* @return {?}
|
|
44
|
-
*/
|
|
45
|
-
canActivate(route) {
|
|
46
|
-
if (!this.invoked) {
|
|
47
|
-
this.invoked = true;
|
|
48
|
-
if (!this.extensionDataLoaders.length) {
|
|
49
|
-
return of(true);
|
|
50
|
-
}
|
|
51
|
-
/** @type {?} */
|
|
52
|
-
const dataLoaderCallbacks = this.extensionDataLoaders.map(callback => callback(route));
|
|
53
|
-
// Undocumented forkJoin behaviour/bug:
|
|
54
|
-
// https://github.com/ReactiveX/rxjs/issues/3246
|
|
55
|
-
// So all callbacks need to emit before completion, otherwise forkJoin will short circuit
|
|
56
|
-
return forkJoin(...dataLoaderCallbacks).pipe(map(() => true), catchError(e => {
|
|
57
|
-
// tslint:disable-next-line
|
|
58
|
-
console.error('Some of the extension data loader guards has been errored.');
|
|
59
|
-
// tslint:disable-next-line
|
|
60
|
-
console.error(e);
|
|
61
|
-
return of(true);
|
|
62
|
-
}));
|
|
63
|
-
}
|
|
64
|
-
else {
|
|
65
|
-
return of(true);
|
|
66
|
-
}
|
|
67
|
-
}
|
|
68
|
-
/**
|
|
69
|
-
* @return {?}
|
|
70
|
-
*/
|
|
71
|
-
canActivateChild() {
|
|
72
|
-
return of(true);
|
|
73
|
-
}
|
|
74
|
-
}
|
|
75
|
-
ExtensionsDataLoaderGuard.decorators = [
|
|
76
|
-
{ type: Injectable, args: [{ providedIn: 'root' },] }
|
|
77
|
-
];
|
|
78
|
-
/** @nocollapse */
|
|
79
|
-
ExtensionsDataLoaderGuard.ctorParameters = () => [
|
|
80
|
-
{ type: Array, decorators: [{ type: Inject, args: [EXTENSION_DATA_LOADERS,] }] }
|
|
81
|
-
];
|
|
82
|
-
/** @nocollapse */ ExtensionsDataLoaderGuard.ngInjectableDef = defineInjectable({ factory: function ExtensionsDataLoaderGuard_Factory() { return new ExtensionsDataLoaderGuard(inject(EXTENSION_DATA_LOADERS)); }, token: ExtensionsDataLoaderGuard, providedIn: "root" });
|
|
83
|
-
|
|
84
|
-
/**
|
|
85
|
-
* @fileoverview added by tsickle
|
|
86
|
-
* @suppress {checkTypes,extraRequire,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
87
|
-
*/
|
|
88
|
-
class PageLayoutContentComponent {
|
|
89
|
-
constructor() {
|
|
90
|
-
this.scrollable = false;
|
|
91
|
-
}
|
|
92
|
-
}
|
|
93
|
-
PageLayoutContentComponent.decorators = [
|
|
94
|
-
{ type: Component, args: [{
|
|
95
|
-
selector: 'aca-page-layout-content',
|
|
96
|
-
template: `
|
|
97
|
-
<ng-content></ng-content>
|
|
98
|
-
`,
|
|
99
|
-
encapsulation: ViewEncapsulation.None,
|
|
100
|
-
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
101
|
-
host: { class: 'aca-page-layout-content' }
|
|
102
|
-
}] }
|
|
103
|
-
];
|
|
104
|
-
PageLayoutContentComponent.propDecorators = {
|
|
105
|
-
scrollable: [{ type: Input }, { type: HostBinding, args: ['class.scrollable',] }]
|
|
106
|
-
};
|
|
107
|
-
|
|
108
|
-
/**
|
|
109
|
-
* @fileoverview added by tsickle
|
|
110
|
-
* @suppress {checkTypes,extraRequire,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
111
|
-
*/
|
|
112
|
-
class PageLayoutErrorComponent {
|
|
113
|
-
}
|
|
114
|
-
PageLayoutErrorComponent.decorators = [
|
|
115
|
-
{ type: Component, args: [{
|
|
116
|
-
selector: 'aca-page-layout-error',
|
|
117
|
-
template: `
|
|
118
|
-
<ng-content></ng-content>
|
|
119
|
-
`,
|
|
120
|
-
encapsulation: ViewEncapsulation.None,
|
|
121
|
-
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
122
|
-
host: { class: 'aca-page-layout-error' }
|
|
123
|
-
}] }
|
|
124
|
-
];
|
|
125
|
-
|
|
126
|
-
/**
|
|
127
|
-
* @fileoverview added by tsickle
|
|
128
|
-
* @suppress {checkTypes,extraRequire,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
129
|
-
*/
|
|
130
|
-
class PageLayoutHeaderComponent {
|
|
131
|
-
}
|
|
132
|
-
PageLayoutHeaderComponent.decorators = [
|
|
133
|
-
{ type: Component, args: [{
|
|
134
|
-
selector: 'aca-page-layout-header',
|
|
135
|
-
template: '<ng-content></ng-content>',
|
|
136
|
-
encapsulation: ViewEncapsulation.None,
|
|
137
|
-
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
138
|
-
host: { class: 'aca-page-layout-header' }
|
|
139
|
-
}] }
|
|
140
|
-
];
|
|
141
|
-
|
|
142
|
-
/**
|
|
143
|
-
* @fileoverview added by tsickle
|
|
144
|
-
* @suppress {checkTypes,extraRequire,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
145
|
-
*/
|
|
146
|
-
class PageLayoutComponent {
|
|
147
|
-
constructor() {
|
|
148
|
-
this.hasError = false;
|
|
149
|
-
}
|
|
150
|
-
}
|
|
151
|
-
PageLayoutComponent.decorators = [
|
|
152
|
-
{ type: Component, args: [{
|
|
153
|
-
selector: 'aca-page-layout',
|
|
154
|
-
template: "<ng-content select=\"aca-page-layout-header\"></ng-content>\n<ng-content select=\"aca-page-layout-error\" *ngIf=\"hasError\"></ng-content>\n<ng-content select=\"aca-page-layout-content\" *ngIf=\"!hasError\"></ng-content>\n",
|
|
155
|
-
encapsulation: ViewEncapsulation.None,
|
|
156
|
-
host: { class: 'aca-page-layout' },
|
|
157
|
-
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
158
|
-
styles: [".aca-page-layout{display:flex;flex-direction:column;flex:1;height:100%;overflow:hidden;min-height:0}.aca-page-layout .aca-page-layout-header{display:flex;align-items:center;flex:0 0 65px;flex-basis:48px;background:#fafafa;border-bottom:1px solid var(--theme-border-color,rgba(0,0,0,.07));padding:0 24px}.aca-page-layout .aca-page-layout-content,.aca-page-layout .aca-page-layout-error{display:flex;flex-direction:row;flex:1;height:100%;overflow:hidden}.aca-page-layout .main-content{display:flex;flex-direction:column;flex:1;height:100%;overflow:hidden;min-height:0}.aca-page-layout .scrollable,.aca-page-layout .scrollable .main-content{overflow:auto!important}.aca-page-layout .sidebar{display:block;height:100%;overflow-y:scroll;max-width:350px;width:350px}[dir=rtl] .aca-page-layout .main-content{border-left:1px solid var(--theme-border-color,rgba(0,0,0,.07))}[dir=ltr] .aca-page-layout .main-content{border-right:1px solid var(--theme-border-color,rgba(0,0,0,.07))}"]
|
|
159
|
-
}] }
|
|
160
|
-
];
|
|
161
|
-
PageLayoutComponent.propDecorators = {
|
|
162
|
-
hasError: [{ type: Input }]
|
|
163
|
-
};
|
|
164
|
-
|
|
165
|
-
/**
|
|
166
|
-
* @fileoverview added by tsickle
|
|
167
|
-
* @suppress {checkTypes,extraRequire,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
168
|
-
*/
|
|
169
|
-
class PageLayoutModule {
|
|
170
|
-
}
|
|
171
|
-
PageLayoutModule.decorators = [
|
|
172
|
-
{ type: NgModule, args: [{
|
|
173
|
-
imports: [CommonModule],
|
|
174
|
-
declarations: [
|
|
175
|
-
PageLayoutContentComponent,
|
|
176
|
-
PageLayoutErrorComponent,
|
|
177
|
-
PageLayoutHeaderComponent,
|
|
178
|
-
PageLayoutComponent
|
|
179
|
-
],
|
|
180
|
-
exports: [
|
|
181
|
-
PageLayoutContentComponent,
|
|
182
|
-
PageLayoutErrorComponent,
|
|
183
|
-
PageLayoutHeaderComponent,
|
|
184
|
-
PageLayoutComponent
|
|
185
|
-
]
|
|
186
|
-
},] }
|
|
187
|
-
];
|
|
188
|
-
|
|
189
|
-
/**
|
|
190
|
-
* @fileoverview added by tsickle
|
|
191
|
-
* @suppress {checkTypes,extraRequire,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
192
|
-
*/
|
|
193
|
-
class LockedByComponent {
|
|
194
|
-
constructor() { }
|
|
195
|
-
/**
|
|
196
|
-
* @return {?}
|
|
197
|
-
*/
|
|
198
|
-
ngOnInit() {
|
|
199
|
-
this.node = this.context.row.node;
|
|
200
|
-
}
|
|
201
|
-
/**
|
|
202
|
-
* @return {?}
|
|
203
|
-
*/
|
|
204
|
-
writeLockedBy() {
|
|
205
|
-
return (this.node &&
|
|
206
|
-
this.node.entry.properties &&
|
|
207
|
-
this.node.entry.properties['cm:lockOwner'] &&
|
|
208
|
-
this.node.entry.properties['cm:lockOwner'].displayName);
|
|
209
|
-
}
|
|
210
|
-
}
|
|
211
|
-
LockedByComponent.decorators = [
|
|
212
|
-
{ type: Component, args: [{
|
|
213
|
-
selector: 'aca-locked-by',
|
|
214
|
-
template: `
|
|
215
|
-
<mat-icon class="locked_by--icon">lock</mat-icon>
|
|
216
|
-
<span class="locked_by--name">{{ writeLockedBy() }}</span>
|
|
217
|
-
`,
|
|
218
|
-
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
219
|
-
encapsulation: ViewEncapsulation.None,
|
|
220
|
-
host: {
|
|
221
|
-
class: 'aca-locked-by'
|
|
222
|
-
},
|
|
223
|
-
styles: [".aca-locked-by{display:flex;align-items:center;padding:0 10px;color:var(--theme-text-color,rgba(0,0,0,.54))}.aca-locked-by .locked_by--icon{font-size:14px;width:14px;height:14px}.aca-locked-by .locked_by--name{font-size:12px;padding:0 2px}"]
|
|
224
|
-
}] }
|
|
225
|
-
];
|
|
226
|
-
/** @nocollapse */
|
|
227
|
-
LockedByComponent.ctorParameters = () => [];
|
|
228
|
-
LockedByComponent.propDecorators = {
|
|
229
|
-
context: [{ type: Input }]
|
|
230
|
-
};
|
|
231
|
-
|
|
232
|
-
/**
|
|
233
|
-
* @fileoverview added by tsickle
|
|
234
|
-
* @suppress {checkTypes,extraRequire,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
235
|
-
*/
|
|
236
|
-
class LockedByModule {
|
|
237
|
-
}
|
|
238
|
-
LockedByModule.decorators = [
|
|
239
|
-
{ type: NgModule, args: [{
|
|
240
|
-
imports: [CommonModule, MatIconModule],
|
|
241
|
-
declarations: [LockedByComponent],
|
|
242
|
-
exports: [LockedByComponent]
|
|
243
|
-
},] }
|
|
244
|
-
];
|
|
245
|
-
|
|
246
|
-
/**
|
|
247
|
-
* @fileoverview added by tsickle
|
|
248
|
-
* @suppress {checkTypes,extraRequire,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
249
|
-
*/
|
|
250
|
-
class NodePermissionService {
|
|
251
|
-
constructor() {
|
|
252
|
-
this.defaultOptions = {
|
|
253
|
-
operation: NodePermissionService.DEFAULT_OPERATION,
|
|
254
|
-
target: null
|
|
255
|
-
};
|
|
256
|
-
}
|
|
257
|
-
/**
|
|
258
|
-
* @param {?} source
|
|
259
|
-
* @param {?} permissions
|
|
260
|
-
* @param {?=} options
|
|
261
|
-
* @return {?}
|
|
262
|
-
*/
|
|
263
|
-
check(source, permissions, options) {
|
|
264
|
-
/** @type {?} */
|
|
265
|
-
const opts = Object.assign({}, this.defaultOptions, options || {});
|
|
266
|
-
if (!source) {
|
|
267
|
-
return false;
|
|
268
|
-
}
|
|
269
|
-
if (Array.isArray(source)) {
|
|
270
|
-
source = source.filter(item => item);
|
|
271
|
-
if (source.length > 0) {
|
|
272
|
-
return source.every(node => this.isOperationAllowed(node, permissions, opts));
|
|
273
|
-
}
|
|
274
|
-
return false;
|
|
275
|
-
}
|
|
276
|
-
else {
|
|
277
|
-
return this.isOperationAllowed(source, permissions, opts);
|
|
278
|
-
}
|
|
279
|
-
}
|
|
280
|
-
/**
|
|
281
|
-
* @private
|
|
282
|
-
* @param {?} node
|
|
283
|
-
* @param {?} permissions
|
|
284
|
-
* @param {?} options
|
|
285
|
-
* @return {?}
|
|
286
|
-
*/
|
|
287
|
-
isOperationAllowed(node, permissions, options) {
|
|
288
|
-
/** @type {?} */
|
|
289
|
-
const allowableOperations = this.getAllowableOperations(node, options.target);
|
|
290
|
-
if (allowableOperations.length) {
|
|
291
|
-
if (options.operation === NodePermissionService.DEFAULT_OPERATION) {
|
|
292
|
-
return permissions.some(permission => allowableOperations.includes(permission));
|
|
293
|
-
}
|
|
294
|
-
else {
|
|
295
|
-
return permissions.every(permission => allowableOperations.includes(permission));
|
|
296
|
-
}
|
|
297
|
-
}
|
|
298
|
-
return false;
|
|
299
|
-
}
|
|
300
|
-
/**
|
|
301
|
-
* @private
|
|
302
|
-
* @param {?} node
|
|
303
|
-
* @param {?=} property
|
|
304
|
-
* @return {?}
|
|
305
|
-
*/
|
|
306
|
-
getAllowableOperations(node, property) {
|
|
307
|
-
/** @type {?} */
|
|
308
|
-
let entry;
|
|
309
|
-
if ('entry' in node) {
|
|
310
|
-
entry = node.entry;
|
|
311
|
-
}
|
|
312
|
-
else {
|
|
313
|
-
entry = node;
|
|
314
|
-
}
|
|
315
|
-
if (property) {
|
|
316
|
-
return entry[property] || [];
|
|
317
|
-
}
|
|
318
|
-
if ('allowableOperationsOnTarget' in entry) {
|
|
319
|
-
return entry.allowableOperationsOnTarget || [];
|
|
320
|
-
}
|
|
321
|
-
else {
|
|
322
|
-
return entry.allowableOperations || [];
|
|
323
|
-
}
|
|
324
|
-
}
|
|
325
|
-
}
|
|
326
|
-
NodePermissionService.DEFAULT_OPERATION = 'OR';
|
|
327
|
-
NodePermissionService.decorators = [
|
|
328
|
-
{ type: Injectable, args: [{
|
|
329
|
-
providedIn: 'root'
|
|
330
|
-
},] }
|
|
331
|
-
];
|
|
332
|
-
/** @nocollapse */ NodePermissionService.ngInjectableDef = defineInjectable({ factory: function NodePermissionService_Factory() { return new NodePermissionService(); }, token: NodePermissionService, providedIn: "root" });
|
|
333
|
-
|
|
334
|
-
/**
|
|
335
|
-
* @fileoverview added by tsickle
|
|
336
|
-
* @suppress {checkTypes,extraRequire,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
337
|
-
*/
|
|
338
|
-
class AppExtensionService {
|
|
339
|
-
/**
|
|
340
|
-
* @param {?} auth
|
|
341
|
-
* @param {?} store
|
|
342
|
-
* @param {?} loader
|
|
343
|
-
* @param {?} extensions
|
|
344
|
-
* @param {?} permissions
|
|
345
|
-
* @param {?} appConfig
|
|
346
|
-
* @param {?} matIconRegistry
|
|
347
|
-
* @param {?} sanitizer
|
|
348
|
-
* @param {?} logger
|
|
349
|
-
*/
|
|
350
|
-
constructor(auth, store, loader, extensions, permissions, appConfig, matIconRegistry, sanitizer, logger) {
|
|
351
|
-
this.auth = auth;
|
|
352
|
-
this.store = store;
|
|
353
|
-
this.loader = loader;
|
|
354
|
-
this.extensions = extensions;
|
|
355
|
-
this.permissions = permissions;
|
|
356
|
-
this.appConfig = appConfig;
|
|
357
|
-
this.matIconRegistry = matIconRegistry;
|
|
358
|
-
this.sanitizer = sanitizer;
|
|
359
|
-
this.logger = logger;
|
|
360
|
-
this._references = new BehaviorSubject([]);
|
|
361
|
-
this.defaults = {
|
|
362
|
-
layout: 'app.layout.main',
|
|
363
|
-
auth: ['app.auth']
|
|
364
|
-
};
|
|
365
|
-
this.headerActions = [];
|
|
366
|
-
this.toolbarActions = [];
|
|
367
|
-
this.viewerToolbarActions = [];
|
|
368
|
-
this.sharedLinkViewerToolbarActions = [];
|
|
369
|
-
this.contextMenuActions = [];
|
|
370
|
-
this.openWithActions = [];
|
|
371
|
-
this.createActions = [];
|
|
372
|
-
this.navbar = [];
|
|
373
|
-
this.sidebarTabs = [];
|
|
374
|
-
this.sidebarActions = [];
|
|
375
|
-
this.viewerRules = {};
|
|
376
|
-
this.userActions = [];
|
|
377
|
-
this.settingGroups = [];
|
|
378
|
-
this.documentListPresets = {
|
|
379
|
-
files: [],
|
|
380
|
-
libraries: [],
|
|
381
|
-
favoriteLibraries: [],
|
|
382
|
-
shared: [],
|
|
383
|
-
recent: [],
|
|
384
|
-
favorites: [],
|
|
385
|
-
trashcan: [],
|
|
386
|
-
searchLibraries: []
|
|
387
|
-
};
|
|
388
|
-
this.references$ = this._references.asObservable();
|
|
389
|
-
this.store.select(getRuleContext).subscribe(result => {
|
|
390
|
-
this.selection = result.selection;
|
|
391
|
-
this.navigation = result.navigation;
|
|
392
|
-
this.profile = result.profile;
|
|
393
|
-
this.repository = result.repository;
|
|
394
|
-
});
|
|
395
|
-
this.store.select(getLanguagePickerState).subscribe(result => {
|
|
396
|
-
this.languagePicker = result;
|
|
397
|
-
});
|
|
398
|
-
}
|
|
399
|
-
/**
|
|
400
|
-
* @return {?}
|
|
401
|
-
*/
|
|
402
|
-
load() {
|
|
403
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
404
|
-
/** @type {?} */
|
|
405
|
-
const config = yield this.extensions.load();
|
|
406
|
-
this.setup(config);
|
|
407
|
-
});
|
|
408
|
-
}
|
|
409
|
-
/**
|
|
410
|
-
* @param {?} config
|
|
411
|
-
* @return {?}
|
|
412
|
-
*/
|
|
413
|
-
setup(config) {
|
|
414
|
-
if (!config) {
|
|
415
|
-
this.logger.error('Extension configuration not found');
|
|
416
|
-
return;
|
|
417
|
-
}
|
|
418
|
-
this.settingGroups = this.loader.getElements(config, 'settings');
|
|
419
|
-
this.headerActions = this.loader.getContentActions(config, 'features.header');
|
|
420
|
-
this.sidebarActions = this.loader.getContentActions(config, 'features.sidebar.toolbar');
|
|
421
|
-
this.toolbarActions = this.loader.getContentActions(config, 'features.toolbar');
|
|
422
|
-
this.viewerToolbarActions = this.loader.getContentActions(config, 'features.viewer.toolbarActions');
|
|
423
|
-
this.sharedLinkViewerToolbarActions = this.loader.getContentActions(config, 'features.viewer.shared.toolbarActions');
|
|
424
|
-
this.contextMenuActions = this.loader.getContentActions(config, 'features.contextMenu');
|
|
425
|
-
this.openWithActions = this.loader.getContentActions(config, 'features.viewer.openWith');
|
|
426
|
-
this.createActions = this.loader.getElements(config, 'features.create');
|
|
427
|
-
this.navbar = this.loadNavBar(config);
|
|
428
|
-
this.sidebarTabs = this.loader.getElements(config, 'features.sidebar.tabs');
|
|
429
|
-
this.userActions = this.loader.getContentActions(config, 'features.userActions');
|
|
430
|
-
this.contentMetadata = this.loadContentMetadata(config);
|
|
431
|
-
this.documentListPresets = {
|
|
432
|
-
files: this.getDocumentListPreset(config, 'files'),
|
|
433
|
-
libraries: this.getDocumentListPreset(config, 'libraries'),
|
|
434
|
-
favoriteLibraries: this.getDocumentListPreset(config, 'favoriteLibraries'),
|
|
435
|
-
shared: this.getDocumentListPreset(config, 'shared'),
|
|
436
|
-
recent: this.getDocumentListPreset(config, 'recent'),
|
|
437
|
-
favorites: this.getDocumentListPreset(config, 'favorites'),
|
|
438
|
-
trashcan: this.getDocumentListPreset(config, 'trashcan'),
|
|
439
|
-
searchLibraries: this.getDocumentListPreset(config, 'search-libraries')
|
|
440
|
-
};
|
|
441
|
-
this.withCredentials = this.appConfig.get('auth.withCredentials', false);
|
|
442
|
-
if (config.features && config.features.viewer) {
|
|
443
|
-
this.viewerRules = ((/** @type {?} */ (config.features.viewer['rules']))) || {};
|
|
444
|
-
}
|
|
445
|
-
this.registerIcons(config);
|
|
446
|
-
/** @type {?} */
|
|
447
|
-
const references = (config.$references || [])
|
|
448
|
-
.filter(entry => typeof entry === 'object')
|
|
449
|
-
.map(entry => (/** @type {?} */ (entry)));
|
|
450
|
-
this._references.next(references);
|
|
451
|
-
}
|
|
452
|
-
/**
|
|
453
|
-
* @protected
|
|
454
|
-
* @param {?} config
|
|
455
|
-
* @return {?}
|
|
456
|
-
*/
|
|
457
|
-
registerIcons(config) {
|
|
458
|
-
/** @type {?} */
|
|
459
|
-
const icons = this.loader
|
|
460
|
-
.getElements(config, 'features.icons')
|
|
461
|
-
.filter(entry => !entry.disabled);
|
|
462
|
-
for (const icon of icons) {
|
|
463
|
-
const [ns, id] = icon.id.split(':');
|
|
464
|
-
/** @type {?} */
|
|
465
|
-
const value = icon.value;
|
|
466
|
-
if (!value) {
|
|
467
|
-
console.warn(`Missing icon value for "${icon.id}".`);
|
|
468
|
-
}
|
|
469
|
-
else if (!ns || !id) {
|
|
470
|
-
console.warn(`Incorrect icon id format: "${icon.id}".`);
|
|
471
|
-
}
|
|
472
|
-
else {
|
|
473
|
-
this.matIconRegistry.addSvgIconInNamespace(ns, id, this.sanitizer.bypassSecurityTrustResourceUrl(value));
|
|
474
|
-
}
|
|
475
|
-
}
|
|
476
|
-
}
|
|
477
|
-
/**
|
|
478
|
-
* @protected
|
|
479
|
-
* @param {?} config
|
|
480
|
-
* @return {?}
|
|
481
|
-
*/
|
|
482
|
-
loadNavBar(config) {
|
|
483
|
-
return this.loader.getElements(config, 'features.navbar');
|
|
484
|
-
}
|
|
485
|
-
/**
|
|
486
|
-
* @protected
|
|
487
|
-
* @param {?} config
|
|
488
|
-
* @param {?} key
|
|
489
|
-
* @return {?}
|
|
490
|
-
*/
|
|
491
|
-
getDocumentListPreset(config, key) {
|
|
492
|
-
return this.loader
|
|
493
|
-
.getElements(config, `features.documentList.${key}`)
|
|
494
|
-
.filter(entry => !entry.disabled);
|
|
495
|
-
}
|
|
496
|
-
/**
|
|
497
|
-
* @param {?} elements
|
|
498
|
-
* @return {?}
|
|
499
|
-
*/
|
|
500
|
-
getApplicationNavigation(elements) {
|
|
501
|
-
return elements
|
|
502
|
-
.filter(group => this.filterVisible(group))
|
|
503
|
-
.map(group => {
|
|
504
|
-
return Object.assign({}, group, { items: (group.items || [])
|
|
505
|
-
.filter(entry => !entry.disabled)
|
|
506
|
-
.filter(item => this.filterVisible(item))
|
|
507
|
-
.sort(sortByOrder)
|
|
508
|
-
.map(item => {
|
|
509
|
-
if (item.children && item.children.length > 0) {
|
|
510
|
-
item.children = item.children
|
|
511
|
-
.filter(entry => !entry.disabled)
|
|
512
|
-
.filter(child => this.filterVisible(child))
|
|
513
|
-
.sort(sortByOrder)
|
|
514
|
-
.map(child => {
|
|
515
|
-
if (child.component) {
|
|
516
|
-
return Object.assign({}, child);
|
|
517
|
-
}
|
|
518
|
-
if (!child.click) {
|
|
519
|
-
/** @type {?} */
|
|
520
|
-
const childRouteRef = this.extensions.getRouteById(child.route);
|
|
521
|
-
/** @type {?} */
|
|
522
|
-
const childUrl = `/${childRouteRef ? childRouteRef.path : child.route}`;
|
|
523
|
-
return Object.assign({}, child, { url: childUrl });
|
|
524
|
-
}
|
|
525
|
-
return Object.assign({}, child, { action: child.click });
|
|
526
|
-
});
|
|
527
|
-
return Object.assign({}, item);
|
|
528
|
-
}
|
|
529
|
-
if (item.component) {
|
|
530
|
-
return Object.assign({}, item);
|
|
531
|
-
}
|
|
532
|
-
if (!item.click) {
|
|
533
|
-
/** @type {?} */
|
|
534
|
-
const routeRef = this.extensions.getRouteById(item.route);
|
|
535
|
-
/** @type {?} */
|
|
536
|
-
const url = `/${routeRef ? routeRef.path : item.route}`;
|
|
537
|
-
return Object.assign({}, item, { url });
|
|
538
|
-
}
|
|
539
|
-
return Object.assign({}, item, { action: item.click });
|
|
540
|
-
})
|
|
541
|
-
.reduce(reduceEmptyMenus, []) });
|
|
542
|
-
});
|
|
543
|
-
}
|
|
544
|
-
/**
|
|
545
|
-
* @param {?} config
|
|
546
|
-
* @return {?}
|
|
547
|
-
*/
|
|
548
|
-
loadContentMetadata(config) {
|
|
549
|
-
/** @type {?} */
|
|
550
|
-
const elements = this.loader.getElements(config, 'features.content-metadata-presets');
|
|
551
|
-
if (!elements.length) {
|
|
552
|
-
return null;
|
|
553
|
-
}
|
|
554
|
-
/** @type {?} */
|
|
555
|
-
let presets = {};
|
|
556
|
-
presets = this.filterDisabled(mergeObjects(presets, ...elements));
|
|
557
|
-
try {
|
|
558
|
-
this.appConfig.config['content-metadata'] = { presets };
|
|
559
|
-
}
|
|
560
|
-
catch (error) {
|
|
561
|
-
this.logger.error(error, '- could not change content-metadata from app.config -');
|
|
562
|
-
}
|
|
563
|
-
return { presets };
|
|
564
|
-
}
|
|
565
|
-
/**
|
|
566
|
-
* @param {?} object
|
|
567
|
-
* @return {?}
|
|
568
|
-
*/
|
|
569
|
-
filterDisabled(object) {
|
|
570
|
-
if (Array.isArray(object)) {
|
|
571
|
-
return object
|
|
572
|
-
.filter(item => !item.disabled)
|
|
573
|
-
.map(item => this.filterDisabled(item));
|
|
574
|
-
}
|
|
575
|
-
else if (typeof object === 'object') {
|
|
576
|
-
if (!object.disabled) {
|
|
577
|
-
Object.keys(object).forEach(prop => {
|
|
578
|
-
object[prop] = this.filterDisabled(object[prop]);
|
|
579
|
-
});
|
|
580
|
-
return object;
|
|
581
|
-
}
|
|
582
|
-
}
|
|
583
|
-
else {
|
|
584
|
-
return object;
|
|
585
|
-
}
|
|
586
|
-
}
|
|
587
|
-
/**
|
|
588
|
-
* @return {?}
|
|
589
|
-
*/
|
|
590
|
-
getNavigationGroups() {
|
|
591
|
-
return this.navbar;
|
|
592
|
-
}
|
|
593
|
-
/**
|
|
594
|
-
* @return {?}
|
|
595
|
-
*/
|
|
596
|
-
getSidebarTabs() {
|
|
597
|
-
return this.sidebarTabs.filter(action => this.filterVisible(action));
|
|
598
|
-
}
|
|
599
|
-
/**
|
|
600
|
-
* @param {?} id
|
|
601
|
-
* @return {?}
|
|
602
|
-
*/
|
|
603
|
-
getComponentById(id) {
|
|
604
|
-
return this.extensions.getComponentById(id);
|
|
605
|
-
}
|
|
606
|
-
/**
|
|
607
|
-
* @return {?}
|
|
608
|
-
*/
|
|
609
|
-
getApplicationRoutes() {
|
|
610
|
-
return this.extensions.routes.map(route => {
|
|
611
|
-
/** @type {?} */
|
|
612
|
-
const guards = this.extensions.getAuthGuards(route.auth && route.auth.length > 0 ? route.auth : this.defaults.auth);
|
|
613
|
-
return {
|
|
614
|
-
path: route.path,
|
|
615
|
-
component: this.getComponentById(route.layout || this.defaults.layout),
|
|
616
|
-
canActivateChild: guards,
|
|
617
|
-
canActivate: guards,
|
|
618
|
-
parentRoute: route.parentRoute,
|
|
619
|
-
children: [
|
|
620
|
-
{
|
|
621
|
-
path: '',
|
|
622
|
-
component: this.getComponentById(route.component),
|
|
623
|
-
data: route.data
|
|
624
|
-
}
|
|
625
|
-
]
|
|
626
|
-
};
|
|
627
|
-
});
|
|
628
|
-
}
|
|
629
|
-
/**
|
|
630
|
-
* @return {?}
|
|
631
|
-
*/
|
|
632
|
-
getCreateActions() {
|
|
633
|
-
return this.createActions
|
|
634
|
-
.filter(action => this.filterVisible(action))
|
|
635
|
-
.map(action => this.copyAction(action))
|
|
636
|
-
.map(action => this.buildMenu(action))
|
|
637
|
-
.map(action => {
|
|
638
|
-
/** @type {?} */
|
|
639
|
-
let disabled = false;
|
|
640
|
-
if (action.rules && action.rules.enabled) {
|
|
641
|
-
disabled = !this.extensions.evaluateRule(action.rules.enabled, this);
|
|
642
|
-
}
|
|
643
|
-
return Object.assign({}, action, { disabled });
|
|
644
|
-
});
|
|
645
|
-
}
|
|
646
|
-
/**
|
|
647
|
-
* @private
|
|
648
|
-
* @param {?} actionRef
|
|
649
|
-
* @return {?}
|
|
650
|
-
*/
|
|
651
|
-
buildMenu(actionRef) {
|
|
652
|
-
if (actionRef.type === ContentActionType.menu &&
|
|
653
|
-
actionRef.children &&
|
|
654
|
-
actionRef.children.length > 0) {
|
|
655
|
-
/** @type {?} */
|
|
656
|
-
const children = actionRef.children
|
|
657
|
-
.filter(action => this.filterVisible(action))
|
|
658
|
-
.map(action => this.buildMenu(action));
|
|
659
|
-
actionRef.children = children
|
|
660
|
-
.map(action => {
|
|
661
|
-
/** @type {?} */
|
|
662
|
-
let disabled = false;
|
|
663
|
-
if (action.rules && action.rules.enabled) {
|
|
664
|
-
disabled = !this.extensions.evaluateRule(action.rules.enabled, this);
|
|
665
|
-
}
|
|
666
|
-
return Object.assign({}, action, { disabled });
|
|
667
|
-
})
|
|
668
|
-
.sort(sortByOrder)
|
|
669
|
-
.reduce(reduceEmptyMenus, [])
|
|
670
|
-
.reduce(reduceSeparators, []);
|
|
671
|
-
}
|
|
672
|
-
return actionRef;
|
|
673
|
-
}
|
|
674
|
-
/**
|
|
675
|
-
* @private
|
|
676
|
-
* @param {?} actions
|
|
677
|
-
* @return {?}
|
|
678
|
-
*/
|
|
679
|
-
getAllowedActions(actions) {
|
|
680
|
-
return (actions || [])
|
|
681
|
-
.filter(action => this.filterVisible(action))
|
|
682
|
-
.map(action => {
|
|
683
|
-
if (action.type === ContentActionType.menu) {
|
|
684
|
-
/** @type {?} */
|
|
685
|
-
const copy = this.copyAction(action);
|
|
686
|
-
if (copy.children && copy.children.length > 0) {
|
|
687
|
-
copy.children = copy.children
|
|
688
|
-
.filter(entry => !entry.disabled)
|
|
689
|
-
.filter(childAction => this.filterVisible(childAction))
|
|
690
|
-
.sort(sortByOrder)
|
|
691
|
-
.reduce(reduceSeparators, []);
|
|
692
|
-
}
|
|
693
|
-
return copy;
|
|
694
|
-
}
|
|
695
|
-
return action;
|
|
696
|
-
})
|
|
697
|
-
.reduce(reduceEmptyMenus, [])
|
|
698
|
-
.reduce(reduceSeparators, []);
|
|
699
|
-
}
|
|
700
|
-
/**
|
|
701
|
-
* @return {?}
|
|
702
|
-
*/
|
|
703
|
-
getAllowedSidebarActions() {
|
|
704
|
-
return this.getAllowedActions(this.sidebarActions);
|
|
705
|
-
}
|
|
706
|
-
/**
|
|
707
|
-
* @return {?}
|
|
708
|
-
*/
|
|
709
|
-
getAllowedToolbarActions() {
|
|
710
|
-
return this.getAllowedActions(this.toolbarActions);
|
|
711
|
-
}
|
|
712
|
-
/**
|
|
713
|
-
* @return {?}
|
|
714
|
-
*/
|
|
715
|
-
getViewerToolbarActions() {
|
|
716
|
-
return this.getAllowedActions(this.viewerToolbarActions);
|
|
717
|
-
}
|
|
718
|
-
/**
|
|
719
|
-
* @return {?}
|
|
720
|
-
*/
|
|
721
|
-
getSharedLinkViewerToolbarActions() {
|
|
722
|
-
return this.getAllowedActions(this.sharedLinkViewerToolbarActions);
|
|
723
|
-
}
|
|
724
|
-
/**
|
|
725
|
-
* @return {?}
|
|
726
|
-
*/
|
|
727
|
-
getHeaderActions() {
|
|
728
|
-
return this.headerActions
|
|
729
|
-
.filter(action => this.filterVisible(action))
|
|
730
|
-
.map(action => {
|
|
731
|
-
if (action.type === ContentActionType.menu) {
|
|
732
|
-
/** @type {?} */
|
|
733
|
-
const copy = this.copyAction(action);
|
|
734
|
-
if (copy.children && copy.children.length > 0) {
|
|
735
|
-
copy.children = copy.children
|
|
736
|
-
.filter(childAction => this.filterVisible(childAction))
|
|
737
|
-
.sort(sortByOrder)
|
|
738
|
-
.reduce(reduceEmptyMenus, [])
|
|
739
|
-
.reduce(reduceSeparators, []);
|
|
740
|
-
}
|
|
741
|
-
return copy;
|
|
742
|
-
}
|
|
743
|
-
return action;
|
|
744
|
-
})
|
|
745
|
-
.sort(sortByOrder)
|
|
746
|
-
.reduce(reduceEmptyMenus, [])
|
|
747
|
-
.reduce(reduceSeparators, []);
|
|
748
|
-
}
|
|
749
|
-
/**
|
|
750
|
-
* @return {?}
|
|
751
|
-
*/
|
|
752
|
-
getAllowedContextMenuActions() {
|
|
753
|
-
return this.getAllowedActions(this.contextMenuActions);
|
|
754
|
-
}
|
|
755
|
-
/**
|
|
756
|
-
* @return {?}
|
|
757
|
-
*/
|
|
758
|
-
getUserActions() {
|
|
759
|
-
return this.userActions
|
|
760
|
-
.filter(action => this.filterVisible(action))
|
|
761
|
-
.sort(sortByOrder);
|
|
762
|
-
}
|
|
763
|
-
/**
|
|
764
|
-
* @return {?}
|
|
765
|
-
*/
|
|
766
|
-
getSettingsGroups() {
|
|
767
|
-
return this.settingGroups.filter(group => this.filterVisible(group));
|
|
768
|
-
}
|
|
769
|
-
/**
|
|
770
|
-
* @param {?} action
|
|
771
|
-
* @return {?}
|
|
772
|
-
*/
|
|
773
|
-
copyAction(action) {
|
|
774
|
-
return Object.assign({}, action, { children: (action.children || []).map(child => this.copyAction(child)) });
|
|
775
|
-
}
|
|
776
|
-
/**
|
|
777
|
-
* @param {?} action
|
|
778
|
-
* @return {?}
|
|
779
|
-
*/
|
|
780
|
-
filterVisible(action) {
|
|
781
|
-
if (action && action.rules && action.rules.visible) {
|
|
782
|
-
return this.extensions.evaluateRule(action.rules.visible, this);
|
|
783
|
-
}
|
|
784
|
-
return true;
|
|
785
|
-
}
|
|
786
|
-
/**
|
|
787
|
-
* @param {?} extension
|
|
788
|
-
* @return {?}
|
|
789
|
-
*/
|
|
790
|
-
isViewerExtensionDisabled(extension) {
|
|
791
|
-
if (extension) {
|
|
792
|
-
if (extension.disabled) {
|
|
793
|
-
return true;
|
|
794
|
-
}
|
|
795
|
-
if (extension.rules && extension.rules.disabled) {
|
|
796
|
-
return this.extensions.evaluateRule(extension.rules.disabled, this);
|
|
797
|
-
}
|
|
798
|
-
}
|
|
799
|
-
return false;
|
|
800
|
-
}
|
|
801
|
-
/**
|
|
802
|
-
* @param {?} id
|
|
803
|
-
* @return {?}
|
|
804
|
-
*/
|
|
805
|
-
runActionById(id) {
|
|
806
|
-
/** @type {?} */
|
|
807
|
-
const action = this.extensions.getActionById(id);
|
|
808
|
-
if (action) {
|
|
809
|
-
const { type, payload } = action;
|
|
810
|
-
/** @type {?} */
|
|
811
|
-
const context = {
|
|
812
|
-
selection: this.selection
|
|
813
|
-
};
|
|
814
|
-
/** @type {?} */
|
|
815
|
-
const expression = this.extensions.runExpression(payload, context);
|
|
816
|
-
this.store.dispatch({ type, payload: expression });
|
|
817
|
-
}
|
|
818
|
-
else {
|
|
819
|
-
this.store.dispatch({ type: id });
|
|
820
|
-
}
|
|
821
|
-
}
|
|
822
|
-
// todo: move to ADF/RuleService
|
|
823
|
-
/**
|
|
824
|
-
* @param {?} ruleId
|
|
825
|
-
* @return {?}
|
|
826
|
-
*/
|
|
827
|
-
isRuleDefined(ruleId) {
|
|
828
|
-
return ruleId && this.getEvaluator(ruleId) ? true : false;
|
|
829
|
-
}
|
|
830
|
-
// todo: move to ADF/RuleService
|
|
831
|
-
/**
|
|
832
|
-
* @param {?} ruleId
|
|
833
|
-
* @param {...?} args
|
|
834
|
-
* @return {?}
|
|
835
|
-
*/
|
|
836
|
-
evaluateRule(ruleId, ...args) {
|
|
837
|
-
/** @type {?} */
|
|
838
|
-
const evaluator = this.getEvaluator(ruleId);
|
|
839
|
-
if (evaluator) {
|
|
840
|
-
return evaluator(this, ...args);
|
|
841
|
-
}
|
|
842
|
-
return false;
|
|
843
|
-
}
|
|
844
|
-
/**
|
|
845
|
-
* @param {?} key
|
|
846
|
-
* @return {?}
|
|
847
|
-
*/
|
|
848
|
-
getEvaluator(key) {
|
|
849
|
-
return this.extensions.getEvaluator(key);
|
|
850
|
-
}
|
|
851
|
-
/**
|
|
852
|
-
* @param {?} node
|
|
853
|
-
* @return {?}
|
|
854
|
-
*/
|
|
855
|
-
canPreviewNode(node) {
|
|
856
|
-
/** @type {?} */
|
|
857
|
-
const rules = this.viewerRules;
|
|
858
|
-
if (this.isRuleDefined(rules.canPreview)) {
|
|
859
|
-
/** @type {?} */
|
|
860
|
-
const canPreview = this.evaluateRule(rules.canPreview, node);
|
|
861
|
-
if (!canPreview) {
|
|
862
|
-
return false;
|
|
863
|
-
}
|
|
864
|
-
}
|
|
865
|
-
return true;
|
|
866
|
-
}
|
|
867
|
-
}
|
|
868
|
-
AppExtensionService.decorators = [
|
|
869
|
-
{ type: Injectable, args: [{
|
|
870
|
-
providedIn: 'root'
|
|
871
|
-
},] }
|
|
872
|
-
];
|
|
873
|
-
/** @nocollapse */
|
|
874
|
-
AppExtensionService.ctorParameters = () => [
|
|
875
|
-
{ type: AuthenticationService },
|
|
876
|
-
{ type: Store },
|
|
877
|
-
{ type: ExtensionLoaderService },
|
|
878
|
-
{ type: ExtensionService },
|
|
879
|
-
{ type: NodePermissionService },
|
|
880
|
-
{ type: AppConfigService },
|
|
881
|
-
{ type: MatIconRegistry },
|
|
882
|
-
{ type: DomSanitizer },
|
|
883
|
-
{ type: LogService }
|
|
884
|
-
];
|
|
885
|
-
/** @nocollapse */ AppExtensionService.ngInjectableDef = defineInjectable({ factory: function AppExtensionService_Factory() { return new AppExtensionService(inject(AuthenticationService), inject(Store), inject(ExtensionLoaderService), inject(ExtensionService), inject(NodePermissionService), inject(AppConfigService), inject(MatIconRegistry), inject(DomSanitizer), inject(LogService)); }, token: AppExtensionService, providedIn: "root" });
|
|
886
|
-
|
|
887
|
-
/**
|
|
888
|
-
* @fileoverview added by tsickle
|
|
889
|
-
* @suppress {checkTypes,extraRequire,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
890
|
-
*/
|
|
891
|
-
class ToolbarMenuItemComponent {
|
|
892
|
-
/**
|
|
893
|
-
* @param {?} extensions
|
|
894
|
-
*/
|
|
895
|
-
constructor(extensions) {
|
|
896
|
-
this.extensions = extensions;
|
|
897
|
-
}
|
|
898
|
-
/**
|
|
899
|
-
* @return {?}
|
|
900
|
-
*/
|
|
901
|
-
runAction() {
|
|
902
|
-
if (this.hasClickAction(this.actionRef)) {
|
|
903
|
-
this.extensions.runActionById(this.actionRef.actions.click);
|
|
904
|
-
}
|
|
905
|
-
}
|
|
906
|
-
/**
|
|
907
|
-
* @private
|
|
908
|
-
* @param {?} actionRef
|
|
909
|
-
* @return {?}
|
|
910
|
-
*/
|
|
911
|
-
hasClickAction(actionRef) {
|
|
912
|
-
if (actionRef && actionRef.actions && actionRef.actions.click) {
|
|
913
|
-
return true;
|
|
914
|
-
}
|
|
915
|
-
return false;
|
|
916
|
-
}
|
|
917
|
-
/**
|
|
918
|
-
* @param {?} _
|
|
919
|
-
* @param {?} obj
|
|
920
|
-
* @return {?}
|
|
921
|
-
*/
|
|
922
|
-
trackById(_, obj) {
|
|
923
|
-
return obj.id;
|
|
924
|
-
}
|
|
925
|
-
}
|
|
926
|
-
ToolbarMenuItemComponent.decorators = [
|
|
927
|
-
{ type: Component, args: [{
|
|
928
|
-
selector: 'app-toolbar-menu-item',
|
|
929
|
-
template: "<ng-container [ngSwitch]=\"actionRef.type\">\n <ng-container *ngSwitchCase=\"'menu'\">\n <button\n mat-menu-item\n role=\"menuitem\"\n [disabled]=\"actionRef.disabled\"\n [matMenuTriggerFor]=\"childMenu\"\n >\n <adf-icon [value]=\"actionRef.icon\"></adf-icon>\n <span>{{ actionRef.title | translate }}</span>\n </button>\n\n <mat-menu #childMenu=\"matMenu\" class=\"app-create-menu__sub-menu\">\n <ng-container\n *ngFor=\"let child of actionRef.children; trackBy: trackById\"\n >\n <app-toolbar-menu-item [actionRef]=\"child\"></app-toolbar-menu-item>\n </ng-container>\n </mat-menu>\n </ng-container>\n\n <ng-container *ngSwitchCase=\"'separator'\">\n <mat-divider></mat-divider>\n </ng-container>\n\n <ng-container *ngSwitchCase=\"'custom'\">\n <adf-dynamic-component [id]=\"actionRef.component\"></adf-dynamic-component>\n </ng-container>\n\n <ng-container *ngSwitchDefault>\n <button\n [id]=\"actionRef.id\"\n role=\"menuItem\"\n mat-menu-item\n [role]=\"'menuItem'\"\n color=\"primary\"\n [disabled]=\"actionRef.disabled\"\n [attr.title]=\"\n (actionRef.disabled\n ? actionRef['description-disabled']\n : actionRef.description || actionRef.title) | translate\n \"\n (click)=\"runAction()\"\n >\n <adf-icon [value]=\"actionRef.icon\"></adf-icon>\n <span>{{ actionRef.title | translate }}</span>\n </button>\n </ng-container>\n</ng-container>\n",
|
|
930
|
-
encapsulation: ViewEncapsulation.None,
|
|
931
|
-
host: { class: 'app-toolbar-menu-item' },
|
|
932
|
-
styles: [`
|
|
933
|
-
.app-toolbar-menu-item:last-child > .mat-divider-horizontal {
|
|
934
|
-
display: none;
|
|
935
|
-
}
|
|
936
|
-
`]
|
|
937
|
-
}] }
|
|
938
|
-
];
|
|
939
|
-
/** @nocollapse */
|
|
940
|
-
ToolbarMenuItemComponent.ctorParameters = () => [
|
|
941
|
-
{ type: AppExtensionService }
|
|
942
|
-
];
|
|
943
|
-
ToolbarMenuItemComponent.propDecorators = {
|
|
944
|
-
actionRef: [{ type: Input }]
|
|
945
|
-
};
|
|
946
|
-
|
|
947
|
-
/**
|
|
948
|
-
* @fileoverview added by tsickle
|
|
949
|
-
* @suppress {checkTypes,extraRequire,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
950
|
-
*/
|
|
951
|
-
class ToolbarMenuComponent {
|
|
952
|
-
constructor() {
|
|
953
|
-
this.color = '';
|
|
954
|
-
}
|
|
955
|
-
/**
|
|
956
|
-
* @return {?}
|
|
957
|
-
*/
|
|
958
|
-
get hasChildren() {
|
|
959
|
-
return (this.actionRef &&
|
|
960
|
-
this.actionRef.children &&
|
|
961
|
-
this.actionRef.children.length > 0);
|
|
962
|
-
}
|
|
963
|
-
/**
|
|
964
|
-
* @param {?} _
|
|
965
|
-
* @param {?} obj
|
|
966
|
-
* @return {?}
|
|
967
|
-
*/
|
|
968
|
-
trackById(_, obj) {
|
|
969
|
-
return obj.id;
|
|
970
|
-
}
|
|
971
|
-
}
|
|
972
|
-
ToolbarMenuComponent.decorators = [
|
|
973
|
-
{ type: Component, args: [{
|
|
974
|
-
selector: 'app-toolbar-menu',
|
|
975
|
-
template: "<button\n [id]=\"actionRef.id\"\n [color]=\"color\"\n mat-icon-button\n [attr.aria-label]=\"actionRef.description || actionRef.title | translate\"\n [attr.title]=\"actionRef.description || actionRef.title | translate\"\n [matMenuTriggerFor]=\"menu\"\n>\n <adf-icon [value]=\"actionRef.icon\"></adf-icon>\n</button>\n\n<mat-menu #menu=\"matMenu\" [overlapTrigger]=\"false\">\n <ng-container *ngFor=\"let child of actionRef.children; trackBy: trackById\">\n <ng-container [ngSwitch]=\"child.type\">\n <ng-container *ngSwitchCase=\"'custom'\">\n <adf-dynamic-component\n [id]=\"child.component\"\n [data]=\"child.data\"\n ></adf-dynamic-component>\n </ng-container>\n <ng-container *ngSwitchDefault>\n <app-toolbar-menu-item [actionRef]=\"child\"></app-toolbar-menu-item>\n </ng-container>\n </ng-container>\n </ng-container>\n</mat-menu>\n",
|
|
976
|
-
encapsulation: ViewEncapsulation.None,
|
|
977
|
-
host: { class: 'app-toolbar-menu' }
|
|
978
|
-
}] }
|
|
979
|
-
];
|
|
980
|
-
ToolbarMenuComponent.propDecorators = {
|
|
981
|
-
actionRef: [{ type: Input }],
|
|
982
|
-
color: [{ type: Input }]
|
|
983
|
-
};
|
|
984
|
-
|
|
985
|
-
/**
|
|
986
|
-
* @fileoverview added by tsickle
|
|
987
|
-
* @suppress {checkTypes,extraRequire,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
988
|
-
*/
|
|
989
|
-
class ToolbarActionComponent {
|
|
990
|
-
/**
|
|
991
|
-
* @param {?} cd
|
|
992
|
-
*/
|
|
993
|
-
constructor(cd) {
|
|
994
|
-
this.cd = cd;
|
|
995
|
-
this.type = 'icon-button';
|
|
996
|
-
this.color = '';
|
|
997
|
-
}
|
|
998
|
-
// todo: review after ADF 2.6
|
|
999
|
-
// preview component : change detection workaround for children without input
|
|
1000
|
-
/**
|
|
1001
|
-
* @return {?}
|
|
1002
|
-
*/
|
|
1003
|
-
ngDoCheck() {
|
|
1004
|
-
if (this.actionRef.id.includes('app.viewer')) {
|
|
1005
|
-
this.cd.markForCheck();
|
|
1006
|
-
}
|
|
1007
|
-
}
|
|
1008
|
-
}
|
|
1009
|
-
ToolbarActionComponent.decorators = [
|
|
1010
|
-
{ type: Component, args: [{
|
|
1011
|
-
selector: 'aca-toolbar-action',
|
|
1012
|
-
template: "<ng-container [ngSwitch]=\"actionRef.type\">\n <ng-container *ngSwitchCase=\"'default'\">\n <app-toolbar-button [type]=\"type\" [actionRef]=\"actionRef\" [color]=\"color\">\n </app-toolbar-button>\n </ng-container>\n\n <ng-container *ngSwitchCase=\"'button'\">\n <app-toolbar-button [type]=\"type\" [actionRef]=\"actionRef\" [color]=\"color\">\n </app-toolbar-button>\n </ng-container>\n\n <adf-toolbar-divider\n *ngSwitchCase=\"'separator'\"\n [id]=\"actionRef.id\"\n ></adf-toolbar-divider>\n\n <ng-container *ngSwitchCase=\"'menu'\">\n <app-toolbar-menu [actionRef]=\"actionRef\" [color]=\"color\">\n </app-toolbar-menu>\n </ng-container>\n\n <ng-container *ngSwitchCase=\"'custom'\">\n <adf-dynamic-component\n [data]=\"actionRef.data\"\n [id]=\"actionRef.component\"\n ></adf-dynamic-component>\n </ng-container>\n</ng-container>\n",
|
|
1013
|
-
encapsulation: ViewEncapsulation.None,
|
|
1014
|
-
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
1015
|
-
host: { class: 'aca-toolbar-action' }
|
|
1016
|
-
}] }
|
|
1017
|
-
];
|
|
1018
|
-
/** @nocollapse */
|
|
1019
|
-
ToolbarActionComponent.ctorParameters = () => [
|
|
1020
|
-
{ type: ChangeDetectorRef }
|
|
1021
|
-
];
|
|
1022
|
-
ToolbarActionComponent.propDecorators = {
|
|
1023
|
-
type: [{ type: Input }],
|
|
1024
|
-
color: [{ type: Input }],
|
|
1025
|
-
actionRef: [{ type: Input }]
|
|
1026
|
-
};
|
|
1027
|
-
|
|
1028
|
-
/**
|
|
1029
|
-
* @fileoverview added by tsickle
|
|
1030
|
-
* @suppress {checkTypes,extraRequire,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
1031
|
-
*/
|
|
1032
|
-
/** @enum {string} */
|
|
1033
|
-
const ToolbarButtonType = {
|
|
1034
|
-
ICON_BUTTON: 'icon-button',
|
|
1035
|
-
MENU_ITEM: 'menu-item',
|
|
1036
|
-
};
|
|
1037
|
-
class ToolbarButtonComponent {
|
|
1038
|
-
/**
|
|
1039
|
-
* @param {?} extensions
|
|
1040
|
-
*/
|
|
1041
|
-
constructor(extensions) {
|
|
1042
|
-
this.extensions = extensions;
|
|
1043
|
-
this.type = ToolbarButtonType.ICON_BUTTON;
|
|
1044
|
-
this.color = '';
|
|
1045
|
-
}
|
|
1046
|
-
/**
|
|
1047
|
-
* @return {?}
|
|
1048
|
-
*/
|
|
1049
|
-
runAction() {
|
|
1050
|
-
if (this.hasClickAction(this.actionRef)) {
|
|
1051
|
-
this.extensions.runActionById(this.actionRef.actions.click);
|
|
1052
|
-
}
|
|
1053
|
-
}
|
|
1054
|
-
/**
|
|
1055
|
-
* @private
|
|
1056
|
-
* @param {?} actionRef
|
|
1057
|
-
* @return {?}
|
|
1058
|
-
*/
|
|
1059
|
-
hasClickAction(actionRef) {
|
|
1060
|
-
if (actionRef && actionRef.actions && actionRef.actions.click) {
|
|
1061
|
-
return true;
|
|
1062
|
-
}
|
|
1063
|
-
return false;
|
|
1064
|
-
}
|
|
1065
|
-
}
|
|
1066
|
-
ToolbarButtonComponent.decorators = [
|
|
1067
|
-
{ type: Component, args: [{
|
|
1068
|
-
selector: 'app-toolbar-button',
|
|
1069
|
-
template: "<ng-container [ngSwitch]=\"type\">\n <ng-container *ngSwitchCase=\"'icon-button'\">\n <button\n [id]=\"actionRef.id\"\n mat-icon-button\n [color]=\"color\"\n [attr.aria-label]=\"actionRef.description || actionRef.title | translate\"\n [attr.title]=\"actionRef.description || actionRef.title | translate\"\n (click)=\"runAction()\"\n >\n <adf-icon [value]=\"actionRef.icon\"></adf-icon>\n </button>\n </ng-container>\n <ng-container *ngSwitchCase=\"'menu-item'\">\n <app-toolbar-menu-item [actionRef]=\"actionRef\"></app-toolbar-menu-item>\n </ng-container>\n</ng-container>\n",
|
|
1070
|
-
encapsulation: ViewEncapsulation.None,
|
|
1071
|
-
host: { class: 'app-toolbar-button' }
|
|
1072
|
-
}] }
|
|
1073
|
-
];
|
|
1074
|
-
/** @nocollapse */
|
|
1075
|
-
ToolbarButtonComponent.ctorParameters = () => [
|
|
1076
|
-
{ type: AppExtensionService }
|
|
1077
|
-
];
|
|
1078
|
-
ToolbarButtonComponent.propDecorators = {
|
|
1079
|
-
type: [{ type: Input }],
|
|
1080
|
-
color: [{ type: Input }],
|
|
1081
|
-
actionRef: [{ type: Input }]
|
|
1082
|
-
};
|
|
1083
|
-
|
|
1084
|
-
/**
|
|
1085
|
-
* @fileoverview added by tsickle
|
|
1086
|
-
* @suppress {checkTypes,extraRequire,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
1087
|
-
*/
|
|
1088
|
-
class SharedToolbarModule {
|
|
1089
|
-
}
|
|
1090
|
-
SharedToolbarModule.decorators = [
|
|
1091
|
-
{ type: NgModule, args: [{
|
|
1092
|
-
imports: [CommonModule, CoreModule, ExtensionsModule],
|
|
1093
|
-
declarations: [
|
|
1094
|
-
ToolbarButtonComponent,
|
|
1095
|
-
ToolbarActionComponent,
|
|
1096
|
-
ToolbarMenuItemComponent,
|
|
1097
|
-
ToolbarMenuComponent
|
|
1098
|
-
],
|
|
1099
|
-
exports: [
|
|
1100
|
-
ToolbarButtonComponent,
|
|
1101
|
-
ToolbarActionComponent,
|
|
1102
|
-
ToolbarMenuItemComponent,
|
|
1103
|
-
ToolbarMenuComponent
|
|
1104
|
-
]
|
|
1105
|
-
},] }
|
|
1106
|
-
];
|
|
1107
|
-
|
|
1108
|
-
/**
|
|
1109
|
-
* @fileoverview added by tsickle
|
|
1110
|
-
* @suppress {checkTypes,extraRequire,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
1111
|
-
*/
|
|
1112
|
-
class ContentApiService {
|
|
1113
|
-
/**
|
|
1114
|
-
* @param {?} api
|
|
1115
|
-
* @param {?} preferences
|
|
1116
|
-
*/
|
|
1117
|
-
constructor(api, preferences) {
|
|
1118
|
-
this.api = api;
|
|
1119
|
-
this.preferences = preferences;
|
|
1120
|
-
}
|
|
1121
|
-
/**
|
|
1122
|
-
* Moves a node to the trashcan.
|
|
1123
|
-
* @param {?} nodeId ID of the target node
|
|
1124
|
-
* @param {?=} options Optional parameters supported by JS-API
|
|
1125
|
-
* @return {?} Empty result that notifies when the deletion is complete
|
|
1126
|
-
*/
|
|
1127
|
-
deleteNode(nodeId, options = {}) {
|
|
1128
|
-
return from(this.api.nodesApi.deleteNode(nodeId, options));
|
|
1129
|
-
}
|
|
1130
|
-
/**
|
|
1131
|
-
* Gets the stored information about a node.
|
|
1132
|
-
* @param {?} nodeId ID of the target node
|
|
1133
|
-
* @param {?=} options Optional parameters supported by JS-API
|
|
1134
|
-
* @return {?} Node information
|
|
1135
|
-
*/
|
|
1136
|
-
getNode(nodeId, options = {}) {
|
|
1137
|
-
/** @type {?} */
|
|
1138
|
-
const defaults = {
|
|
1139
|
-
include: ['path', 'properties', 'allowableOperations', 'permissions']
|
|
1140
|
-
};
|
|
1141
|
-
/** @type {?} */
|
|
1142
|
-
const queryOptions = Object.assign(defaults, options);
|
|
1143
|
-
return from(this.api.nodesApi.getNode(nodeId, queryOptions));
|
|
1144
|
-
}
|
|
1145
|
-
/**
|
|
1146
|
-
* @param {?} nodeId
|
|
1147
|
-
* @param {?=} options
|
|
1148
|
-
* @return {?}
|
|
1149
|
-
*/
|
|
1150
|
-
getNodeInfo(nodeId, options) {
|
|
1151
|
-
/** @type {?} */
|
|
1152
|
-
const defaults = {
|
|
1153
|
-
include: ['isFavorite', 'allowableOperations', 'path']
|
|
1154
|
-
};
|
|
1155
|
-
/** @type {?} */
|
|
1156
|
-
const queryOptions = Object.assign(defaults, options || {});
|
|
1157
|
-
return from(this.api.nodesApi.getNodeInfo(nodeId, queryOptions));
|
|
1158
|
-
}
|
|
1159
|
-
/**
|
|
1160
|
-
* Gets the items contained in a folder node.
|
|
1161
|
-
* @param {?} nodeId ID of the target node
|
|
1162
|
-
* @param {?=} options Optional parameters supported by JS-API
|
|
1163
|
-
* @return {?} List of child items from the folder
|
|
1164
|
-
*/
|
|
1165
|
-
getNodeChildren(nodeId, options = {}) {
|
|
1166
|
-
/** @type {?} */
|
|
1167
|
-
const defaults = {
|
|
1168
|
-
maxItems: this.preferences.paginationSize,
|
|
1169
|
-
skipCount: 0,
|
|
1170
|
-
include: [
|
|
1171
|
-
'isLocked',
|
|
1172
|
-
'path',
|
|
1173
|
-
'properties',
|
|
1174
|
-
'allowableOperations',
|
|
1175
|
-
'permissions'
|
|
1176
|
-
]
|
|
1177
|
-
};
|
|
1178
|
-
/** @type {?} */
|
|
1179
|
-
const queryOptions = Object.assign(defaults, options);
|
|
1180
|
-
return from(this.api.nodesApi.getNodeChildren(nodeId, queryOptions));
|
|
1181
|
-
}
|
|
1182
|
-
/**
|
|
1183
|
-
* @param {?} linkId
|
|
1184
|
-
* @return {?}
|
|
1185
|
-
*/
|
|
1186
|
-
deleteSharedLink(linkId) {
|
|
1187
|
-
return from(this.api.sharedLinksApi.deleteSharedLink(linkId));
|
|
1188
|
-
}
|
|
1189
|
-
/**
|
|
1190
|
-
* @param {?=} options
|
|
1191
|
-
* @return {?}
|
|
1192
|
-
*/
|
|
1193
|
-
getDeletedNodes(options = {}) {
|
|
1194
|
-
/** @type {?} */
|
|
1195
|
-
const defaults = {
|
|
1196
|
-
include: ['path']
|
|
1197
|
-
};
|
|
1198
|
-
/** @type {?} */
|
|
1199
|
-
const queryOptions = Object.assign(defaults, options);
|
|
1200
|
-
return from(this.api.nodesApi.getDeletedNodes(queryOptions));
|
|
1201
|
-
}
|
|
1202
|
-
/**
|
|
1203
|
-
* @param {?} nodeId
|
|
1204
|
-
* @return {?}
|
|
1205
|
-
*/
|
|
1206
|
-
restoreNode(nodeId) {
|
|
1207
|
-
return from(this.api.nodesApi.restoreNode(nodeId));
|
|
1208
|
-
}
|
|
1209
|
-
/**
|
|
1210
|
-
* @param {?} nodeId
|
|
1211
|
-
* @return {?}
|
|
1212
|
-
*/
|
|
1213
|
-
purgeDeletedNode(nodeId) {
|
|
1214
|
-
return from(this.api.nodesApi.purgeDeletedNode(nodeId));
|
|
1215
|
-
}
|
|
1216
|
-
/**
|
|
1217
|
-
* Gets information about a user identified by their username.
|
|
1218
|
-
* @param {?} personId ID of the target user
|
|
1219
|
-
* @param {?=} options
|
|
1220
|
-
* @return {?} User information
|
|
1221
|
-
*/
|
|
1222
|
-
getPerson(personId, options) {
|
|
1223
|
-
return from(this.api.peopleApi.getPerson(personId, options));
|
|
1224
|
-
}
|
|
1225
|
-
/**
|
|
1226
|
-
* Copy a node to destination node
|
|
1227
|
-
*
|
|
1228
|
-
* @param {?} nodeId The id of the node to be copied
|
|
1229
|
-
* @param {?} targetParentId The id of the folder-node where the node have to be copied to
|
|
1230
|
-
* @param {?=} name The new name for the copy that would be added on the destination folder
|
|
1231
|
-
* @param {?=} opts
|
|
1232
|
-
* @return {?}
|
|
1233
|
-
*/
|
|
1234
|
-
copyNode(nodeId, targetParentId, name, opts) {
|
|
1235
|
-
return from(this.api.nodesApi.copyNode(nodeId, { targetParentId, name }, opts));
|
|
1236
|
-
}
|
|
1237
|
-
/**
|
|
1238
|
-
* Gets product information for Content Services.
|
|
1239
|
-
* @return {?} ProductVersionModel containing product details
|
|
1240
|
-
*/
|
|
1241
|
-
getRepositoryInformation() {
|
|
1242
|
-
return from(this.api.getInstance().discovery.discoveryApi.getRepositoryInformation());
|
|
1243
|
-
}
|
|
1244
|
-
/**
|
|
1245
|
-
* @param {?} personId
|
|
1246
|
-
* @param {?=} opts
|
|
1247
|
-
* @return {?}
|
|
1248
|
-
*/
|
|
1249
|
-
getFavorites(personId, opts) {
|
|
1250
|
-
return from(this.api.favoritesApi.getFavorites(personId, opts));
|
|
1251
|
-
}
|
|
1252
|
-
/**
|
|
1253
|
-
* @param {?=} personId
|
|
1254
|
-
* @param {?=} opts
|
|
1255
|
-
* @return {?}
|
|
1256
|
-
*/
|
|
1257
|
-
getFavoriteLibraries(personId = '-me-', opts) {
|
|
1258
|
-
return this.getFavorites(personId, Object.assign({}, opts, { where: '(EXISTS(target/site))' })).pipe(map((response) => {
|
|
1259
|
-
return {
|
|
1260
|
-
list: {
|
|
1261
|
-
entries: response.list.entries.map(({ entry }) => {
|
|
1262
|
-
entry.target.site.createdAt = entry.createdAt;
|
|
1263
|
-
return {
|
|
1264
|
-
entry: entry.target.site
|
|
1265
|
-
};
|
|
1266
|
-
}),
|
|
1267
|
-
pagination: response.list.pagination
|
|
1268
|
-
}
|
|
1269
|
-
};
|
|
1270
|
-
}));
|
|
1271
|
-
}
|
|
1272
|
-
/**
|
|
1273
|
-
* @param {?=} opts
|
|
1274
|
-
* @return {?}
|
|
1275
|
-
*/
|
|
1276
|
-
findSharedLinks(opts) {
|
|
1277
|
-
return from(this.api.sharedLinksApi.findSharedLinks(opts));
|
|
1278
|
-
}
|
|
1279
|
-
/**
|
|
1280
|
-
* @param {?} sharedId
|
|
1281
|
-
* @param {?=} attachment
|
|
1282
|
-
* @return {?}
|
|
1283
|
-
*/
|
|
1284
|
-
getSharedLinkContent(sharedId, attachment) {
|
|
1285
|
-
return this.api.contentApi.getSharedLinkContentUrl(sharedId, attachment);
|
|
1286
|
-
}
|
|
1287
|
-
/**
|
|
1288
|
-
* @param {?} request
|
|
1289
|
-
* @return {?}
|
|
1290
|
-
*/
|
|
1291
|
-
search(request) {
|
|
1292
|
-
return from(this.api.searchApi.search(request));
|
|
1293
|
-
}
|
|
1294
|
-
/**
|
|
1295
|
-
* @param {?} nodeId
|
|
1296
|
-
* @param {?=} attachment
|
|
1297
|
-
* @return {?}
|
|
1298
|
-
*/
|
|
1299
|
-
getContentUrl(nodeId, attachment) {
|
|
1300
|
-
return this.api.contentApi.getContentUrl(nodeId, attachment);
|
|
1301
|
-
}
|
|
1302
|
-
/**
|
|
1303
|
-
* @param {?=} siteId
|
|
1304
|
-
* @param {?=} opts
|
|
1305
|
-
* @return {?}
|
|
1306
|
-
*/
|
|
1307
|
-
deleteSite(siteId, opts) {
|
|
1308
|
-
return from(this.api.sitesApi.deleteSite(siteId, opts));
|
|
1309
|
-
}
|
|
1310
|
-
/**
|
|
1311
|
-
* @param {?=} siteId
|
|
1312
|
-
* @return {?}
|
|
1313
|
-
*/
|
|
1314
|
-
leaveSite(siteId) {
|
|
1315
|
-
return from(this.api.sitesApi.removeSiteMember(siteId, '-me-'));
|
|
1316
|
-
}
|
|
1317
|
-
/**
|
|
1318
|
-
* @param {?} siteBody
|
|
1319
|
-
* @param {?=} opts
|
|
1320
|
-
* @return {?}
|
|
1321
|
-
*/
|
|
1322
|
-
createSite(siteBody, opts) {
|
|
1323
|
-
return from(this.api.sitesApi.createSite(siteBody, opts));
|
|
1324
|
-
}
|
|
1325
|
-
/**
|
|
1326
|
-
* @param {?=} siteId
|
|
1327
|
-
* @param {?=} opts
|
|
1328
|
-
* @return {?}
|
|
1329
|
-
*/
|
|
1330
|
-
getSite(siteId, opts) {
|
|
1331
|
-
return from(this.api.sitesApi.getSite(siteId, opts));
|
|
1332
|
-
}
|
|
1333
|
-
/**
|
|
1334
|
-
* @param {?} siteId
|
|
1335
|
-
* @param {?} siteBody
|
|
1336
|
-
* @return {?}
|
|
1337
|
-
*/
|
|
1338
|
-
updateLibrary(siteId, siteBody) {
|
|
1339
|
-
return from(this.api.sitesApi.updateSite(siteId, siteBody));
|
|
1340
|
-
}
|
|
1341
|
-
/**
|
|
1342
|
-
* @param {?} nodes
|
|
1343
|
-
* @return {?}
|
|
1344
|
-
*/
|
|
1345
|
-
addFavorite(nodes) {
|
|
1346
|
-
/** @type {?} */
|
|
1347
|
-
const payload = nodes.map(node => {
|
|
1348
|
-
const { isFolder, nodeId, id } = (/** @type {?} */ (node.entry));
|
|
1349
|
-
/** @type {?} */
|
|
1350
|
-
const siteId = node.entry['guid'];
|
|
1351
|
-
/** @type {?} */
|
|
1352
|
-
const type = siteId ? 'site' : isFolder ? 'folder' : 'file';
|
|
1353
|
-
/** @type {?} */
|
|
1354
|
-
const guid = siteId || nodeId || id;
|
|
1355
|
-
return {
|
|
1356
|
-
target: {
|
|
1357
|
-
[type]: {
|
|
1358
|
-
guid
|
|
1359
|
-
}
|
|
1360
|
-
}
|
|
1361
|
-
};
|
|
1362
|
-
});
|
|
1363
|
-
return from(this.api.favoritesApi.addFavorite('-me-', (/** @type {?} */ (payload))));
|
|
1364
|
-
}
|
|
1365
|
-
/**
|
|
1366
|
-
* @param {?} nodes
|
|
1367
|
-
* @return {?}
|
|
1368
|
-
*/
|
|
1369
|
-
removeFavorite(nodes) {
|
|
1370
|
-
return from(Promise.all(nodes.map((node) => {
|
|
1371
|
-
/** @type {?} */
|
|
1372
|
-
const id = node.entry.nodeId || node.entry.id;
|
|
1373
|
-
return this.api.favoritesApi.removeFavoriteSite('-me-', id);
|
|
1374
|
-
})));
|
|
1375
|
-
}
|
|
1376
|
-
/**
|
|
1377
|
-
* @param {?} nodeId
|
|
1378
|
-
* @param {?=} opts
|
|
1379
|
-
* @return {?}
|
|
1380
|
-
*/
|
|
1381
|
-
unlockNode(nodeId, opts) {
|
|
1382
|
-
return this.api.nodesApi.unlockNode(nodeId, opts);
|
|
1383
|
-
}
|
|
1384
|
-
}
|
|
1385
|
-
ContentApiService.decorators = [
|
|
1386
|
-
{ type: Injectable, args: [{
|
|
1387
|
-
providedIn: 'root'
|
|
1388
|
-
},] }
|
|
1389
|
-
];
|
|
1390
|
-
/** @nocollapse */
|
|
1391
|
-
ContentApiService.ctorParameters = () => [
|
|
1392
|
-
{ type: AlfrescoApiService },
|
|
1393
|
-
{ type: UserPreferencesService }
|
|
1394
|
-
];
|
|
1395
|
-
/** @nocollapse */ ContentApiService.ngInjectableDef = defineInjectable({ factory: function ContentApiService_Factory() { return new ContentApiService(inject(AlfrescoApiService), inject(UserPreferencesService)); }, token: ContentApiService, providedIn: "root" });
|
|
1396
|
-
|
|
1397
|
-
/**
|
|
1398
|
-
* @fileoverview added by tsickle
|
|
1399
|
-
* @suppress {checkTypes,extraRequire,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
1400
|
-
*/
|
|
1401
|
-
class InfoDrawerComponent {
|
|
1402
|
-
/**
|
|
1403
|
-
* @param {?} store
|
|
1404
|
-
* @param {?} contentApi
|
|
1405
|
-
* @param {?} extensions
|
|
1406
|
-
*/
|
|
1407
|
-
constructor(store, contentApi, extensions) {
|
|
1408
|
-
this.store = store;
|
|
1409
|
-
this.contentApi = contentApi;
|
|
1410
|
-
this.extensions = extensions;
|
|
1411
|
-
this.isLoading = false;
|
|
1412
|
-
this.tabs = [];
|
|
1413
|
-
this.actions = [];
|
|
1414
|
-
this.onDestroy$ = new Subject();
|
|
1415
|
-
}
|
|
1416
|
-
/**
|
|
1417
|
-
* @return {?}
|
|
1418
|
-
*/
|
|
1419
|
-
onEscapeKeyboardEvent() {
|
|
1420
|
-
this.close();
|
|
1421
|
-
}
|
|
1422
|
-
/**
|
|
1423
|
-
* @return {?}
|
|
1424
|
-
*/
|
|
1425
|
-
ngOnInit() {
|
|
1426
|
-
this.tabs = this.extensions.getSidebarTabs();
|
|
1427
|
-
this.store
|
|
1428
|
-
.select(getAppSelection)
|
|
1429
|
-
.pipe(takeUntil(this.onDestroy$))
|
|
1430
|
-
.subscribe(() => {
|
|
1431
|
-
this.actions = this.extensions.getAllowedSidebarActions();
|
|
1432
|
-
});
|
|
1433
|
-
}
|
|
1434
|
-
/**
|
|
1435
|
-
* @return {?}
|
|
1436
|
-
*/
|
|
1437
|
-
ngOnDestroy() {
|
|
1438
|
-
this.onDestroy$.next(true);
|
|
1439
|
-
this.onDestroy$.complete();
|
|
1440
|
-
this.store.dispatch(new SetInfoDrawerStateAction(false));
|
|
1441
|
-
}
|
|
1442
|
-
/**
|
|
1443
|
-
* @return {?}
|
|
1444
|
-
*/
|
|
1445
|
-
ngOnChanges() {
|
|
1446
|
-
if (this.node) {
|
|
1447
|
-
if (this.node['isLibrary']) {
|
|
1448
|
-
return this.setDisplayNode(this.node);
|
|
1449
|
-
}
|
|
1450
|
-
/** @type {?} */
|
|
1451
|
-
const entry = this.node.entry;
|
|
1452
|
-
/** @type {?} */
|
|
1453
|
-
const id = entry.nodeId || entry.id;
|
|
1454
|
-
return this.loadNodeInfo(id);
|
|
1455
|
-
}
|
|
1456
|
-
}
|
|
1457
|
-
/**
|
|
1458
|
-
* @param {?} _
|
|
1459
|
-
* @param {?} action
|
|
1460
|
-
* @return {?}
|
|
1461
|
-
*/
|
|
1462
|
-
trackByActionId(_, action) {
|
|
1463
|
-
return action.id;
|
|
1464
|
-
}
|
|
1465
|
-
/**
|
|
1466
|
-
* @private
|
|
1467
|
-
* @return {?}
|
|
1468
|
-
*/
|
|
1469
|
-
close() {
|
|
1470
|
-
this.store.dispatch(new ToggleInfoDrawerAction());
|
|
1471
|
-
}
|
|
1472
|
-
/**
|
|
1473
|
-
* @private
|
|
1474
|
-
* @param {?} nodeId
|
|
1475
|
-
* @return {?}
|
|
1476
|
-
*/
|
|
1477
|
-
loadNodeInfo(nodeId) {
|
|
1478
|
-
if (nodeId) {
|
|
1479
|
-
this.isLoading = true;
|
|
1480
|
-
this.contentApi.getNodeInfo(nodeId).subscribe(entity => {
|
|
1481
|
-
this.setDisplayNode(entity);
|
|
1482
|
-
this.isLoading = false;
|
|
1483
|
-
}, () => (this.isLoading = false));
|
|
1484
|
-
}
|
|
1485
|
-
}
|
|
1486
|
-
/**
|
|
1487
|
-
* @private
|
|
1488
|
-
* @param {?} node
|
|
1489
|
-
* @return {?}
|
|
1490
|
-
*/
|
|
1491
|
-
setDisplayNode(node) {
|
|
1492
|
-
this.displayNode = node;
|
|
1493
|
-
}
|
|
1494
|
-
}
|
|
1495
|
-
InfoDrawerComponent.decorators = [
|
|
1496
|
-
{ type: Component, args: [{
|
|
1497
|
-
selector: 'aca-info-drawer',
|
|
1498
|
-
template: "<div *ngIf=\"isLoading\">\n <mat-progress-bar mode=\"indeterminate\"></mat-progress-bar>\n</div>\n<ng-container *ngIf=\"!isLoading && !!displayNode\">\n <adf-info-drawer\n [title]=\"'APP.INFO_DRAWER.TITLE'\"\n cdkTrapFocus\n cdkTrapFocusAutoCapture\n >\n <adf-toolbar class=\"adf-toolbar--inline\" info-drawer-buttons>\n <ng-container *ngFor=\"let entry of actions; trackBy: trackByActionId\">\n <aca-toolbar-action [actionRef]=\"entry\"></aca-toolbar-action>\n </ng-container>\n </adf-toolbar>\n\n <adf-info-drawer-tab\n *ngFor=\"let tab of tabs\"\n [icon]=\"tab.icon\"\n [label]=\"tab.title\"\n >\n <adf-dynamic-tab\n [node]=\"displayNode\"\n [id]=\"tab.component\"\n [attr.data-automation-id]=\"tab.component\"\n >\n </adf-dynamic-tab>\n </adf-info-drawer-tab>\n </adf-info-drawer>\n</ng-container>\n"
|
|
1499
|
-
}] }
|
|
1500
|
-
];
|
|
1501
|
-
/** @nocollapse */
|
|
1502
|
-
InfoDrawerComponent.ctorParameters = () => [
|
|
1503
|
-
{ type: Store },
|
|
1504
|
-
{ type: ContentApiService },
|
|
1505
|
-
{ type: AppExtensionService }
|
|
1506
|
-
];
|
|
1507
|
-
InfoDrawerComponent.propDecorators = {
|
|
1508
|
-
nodeId: [{ type: Input }],
|
|
1509
|
-
node: [{ type: Input }],
|
|
1510
|
-
onEscapeKeyboardEvent: [{ type: HostListener, args: ['keydown.escape',] }]
|
|
1511
|
-
};
|
|
1512
|
-
|
|
1513
|
-
/**
|
|
1514
|
-
* @fileoverview added by tsickle
|
|
1515
|
-
* @suppress {checkTypes,extraRequire,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
1516
|
-
*/
|
|
1517
|
-
class SharedInfoDrawerModule {
|
|
1518
|
-
}
|
|
1519
|
-
SharedInfoDrawerModule.decorators = [
|
|
1520
|
-
{ type: NgModule, args: [{
|
|
1521
|
-
imports: [
|
|
1522
|
-
CommonModule,
|
|
1523
|
-
InfoDrawerModule,
|
|
1524
|
-
MatProgressBarModule,
|
|
1525
|
-
ExtensionsModule,
|
|
1526
|
-
ToolbarModule,
|
|
1527
|
-
SharedToolbarModule
|
|
1528
|
-
],
|
|
1529
|
-
declarations: [InfoDrawerComponent],
|
|
1530
|
-
exports: [InfoDrawerComponent]
|
|
1531
|
-
},] }
|
|
1532
|
-
];
|
|
1533
|
-
|
|
1534
|
-
/**
|
|
1535
|
-
* @fileoverview added by tsickle
|
|
1536
|
-
* @suppress {checkTypes,extraRequire,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
1537
|
-
*/
|
|
1538
|
-
|
|
1539
|
-
/**
|
|
1540
|
-
* @fileoverview added by tsickle
|
|
1541
|
-
* @suppress {checkTypes,extraRequire,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
1542
|
-
*/
|
|
1543
|
-
|
|
1544
|
-
/**
|
|
1545
|
-
* @fileoverview added by tsickle
|
|
1546
|
-
* @suppress {checkTypes,extraRequire,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
1547
|
-
*/
|
|
1548
|
-
class AppRouteReuseStrategy {
|
|
1549
|
-
constructor() {
|
|
1550
|
-
this.routeCache = new Map();
|
|
1551
|
-
}
|
|
1552
|
-
/**
|
|
1553
|
-
* @return {?}
|
|
1554
|
-
*/
|
|
1555
|
-
resetCache() {
|
|
1556
|
-
this.routeCache.forEach(value => {
|
|
1557
|
-
this.deactivateComponent(value.handle);
|
|
1558
|
-
});
|
|
1559
|
-
this.routeCache.clear();
|
|
1560
|
-
}
|
|
1561
|
-
/**
|
|
1562
|
-
* @private
|
|
1563
|
-
* @param {?} handle
|
|
1564
|
-
* @return {?}
|
|
1565
|
-
*/
|
|
1566
|
-
deactivateComponent(handle) {
|
|
1567
|
-
if (!handle) {
|
|
1568
|
-
return;
|
|
1569
|
-
}
|
|
1570
|
-
/** @type {?} */
|
|
1571
|
-
const componentRef = handle['componentRef'];
|
|
1572
|
-
if (componentRef) {
|
|
1573
|
-
componentRef.destroy();
|
|
1574
|
-
}
|
|
1575
|
-
}
|
|
1576
|
-
/**
|
|
1577
|
-
* @param {?} future
|
|
1578
|
-
* @param {?} curr
|
|
1579
|
-
* @return {?}
|
|
1580
|
-
*/
|
|
1581
|
-
shouldReuseRoute(future, curr) {
|
|
1582
|
-
/** @type {?} */
|
|
1583
|
-
const ret = future.routeConfig === curr.routeConfig;
|
|
1584
|
-
if (ret) {
|
|
1585
|
-
this.addRedirectsRecursively(future); // update redirects
|
|
1586
|
-
}
|
|
1587
|
-
return ret;
|
|
1588
|
-
}
|
|
1589
|
-
/**
|
|
1590
|
-
* @param {?} route
|
|
1591
|
-
* @return {?}
|
|
1592
|
-
*/
|
|
1593
|
-
shouldDetach(route) {
|
|
1594
|
-
/** @type {?} */
|
|
1595
|
-
const data = this.getRouteData(route);
|
|
1596
|
-
return data && data.reuse;
|
|
1597
|
-
}
|
|
1598
|
-
/**
|
|
1599
|
-
* @param {?} route
|
|
1600
|
-
* @param {?} handle
|
|
1601
|
-
* @return {?}
|
|
1602
|
-
*/
|
|
1603
|
-
store(route, handle) {
|
|
1604
|
-
/** @type {?} */
|
|
1605
|
-
const url = this.getFullRouteUrl(route);
|
|
1606
|
-
/** @type {?} */
|
|
1607
|
-
const data = this.getRouteData(route);
|
|
1608
|
-
this.routeCache.set(url, { handle, data });
|
|
1609
|
-
this.addRedirectsRecursively(route);
|
|
1610
|
-
}
|
|
1611
|
-
/**
|
|
1612
|
-
* @param {?} route
|
|
1613
|
-
* @return {?}
|
|
1614
|
-
*/
|
|
1615
|
-
shouldAttach(route) {
|
|
1616
|
-
/** @type {?} */
|
|
1617
|
-
const url = this.getFullRouteUrl(route);
|
|
1618
|
-
return this.routeCache.has(url);
|
|
1619
|
-
}
|
|
1620
|
-
/**
|
|
1621
|
-
* @param {?} route
|
|
1622
|
-
* @return {?}
|
|
1623
|
-
*/
|
|
1624
|
-
retrieve(route) {
|
|
1625
|
-
/** @type {?} */
|
|
1626
|
-
const url = this.getFullRouteUrl(route);
|
|
1627
|
-
/** @type {?} */
|
|
1628
|
-
const data = this.getRouteData(route);
|
|
1629
|
-
return data && data.reuse && this.routeCache.has(url)
|
|
1630
|
-
? this.routeCache.get(url).handle
|
|
1631
|
-
: null;
|
|
1632
|
-
}
|
|
1633
|
-
/**
|
|
1634
|
-
* @private
|
|
1635
|
-
* @param {?} route
|
|
1636
|
-
* @return {?}
|
|
1637
|
-
*/
|
|
1638
|
-
addRedirectsRecursively(route) {
|
|
1639
|
-
/** @type {?} */
|
|
1640
|
-
const config = route.routeConfig;
|
|
1641
|
-
if (config) {
|
|
1642
|
-
if (!config.loadChildren) {
|
|
1643
|
-
/** @type {?} */
|
|
1644
|
-
const routeFirstChild = route.firstChild;
|
|
1645
|
-
/** @type {?} */
|
|
1646
|
-
const routeFirstChildUrl = routeFirstChild
|
|
1647
|
-
? this.getRouteUrlPaths(routeFirstChild).join('/')
|
|
1648
|
-
: '';
|
|
1649
|
-
/** @type {?} */
|
|
1650
|
-
const childConfigs = config.children;
|
|
1651
|
-
if (childConfigs) {
|
|
1652
|
-
/** @type {?} */
|
|
1653
|
-
const childConfigWithRedirect = childConfigs.find(c => c.path === '' && !!c.redirectTo);
|
|
1654
|
-
if (childConfigWithRedirect) {
|
|
1655
|
-
childConfigWithRedirect.redirectTo = routeFirstChildUrl;
|
|
1656
|
-
}
|
|
1657
|
-
}
|
|
1658
|
-
}
|
|
1659
|
-
route.children.forEach(childRoute => this.addRedirectsRecursively(childRoute));
|
|
1660
|
-
}
|
|
1661
|
-
}
|
|
1662
|
-
/**
|
|
1663
|
-
* @private
|
|
1664
|
-
* @param {?} route
|
|
1665
|
-
* @return {?}
|
|
1666
|
-
*/
|
|
1667
|
-
getFullRouteUrl(route) {
|
|
1668
|
-
return this.getFullRouteUrlPaths(route)
|
|
1669
|
-
.filter(Boolean)
|
|
1670
|
-
.join('/');
|
|
1671
|
-
}
|
|
1672
|
-
/**
|
|
1673
|
-
* @private
|
|
1674
|
-
* @param {?} route
|
|
1675
|
-
* @return {?}
|
|
1676
|
-
*/
|
|
1677
|
-
getFullRouteUrlPaths(route) {
|
|
1678
|
-
/** @type {?} */
|
|
1679
|
-
const paths = this.getRouteUrlPaths(route);
|
|
1680
|
-
return route.parent
|
|
1681
|
-
? [...this.getFullRouteUrlPaths(route.parent), ...paths]
|
|
1682
|
-
: paths;
|
|
1683
|
-
}
|
|
1684
|
-
/**
|
|
1685
|
-
* @private
|
|
1686
|
-
* @param {?} route
|
|
1687
|
-
* @return {?}
|
|
1688
|
-
*/
|
|
1689
|
-
getRouteUrlPaths(route) {
|
|
1690
|
-
return route.url.map(urlSegment => urlSegment.path);
|
|
1691
|
-
}
|
|
1692
|
-
/**
|
|
1693
|
-
* @private
|
|
1694
|
-
* @param {?} route
|
|
1695
|
-
* @return {?}
|
|
1696
|
-
*/
|
|
1697
|
-
getRouteData(route) {
|
|
1698
|
-
return route.routeConfig && ((/** @type {?} */ (route.routeConfig.data)));
|
|
1699
|
-
}
|
|
1700
|
-
}
|
|
1701
|
-
|
|
1702
|
-
/**
|
|
1703
|
-
* @fileoverview added by tsickle
|
|
1704
|
-
* @suppress {checkTypes,extraRequire,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
1705
|
-
*/
|
|
1706
|
-
class AppSharedRuleGuard {
|
|
1707
|
-
/**
|
|
1708
|
-
* @param {?} store
|
|
1709
|
-
*/
|
|
1710
|
-
constructor(store) {
|
|
1711
|
-
this.isQuickShareEnabled$ = store.select(isQuickShareEnabled);
|
|
1712
|
-
}
|
|
1713
|
-
/**
|
|
1714
|
-
* @param {?} _
|
|
1715
|
-
* @return {?}
|
|
1716
|
-
*/
|
|
1717
|
-
canActivate(_) {
|
|
1718
|
-
return this.isQuickShareEnabled$;
|
|
1719
|
-
}
|
|
1720
|
-
/**
|
|
1721
|
-
* @param {?} route
|
|
1722
|
-
* @return {?}
|
|
1723
|
-
*/
|
|
1724
|
-
canActivateChild(route) {
|
|
1725
|
-
return this.canActivate(route);
|
|
1726
|
-
}
|
|
1727
|
-
}
|
|
1728
|
-
AppSharedRuleGuard.decorators = [
|
|
1729
|
-
{ type: Injectable, args: [{
|
|
1730
|
-
providedIn: 'root'
|
|
1731
|
-
},] }
|
|
1732
|
-
];
|
|
1733
|
-
/** @nocollapse */
|
|
1734
|
-
AppSharedRuleGuard.ctorParameters = () => [
|
|
1735
|
-
{ type: Store }
|
|
1736
|
-
];
|
|
1737
|
-
/** @nocollapse */ AppSharedRuleGuard.ngInjectableDef = defineInjectable({ factory: function AppSharedRuleGuard_Factory() { return new AppSharedRuleGuard(inject(Store)); }, token: AppSharedRuleGuard, providedIn: "root" });
|
|
1738
|
-
|
|
1739
|
-
/**
|
|
1740
|
-
* @fileoverview added by tsickle
|
|
1741
|
-
* @suppress {checkTypes,extraRequire,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
1742
|
-
*/
|
|
1743
|
-
class AppService {
|
|
1744
|
-
/**
|
|
1745
|
-
* @param {?} auth
|
|
1746
|
-
* @param {?} config
|
|
1747
|
-
* @param {?} searchQueryBuilderService
|
|
1748
|
-
* @param {?} routeStrategy
|
|
1749
|
-
*/
|
|
1750
|
-
constructor(auth, config, searchQueryBuilderService, routeStrategy) {
|
|
1751
|
-
this.config = config;
|
|
1752
|
-
this.ready = new BehaviorSubject(auth.isLoggedIn() || this.withCredentials);
|
|
1753
|
-
this.ready$ = this.ready.asObservable();
|
|
1754
|
-
auth.onLogin.subscribe(() => {
|
|
1755
|
-
routeStrategy.resetCache();
|
|
1756
|
-
this.ready.next(true);
|
|
1757
|
-
});
|
|
1758
|
-
auth.onLogout.subscribe(() => {
|
|
1759
|
-
searchQueryBuilderService.resetToDefaults();
|
|
1760
|
-
routeStrategy.resetCache();
|
|
1761
|
-
});
|
|
1762
|
-
}
|
|
1763
|
-
/**
|
|
1764
|
-
* Whether `withCredentials` mode is enabled.
|
|
1765
|
-
* Usually means that `Kerberos` mode is used.
|
|
1766
|
-
* @return {?}
|
|
1767
|
-
*/
|
|
1768
|
-
get withCredentials() {
|
|
1769
|
-
return this.config.get('auth.withCredentials', false);
|
|
1770
|
-
}
|
|
1771
|
-
}
|
|
1772
|
-
AppService.decorators = [
|
|
1773
|
-
{ type: Injectable, args: [{
|
|
1774
|
-
providedIn: 'root'
|
|
1775
|
-
},] }
|
|
1776
|
-
];
|
|
1777
|
-
/** @nocollapse */
|
|
1778
|
-
AppService.ctorParameters = () => [
|
|
1779
|
-
{ type: AuthenticationService },
|
|
1780
|
-
{ type: AppConfigService },
|
|
1781
|
-
{ type: SearchQueryBuilderService },
|
|
1782
|
-
{ type: AppRouteReuseStrategy, decorators: [{ type: Inject, args: [RouteReuseStrategy,] }] }
|
|
1783
|
-
];
|
|
1784
|
-
/** @nocollapse */ AppService.ngInjectableDef = defineInjectable({ factory: function AppService_Factory() { return new AppService(inject(AuthenticationService), inject(AppConfigService), inject(SearchQueryBuilderService), inject(RouteReuseStrategy)); }, token: AppService, providedIn: "root" });
|
|
1785
|
-
|
|
1786
|
-
/**
|
|
1787
|
-
* @fileoverview added by tsickle
|
|
1788
|
-
* @suppress {checkTypes,extraRequire,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
1789
|
-
*/
|
|
1790
|
-
class GenericErrorComponent {
|
|
1791
|
-
constructor() {
|
|
1792
|
-
this.text = 'APP.MESSAGES.ERRORS.MISSING_CONTENT';
|
|
1793
|
-
}
|
|
1794
|
-
}
|
|
1795
|
-
GenericErrorComponent.decorators = [
|
|
1796
|
-
{ type: Component, args: [{
|
|
1797
|
-
selector: 'aca-generic-error',
|
|
1798
|
-
template: "<mat-icon>error</mat-icon>\n<p class=\"generic-error__title\">\n {{ text | translate }}\n</p>\n",
|
|
1799
|
-
encapsulation: ViewEncapsulation.None,
|
|
1800
|
-
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
1801
|
-
host: { class: 'aca-generic-error' },
|
|
1802
|
-
styles: [".aca-generic-error{color:var(--theme-text-color,rgba(0,0,0,.54));display:flex;align-items:center;justify-content:center;flex-direction:column;width:100%;height:100%}.aca-generic-error__title{font-size:16px}.aca-generic-error mat-icon{color:var(--theme-warn-color,#f44336);font-size:52px;height:52px;width:52px}"]
|
|
1803
|
-
}] }
|
|
1804
|
-
];
|
|
1805
|
-
GenericErrorComponent.propDecorators = {
|
|
1806
|
-
text: [{ type: Input }]
|
|
1807
|
-
};
|
|
1808
|
-
|
|
1809
|
-
/**
|
|
1810
|
-
* @fileoverview added by tsickle
|
|
1811
|
-
* @suppress {checkTypes,extraRequire,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
1812
|
-
*/
|
|
1813
|
-
class GenericErrorModule {
|
|
1814
|
-
}
|
|
1815
|
-
GenericErrorModule.decorators = [
|
|
1816
|
-
{ type: NgModule, args: [{
|
|
1817
|
-
imports: [CommonModule, MatIconModule, TranslateModule.forChild()],
|
|
1818
|
-
declarations: [GenericErrorComponent],
|
|
1819
|
-
exports: [GenericErrorComponent]
|
|
1820
|
-
},] }
|
|
1821
|
-
];
|
|
1822
|
-
|
|
1823
|
-
/**
|
|
1824
|
-
* @fileoverview added by tsickle
|
|
1825
|
-
* @suppress {checkTypes,extraRequire,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
1826
|
-
*/
|
|
1827
|
-
class ContextActionsDirective {
|
|
1828
|
-
/**
|
|
1829
|
-
* @param {?} store
|
|
1830
|
-
*/
|
|
1831
|
-
constructor(store) {
|
|
1832
|
-
this.store = store;
|
|
1833
|
-
this.execute$ = new Subject();
|
|
1834
|
-
this.onDestroy$ = new Subject();
|
|
1835
|
-
// tslint:disable-next-line:no-input-rename
|
|
1836
|
-
this.enabled = true;
|
|
1837
|
-
}
|
|
1838
|
-
/**
|
|
1839
|
-
* @param {?} event
|
|
1840
|
-
* @return {?}
|
|
1841
|
-
*/
|
|
1842
|
-
onContextMenuEvent(event) {
|
|
1843
|
-
if (event) {
|
|
1844
|
-
event.preventDefault();
|
|
1845
|
-
if (this.enabled) {
|
|
1846
|
-
/** @type {?} */
|
|
1847
|
-
const target = this.getTarget(event);
|
|
1848
|
-
if (target) {
|
|
1849
|
-
this.execute(event, target);
|
|
1850
|
-
}
|
|
1851
|
-
}
|
|
1852
|
-
}
|
|
1853
|
-
}
|
|
1854
|
-
/**
|
|
1855
|
-
* @return {?}
|
|
1856
|
-
*/
|
|
1857
|
-
ngOnInit() {
|
|
1858
|
-
this.execute$
|
|
1859
|
-
.pipe(debounceTime(300), takeUntil(this.onDestroy$))
|
|
1860
|
-
.subscribe((event) => {
|
|
1861
|
-
this.store.dispatch(new ContextMenu(event));
|
|
1862
|
-
});
|
|
1863
|
-
}
|
|
1864
|
-
/**
|
|
1865
|
-
* @return {?}
|
|
1866
|
-
*/
|
|
1867
|
-
ngOnDestroy() {
|
|
1868
|
-
this.onDestroy$.next(true);
|
|
1869
|
-
this.onDestroy$.complete();
|
|
1870
|
-
}
|
|
1871
|
-
/**
|
|
1872
|
-
* @param {?} event
|
|
1873
|
-
* @param {?} target
|
|
1874
|
-
* @return {?}
|
|
1875
|
-
*/
|
|
1876
|
-
execute(event, target) {
|
|
1877
|
-
if (!this.isSelected(target)) {
|
|
1878
|
-
target.dispatchEvent(new MouseEvent('click'));
|
|
1879
|
-
}
|
|
1880
|
-
this.execute$.next(event);
|
|
1881
|
-
}
|
|
1882
|
-
/**
|
|
1883
|
-
* @private
|
|
1884
|
-
* @param {?} event
|
|
1885
|
-
* @return {?}
|
|
1886
|
-
*/
|
|
1887
|
-
getTarget(event) {
|
|
1888
|
-
/** @type {?} */
|
|
1889
|
-
const target = (/** @type {?} */ (event.target));
|
|
1890
|
-
return this.findAncestor(target, 'adf-datatable-cell');
|
|
1891
|
-
}
|
|
1892
|
-
/**
|
|
1893
|
-
* @private
|
|
1894
|
-
* @param {?} target
|
|
1895
|
-
* @return {?}
|
|
1896
|
-
*/
|
|
1897
|
-
isSelected(target) {
|
|
1898
|
-
if (!target) {
|
|
1899
|
-
return false;
|
|
1900
|
-
}
|
|
1901
|
-
return this.findAncestor(target, 'adf-datatable-row').classList.contains('adf-is-selected');
|
|
1902
|
-
}
|
|
1903
|
-
/**
|
|
1904
|
-
* @private
|
|
1905
|
-
* @param {?} el
|
|
1906
|
-
* @param {?} className
|
|
1907
|
-
* @return {?}
|
|
1908
|
-
*/
|
|
1909
|
-
findAncestor(el, className) {
|
|
1910
|
-
if (el.classList.contains(className)) {
|
|
1911
|
-
return el;
|
|
1912
|
-
}
|
|
1913
|
-
// tslint:disable-next-line:curly
|
|
1914
|
-
while ((el = el.parentElement) && !el.classList.contains(className))
|
|
1915
|
-
;
|
|
1916
|
-
return el;
|
|
1917
|
-
}
|
|
1918
|
-
}
|
|
1919
|
-
ContextActionsDirective.decorators = [
|
|
1920
|
-
{ type: Directive, args: [{
|
|
1921
|
-
selector: '[acaContextActions]',
|
|
1922
|
-
exportAs: 'acaContextActions'
|
|
1923
|
-
},] }
|
|
1924
|
-
];
|
|
1925
|
-
/** @nocollapse */
|
|
1926
|
-
ContextActionsDirective.ctorParameters = () => [
|
|
1927
|
-
{ type: Store }
|
|
1928
|
-
];
|
|
1929
|
-
ContextActionsDirective.propDecorators = {
|
|
1930
|
-
enabled: [{ type: Input, args: ['acaContextEnable',] }],
|
|
1931
|
-
onContextMenuEvent: [{ type: HostListener, args: ['contextmenu', ['$event'],] }]
|
|
1932
|
-
};
|
|
1933
|
-
|
|
1934
|
-
/**
|
|
1935
|
-
* @fileoverview added by tsickle
|
|
1936
|
-
* @suppress {checkTypes,extraRequire,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
1937
|
-
*/
|
|
1938
|
-
/**
|
|
1939
|
-
* @deprecated in 1.11.0, use SharedDirectivesModule instead.
|
|
1940
|
-
*/
|
|
1941
|
-
class ContextActionsModule {
|
|
1942
|
-
}
|
|
1943
|
-
ContextActionsModule.decorators = [
|
|
1944
|
-
{ type: NgModule, args: [{
|
|
1945
|
-
declarations: [ContextActionsDirective],
|
|
1946
|
-
exports: [ContextActionsDirective]
|
|
1947
|
-
},] }
|
|
1948
|
-
];
|
|
1949
|
-
|
|
1950
|
-
/**
|
|
1951
|
-
* @fileoverview added by tsickle
|
|
1952
|
-
* @suppress {checkTypes,extraRequire,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
1953
|
-
*/
|
|
1954
|
-
class PaginationDirective {
|
|
1955
|
-
/**
|
|
1956
|
-
* @param {?} pagination
|
|
1957
|
-
* @param {?} preferences
|
|
1958
|
-
* @param {?} config
|
|
1959
|
-
*/
|
|
1960
|
-
constructor(pagination, preferences, config) {
|
|
1961
|
-
this.pagination = pagination;
|
|
1962
|
-
this.preferences = preferences;
|
|
1963
|
-
this.config = config;
|
|
1964
|
-
this.subscriptions = [];
|
|
1965
|
-
}
|
|
1966
|
-
/**
|
|
1967
|
-
* @return {?}
|
|
1968
|
-
*/
|
|
1969
|
-
ngOnInit() {
|
|
1970
|
-
this.pagination.supportedPageSizes = this.config.get('pagination.supportedPageSizes');
|
|
1971
|
-
this.subscriptions.push(this.pagination.changePageSize.subscribe((event) => {
|
|
1972
|
-
this.preferences.paginationSize = event.maxItems;
|
|
1973
|
-
}));
|
|
1974
|
-
}
|
|
1975
|
-
/**
|
|
1976
|
-
* @return {?}
|
|
1977
|
-
*/
|
|
1978
|
-
ngOnDestroy() {
|
|
1979
|
-
this.subscriptions.forEach(subscription => subscription.unsubscribe());
|
|
1980
|
-
this.subscriptions = [];
|
|
1981
|
-
}
|
|
1982
|
-
}
|
|
1983
|
-
PaginationDirective.decorators = [
|
|
1984
|
-
{ type: Directive, args: [{
|
|
1985
|
-
selector: '[acaPagination]'
|
|
1986
|
-
},] }
|
|
1987
|
-
];
|
|
1988
|
-
/** @nocollapse */
|
|
1989
|
-
PaginationDirective.ctorParameters = () => [
|
|
1990
|
-
{ type: PaginationComponent },
|
|
1991
|
-
{ type: UserPreferencesService },
|
|
1992
|
-
{ type: AppConfigService }
|
|
1993
|
-
];
|
|
1994
|
-
|
|
1995
|
-
/**
|
|
1996
|
-
* @fileoverview added by tsickle
|
|
1997
|
-
* @suppress {checkTypes,extraRequire,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
1998
|
-
*/
|
|
1999
|
-
class SharedDirectivesModule {
|
|
2000
|
-
}
|
|
2001
|
-
SharedDirectivesModule.decorators = [
|
|
2002
|
-
{ type: NgModule, args: [{
|
|
2003
|
-
imports: [ContextActionsModule],
|
|
2004
|
-
declarations: [PaginationDirective],
|
|
2005
|
-
exports: [PaginationDirective, ContextActionsModule]
|
|
2006
|
-
},] }
|
|
2007
|
-
];
|
|
2008
|
-
|
|
2009
|
-
/**
|
|
2010
|
-
* @fileoverview added by tsickle
|
|
2011
|
-
* @suppress {checkTypes,extraRequire,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
2012
|
-
*/
|
|
2013
|
-
/*!
|
|
2014
|
-
* @license
|
|
2015
|
-
* Alfresco Example Content Application
|
|
2016
|
-
*
|
|
2017
|
-
* Copyright (C) 2005 - 2020 Alfresco Software Limited
|
|
2018
|
-
*
|
|
2019
|
-
* This file is part of the Alfresco Example Content Application.
|
|
2020
|
-
* If the software was purchased under a paid Alfresco license, the terms of
|
|
2021
|
-
* the paid license agreement will prevail. Otherwise, the software is
|
|
2022
|
-
* provided under the following open source license terms:
|
|
2023
|
-
*
|
|
2024
|
-
* The Alfresco Example Content Application is free software: you can redistribute it and/or modify
|
|
2025
|
-
* it under the terms of the GNU Lesser General Public License as published by
|
|
2026
|
-
* the Free Software Foundation, either version 3 of the License, or
|
|
2027
|
-
* (at your option) any later version.
|
|
2028
|
-
*
|
|
2029
|
-
* The Alfresco Example Content Application is distributed in the hope that it will be useful,
|
|
2030
|
-
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
2031
|
-
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
2032
|
-
* GNU Lesser General Public License for more details.
|
|
2033
|
-
*
|
|
2034
|
-
* You should have received a copy of the GNU Lesser General Public License
|
|
2035
|
-
* along with Alfresco. If not, see <http://www.gnu.org/licenses/>.
|
|
2036
|
-
*/
|
|
2037
|
-
/**
|
|
2038
|
-
* @param {?} node
|
|
2039
|
-
* @return {?}
|
|
2040
|
-
*/
|
|
2041
|
-
function isLocked(node) {
|
|
2042
|
-
const { entry } = node;
|
|
2043
|
-
return ((entry && entry.isLocked) ||
|
|
2044
|
-
(entry.properties &&
|
|
2045
|
-
(entry.properties['cm:lockType'] === 'READ_ONLY_LOCK' ||
|
|
2046
|
-
entry.properties['cm:lockType'] === 'WRITE_LOCK')));
|
|
2047
|
-
}
|
|
2048
|
-
/**
|
|
2049
|
-
* @param {?} node
|
|
2050
|
-
* @return {?}
|
|
2051
|
-
*/
|
|
2052
|
-
function isLibrary(node) {
|
|
2053
|
-
const { entry } = node;
|
|
2054
|
-
return ((entry.guid &&
|
|
2055
|
-
entry.id &&
|
|
2056
|
-
entry.preset &&
|
|
2057
|
-
entry.title &&
|
|
2058
|
-
entry.visibility) ||
|
|
2059
|
-
entry.nodeType === 'st:site');
|
|
2060
|
-
}
|
|
2061
|
-
|
|
2062
|
-
/**
|
|
2063
|
-
* @fileoverview added by tsickle
|
|
2064
|
-
* @suppress {checkTypes,extraRequire,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
2065
|
-
*/
|
|
2066
|
-
class SharedModule {
|
|
2067
|
-
/**
|
|
2068
|
-
* @return {?}
|
|
2069
|
-
*/
|
|
2070
|
-
static forRoot() {
|
|
2071
|
-
return {
|
|
2072
|
-
ngModule: SharedModule,
|
|
2073
|
-
providers: [ContentApiService, NodePermissionService, AppService]
|
|
2074
|
-
};
|
|
2075
|
-
}
|
|
2076
|
-
}
|
|
2077
|
-
SharedModule.decorators = [
|
|
2078
|
-
{ type: NgModule, args: [{
|
|
2079
|
-
imports: [ContextActionsModule],
|
|
2080
|
-
exports: [ContextActionsModule]
|
|
2081
|
-
},] }
|
|
2082
|
-
];
|
|
2083
|
-
|
|
2084
|
-
/**
|
|
2085
|
-
* @fileoverview added by tsickle
|
|
2086
|
-
* @suppress {checkTypes,extraRequire,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
2087
|
-
*/
|
|
2088
|
-
|
|
2089
|
-
/**
|
|
2090
|
-
* @fileoverview added by tsickle
|
|
2091
|
-
* @suppress {checkTypes,extraRequire,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
2092
|
-
*/
|
|
2093
|
-
|
|
2094
|
-
export { DefaultExtensionLoaderFactory, EXTENSION_DATA_LOADERS, ExtensionsDataLoaderGuard, PageLayoutContentComponent, PageLayoutErrorComponent, PageLayoutHeaderComponent, PageLayoutComponent, PageLayoutModule, LockedByComponent, LockedByModule, SharedToolbarModule, SharedInfoDrawerModule, AppRouteReuseStrategy, AppSharedRuleGuard, AppService, ContentApiService, NodePermissionService, AppExtensionService, GenericErrorComponent, GenericErrorModule, ContextActionsModule, SharedDirectivesModule, isLocked, isLibrary, SharedModule, InfoDrawerComponent as ɵe, ToolbarActionComponent as ɵb, ToolbarButtonComponent as ɵa, ToolbarMenuItemComponent as ɵc, ToolbarMenuComponent as ɵd, ContextActionsDirective as ɵf, PaginationDirective as ɵg };
|
|
2095
|
-
|
|
2096
|
-
//# sourceMappingURL=alfresco-aca-shared.js.map
|