@alfresco/aca-shared 2.0.1 → 4.0.0-A.2-9920

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 (220) hide show
  1. package/README.md +2 -1
  2. package/{esm2015/alfresco-aca-shared.js → esm2020/alfresco-aca-shared.mjs} +0 -0
  3. package/esm2020/lib/adf-extensions/extensions-data-loader.guard.mjs +74 -0
  4. package/esm2020/lib/components/document-base-page/document-base-page.component.mjs +160 -0
  5. package/esm2020/lib/components/document-base-page/document-base-page.service.mjs +10 -0
  6. package/esm2020/lib/components/generic-error/generic-error.component.mjs +42 -0
  7. package/esm2020/lib/components/generic-error/generic-error.module.mjs +45 -0
  8. package/esm2020/lib/components/info-drawer/info-drawer.component.mjs +124 -0
  9. package/esm2020/lib/components/info-drawer/shared-info-drawer.module.mjs +47 -0
  10. package/esm2020/lib/components/locked-by/locked-by.component.mjs +53 -0
  11. package/esm2020/lib/components/locked-by/locked-by.module.mjs +45 -0
  12. package/esm2020/lib/components/page-layout/page-layout-content.component.mjs +49 -0
  13. package/esm2020/lib/components/page-layout/page-layout-error.component.mjs +41 -0
  14. package/esm2020/lib/components/page-layout/page-layout-header.component.mjs +41 -0
  15. package/esm2020/lib/components/page-layout/page-layout.component.mjs +41 -0
  16. package/esm2020/lib/components/page-layout/page-layout.module.mjs +45 -0
  17. package/esm2020/lib/components/tool-bar/shared-toolbar.module.mjs +47 -0
  18. package/esm2020/lib/components/tool-bar/toolbar-action/toolbar-action.component.mjs +58 -0
  19. package/esm2020/lib/components/tool-bar/toolbar-button/toolbar-button.component.mjs +67 -0
  20. package/esm2020/lib/components/tool-bar/toolbar-menu/toolbar-menu.component.mjs +78 -0
  21. package/esm2020/lib/components/tool-bar/toolbar-menu-item/toolbar-menu-item.component.mjs +69 -0
  22. package/esm2020/lib/directives/contextmenu/contextmenu.directive.mjs +107 -0
  23. package/{esm2015/lib/components/info-drawer/shared-info-drawer.module.js → esm2020/lib/directives/contextmenu/contextmenu.module.mjs} +17 -15
  24. package/esm2020/lib/directives/pagination.directive.mjs +55 -0
  25. package/esm2020/lib/directives/shared.directives.module.mjs +42 -0
  26. package/esm2020/lib/models/modal-configuration.mjs +2 -0
  27. package/{esm2015/lib/models/types.js → esm2020/lib/models/types.mjs} +1 -0
  28. package/{esm2015/lib/models/viewer.rules.js → esm2020/lib/models/viewer.rules.mjs} +2 -1
  29. package/esm2020/lib/routing/shared.guard.mjs +49 -0
  30. package/esm2020/lib/services/alfresco-office-extension.service.mjs +64 -0
  31. package/esm2020/lib/services/app-hook.service.mjs +88 -0
  32. package/esm2020/lib/services/app.extension.service.mjs +453 -0
  33. package/esm2020/lib/services/app.service.mjs +213 -0
  34. package/esm2020/lib/services/content-api.service.mjs +268 -0
  35. package/{esm2015/lib/services/node-permission.service.js → esm2020/lib/services/node-permission.service.mjs} +9 -7
  36. package/esm2020/lib/services/router.extension.service.mjs +106 -0
  37. package/esm2020/lib/shared.module.mjs +49 -0
  38. package/esm2020/lib/testing/lib-testing-module.mjs +118 -0
  39. package/{esm2015/store/actions/contextmenu.actions.js → esm2020/lib/testing/translation.service.mjs} +19 -9
  40. package/{esm2015/lib/utils/node.utils.js → esm2020/lib/utils/node.utils.mjs} +0 -0
  41. package/esm2020/public-api.mjs +63 -0
  42. package/{esm2015/rules/alfresco-aca-shared-rules.js → esm2020/rules/alfresco-aca-shared-rules.mjs} +0 -0
  43. package/esm2020/rules/app.rules.mjs +503 -0
  44. package/esm2020/rules/navigation.rules.mjs +152 -0
  45. package/{esm2015/rules/public-api.js → esm2020/rules/public-api.mjs} +0 -0
  46. package/{esm2015/store/states/app.state.js → esm2020/rules/repository.rules.mjs} +10 -1
  47. package/esm2020/rules/user.rules.mjs +30 -0
  48. package/esm2020/store/actions/app-action-types.mjs +48 -0
  49. package/esm2020/store/actions/app.actions.mjs +135 -0
  50. package/esm2020/store/actions/context-menu-action-types.mjs +29 -0
  51. package/esm2020/store/actions/contextmenu.actions.mjs +32 -0
  52. package/esm2020/store/actions/library.actions.mjs +64 -0
  53. package/{esm2015/store/actions/metadata-aspect.actions.js → esm2020/store/actions/metadata-aspect.actions.mjs} +0 -0
  54. package/esm2020/store/actions/node.actions.mjs +189 -0
  55. package/{esm2015/lib/components/generic-error/generic-error.module.js → esm2020/store/actions/router-action-types.mjs} +9 -15
  56. package/esm2020/store/actions/router.actions.mjs +55 -0
  57. package/esm2020/store/actions/search.actions.mjs +36 -0
  58. package/esm2020/store/actions/snackbar.actions.mjs +58 -0
  59. package/esm2020/store/actions/template-action-types.mjs +32 -0
  60. package/{esm2015/lib/components/generic-error/generic-error.component.js → esm2020/store/actions/template.actions.mjs} +21 -17
  61. package/esm2020/store/actions/upload.actions.mjs +50 -0
  62. package/esm2020/store/actions/viewer.actions.mjs +82 -0
  63. package/{esm2015/store/alfresco-aca-shared-store.js → esm2020/store/alfresco-aca-shared-store.mjs} +0 -0
  64. package/esm2020/store/effects/dialog.effects.mjs +45 -0
  65. package/esm2020/store/effects/router.effects.mjs +117 -0
  66. package/esm2020/store/effects/snackbar.effects.mjs +86 -0
  67. package/{esm2015/store/models/delete-status.model.js → esm2020/store/models/delete-status.model.mjs} +1 -0
  68. package/{esm2015/store/models/deleted-node-info.model.js → esm2020/store/models/deleted-node-info.model.mjs} +1 -0
  69. package/esm2020/store/models/modal-configuration.mjs +2 -0
  70. package/{esm2015/store/models/node-info.model.js → esm2020/store/models/node-info.model.mjs} +1 -0
  71. package/{esm2015/store/models/search-option.model.js → esm2020/store/models/search-option.model.mjs} +0 -0
  72. package/esm2020/store/public-api.mjs +50 -0
  73. package/esm2020/store/selectors/app.selectors.mjs +60 -0
  74. package/esm2020/store/states/app.state.mjs +27 -0
  75. package/esm2020/store/store.module.mjs +43 -0
  76. package/fesm2015/alfresco-aca-shared-rules.mjs +751 -0
  77. package/fesm2015/alfresco-aca-shared-rules.mjs.map +1 -0
  78. package/fesm2015/{alfresco-aca-shared-store.js → alfresco-aca-shared-store.mjs} +302 -276
  79. package/fesm2015/alfresco-aca-shared-store.mjs.map +1 -0
  80. package/fesm2015/alfresco-aca-shared.mjs +2726 -0
  81. package/fesm2015/alfresco-aca-shared.mjs.map +1 -0
  82. package/{fesm2015/alfresco-aca-shared-rules.js → fesm2020/alfresco-aca-shared-rules.mjs} +220 -150
  83. package/fesm2020/alfresco-aca-shared-rules.mjs.map +1 -0
  84. package/fesm2020/alfresco-aca-shared-store.mjs +1406 -0
  85. package/fesm2020/alfresco-aca-shared-store.mjs.map +1 -0
  86. package/fesm2020/alfresco-aca-shared.mjs +2841 -0
  87. package/fesm2020/alfresco-aca-shared.mjs.map +1 -0
  88. package/{alfresco-aca-shared.d.ts → index.d.ts} +1 -0
  89. package/lib/adf-extensions/extensions-data-loader.guard.d.ts +4 -1
  90. package/lib/components/document-base-page/document-base-page.component.d.ts +74 -0
  91. package/lib/components/document-base-page/document-base-page.service.d.ts +5 -0
  92. package/lib/components/generic-error/generic-error.component.d.ts +3 -24
  93. package/lib/components/generic-error/generic-error.module.d.ts +8 -24
  94. package/lib/components/info-drawer/info-drawer.component.d.ts +6 -0
  95. package/lib/components/info-drawer/shared-info-drawer.module.d.ts +11 -24
  96. package/lib/components/locked-by/locked-by.component.d.ts +5 -30
  97. package/lib/components/locked-by/locked-by.module.d.ts +8 -24
  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 +3 -24
  102. package/lib/components/page-layout/page-layout.module.d.ts +9 -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 +7 -2
  105. package/lib/components/tool-bar/toolbar-button/toolbar-button.component.d.ts +5 -25
  106. package/lib/components/tool-bar/toolbar-menu/toolbar-menu.component.d.ts +13 -7
  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 +5 -1
  109. package/lib/directives/contextmenu/contextmenu.module.d.ts +5 -24
  110. package/lib/directives/pagination.directive.d.ts +3 -0
  111. package/lib/directives/shared.directives.module.d.ts +6 -24
  112. package/lib/models/modal-configuration.d.ts +3 -0
  113. package/lib/models/viewer.rules.d.ts +4 -0
  114. package/lib/routing/shared.guard.d.ts +3 -24
  115. package/lib/services/alfresco-office-extension.service.d.ts +11 -0
  116. package/lib/services/app-hook.service.d.ts +55 -0
  117. package/lib/services/app.extension.service.d.ts +30 -45
  118. package/lib/services/app.service.d.ts +42 -6
  119. package/lib/services/content-api.service.d.ts +34 -25
  120. package/lib/services/node-permission.service.d.ts +3 -24
  121. package/lib/services/router.extension.service.d.ts +3 -24
  122. package/lib/shared.module.d.ts +5 -0
  123. package/lib/testing/lib-testing-module.d.ts +43 -0
  124. package/lib/testing/translation.service.d.ts +10 -0
  125. package/package.json +57 -18
  126. package/public-api.d.ts +7 -1
  127. package/rules/app.rules.d.ts +104 -30
  128. package/rules/{alfresco-aca-shared-rules.d.ts → index.d.ts} +1 -0
  129. package/rules/navigation.rules.d.ts +6 -6
  130. package/rules/repository.rules.d.ts +2 -1
  131. package/rules/user.rules.d.ts +1 -1
  132. package/store/actions/app-action-types.d.ts +46 -0
  133. package/store/actions/app.actions.d.ts +19 -18
  134. package/{lib/routing/app.routes.strategy.d.ts → store/actions/context-menu-action-types.d.ts} +2 -15
  135. package/store/actions/contextmenu.actions.d.ts +1 -3
  136. package/store/actions/library.actions.d.ts +3 -1
  137. package/store/actions/node.actions.d.ts +33 -7
  138. package/store/actions/router-action-types.d.ts +31 -0
  139. package/store/actions/router.actions.d.ts +5 -6
  140. package/store/actions/search.actions.d.ts +1 -13
  141. package/store/actions/snackbar.actions.d.ts +8 -11
  142. package/store/actions/template-action-types.d.ts +30 -0
  143. package/store/actions/template.actions.d.ts +1 -6
  144. package/store/actions/upload.actions.d.ts +3 -1
  145. package/store/actions/viewer.actions.d.ts +6 -0
  146. package/store/effects/dialog.effects.d.ts +4 -1
  147. package/store/effects/router.effects.d.ts +11 -29
  148. package/store/effects/snackbar.effects.d.ts +6 -3
  149. package/store/{alfresco-aca-shared-store.d.ts → index.d.ts} +1 -0
  150. package/store/models/modal-configuration.d.ts +3 -0
  151. package/store/public-api.d.ts +4 -0
  152. package/store/selectors/app.selectors.d.ts +6 -1
  153. package/store/states/app.state.d.ts +8 -1
  154. package/store/store.module.d.ts +5 -24
  155. package/alfresco-aca-shared.metadata.json +0 -1
  156. package/bundles/alfresco-aca-shared-rules.umd.js +0 -745
  157. package/bundles/alfresco-aca-shared-rules.umd.js.map +0 -1
  158. package/bundles/alfresco-aca-shared-rules.umd.min.js +0 -125
  159. package/bundles/alfresco-aca-shared-rules.umd.min.js.map +0 -1
  160. package/bundles/alfresco-aca-shared-store.umd.js +0 -1784
  161. package/bundles/alfresco-aca-shared-store.umd.js.map +0 -1
  162. package/bundles/alfresco-aca-shared-store.umd.min.js +0 -462
  163. package/bundles/alfresco-aca-shared-store.umd.min.js.map +0 -1
  164. package/bundles/alfresco-aca-shared.umd.js +0 -2523
  165. package/bundles/alfresco-aca-shared.umd.js.map +0 -1
  166. package/bundles/alfresco-aca-shared.umd.min.js +0 -740
  167. package/bundles/alfresco-aca-shared.umd.min.js.map +0 -1
  168. package/esm2015/lib/adf-extensions/extensions-data-loader.guard.js +0 -74
  169. package/esm2015/lib/components/info-drawer/info-drawer.component.js +0 -105
  170. package/esm2015/lib/components/locked-by/locked-by.component.js +0 -54
  171. package/esm2015/lib/components/locked-by/locked-by.module.js +0 -38
  172. package/esm2015/lib/components/page-layout/page-layout-content.component.js +0 -43
  173. package/esm2015/lib/components/page-layout/page-layout-error.component.js +0 -37
  174. package/esm2015/lib/components/page-layout/page-layout-header.component.js +0 -37
  175. package/esm2015/lib/components/page-layout/page-layout.component.js +0 -44
  176. package/esm2015/lib/components/page-layout/page-layout.module.js +0 -40
  177. package/esm2015/lib/components/tool-bar/shared-toolbar.module.js +0 -42
  178. package/esm2015/lib/components/tool-bar/toolbar-action/toolbar-action.component.js +0 -57
  179. package/esm2015/lib/components/tool-bar/toolbar-button/toolbar-button.component.js +0 -66
  180. package/esm2015/lib/components/tool-bar/toolbar-menu/toolbar-menu.component.js +0 -55
  181. package/esm2015/lib/components/tool-bar/toolbar-menu-item/toolbar-menu-item.component.js +0 -65
  182. package/esm2015/lib/directives/contextmenu/contextmenu.directive.js +0 -97
  183. package/esm2015/lib/directives/contextmenu/contextmenu.module.js +0 -38
  184. package/esm2015/lib/directives/pagination.directive.js +0 -55
  185. package/esm2015/lib/directives/shared.directives.module.js +0 -37
  186. package/esm2015/lib/routing/app.routes.strategy.js +0 -105
  187. package/esm2015/lib/routing/shared.guard.js +0 -50
  188. package/esm2015/lib/services/app.extension.service.js +0 -398
  189. package/esm2015/lib/services/app.service.js +0 -69
  190. package/esm2015/lib/services/content-api.service.js +0 -205
  191. package/esm2015/lib/services/router.extension.service.js +0 -110
  192. package/esm2015/lib/shared.module.js +0 -44
  193. package/esm2015/public-api.js +0 -57
  194. package/esm2015/rules/app.rules.js +0 -420
  195. package/esm2015/rules/navigation.rules.js +0 -164
  196. package/esm2015/rules/repository.rules.js +0 -32
  197. package/esm2015/rules/user.rules.js +0 -32
  198. package/esm2015/store/actions/app.actions.js +0 -130
  199. package/esm2015/store/actions/library.actions.js +0 -63
  200. package/esm2015/store/actions/node.actions.js +0 -161
  201. package/esm2015/store/actions/router.actions.js +0 -56
  202. package/esm2015/store/actions/search.actions.js +0 -54
  203. package/esm2015/store/actions/snackbar.actions.js +0 -61
  204. package/esm2015/store/actions/template.actions.js +0 -54
  205. package/esm2015/store/actions/upload.actions.js +0 -49
  206. package/esm2015/store/actions/viewer.actions.js +0 -75
  207. package/esm2015/store/effects/dialog.effects.js +0 -49
  208. package/esm2015/store/effects/router.effects.js +0 -132
  209. package/esm2015/store/effects/snackbar.effects.js +0 -90
  210. package/esm2015/store/public-api.js +0 -46
  211. package/esm2015/store/selectors/app.selectors.js +0 -80
  212. package/esm2015/store/store.module.js +0 -37
  213. package/fesm2015/alfresco-aca-shared-rules.js.map +0 -1
  214. package/fesm2015/alfresco-aca-shared-store.js.map +0 -1
  215. package/fesm2015/alfresco-aca-shared.js +0 -2167
  216. package/fesm2015/alfresco-aca-shared.js.map +0 -1
  217. package/rules/alfresco-aca-shared-rules.metadata.json +0 -1
  218. package/rules/package.json +0 -11
  219. package/store/alfresco-aca-shared-store.metadata.json +0 -1
  220. package/store/package.json +0 -11
@@ -1,745 +0,0 @@
1
- (function (global, factory) {
2
- typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports) :
3
- typeof define === 'function' && define.amd ? define('@alfresco/aca-shared/rules', ['exports'], factory) :
4
- (global = global || self, factory((global.alfresco = global.alfresco || {}, global.alfresco['aca-shared'] = global.alfresco['aca-shared'] || {}, global.alfresco['aca-shared'].rules = {})));
5
- }(this, (function (exports) { 'use strict';
6
-
7
- /*!
8
- * @license
9
- * Alfresco Example Content Application
10
- *
11
- * Copyright (C) 2005 - 2020 Alfresco Software Limited
12
- *
13
- * This file is part of the Alfresco Example Content Application.
14
- * If the software was purchased under a paid Alfresco license, the terms of
15
- * the paid license agreement will prevail. Otherwise, the software is
16
- * provided under the following open source license terms:
17
- *
18
- * The Alfresco Example Content Application is free software: you can redistribute it and/or modify
19
- * it under the terms of the GNU Lesser General Public License as published by
20
- * the Free Software Foundation, either version 3 of the License, or
21
- * (at your option) any later version.
22
- *
23
- * The Alfresco Example Content Application is distributed in the hope that it will be useful,
24
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
25
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
26
- * GNU Lesser General Public License for more details.
27
- *
28
- * You should have received a copy of the GNU Lesser General Public License
29
- * along with Alfresco. If not, see <http://www.gnu.org/licenses/>.
30
- */
31
- /**
32
- * Checks if a Preview route is activated.
33
- * JSON ref: `app.navigation.isPreview`
34
- */
35
- function isPreview(context) {
36
- var url = context.navigation.url;
37
- return url && (url.includes('/preview/') || url.includes('viewer:view') || url.includes('/view/'));
38
- }
39
- /**
40
- * Checks if a **Favorites** route is activated.
41
- * JSON ref: `app.navigation.isFavorites`
42
- */
43
- function isFavorites(context) {
44
- var url = context.navigation.url;
45
- return url && url.startsWith('/favorites') && !isPreview(context);
46
- }
47
- /**
48
- * Checks if the activated route is not **Favorites**.
49
- * JSON ref: `app.navigation.isNotFavorites`
50
- */
51
- function isNotFavorites(context) {
52
- return !isFavorites(context);
53
- }
54
- /**
55
- * Checks if a **Shared Files** route is activated.
56
- * JSON ref: `app.navigation.isSharedFiles`
57
- */
58
- function isSharedFiles(context) {
59
- var url = context.navigation.url;
60
- return url && url.startsWith('/shared') && !isPreview(context);
61
- }
62
- /**
63
- * Checks if the activated route is not **Shared Files**.
64
- * JSON ref: `app.navigation.isNotSharedFiles`
65
- */
66
- function isNotSharedFiles(context) {
67
- return !isSharedFiles(context);
68
- }
69
- /**
70
- * Checks if a **Trashcan** route is activated.
71
- * JSON ref: `app.navigation.isTrashcan`
72
- */
73
- function isTrashcan(context) {
74
- var url = context.navigation.url;
75
- return url && url.startsWith('/trashcan');
76
- }
77
- /**
78
- * Checks if the activated route is not **Trashcan**.
79
- * JSON ref: `app.navigation.isNotTrashcan`
80
- */
81
- function isNotTrashcan(context) {
82
- return !isTrashcan(context);
83
- }
84
- /**
85
- * Checks if a **Personal Files** route is activated.
86
- * JSON ref: `app.navigation.isPersonalFiles`
87
- */
88
- function isPersonalFiles(context) {
89
- var url = context.navigation.url;
90
- return url && url.startsWith('/personal-files');
91
- }
92
- /**
93
- * Checks if a **Library Files** route is activated.
94
- * JSON ref: `app.navigation.isLibraryFiles`
95
- */
96
- function isLibraryFiles(context) {
97
- var url = context.navigation.url;
98
- return url && url.startsWith('/libraries');
99
- }
100
- /**
101
- * Checks if a **Library Files** or **Library Search Result** route is activated.
102
- * JSON ref: `app.navigation.isLibraryFiles`
103
- */
104
- function isLibraries(context) {
105
- var url = context.navigation.url;
106
- return url && (url.endsWith('/libraries') || url.startsWith('/search-libraries'));
107
- }
108
- /**
109
- * Checks if the activated route is neither **Libraries** nor **Library Search Results**.
110
- * JSON ref: `app.navigation.isNotLibraries`
111
- */
112
- function isNotLibraries(context) {
113
- return !isLibraries(context);
114
- }
115
- /**
116
- * Checks if a **Recent Files** route is activated.
117
- * JSON ref: `app.navigation.isRecentFiles`
118
- */
119
- function isRecentFiles(context) {
120
- var url = context.navigation.url;
121
- return url && url.startsWith('/recent-files');
122
- }
123
- /**
124
- * Checks if the activated route is not **Recent Files**.
125
- * JSON ref: `app.navigation.isNotRecentFiles`
126
- */
127
- function isNotRecentFiles(context) {
128
- return !isRecentFiles(context);
129
- }
130
- /**
131
- * Checks if a **Search Results** route is activated.
132
- * JSON ref: `app.navigation.isSearchResults`
133
- */
134
- function isSearchResults(context /*,
135
- ...args: RuleParameter[]*/) {
136
- var url = context.navigation.url;
137
- return url && url.startsWith('/search');
138
- }
139
- /**
140
- * Checks if the activated route is not **Search Results**.
141
- * JSON ref: `app.navigation.isNotSearchResults`
142
- */
143
- function isNotSearchResults(context) {
144
- return !isSearchResults(context);
145
- }
146
- /**
147
- * Checks if a **Shared Preview** route is activated.
148
- * JSON ref: `app.navigation.isSharedPreview`
149
- */
150
- function isSharedPreview(context) {
151
- var url = context.navigation.url;
152
- return url && (url.startsWith('/shared/preview/') || (url.startsWith('/shared') && url.includes('viewer:view')));
153
- }
154
- /**
155
- * Checks if a **Favorites Preview** route is activated.
156
- * JSON ref: `app.navigation.isFavoritesPreview`
157
- */
158
- function isFavoritesPreview(context) {
159
- var url = context.navigation.url;
160
- return url && (url.startsWith('/favorites/preview/') || (url.startsWith('/favorites') && url.includes('viewer:view')));
161
- }
162
- /**
163
- * Checks if a **Shared File Preview** route is activated.
164
- * JSON ref: `app.navigation.isFavoritesPreview`
165
- */
166
- function isSharedFileViewer(context) {
167
- var url = context.navigation.url;
168
- return url && url.startsWith('/preview/s/');
169
- }
170
-
171
- /*!
172
- * @license
173
- * Alfresco Example Content Application
174
- *
175
- * Copyright (C) 2005 - 2020 Alfresco Software Limited
176
- *
177
- * This file is part of the Alfresco Example Content Application.
178
- * If the software was purchased under a paid Alfresco license, the terms of
179
- * the paid license agreement will prevail. Otherwise, the software is
180
- * provided under the following open source license terms:
181
- *
182
- * The Alfresco Example Content Application is free software: you can redistribute it and/or modify
183
- * it under the terms of the GNU Lesser General Public License as published by
184
- * the Free Software Foundation, either version 3 of the License, or
185
- * (at your option) any later version.
186
- *
187
- * The Alfresco Example Content Application is distributed in the hope that it will be useful,
188
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
189
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
190
- * GNU Lesser General Public License for more details.
191
- *
192
- * You should have received a copy of the GNU Lesser General Public License
193
- * along with Alfresco. If not, see <http://www.gnu.org/licenses/>.
194
- */
195
- /**
196
- * Checks if the quick share repository option is enabled or not.
197
- * JSON ref: `repository.isQuickShareEnabled`
198
- */
199
- function hasQuickShareEnabled(context) {
200
- return context.repository.status.isQuickShareEnabled;
201
- }
202
-
203
- /*!
204
- * @license
205
- * Alfresco Example Content Application
206
- *
207
- * Copyright (C) 2005 - 2020 Alfresco Software Limited
208
- *
209
- * This file is part of the Alfresco Example Content Application.
210
- * If the software was purchased under a paid Alfresco license, the terms of
211
- * the paid license agreement will prevail. Otherwise, the software is
212
- * provided under the following open source license terms:
213
- *
214
- * The Alfresco Example Content Application is free software: you can redistribute it and/or modify
215
- * it under the terms of the GNU Lesser General Public License as published by
216
- * the Free Software Foundation, either version 3 of the License, or
217
- * (at your option) any later version.
218
- *
219
- * The Alfresco Example Content Application is distributed in the hope that it will be useful,
220
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
221
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
222
- * GNU Lesser General Public License for more details.
223
- *
224
- * You should have received a copy of the GNU Lesser General Public License
225
- * along with Alfresco. If not, see <http://www.gnu.org/licenses/>.
226
- */
227
- /**
228
- * Checks if user can copy selected node.
229
- * JSON ref: `app.canCopyNode`
230
- * @param context Rule execution context
231
- */
232
- function canCopyNode(context) {
233
- return [hasSelection(context), isNotTrashcan(context), isNotLibraries(context)].every(Boolean);
234
- }
235
- /**
236
- * Checks if user can mark selected nodes as **Favorite**.
237
- * JSON ref: `app.selection.canAddFavorite`
238
- */
239
- function canAddFavorite(context) {
240
- if (!context.selection.isEmpty) {
241
- if (isFavorites(context) || isLibraries(context) || isTrashcan(context)) {
242
- return false;
243
- }
244
- return context.selection.nodes.some(function (node) { return !node.entry.isFavorite; });
245
- }
246
- return false;
247
- }
248
- /**
249
- * Checks if user can un-mark selected nodes as **Favorite**.
250
- * JSON ref: `app.selection.canRemoveFavorite`
251
- */
252
- function canRemoveFavorite(context) {
253
- if (!context.selection.isEmpty && !isTrashcan(context)) {
254
- if (isFavorites(context)) {
255
- return true;
256
- }
257
- return context.selection.nodes.every(function (node) { return node.entry.isFavorite; });
258
- }
259
- return false;
260
- }
261
- /**
262
- * Checks if user can share selected file.
263
- * JSON ref: `app.selection.file.canShare`
264
- */
265
- function canShareFile(context) {
266
- return [context.selection.file, isNotTrashcan(context), hasQuickShareEnabled(context), !isShared(context)].every(Boolean);
267
- }
268
- /**
269
- * Checks if user can perform "Join" or "Cancel Join Request" on a library.
270
- * JSON ref: `canToggleJoinLibrary`
271
- */
272
- function canToggleJoinLibrary(context) {
273
- return [hasLibrarySelected(context), !isPrivateLibrary(context), hasNoLibraryRole(context)].every(Boolean);
274
- }
275
- /**
276
- * Checks if user can edit the selected folder.
277
- * JSON ref: `canEditFolder`
278
- * @param context Rule execution context
279
- */
280
- function canEditFolder(context) {
281
- return [canUpdateSelectedFolder(context), isNotTrashcan(context)].every(Boolean);
282
- }
283
- /**
284
- * Checks if the selected file is already shared.
285
- * JSON ref: `app.selection.file.isShared`
286
- */
287
- function isShared(context) {
288
- if (isSharedFiles(context) && context.selection.file) {
289
- return true;
290
- }
291
- if ((isNotTrashcan(context), !context.selection.isEmpty && context.selection.file)) {
292
- return !!(context.selection.file.entry && context.selection.file.entry.properties && context.selection.file.entry.properties['qshare:sharedId']);
293
- }
294
- return false;
295
- }
296
- /**
297
- * Checks if user can delete selected nodes.
298
- * JSON ref: `app.selection.canDelete`
299
- */
300
- function canDeleteSelection(context) {
301
- if (isNotTrashcan(context) &&
302
- isNotLibraries(context) &&
303
- isNotSearchResults(context) &&
304
- !context.selection.isEmpty) {
305
- if (hasLockedFiles(context)) {
306
- return false;
307
- }
308
- // temp workaround for Favorites api
309
- if (isFavorites(context)) {
310
- return true;
311
- }
312
- if (isPreview(context)) {
313
- return context.permissions.check(context.selection.nodes, ['delete']);
314
- }
315
- // workaround for Shared Files
316
- if (isSharedFiles(context)) {
317
- return context.permissions.check(context.selection.nodes, ['delete'], {
318
- target: 'allowableOperationsOnTarget'
319
- });
320
- }
321
- return context.permissions.check(context.selection.nodes, ['delete']);
322
- }
323
- return false;
324
- }
325
- /**
326
- * Checks if user can un-share selected nodes.
327
- * JSON ref: `app.selection.canUnshare`
328
- */
329
- function canUnshareNodes(context) {
330
- if (!context.selection.isEmpty) {
331
- return context.permissions.check(context.selection.nodes, ['delete'], {
332
- target: 'allowableOperationsOnTarget'
333
- });
334
- }
335
- return false;
336
- }
337
- /**
338
- * Checks if user selected anything.
339
- * JSON ref: `app.selection.notEmpty`
340
- */
341
- function hasSelection(context) {
342
- return !context.selection.isEmpty;
343
- }
344
- /**
345
- * Checks if user can create a new folder with current path.
346
- * JSON ref: `app.navigation.folder.canCreate`
347
- */
348
- function canCreateFolder(context) {
349
- var currentFolder = context.navigation.currentFolder;
350
- if (currentFolder) {
351
- return context.permissions.check(currentFolder, ['create']);
352
- }
353
- return false;
354
- }
355
- /**
356
- * Checks if user can upload content to current folder.
357
- * JSON ref: `app.navigation.folder.canUpload`
358
- */
359
- function canUpload(context) {
360
- var currentFolder = context.navigation.currentFolder;
361
- if (currentFolder) {
362
- return context.permissions.check(currentFolder, ['create']);
363
- }
364
- return false;
365
- }
366
- /**
367
- * Checks if user can download selected nodes (either files or folders).
368
- * JSON ref: `app.selection.canDownload`
369
- */
370
- function canDownloadSelection(context) {
371
- if (!context.selection.isEmpty && isNotTrashcan(context)) {
372
- return context.selection.nodes.every(function (node) {
373
- return node.entry && (node.entry.isFile || node.entry.isFolder || !!node.entry.nodeId);
374
- });
375
- }
376
- return false;
377
- }
378
- /**
379
- * Checks if user has selected a folder.
380
- * JSON ref: `app.selection.folder`
381
- */
382
- function hasFolderSelected(context) {
383
- var folder = context.selection.folder;
384
- return folder ? true : false;
385
- }
386
- /**
387
- * Checks if user has selected a library (site).
388
- * JSON ref: `app.selection.library`
389
- */
390
- function hasLibrarySelected(context) {
391
- var library = context.selection.library;
392
- return library ? true : false;
393
- }
394
- /**
395
- * Checks if user has selected a **private** library (site)
396
- * JSON ref: `app.selection.isPrivateLibrary`
397
- */
398
- function isPrivateLibrary(context) {
399
- var library = context.selection.library;
400
- return library ? !!(library.entry && library.entry.visibility && library.entry.visibility === 'PRIVATE') : false;
401
- }
402
- /**
403
- * Checks if the selected library has a **role** property defined.
404
- * JSON ref: `app.selection.hasLibraryRole`
405
- */
406
- function hasLibraryRole(context) {
407
- var library = context.selection.library;
408
- return library ? !!(library.entry && library.entry.role) : false;
409
- }
410
- /**
411
- * Checks if the selected library has no **role** property defined.
412
- * JSON ref: `app.selection.hasNoLibraryRole`
413
- */
414
- function hasNoLibraryRole(context) {
415
- return !hasLibraryRole(context);
416
- }
417
- /**
418
- * Checks if user has selected a file.
419
- * JSON ref: `app.selection.file`
420
- */
421
- function hasFileSelected(context) {
422
- if (context && context.selection && context.selection.file) {
423
- return true;
424
- }
425
- return false;
426
- }
427
- /**
428
- * Checks if user can update the first selected node.
429
- * JSON ref: `app.selection.first.canUpdate`
430
- */
431
- function canUpdateSelectedNode(context) {
432
- if (context.selection && !context.selection.isEmpty) {
433
- var node = context.selection.first;
434
- if (node.entry.isFile && hasLockedFiles(context)) {
435
- return false;
436
- }
437
- return context.permissions.check(node, ['update']);
438
- }
439
- return false;
440
- }
441
- /**
442
- * Checks if user can update the first selected folder.
443
- * JSON ref: `app.selection.folder.canUpdate`
444
- */
445
- function canUpdateSelectedFolder(context) {
446
- var folder = context.selection.folder;
447
- if (folder) {
448
- return (
449
- // workaround for Favorites Api
450
- isFavorites(context) || context.permissions.check(folder.entry, ['update']));
451
- }
452
- return false;
453
- }
454
- /**
455
- * Checks if user has selected a **locked** file node.
456
- * JSON ref: `app.selection.file.isLocked`
457
- */
458
- function hasLockedFiles(context) {
459
- if (context && context.selection && context.selection.nodes) {
460
- return context.selection.nodes.some(function (node) {
461
- if (!node.entry.isFile) {
462
- return false;
463
- }
464
- return node.entry.isLocked || (node.entry.properties && node.entry.properties['cm:lockType'] === 'READ_ONLY_LOCK');
465
- });
466
- }
467
- return false;
468
- }
469
- /**
470
- * Checks if the selected file has **write** or **read-only** locks specified.
471
- * JSON ref: `app.selection.file.isLocked`
472
- */
473
- function isWriteLocked(context) {
474
- return !!(context &&
475
- context.selection &&
476
- context.selection.file &&
477
- context.selection.file.entry &&
478
- context.selection.file.entry.properties &&
479
- (context.selection.file.entry.properties['cm:lockType'] === 'WRITE_LOCK' ||
480
- context.selection.file.entry.properties['cm:lockType'] === 'READ_ONLY_LOCK'));
481
- }
482
- /**
483
- * Checks if the selected file has **write** or **read-only** locks specified,
484
- * and that current user is the owner of the lock.
485
- * JSON ref: `app.selection.file.isLockOwner`
486
- */
487
- function isUserWriteLockOwner(context) {
488
- return (isWriteLocked(context) &&
489
- context.selection.file.entry.properties['cm:lockOwner'] &&
490
- context.selection.file.entry.properties['cm:lockOwner'].id === context.profile.id);
491
- }
492
- /**
493
- * Checks if user can lock selected file.
494
- * JSON ref: `app.selection.file.canLock`
495
- */
496
- function canLockFile(context) {
497
- return !isWriteLocked(context) && canUpdateSelectedNode(context);
498
- }
499
- /**
500
- * Checks if user can unlock selected file.
501
- * JSON ref: `app.selection.file.canUnlock`
502
- */
503
- function canUnlockFile(context) {
504
- var file = context.selection.file;
505
- return isWriteLocked(context) && (context.permissions.check(file.entry, ['delete']) || isUserWriteLockOwner(context));
506
- }
507
- /**
508
- * Checks if user can upload a new version of the file.
509
- * JSON ref: `app.selection.file.canUploadVersion`
510
- */
511
- function canUploadVersion(context) {
512
- if (isFavorites(context) || isSharedFiles(context)) {
513
- return hasFileSelected(context);
514
- }
515
- return [
516
- hasFileSelected(context),
517
- isNotTrashcan(context),
518
- isWriteLocked(context) ? isUserWriteLockOwner(context) : canUpdateSelectedNode(context)
519
- ].every(Boolean);
520
- }
521
- /**
522
- * Checks if user has trashcan item selected.
523
- * JSON ref: `isTrashcanItemSelected`
524
- * @param context Rule execution context
525
- */
526
- function isTrashcanItemSelected(context) {
527
- return [isTrashcan(context), hasSelection(context)].every(Boolean);
528
- }
529
- /**
530
- * Checks if user can view the file.
531
- * JSON ref: `canViewFile`
532
- * @param context Rule execution context
533
- */
534
- function canViewFile(context) {
535
- return [hasFileSelected(context), isNotTrashcan(context)].every(Boolean);
536
- }
537
- /**
538
- * Checks if user can **Leave** selected library.
539
- * JSON ref: `canLeaveLibrary`
540
- * @param context Rule execution context
541
- */
542
- function canLeaveLibrary(context) {
543
- return [hasLibrarySelected(context), hasLibraryRole(context)].every(Boolean);
544
- }
545
- /**
546
- * Checks if user can toggle shared link mode.
547
- * JSON ref: `canToggleSharedLink`
548
- * @param context Rule execution context
549
- */
550
- function canToggleSharedLink(context) {
551
- return [hasFileSelected(context), [canShareFile(context), isShared(context)].some(Boolean)].every(Boolean);
552
- }
553
- /**
554
- * Checks if user can show **Info Drawer** for the selected node.
555
- * JSON ref: `canShowInfoDrawer`
556
- * @param context Rule execution context
557
- */
558
- function canShowInfoDrawer(context) {
559
- return [hasSelection(context), isNotLibraries(context), isNotTrashcan(context)].every(Boolean);
560
- }
561
- /**
562
- * Checks if user can manage file versions for the selected node.
563
- * JSON ref: `canManageFileVersions`
564
- * @param context Rule execution context
565
- */
566
- function canManageFileVersions(context) {
567
- return [hasFileSelected(context), isNotTrashcan(context), !hasLockedFiles(context)].every(Boolean);
568
- }
569
- /**
570
- * Checks if user can manage permissions for the selected node.
571
- * JSON ref: `canManagePermissions`
572
- * @param context Rule execution context
573
- */
574
- function canManagePermissions(context) {
575
- return [canUpdateSelectedNode(context), isNotTrashcan(context)].every(Boolean);
576
- }
577
- /**
578
- * Checks if user can toggle **Edit Offline** mode for selected node.
579
- * JSON ref: `canToggleEditOffline`
580
- * @param context Rule execution context
581
- */
582
- function canToggleEditOffline(context) {
583
- return [hasFileSelected(context), isNotTrashcan(context), canLockFile(context) || canUnlockFile(context)].every(Boolean);
584
- }
585
- /**
586
- * @deprecated Uses workarounds for for recent files and search api issues.
587
- * Checks if user can toggle **Favorite** state for a node.
588
- * @param context Rule execution context
589
- */
590
- function canToggleFavorite(context) {
591
- return [
592
- [canAddFavorite(context), canRemoveFavorite(context)].some(Boolean),
593
- [isRecentFiles(context), isSharedFiles(context), isSearchResults(context), isFavorites(context)].some(Boolean)
594
- ].every(Boolean);
595
- }
596
- /**
597
- * Checks if application should render language picker menu.
598
- * JSON ref: `canShowLanguagePicker`
599
- * @param context Rule execution context
600
- */
601
- function canShowLanguagePicker(context) {
602
- return context.languagePicker;
603
- }
604
- /**
605
- * Checks if application should render logout option.
606
- * JSON ref: `canShowLogout`
607
- * @param context Rule execution context
608
- */
609
- function canShowLogout(context) {
610
- return !context.withCredentials;
611
- }
612
- /**
613
- * Checks if user is library manager
614
- * JSON ref: `isLibraryManager`
615
- * @param context Rule execution context
616
- */
617
- function isLibraryManager(context) {
618
- return hasLibrarySelected(context) && context.selection.library.entry && context.selection.library.entry.role === 'SiteManager';
619
- }
620
-
621
- /*!
622
- * @license
623
- * Alfresco Example Content Application
624
- *
625
- * Copyright (C) 2005 - 2020 Alfresco Software Limited
626
- *
627
- * This file is part of the Alfresco Example Content Application.
628
- * If the software was purchased under a paid Alfresco license, the terms of
629
- * the paid license agreement will prevail. Otherwise, the software is
630
- * provided under the following open source license terms:
631
- *
632
- * The Alfresco Example Content Application is free software: you can redistribute it and/or modify
633
- * it under the terms of the GNU Lesser General Public License as published by
634
- * the Free Software Foundation, either version 3 of the License, or
635
- * (at your option) any later version.
636
- *
637
- * The Alfresco Example Content Application is distributed in the hope that it will be useful,
638
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
639
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
640
- * GNU Lesser General Public License for more details.
641
- *
642
- * You should have received a copy of the GNU Lesser General Public License
643
- * along with Alfresco. If not, see <http://www.gnu.org/licenses/>.
644
- */
645
- /**
646
- * Checks if user is admin.
647
- * JSON ref: `user.isAdmin`
648
- */
649
- function isAdmin(context) {
650
- return context.profile.isAdmin;
651
- }
652
-
653
- /*!
654
- * @license
655
- * Alfresco Example Content Application
656
- *
657
- * Copyright (C) 2005 - 2020 Alfresco Software Limited
658
- *
659
- * This file is part of the Alfresco Example Content Application.
660
- * If the software was purchased under a paid Alfresco license, the terms of
661
- * the paid license agreement will prevail. Otherwise, the software is
662
- * provided under the following open source license terms:
663
- *
664
- * The Alfresco Example Content Application is free software: you can redistribute it and/or modify
665
- * it under the terms of the GNU Lesser General Public License as published by
666
- * the Free Software Foundation, either version 3 of the License, or
667
- * (at your option) any later version.
668
- *
669
- * The Alfresco Example Content Application is distributed in the hope that it will be useful,
670
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
671
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
672
- * GNU Lesser General Public License for more details.
673
- *
674
- * You should have received a copy of the GNU Lesser General Public License
675
- * along with Alfresco. If not, see <http://www.gnu.org/licenses/>.
676
- */
677
-
678
- /**
679
- * Generated bundle index. Do not edit.
680
- */
681
-
682
- exports.canAddFavorite = canAddFavorite;
683
- exports.canCopyNode = canCopyNode;
684
- exports.canCreateFolder = canCreateFolder;
685
- exports.canDeleteSelection = canDeleteSelection;
686
- exports.canDownloadSelection = canDownloadSelection;
687
- exports.canEditFolder = canEditFolder;
688
- exports.canLeaveLibrary = canLeaveLibrary;
689
- exports.canLockFile = canLockFile;
690
- exports.canManageFileVersions = canManageFileVersions;
691
- exports.canManagePermissions = canManagePermissions;
692
- exports.canRemoveFavorite = canRemoveFavorite;
693
- exports.canShareFile = canShareFile;
694
- exports.canShowInfoDrawer = canShowInfoDrawer;
695
- exports.canShowLanguagePicker = canShowLanguagePicker;
696
- exports.canShowLogout = canShowLogout;
697
- exports.canToggleEditOffline = canToggleEditOffline;
698
- exports.canToggleFavorite = canToggleFavorite;
699
- exports.canToggleJoinLibrary = canToggleJoinLibrary;
700
- exports.canToggleSharedLink = canToggleSharedLink;
701
- exports.canUnlockFile = canUnlockFile;
702
- exports.canUnshareNodes = canUnshareNodes;
703
- exports.canUpdateSelectedFolder = canUpdateSelectedFolder;
704
- exports.canUpdateSelectedNode = canUpdateSelectedNode;
705
- exports.canUpload = canUpload;
706
- exports.canUploadVersion = canUploadVersion;
707
- exports.canViewFile = canViewFile;
708
- exports.hasFileSelected = hasFileSelected;
709
- exports.hasFolderSelected = hasFolderSelected;
710
- exports.hasLibraryRole = hasLibraryRole;
711
- exports.hasLibrarySelected = hasLibrarySelected;
712
- exports.hasLockedFiles = hasLockedFiles;
713
- exports.hasNoLibraryRole = hasNoLibraryRole;
714
- exports.hasQuickShareEnabled = hasQuickShareEnabled;
715
- exports.hasSelection = hasSelection;
716
- exports.isAdmin = isAdmin;
717
- exports.isFavorites = isFavorites;
718
- exports.isFavoritesPreview = isFavoritesPreview;
719
- exports.isLibraries = isLibraries;
720
- exports.isLibraryFiles = isLibraryFiles;
721
- exports.isLibraryManager = isLibraryManager;
722
- exports.isNotFavorites = isNotFavorites;
723
- exports.isNotLibraries = isNotLibraries;
724
- exports.isNotRecentFiles = isNotRecentFiles;
725
- exports.isNotSearchResults = isNotSearchResults;
726
- exports.isNotSharedFiles = isNotSharedFiles;
727
- exports.isNotTrashcan = isNotTrashcan;
728
- exports.isPersonalFiles = isPersonalFiles;
729
- exports.isPreview = isPreview;
730
- exports.isPrivateLibrary = isPrivateLibrary;
731
- exports.isRecentFiles = isRecentFiles;
732
- exports.isSearchResults = isSearchResults;
733
- exports.isShared = isShared;
734
- exports.isSharedFileViewer = isSharedFileViewer;
735
- exports.isSharedFiles = isSharedFiles;
736
- exports.isSharedPreview = isSharedPreview;
737
- exports.isTrashcan = isTrashcan;
738
- exports.isTrashcanItemSelected = isTrashcanItemSelected;
739
- exports.isUserWriteLockOwner = isUserWriteLockOwner;
740
- exports.isWriteLocked = isWriteLocked;
741
-
742
- Object.defineProperty(exports, '__esModule', { value: true });
743
-
744
- })));
745
- //# sourceMappingURL=alfresco-aca-shared-rules.umd.js.map