@alfresco/aca-shared 2.0.1 → 4.0.0-4895381898

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