@alfresco/aca-shared 4.1.0 → 4.2.0-5542991658

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.
@@ -291,7 +291,10 @@ function getFileExtension(fileName) {
291
291
  * Checks if the content plugin is enabled.
292
292
  * JSON ref: `app.isContentServiceEnabled`
293
293
  */
294
- const isContentServiceEnabled = () => localStorage && localStorage.getItem('contentService') !== 'false';
294
+ const isContentServiceEnabled = (context) => {
295
+ const flag = context.appConfig.get('plugins.contentService');
296
+ return flag === true || flag === 'true';
297
+ };
295
298
  /**
296
299
  * Checks if Search is supported for active view
297
300
  * JSON ref: `app.isSearchSupported`
@@ -301,9 +304,9 @@ const isSearchSupported = (context) => [isNotSearchResults(context) /* , !hasSel
301
304
  * Checks if upload action is supported for the given context
302
305
  * JSON ref: `app.isUploadSupported`
303
306
  *
304
- * @param content Rule execution context
307
+ * @param context Rule execution context
305
308
  */
306
- const isUploadSupported = (context) => [isContentServiceEnabled(), isPersonalFiles(context) || isLibraryContent(context), canUpload(context)].every(Boolean);
309
+ const isUploadSupported = (context) => [isContentServiceEnabled(context), isPersonalFiles(context) || isLibraryContent(context), canUpload(context)].every(Boolean);
307
310
  /**
308
311
  * Checks if user can copy selected node.
309
312
  * JSON ref: `app.canCopyNode`
@@ -419,7 +422,7 @@ const hasSelection = (context) => !context.selection.isEmpty;
419
422
  * JSON ref: `app.navigation.folder.canCreate`
420
423
  */
421
424
  function canCreateFolder(context) {
422
- if (isContentServiceEnabled() && (isPersonalFiles(context) || isLibraryContent(context))) {
425
+ if (isContentServiceEnabled(context) && (isPersonalFiles(context) || isLibraryContent(context))) {
423
426
  const { currentFolder } = context.navigation;
424
427
  if (currentFolder) {
425
428
  return context.permissions.check(currentFolder, ['create']);
@@ -433,13 +436,13 @@ function canCreateFolder(context) {
433
436
  *
434
437
  * @param context Rule execution context
435
438
  */
436
- const canCreateLibrary = (context) => [isContentServiceEnabled(), isLibraries(context)].every(Boolean);
439
+ const canCreateLibrary = (context) => [isContentServiceEnabled(context), isLibraries(context)].every(Boolean);
437
440
  /**
438
441
  * Checks if user can upload content to current folder.
439
442
  * JSON ref: `app.navigation.folder.canUpload`
440
443
  */
441
444
  function canUpload(context) {
442
- if (isContentServiceEnabled() && (isPersonalFiles(context) || isLibraryContent(context))) {
445
+ if (isContentServiceEnabled(context) && (isPersonalFiles(context) || isLibraryContent(context))) {
443
446
  const { currentFolder } = context.navigation;
444
447
  if (currentFolder) {
445
448
  return context.permissions.check(currentFolder, ['create']);
@@ -704,6 +707,10 @@ const showInfoSelectionButton = (context) => isSearchResults(context) && !isPrev
704
707
  * @param context Rule execution context
705
708
  */
706
709
  function canOpenWithOffice(context) {
710
+ const flag = `${context.appConfig.get('plugins.aosPlugin', false)}`;
711
+ if (flag !== 'true') {
712
+ return false;
713
+ }
707
714
  if (context.navigation && context.navigation.url && context.navigation.url.startsWith('/trashcan')) {
708
715
  return false;
709
716
  }
@@ -1 +1 @@
1
- {"version":3,"file":"alfresco-aca-shared-rules.mjs","sources":["../../../../projects/aca-shared/rules/src/navigation.rules.ts","../../../../projects/aca-shared/rules/src/repository.rules.ts","../../../../projects/aca-shared/rules/src/user.rules.ts","../../../../projects/aca-shared/rules/src/app.rules.ts","../../../../projects/aca-shared/rules/src/public-api.ts","../../../../projects/aca-shared/rules/src/alfresco-aca-shared-rules.ts"],"sourcesContent":["/*!\n * Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved.\n *\n * Alfresco Example Content Application\n *\n * This file is part of the Alfresco Example Content Application.\n * If the software was purchased under a paid Alfresco license, the terms of\n * the paid license agreement will prevail. Otherwise, the software is\n * provided under the following open source license terms:\n *\n * The Alfresco Example Content Application is free software: you can redistribute it and/or modify\n * it under the terms of the GNU Lesser General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * The Alfresco Example Content Application is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU Lesser General Public License for more details.\n *\n * You should have received a copy of the GNU Lesser General Public License\n * from Hyland Software. If not, see <http://www.gnu.org/licenses/>.\n */\n\nimport { RuleContext } from '@alfresco/adf-extensions';\n\n/**\n * Checks if a Preview route is activated.\n * JSON ref: `app.navigation.isPreview`\n */\nexport function isPreview(context: RuleContext): boolean {\n const { url } = context.navigation;\n return url && (url.includes('/preview/') || url.includes('viewer:view') || url.includes('/view/'));\n}\n\n/**\n * Checks if a **Favorites** route is activated.\n * JSON ref: `app.navigation.isFavorites`\n */\nexport function isFavorites(context: RuleContext): boolean {\n const { url } = context.navigation;\n return url && url.startsWith('/favorites') && !isPreview(context);\n}\n\n/**\n * Checks if the activated route is not **Favorites**.\n * JSON ref: `app.navigation.isNotFavorites`\n */\nexport const isNotFavorites = (context: RuleContext): boolean => !isFavorites(context);\n\n/**\n * Checks if a **Shared Files** route is activated.\n * JSON ref: `app.navigation.isSharedFiles`\n */\nexport function isSharedFiles(context: RuleContext): boolean {\n const { url } = context.navigation;\n return url && url.startsWith('/shared') && !isPreview(context);\n}\n\n/**\n * Checks if the activated route is not **Shared Files**.\n * JSON ref: `app.navigation.isNotSharedFiles`\n */\nexport const isNotSharedFiles = (context: RuleContext): boolean => !isSharedFiles(context);\n\n/**\n * Checks if a **Trashcan** route is activated.\n * JSON ref: `app.navigation.isTrashcan`\n */\nexport function isTrashcan(context: RuleContext): boolean {\n const { url } = context.navigation;\n return url && url.startsWith('/trashcan');\n}\n\n/**\n * Checks if the activated route is not **Trashcan**.\n * JSON ref: `app.navigation.isNotTrashcan`\n */\nexport const isNotTrashcan = (context: RuleContext): boolean => !isTrashcan(context);\n\n/**\n * Checks if a **Personal Files** route is activated.\n * JSON ref: `app.navigation.isPersonalFiles`\n */\nexport function isPersonalFiles(context: RuleContext): boolean {\n const { url } = context.navigation;\n return url && url.startsWith('/personal-files');\n}\n\n/**\n * Checks if a **Library Files** route is activated.\n * JSON ref: `app.navigation.isLibraryFiles`\n */\nexport function isLibraryFiles(context: RuleContext): boolean {\n const { url } = context.navigation;\n return url && url.startsWith('/libraries');\n}\n\n/**\n * Checks if a **Library Files** or **Library Search Result** route is activated.\n * JSON ref: `app.navigation.isLibraryFiles`\n */\nexport function isLibraries(context: RuleContext): boolean {\n const { url } = context.navigation;\n return url && (url.endsWith('/libraries') || url.startsWith('/search-libraries'));\n}\n\nexport function isLibraryContent(context: RuleContext): boolean {\n const { url } = context.navigation;\n return url && (url.endsWith('/libraries') || url.includes('/libraries/') || url.startsWith('/search-libraries'));\n}\n\n/**\n * Checks if the activated route is neither **Libraries** nor **Library Search Results**.\n * JSON ref: `app.navigation.isNotLibraries`\n */\nexport const isNotLibraries = (context: RuleContext): boolean => !isLibraries(context);\n\n/**\n * Checks if a **Recent Files** route is activated.\n * JSON ref: `app.navigation.isRecentFiles`\n */\nexport function isRecentFiles(context: RuleContext): boolean {\n const { url } = context.navigation;\n return url && url.startsWith('/recent-files');\n}\n\n/**\n * Checks if the activated route is not **Recent Files**.\n * JSON ref: `app.navigation.isNotRecentFiles`\n */\nexport const isNotRecentFiles = (context: RuleContext): boolean => !isRecentFiles(context);\n\n/**\n * Checks if a **Search Results** route is activated.\n * JSON ref: `app.navigation.isSearchResults`\n */\nexport function isSearchResults(\n context: RuleContext\n // ...args: RuleParameter[]\n): boolean {\n const { url } = context.navigation;\n return url && url.startsWith('/search');\n}\n\n/**\n * Checks if the activated route is not **Search Results**.\n * JSON ref: `app.navigation.isNotSearchResults`\n */\nexport const isNotSearchResults = (context: RuleContext): boolean => !isSearchResults(context);\n\n/**\n * Checks if a **Shared Preview** route is activated.\n * JSON ref: `app.navigation.isSharedPreview`\n */\nexport function isSharedPreview(context: RuleContext): boolean {\n const { url } = context.navigation;\n return url && (url.startsWith('/shared/preview/') || (url.startsWith('/shared') && url.includes('viewer:view')));\n}\n\n/**\n * Checks if a **Favorites Preview** route is activated.\n * JSON ref: `app.navigation.isFavoritesPreview`\n */\nexport function isFavoritesPreview(context: RuleContext): boolean {\n const { url } = context.navigation;\n return url && (url.startsWith('/favorites/preview/') || (url.startsWith('/favorites') && url.includes('viewer:view')));\n}\n\n/**\n * Checks if a **Shared File Preview** route is activated.\n * JSON ref: `app.navigation.isFavoritesPreview`\n */\nexport function isSharedFileViewer(context: RuleContext): boolean {\n const { url } = context.navigation;\n return url && url.startsWith('/preview/s/');\n}\n","/*!\n * Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved.\n *\n * Alfresco Example Content Application\n *\n * This file is part of the Alfresco Example Content Application.\n * If the software was purchased under a paid Alfresco license, the terms of\n * the paid license agreement will prevail. Otherwise, the software is\n * provided under the following open source license terms:\n *\n * The Alfresco Example Content Application is free software: you can redistribute it and/or modify\n * it under the terms of the GNU Lesser General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * The Alfresco Example Content Application is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU Lesser General Public License for more details.\n *\n * You should have received a copy of the GNU Lesser General Public License\n * from Hyland Software. If not, see <http://www.gnu.org/licenses/>.\n */\n\nimport { RuleContext } from '@alfresco/adf-extensions';\n\n/**\n * Checks if the quick share repository option is enabled or not.\n * JSON ref: `repository.isQuickShareEnabled`\n */\nexport const hasQuickShareEnabled = (context: RuleContext): boolean => context.repository.status.isQuickShareEnabled;\n\nexport function isMajorVersionAvailable(context: RuleContext, versionNumber: string): boolean {\n const majorVersion = context.repository.version?.major ? parseInt(context.repository.version.major, 10) : 0;\n return majorVersion >= parseInt(versionNumber, 10);\n}\n","/*!\n * Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved.\n *\n * Alfresco Example Content Application\n *\n * This file is part of the Alfresco Example Content Application.\n * If the software was purchased under a paid Alfresco license, the terms of\n * the paid license agreement will prevail. Otherwise, the software is\n * provided under the following open source license terms:\n *\n * The Alfresco Example Content Application is free software: you can redistribute it and/or modify\n * it under the terms of the GNU Lesser General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * The Alfresco Example Content Application is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU Lesser General Public License for more details.\n *\n * You should have received a copy of the GNU Lesser General Public License\n * from Hyland Software. If not, see <http://www.gnu.org/licenses/>.\n */\n\nimport { RuleContext } from '@alfresco/adf-extensions';\n\n/**\n * Checks if user is admin.\n * JSON ref: `user.isAdmin`\n */\nexport const isAdmin = (context: RuleContext): boolean => context.profile.isAdmin;\n","/*!\n * Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved.\n *\n * Alfresco Example Content Application\n *\n * This file is part of the Alfresco Example Content Application.\n * If the software was purchased under a paid Alfresco license, the terms of\n * the paid license agreement will prevail. Otherwise, the software is\n * provided under the following open source license terms:\n *\n * The Alfresco Example Content Application is free software: you can redistribute it and/or modify\n * it under the terms of the GNU Lesser General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * The Alfresco Example Content Application is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU Lesser General Public License for more details.\n *\n * You should have received a copy of the GNU Lesser General Public License\n * from Hyland Software. If not, see <http://www.gnu.org/licenses/>.\n */\n\nimport { AppConfigService } from '@alfresco/adf-core';\nimport { RuleContext } from '@alfresco/adf-extensions';\nimport * as navigation from './navigation.rules';\nimport * as repository from './repository.rules';\nimport { isAdmin } from './user.rules';\n\n/* cspell:disable */\nexport const supportedExtensions = {\n doc: 'ms-word',\n docx: 'ms-word',\n docm: 'ms-word',\n dot: 'ms-word',\n dotx: 'ms-word',\n dotm: 'ms-word',\n rtf: 'ms-word',\n xls: 'ms-excel',\n xlsx: 'ms-excel',\n xlsb: 'ms-excel',\n xlsm: 'ms-excel',\n xlt: 'ms-excel',\n xltx: 'ms-excel',\n xltm: 'ms-excel',\n xlam: 'ms-excel',\n ppt: 'ms-powerpoint',\n pptx: 'ms-powerpoint',\n pot: 'ms-powerpoint',\n potx: 'ms-powerpoint',\n potm: 'ms-powerpoint',\n pptm: 'ms-powerpoint',\n pps: 'ms-powerpoint',\n ppsx: 'ms-powerpoint',\n ppam: 'ms-powerpoint',\n ppsm: 'ms-powerpoint',\n sldx: 'ms-powerpoint',\n sldm: 'ms-powerpoint',\n vsd: 'ms-visio',\n vss: 'ms-visio',\n vst: 'ms-visio',\n vsdx: 'ms-visio',\n vsdm: 'ms-visio',\n vssx: 'ms-visio',\n vssm: 'ms-visio',\n vstx: 'ms-visio',\n vstm: 'ms-visio'\n};\n/* cspell:enable */\n\nexport function getFileExtension(fileName: string): string | null {\n if (fileName) {\n const match = fileName.match(/\\.([^\\./\\?\\#]+)($|\\?|\\#)/);\n\n return match ? match[1] : null;\n }\n\n return null;\n}\n\nexport interface AcaRuleContext extends RuleContext {\n withCredentials: boolean;\n appConfig: AppConfigService;\n}\n\n/**\n * Checks if the content plugin is enabled.\n * JSON ref: `app.isContentServiceEnabled`\n */\nexport const isContentServiceEnabled = (): boolean => localStorage && localStorage.getItem('contentService') !== 'false';\n\n/**\n * Checks if Search is supported for active view\n * JSON ref: `app.isSearchSupported`\n */\nexport const isSearchSupported = (context: RuleContext): boolean =>\n [navigation.isNotSearchResults(context) /* , !hasSelection(context)*/].every(Boolean);\n\n/**\n * Checks if upload action is supported for the given context\n * JSON ref: `app.isUploadSupported`\n *\n * @param content Rule execution context\n */\nexport const isUploadSupported = (context: RuleContext): boolean =>\n [isContentServiceEnabled(), navigation.isPersonalFiles(context) || navigation.isLibraryContent(context), canUpload(context)].every(Boolean);\n/**\n * Checks if user can copy selected node.\n * JSON ref: `app.canCopyNode`\n *\n * @param context Rule execution context\n */\nexport const canCopyNode = (context: RuleContext): boolean =>\n [hasSelection(context), navigation.isNotTrashcan(context), navigation.isNotLibraries(context)].every(Boolean);\n\n/**\n * Checks if user can mark selected nodes as **Favorite**.\n * JSON ref: `app.selection.canAddFavorite`\n */\nexport function canAddFavorite(context: RuleContext): boolean {\n if (!context.selection.isEmpty) {\n if (navigation.isFavorites(context) || navigation.isLibraries(context) || navigation.isTrashcan(context)) {\n return false;\n }\n return context.selection.nodes.some((node) => !node.entry.isFavorite);\n }\n return false;\n}\n\n/**\n * Checks if user can un-mark selected nodes as **Favorite**.\n * JSON ref: `app.selection.canRemoveFavorite`\n */\nexport function canRemoveFavorite(context: RuleContext): boolean {\n if (!context.selection.isEmpty && !navigation.isTrashcan(context)) {\n if (navigation.isFavorites(context)) {\n return true;\n }\n return context.selection.nodes.every((node) => node.entry.isFavorite);\n }\n return false;\n}\n\n/**\n * Checks if user can share selected file.\n * JSON ref: `app.selection.file.canShare`\n */\nexport const canShareFile = (context: RuleContext): boolean =>\n [context.selection.file, navigation.isNotTrashcan(context), repository.hasQuickShareEnabled(context), !isShared(context)].every(Boolean);\n\n/**\n * Checks if user can perform \"Join\" or \"Cancel Join Request\" on a library.\n * JSON ref: `canToggleJoinLibrary`\n */\nexport const canToggleJoinLibrary = (context: RuleContext): boolean =>\n [hasLibrarySelected(context), !isPrivateLibrary(context), hasNoLibraryRole(context)].every(Boolean) ||\n [hasLibrarySelected(context), isPrivateLibrary(context), hasNoLibraryRole(context), isAdmin(context)].every(Boolean);\n\n/**\n * Checks if user can edit the selected folder.\n * JSON ref: `canEditFolder`\n *\n * @param context Rule execution context\n */\nexport const canEditFolder = (context: RuleContext): boolean => [canUpdateSelectedFolder(context), navigation.isNotTrashcan(context)].every(Boolean);\n\n/**\n * Checks if the selected file is already shared.\n * JSON ref: `app.selection.file.isShared`\n */\nexport function isShared(context: RuleContext): boolean {\n if (navigation.isSharedFiles(context) && context.selection.file) {\n return true;\n }\n\n if (navigation.isNotTrashcan(context) && !context.selection.isEmpty && context.selection.file) {\n return !!(context.selection.file.entry && context.selection.file.entry.properties && context.selection.file.entry.properties['qshare:sharedId']);\n }\n\n return false;\n}\n\n/**\n * Checks if user can delete selected nodes.\n * JSON ref: `app.selection.canDelete`\n */\nexport function canDeleteSelection(context: RuleContext): boolean {\n if (\n navigation.isNotTrashcan(context) &&\n navigation.isNotLibraries(context) &&\n navigation.isNotSearchResults(context) &&\n !context.selection.isEmpty\n ) {\n if (hasLockedFiles(context)) {\n return false;\n }\n\n // temp workaround for Favorites api\n if (navigation.isFavorites(context)) {\n return true;\n }\n\n if (navigation.isPreview(context)) {\n return context.permissions.check(context.selection.nodes, ['delete']);\n }\n\n // workaround for Shared Files\n if (navigation.isSharedFiles(context)) {\n return context.permissions.check(context.selection.nodes, ['delete'], {\n target: 'allowableOperationsOnTarget'\n });\n }\n\n return context.permissions.check(context.selection.nodes, ['delete']);\n }\n return false;\n}\n\n/**\n * Checks if user can un-share selected nodes.\n * JSON ref: `app.selection.canUnshare`\n */\nexport function canUnshareNodes(context: RuleContext): boolean {\n if (!context.selection.isEmpty) {\n return context.permissions.check(context.selection.nodes, ['delete'], {\n target: 'allowableOperationsOnTarget'\n });\n }\n return false;\n}\n\n/**\n * Checks if user selected anything.\n * JSON ref: `app.selection.notEmpty`\n */\nexport const hasSelection = (context: RuleContext): boolean => !context.selection.isEmpty;\n\n/**\n * Checks if user can create a new folder with current path.\n * JSON ref: `app.navigation.folder.canCreate`\n */\nexport function canCreateFolder(context: RuleContext): boolean {\n if (isContentServiceEnabled() && (navigation.isPersonalFiles(context) || navigation.isLibraryContent(context))) {\n const { currentFolder } = context.navigation;\n\n if (currentFolder) {\n return context.permissions.check(currentFolder, ['create']);\n }\n }\n return false;\n}\n\n/**\n * Checks if user can create a Library\n * JSON ref: `app.canCreateLibrary`\n *\n * @param context Rule execution context\n */\nexport const canCreateLibrary = (context: RuleContext): boolean => [isContentServiceEnabled(), navigation.isLibraries(context)].every(Boolean);\n\n/**\n * Checks if user can upload content to current folder.\n * JSON ref: `app.navigation.folder.canUpload`\n */\nexport function canUpload(context: RuleContext): boolean {\n if (isContentServiceEnabled() && (navigation.isPersonalFiles(context) || navigation.isLibraryContent(context))) {\n const { currentFolder } = context.navigation;\n\n if (currentFolder) {\n return context.permissions.check(currentFolder, ['create']);\n }\n }\n return false;\n}\n\n/**\n * Checks if user can download selected nodes (either files or folders).\n * JSON ref: `app.selection.canDownload`\n */\nexport function canDownloadSelection(context: RuleContext): boolean {\n if (!context.selection.isEmpty && navigation.isNotTrashcan(context)) {\n return context.selection.nodes.every((node: any) => node.entry && (node.entry.isFile || node.entry.isFolder || !!node.entry.nodeId));\n }\n return false;\n}\n\n/**\n * Checks if user has selected a folder.\n * JSON ref: `app.selection.folder`\n */\nexport const hasFolderSelected = (context: RuleContext): boolean => !!context.selection.folder;\n\n/**\n * Checks if user has selected a library (site).\n * JSON ref: `app.selection.library`\n */\nexport const hasLibrarySelected = (context: RuleContext): boolean => !!context.selection.library;\n\n/**\n * Checks if user has selected a **private** library (site)\n * JSON ref: `app.selection.isPrivateLibrary`\n */\nexport function isPrivateLibrary(context: RuleContext): boolean {\n const library = context.selection.library;\n return library ? !!(library.entry && library.entry.visibility && library.entry.visibility === 'PRIVATE') : false;\n}\n\n/**\n * Checks if the selected library has a **role** property defined.\n * JSON ref: `app.selection.hasLibraryRole`\n */\nexport function hasLibraryRole(context: RuleContext): boolean {\n const library = context.selection.library;\n return library ? !!(library.entry && library.entry.role) : false;\n}\n\n/**\n * Checks if the selected library has no **role** property defined.\n * JSON ref: `app.selection.hasNoLibraryRole`\n */\nexport const hasNoLibraryRole = (context: RuleContext): boolean => !hasLibraryRole(context);\n\n/**\n * Checks if user has selected a file.\n * JSON ref: `app.selection.file`\n */\nexport const hasFileSelected = (context: RuleContext): boolean => !!(context && context.selection && context.selection.file);\n\n/**\n * Checks if user can update the first selected node.\n * JSON ref: `app.selection.first.canUpdate`\n */\nexport function canUpdateSelectedNode(context: RuleContext): boolean {\n if (context.selection && !context.selection.isEmpty) {\n const node = context.selection.first;\n\n if (node?.entry.isFile && hasLockedFiles(context)) {\n return false;\n }\n\n return context.permissions.check(node, ['update']);\n }\n return false;\n}\n\nexport function isMultiselection(context: RuleContext): boolean {\n let isMultiNodeSelected = false;\n if (context.selection && !context.selection.isEmpty) {\n isMultiNodeSelected = context.selection.count > 1;\n }\n return isMultiNodeSelected;\n}\n\n/**\n * Checks if user can update the first selected folder.\n * JSON ref: `app.selection.folder.canUpdate`\n */\nexport function canUpdateSelectedFolder(context: RuleContext): boolean {\n const { folder } = context.selection;\n if (folder) {\n return (\n // workaround for Favorites Api\n navigation.isFavorites(context) || context.permissions.check(folder.entry, ['update'])\n );\n }\n return false;\n}\n\n/**\n * Checks if user has selected a **locked** file node.\n * JSON ref: `app.selection.file.isLocked`\n */\nexport function hasLockedFiles(context: RuleContext): boolean {\n if (context && context.selection && context.selection.nodes) {\n return context.selection.nodes.some((node) => {\n if (!node.entry.isFile) {\n return false;\n }\n\n return node.entry.isLocked || (node.entry.properties && node.entry.properties['cm:lockType'] === 'READ_ONLY_LOCK');\n });\n }\n\n return false;\n}\n\n/**\n * Checks if the selected file has **write** or **read-only** locks specified.\n * JSON ref: `app.selection.file.isLocked`\n */\nexport const isWriteLocked = (context: RuleContext): boolean =>\n !!(\n context &&\n context.selection &&\n context.selection.file &&\n context.selection.file.entry &&\n context.selection.file.entry.properties &&\n (context.selection.file.entry.properties['cm:lockType'] === 'WRITE_LOCK' ||\n context.selection.file.entry.properties['cm:lockType'] === 'READ_ONLY_LOCK')\n );\n\n/**\n * Checks if the selected file has **write** or **read-only** locks specified,\n * and that current user is the owner of the lock.\n * JSON ref: `app.selection.file.isLockOwner`\n */\nexport const isUserWriteLockOwner = (context: RuleContext): boolean =>\n isWriteLocked(context) &&\n context.selection.file?.entry.properties['cm:lockOwner'] &&\n context.selection.file?.entry.properties['cm:lockOwner'].id === context.profile.id;\n\n/**\n * Checks if user can lock selected file.\n * JSON ref: `app.selection.file.canLock`\n */\nexport const canLockFile = (context: RuleContext): boolean => !isWriteLocked(context) && canUpdateSelectedNode(context);\n\n/**\n * Checks if user can unlock selected file.\n * JSON ref: `app.selection.file.canUnlock`\n */\nexport function canUnlockFile(context: RuleContext): boolean {\n const { file } = context.selection;\n return isWriteLocked(context) && (context.permissions.check(file?.entry, ['delete']) || isUserWriteLockOwner(context));\n}\n\n/**\n * Checks if user can upload a new version of the file.\n * JSON ref: `app.selection.file.canUploadVersion`\n */\nexport function canUploadVersion(context: RuleContext): boolean {\n if (navigation.isFavorites(context) || navigation.isSharedFiles(context)) {\n return hasFileSelected(context);\n }\n\n return [\n hasFileSelected(context),\n navigation.isNotTrashcan(context),\n isWriteLocked(context) ? isUserWriteLockOwner(context) : canUpdateSelectedNode(context)\n ].every(Boolean);\n}\n\n/**\n * Checks if user has trashcan item selected.\n * JSON ref: `isTrashcanItemSelected`\n *\n * @param context Rule execution context\n */\nexport const isTrashcanItemSelected = (context: RuleContext): boolean => [navigation.isTrashcan(context), hasSelection(context)].every(Boolean);\n\n/**\n * Checks if user can view the file.\n * JSON ref: `canViewFile`\n *\n * @param context Rule execution context\n */\nexport const canViewFile = (context: RuleContext): boolean => [hasFileSelected(context), navigation.isNotTrashcan(context)].every(Boolean);\n\n/**\n * Checks if user can **Leave** selected library.\n * JSON ref: `canLeaveLibrary`\n *\n * @param context Rule execution context\n */\nexport const canLeaveLibrary = (context: RuleContext): boolean => [hasLibrarySelected(context), hasLibraryRole(context)].every(Boolean);\n\n/**\n * Checks if user can toggle shared link mode.\n * JSON ref: `canToggleSharedLink`\n *\n * @param context Rule execution context\n */\nexport const canToggleSharedLink = (context: RuleContext): boolean =>\n [hasFileSelected(context), [canShareFile(context), isShared(context)].some(Boolean)].every(Boolean);\n\n/**\n * Checks if user can show **Info Drawer** for the selected node.\n * JSON ref: `canShowInfoDrawer`\n *\n * @param context Rule execution context\n */\nexport const canShowInfoDrawer = (context: RuleContext): boolean =>\n [hasSelection(context), navigation.isNotLibraries(context), navigation.isNotTrashcan(context)].every(Boolean);\n\n/**\n * Checks if user can manage file versions for the selected node.\n * JSON ref: `canManageFileVersions`\n *\n * @param context Rule execution context\n */\nexport const canManageFileVersions = (context: RuleContext): boolean =>\n [hasFileSelected(context), navigation.isNotTrashcan(context), !hasLockedFiles(context)].every(Boolean);\n\n/**\n * Checks if user can edit aspects for the selected node.\n * JSON ref: `canEditAspects`\n *\n * @param context Rule execution context\n */\nexport const canEditAspects = (context: RuleContext): boolean =>\n [\n !isMultiselection(context),\n canUpdateSelectedNode(context),\n !isWriteLocked(context),\n navigation.isNotTrashcan(context),\n repository.isMajorVersionAvailable(context, '7')\n ].every(Boolean);\n\n/**\n * Checks if user can manage permissions for the selected node.\n * JSON ref: `canManagePermissions`\n *\n * @param context Rule execution context\n */\nexport const canManagePermissions = (context: RuleContext): boolean =>\n [canUpdateSelectedNode(context), navigation.isNotTrashcan(context)].every(Boolean);\n\n/**\n * Checks if user can toggle **Edit Offline** mode for selected node.\n * JSON ref: `canToggleEditOffline`\n *\n * @param context Rule execution context\n */\nexport const canToggleEditOffline = (context: RuleContext): boolean =>\n [hasFileSelected(context), navigation.isNotTrashcan(context), canLockFile(context) || canUnlockFile(context)].every(Boolean);\n\n/**\n * @deprecated Uses workarounds for for recent files and search api issues.\n * Checks if user can toggle **Favorite** state for a node.\n * @param context Rule execution context\n */\nexport const canToggleFavorite = (context: RuleContext): boolean =>\n [\n [canAddFavorite(context), canRemoveFavorite(context)].some(Boolean),\n [navigation.isRecentFiles(context), navigation.isSharedFiles(context), navigation.isSearchResults(context), navigation.isFavorites(context)].some(\n Boolean\n )\n ].every(Boolean);\n\n/**\n * Checks if application should render logout option.\n * JSON ref: `canShowLogout`\n *\n * @param context Rule execution context\n */\nexport const canShowLogout = (context: AcaRuleContext): boolean => !context.withCredentials;\n\n/**\n * Checks if user is library manager\n * JSON ref: `isLibraryManager`\n *\n * @param context Rule execution context\n */\nexport const isLibraryManager = (context: RuleContext): boolean =>\n hasLibrarySelected(context) && context.selection.library?.entry.role === 'SiteManager';\n\n/**\n * Checks if the preview button for search results can be showed\n * JSON ref: `canInfoPreview`\n *\n * @param context Rule execution context\n */\nexport const canInfoPreview = (context: RuleContext): boolean => {\n const isSearchResult = navigation.isSearchResults(context);\n const isNotMultiselect = !isMultiselection(context);\n const isFileSelected = !hasFolderSelected(context);\n const isPreview = !navigation.isPreview(context);\n\n return isSearchResult && isNotMultiselect && isFileSelected && isPreview;\n};\n\nexport const showInfoSelectionButton = (context: RuleContext): boolean => navigation.isSearchResults(context) && !navigation.isPreview(context);\n\n/**\n * Checks if the file can be opened with MS Office\n * JSON ref: `aos.canOpenWithOffice`\n *\n * @param context Rule execution context\n */\nexport function canOpenWithOffice(context: RuleContext): boolean {\n if (context.navigation && context.navigation.url && context.navigation.url.startsWith('/trashcan')) {\n return false;\n }\n\n if (!context || !context.selection) {\n return false;\n }\n\n const { file } = context.selection;\n\n if (!file || !file.entry) {\n return false;\n }\n\n const extension = getFileExtension(file.entry.name);\n if (!extension || !supportedExtensions[extension]) {\n return false;\n }\n\n if (!file.entry.properties) {\n return false;\n }\n\n if (file.entry.isLocked) {\n return false;\n }\n\n if (file.entry.properties['cm:lockType'] === 'WRITE_LOCK' || file.entry.properties['cm:lockType'] === 'READ_ONLY_LOCK') {\n return false;\n }\n\n const lockOwner = file.entry.properties['cm:lockOwner'];\n if (lockOwner && lockOwner.id !== context.profile.id) {\n return false;\n }\n\n // workaround for Shared files\n if (context.navigation && context.navigation.url && context.navigation.url.startsWith('/shared')) {\n // eslint-disable-next-line no-prototype-builtins\n if (file.entry.hasOwnProperty('allowableOperationsOnTarget')) {\n return context.permissions.check(file, ['update'], {\n target: 'allowableOperationsOnTarget'\n });\n }\n }\n\n return context.permissions.check(file, ['update']);\n}\n","/*!\n * Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved.\n *\n * Alfresco Example Content Application\n *\n * This file is part of the Alfresco Example Content Application.\n * If the software was purchased under a paid Alfresco license, the terms of\n * the paid license agreement will prevail. Otherwise, the software is\n * provided under the following open source license terms:\n *\n * The Alfresco Example Content Application is free software: you can redistribute it and/or modify\n * it under the terms of the GNU Lesser General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * The Alfresco Example Content Application is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU Lesser General Public License for more details.\n *\n * You should have received a copy of the GNU Lesser General Public License\n * from Hyland Software. If not, see <http://www.gnu.org/licenses/>.\n */\n\nexport * from './app.rules';\nexport * from './navigation.rules';\nexport * from './repository.rules';\nexport * from './user.rules';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":["navigation.isNotSearchResults","navigation.isPersonalFiles","navigation.isLibraryContent","navigation.isNotTrashcan","navigation.isNotLibraries","navigation.isFavorites","navigation.isLibraries","navigation.isTrashcan","repository.hasQuickShareEnabled","navigation.isSharedFiles","navigation.isPreview","repository.isMajorVersionAvailable","navigation.isRecentFiles","navigation.isSearchResults","isPreview"],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;AAsBG;AAIH;;;AAGG;AACG,SAAU,SAAS,CAAC,OAAoB,EAAA;AAC5C,IAAA,MAAM,EAAE,GAAG,EAAE,GAAG,OAAO,CAAC,UAAU,CAAC;IACnC,OAAO,GAAG,KAAK,GAAG,CAAC,QAAQ,CAAC,WAAW,CAAC,IAAI,GAAG,CAAC,QAAQ,CAAC,aAAa,CAAC,IAAI,GAAG,CAAC,QAAQ,CAAC,QAAQ,CAAC,CAAC,CAAC;AACrG,CAAC;AAED;;;AAGG;AACG,SAAU,WAAW,CAAC,OAAoB,EAAA;AAC9C,IAAA,MAAM,EAAE,GAAG,EAAE,GAAG,OAAO,CAAC,UAAU,CAAC;AACnC,IAAA,OAAO,GAAG,IAAI,GAAG,CAAC,UAAU,CAAC,YAAY,CAAC,IAAI,C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D,IAAI,SAAS,IAAI,SAAS,CAAC,EAAE,KAAK,OAAO,CAAC,OAAO,CAAC,EAAE,EAAE;AACpD,QAAA,OAAO,KAAK,CAAC;AACd,KAAA;;IAGD,IAAI,OAAO,CAAC,UAAU,IAAI,OAAO,CAAC,UAAU,CAAC,GAAG,IAAI,OAAO,CAAC,UAAU,CAAC,GAAG,CAAC,UAAU,CAAC,SAAS,CAAC,EAAE;;QAEhG,IAAI,IAAI,CAAC,KAAK,CAAC,cAAc,CAAC,6BAA6B,CAAC,EAAE;YAC5D,OAAO,OAAO,CAAC,WAAW,CAAC,KAAK,CAAC,IAAI,EAAE,CAAC,QAAQ,CAAC,EAAE;AACjD,gBAAA,MAAM,EAAE,6BAA6B;AACtC,aAAA,CAAC,CAAC;AACJ,SAAA;AACF,KAAA;AAED,IAAA,OAAO,OAAO,CAAC,WAAW,CAAC,KAAK,CAAC,IAAI,EAAE,CAAC,QAAQ,CAAC,CAAC,CAAC;AACrD;;ACpnBA;;;;;;;;;;;;;;;;;;;;;;AAsBG;;ACtBH;;AAEG;;;;"}
1
+ {"version":3,"file":"alfresco-aca-shared-rules.mjs","sources":["../../../../projects/aca-shared/rules/src/navigation.rules.ts","../../../../projects/aca-shared/rules/src/repository.rules.ts","../../../../projects/aca-shared/rules/src/user.rules.ts","../../../../projects/aca-shared/rules/src/app.rules.ts","../../../../projects/aca-shared/rules/src/public-api.ts","../../../../projects/aca-shared/rules/src/alfresco-aca-shared-rules.ts"],"sourcesContent":["/*!\n * Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved.\n *\n * Alfresco Example Content Application\n *\n * This file is part of the Alfresco Example Content Application.\n * If the software was purchased under a paid Alfresco license, the terms of\n * the paid license agreement will prevail. Otherwise, the software is\n * provided under the following open source license terms:\n *\n * The Alfresco Example Content Application is free software: you can redistribute it and/or modify\n * it under the terms of the GNU Lesser General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * The Alfresco Example Content Application is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU Lesser General Public License for more details.\n *\n * You should have received a copy of the GNU Lesser General Public License\n * from Hyland Software. If not, see <http://www.gnu.org/licenses/>.\n */\n\nimport { RuleContext } from '@alfresco/adf-extensions';\n\n/**\n * Checks if a Preview route is activated.\n * JSON ref: `app.navigation.isPreview`\n */\nexport function isPreview(context: RuleContext): boolean {\n const { url } = context.navigation;\n return url && (url.includes('/preview/') || url.includes('viewer:view') || url.includes('/view/'));\n}\n\n/**\n * Checks if a **Favorites** route is activated.\n * JSON ref: `app.navigation.isFavorites`\n */\nexport function isFavorites(context: RuleContext): boolean {\n const { url } = context.navigation;\n return url && url.startsWith('/favorites') && !isPreview(context);\n}\n\n/**\n * Checks if the activated route is not **Favorites**.\n * JSON ref: `app.navigation.isNotFavorites`\n */\nexport const isNotFavorites = (context: RuleContext): boolean => !isFavorites(context);\n\n/**\n * Checks if a **Shared Files** route is activated.\n * JSON ref: `app.navigation.isSharedFiles`\n */\nexport function isSharedFiles(context: RuleContext): boolean {\n const { url } = context.navigation;\n return url && url.startsWith('/shared') && !isPreview(context);\n}\n\n/**\n * Checks if the activated route is not **Shared Files**.\n * JSON ref: `app.navigation.isNotSharedFiles`\n */\nexport const isNotSharedFiles = (context: RuleContext): boolean => !isSharedFiles(context);\n\n/**\n * Checks if a **Trashcan** route is activated.\n * JSON ref: `app.navigation.isTrashcan`\n */\nexport function isTrashcan(context: RuleContext): boolean {\n const { url } = context.navigation;\n return url && url.startsWith('/trashcan');\n}\n\n/**\n * Checks if the activated route is not **Trashcan**.\n * JSON ref: `app.navigation.isNotTrashcan`\n */\nexport const isNotTrashcan = (context: RuleContext): boolean => !isTrashcan(context);\n\n/**\n * Checks if a **Personal Files** route is activated.\n * JSON ref: `app.navigation.isPersonalFiles`\n */\nexport function isPersonalFiles(context: RuleContext): boolean {\n const { url } = context.navigation;\n return url && url.startsWith('/personal-files');\n}\n\n/**\n * Checks if a **Library Files** route is activated.\n * JSON ref: `app.navigation.isLibraryFiles`\n */\nexport function isLibraryFiles(context: RuleContext): boolean {\n const { url } = context.navigation;\n return url && url.startsWith('/libraries');\n}\n\n/**\n * Checks if a **Library Files** or **Library Search Result** route is activated.\n * JSON ref: `app.navigation.isLibraryFiles`\n */\nexport function isLibraries(context: RuleContext): boolean {\n const { url } = context.navigation;\n return url && (url.endsWith('/libraries') || url.startsWith('/search-libraries'));\n}\n\nexport function isLibraryContent(context: RuleContext): boolean {\n const { url } = context.navigation;\n return url && (url.endsWith('/libraries') || url.includes('/libraries/') || url.startsWith('/search-libraries'));\n}\n\n/**\n * Checks if the activated route is neither **Libraries** nor **Library Search Results**.\n * JSON ref: `app.navigation.isNotLibraries`\n */\nexport const isNotLibraries = (context: RuleContext): boolean => !isLibraries(context);\n\n/**\n * Checks if a **Recent Files** route is activated.\n * JSON ref: `app.navigation.isRecentFiles`\n */\nexport function isRecentFiles(context: RuleContext): boolean {\n const { url } = context.navigation;\n return url && url.startsWith('/recent-files');\n}\n\n/**\n * Checks if the activated route is not **Recent Files**.\n * JSON ref: `app.navigation.isNotRecentFiles`\n */\nexport const isNotRecentFiles = (context: RuleContext): boolean => !isRecentFiles(context);\n\n/**\n * Checks if a **Search Results** route is activated.\n * JSON ref: `app.navigation.isSearchResults`\n */\nexport function isSearchResults(\n context: RuleContext\n // ...args: RuleParameter[]\n): boolean {\n const { url } = context.navigation;\n return url && url.startsWith('/search');\n}\n\n/**\n * Checks if the activated route is not **Search Results**.\n * JSON ref: `app.navigation.isNotSearchResults`\n */\nexport const isNotSearchResults = (context: RuleContext): boolean => !isSearchResults(context);\n\n/**\n * Checks if a **Shared Preview** route is activated.\n * JSON ref: `app.navigation.isSharedPreview`\n */\nexport function isSharedPreview(context: RuleContext): boolean {\n const { url } = context.navigation;\n return url && (url.startsWith('/shared/preview/') || (url.startsWith('/shared') && url.includes('viewer:view')));\n}\n\n/**\n * Checks if a **Favorites Preview** route is activated.\n * JSON ref: `app.navigation.isFavoritesPreview`\n */\nexport function isFavoritesPreview(context: RuleContext): boolean {\n const { url } = context.navigation;\n return url && (url.startsWith('/favorites/preview/') || (url.startsWith('/favorites') && url.includes('viewer:view')));\n}\n\n/**\n * Checks if a **Shared File Preview** route is activated.\n * JSON ref: `app.navigation.isFavoritesPreview`\n */\nexport function isSharedFileViewer(context: RuleContext): boolean {\n const { url } = context.navigation;\n return url && url.startsWith('/preview/s/');\n}\n","/*!\n * Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved.\n *\n * Alfresco Example Content Application\n *\n * This file is part of the Alfresco Example Content Application.\n * If the software was purchased under a paid Alfresco license, the terms of\n * the paid license agreement will prevail. Otherwise, the software is\n * provided under the following open source license terms:\n *\n * The Alfresco Example Content Application is free software: you can redistribute it and/or modify\n * it under the terms of the GNU Lesser General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * The Alfresco Example Content Application is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU Lesser General Public License for more details.\n *\n * You should have received a copy of the GNU Lesser General Public License\n * from Hyland Software. If not, see <http://www.gnu.org/licenses/>.\n */\n\nimport { RuleContext } from '@alfresco/adf-extensions';\n\n/**\n * Checks if the quick share repository option is enabled or not.\n * JSON ref: `repository.isQuickShareEnabled`\n */\nexport const hasQuickShareEnabled = (context: RuleContext): boolean => context.repository.status.isQuickShareEnabled;\n\nexport function isMajorVersionAvailable(context: RuleContext, versionNumber: string): boolean {\n const majorVersion = context.repository.version?.major ? parseInt(context.repository.version.major, 10) : 0;\n return majorVersion >= parseInt(versionNumber, 10);\n}\n","/*!\n * Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved.\n *\n * Alfresco Example Content Application\n *\n * This file is part of the Alfresco Example Content Application.\n * If the software was purchased under a paid Alfresco license, the terms of\n * the paid license agreement will prevail. Otherwise, the software is\n * provided under the following open source license terms:\n *\n * The Alfresco Example Content Application is free software: you can redistribute it and/or modify\n * it under the terms of the GNU Lesser General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * The Alfresco Example Content Application is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU Lesser General Public License for more details.\n *\n * You should have received a copy of the GNU Lesser General Public License\n * from Hyland Software. If not, see <http://www.gnu.org/licenses/>.\n */\n\nimport { RuleContext } from '@alfresco/adf-extensions';\n\n/**\n * Checks if user is admin.\n * JSON ref: `user.isAdmin`\n */\nexport const isAdmin = (context: RuleContext): boolean => context.profile.isAdmin;\n","/*!\n * Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved.\n *\n * Alfresco Example Content Application\n *\n * This file is part of the Alfresco Example Content Application.\n * If the software was purchased under a paid Alfresco license, the terms of\n * the paid license agreement will prevail. Otherwise, the software is\n * provided under the following open source license terms:\n *\n * The Alfresco Example Content Application is free software: you can redistribute it and/or modify\n * it under the terms of the GNU Lesser General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * The Alfresco Example Content Application is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU Lesser General Public License for more details.\n *\n * You should have received a copy of the GNU Lesser General Public License\n * from Hyland Software. If not, see <http://www.gnu.org/licenses/>.\n */\n\nimport { AppConfigService } from '@alfresco/adf-core';\nimport { RuleContext } from '@alfresco/adf-extensions';\nimport * as navigation from './navigation.rules';\nimport * as repository from './repository.rules';\nimport { isAdmin } from './user.rules';\n\n/* cspell:disable */\nexport const supportedExtensions = {\n doc: 'ms-word',\n docx: 'ms-word',\n docm: 'ms-word',\n dot: 'ms-word',\n dotx: 'ms-word',\n dotm: 'ms-word',\n rtf: 'ms-word',\n xls: 'ms-excel',\n xlsx: 'ms-excel',\n xlsb: 'ms-excel',\n xlsm: 'ms-excel',\n xlt: 'ms-excel',\n xltx: 'ms-excel',\n xltm: 'ms-excel',\n xlam: 'ms-excel',\n ppt: 'ms-powerpoint',\n pptx: 'ms-powerpoint',\n pot: 'ms-powerpoint',\n potx: 'ms-powerpoint',\n potm: 'ms-powerpoint',\n pptm: 'ms-powerpoint',\n pps: 'ms-powerpoint',\n ppsx: 'ms-powerpoint',\n ppam: 'ms-powerpoint',\n ppsm: 'ms-powerpoint',\n sldx: 'ms-powerpoint',\n sldm: 'ms-powerpoint',\n vsd: 'ms-visio',\n vss: 'ms-visio',\n vst: 'ms-visio',\n vsdx: 'ms-visio',\n vsdm: 'ms-visio',\n vssx: 'ms-visio',\n vssm: 'ms-visio',\n vstx: 'ms-visio',\n vstm: 'ms-visio'\n};\n/* cspell:enable */\n\nexport function getFileExtension(fileName: string): string | null {\n if (fileName) {\n const match = fileName.match(/\\.([^\\./\\?\\#]+)($|\\?|\\#)/);\n\n return match ? match[1] : null;\n }\n\n return null;\n}\n\nexport interface AcaRuleContext extends RuleContext {\n withCredentials: boolean;\n appConfig: AppConfigService;\n}\n\n/**\n * Checks if the content plugin is enabled.\n * JSON ref: `app.isContentServiceEnabled`\n */\nexport const isContentServiceEnabled = (context: AcaRuleContext): boolean => {\n const flag = context.appConfig.get<boolean | string>('plugins.contentService');\n return flag === true || flag === 'true';\n};\n\n/**\n * Checks if Search is supported for active view\n * JSON ref: `app.isSearchSupported`\n */\nexport const isSearchSupported = (context: RuleContext): boolean =>\n [navigation.isNotSearchResults(context) /* , !hasSelection(context)*/].every(Boolean);\n\n/**\n * Checks if upload action is supported for the given context\n * JSON ref: `app.isUploadSupported`\n *\n * @param context Rule execution context\n */\nexport const isUploadSupported = (context: AcaRuleContext): boolean =>\n [isContentServiceEnabled(context), navigation.isPersonalFiles(context) || navigation.isLibraryContent(context), canUpload(context)].every(Boolean);\n/**\n * Checks if user can copy selected node.\n * JSON ref: `app.canCopyNode`\n *\n * @param context Rule execution context\n */\nexport const canCopyNode = (context: RuleContext): boolean =>\n [hasSelection(context), navigation.isNotTrashcan(context), navigation.isNotLibraries(context)].every(Boolean);\n\n/**\n * Checks if user can mark selected nodes as **Favorite**.\n * JSON ref: `app.selection.canAddFavorite`\n */\nexport function canAddFavorite(context: RuleContext): boolean {\n if (!context.selection.isEmpty) {\n if (navigation.isFavorites(context) || navigation.isLibraries(context) || navigation.isTrashcan(context)) {\n return false;\n }\n return context.selection.nodes.some((node) => !node.entry.isFavorite);\n }\n return false;\n}\n\n/**\n * Checks if user can un-mark selected nodes as **Favorite**.\n * JSON ref: `app.selection.canRemoveFavorite`\n */\nexport function canRemoveFavorite(context: RuleContext): boolean {\n if (!context.selection.isEmpty && !navigation.isTrashcan(context)) {\n if (navigation.isFavorites(context)) {\n return true;\n }\n return context.selection.nodes.every((node) => node.entry.isFavorite);\n }\n return false;\n}\n\n/**\n * Checks if user can share selected file.\n * JSON ref: `app.selection.file.canShare`\n */\nexport const canShareFile = (context: RuleContext): boolean =>\n [context.selection.file, navigation.isNotTrashcan(context), repository.hasQuickShareEnabled(context), !isShared(context)].every(Boolean);\n\n/**\n * Checks if user can perform \"Join\" or \"Cancel Join Request\" on a library.\n * JSON ref: `canToggleJoinLibrary`\n */\nexport const canToggleJoinLibrary = (context: RuleContext): boolean =>\n [hasLibrarySelected(context), !isPrivateLibrary(context), hasNoLibraryRole(context)].every(Boolean) ||\n [hasLibrarySelected(context), isPrivateLibrary(context), hasNoLibraryRole(context), isAdmin(context)].every(Boolean);\n\n/**\n * Checks if user can edit the selected folder.\n * JSON ref: `canEditFolder`\n *\n * @param context Rule execution context\n */\nexport const canEditFolder = (context: RuleContext): boolean => [canUpdateSelectedFolder(context), navigation.isNotTrashcan(context)].every(Boolean);\n\n/**\n * Checks if the selected file is already shared.\n * JSON ref: `app.selection.file.isShared`\n */\nexport function isShared(context: RuleContext): boolean {\n if (navigation.isSharedFiles(context) && context.selection.file) {\n return true;\n }\n\n if (navigation.isNotTrashcan(context) && !context.selection.isEmpty && context.selection.file) {\n return !!(context.selection.file.entry && context.selection.file.entry.properties && context.selection.file.entry.properties['qshare:sharedId']);\n }\n\n return false;\n}\n\n/**\n * Checks if user can delete selected nodes.\n * JSON ref: `app.selection.canDelete`\n */\nexport function canDeleteSelection(context: RuleContext): boolean {\n if (\n navigation.isNotTrashcan(context) &&\n navigation.isNotLibraries(context) &&\n navigation.isNotSearchResults(context) &&\n !context.selection.isEmpty\n ) {\n if (hasLockedFiles(context)) {\n return false;\n }\n\n // temp workaround for Favorites api\n if (navigation.isFavorites(context)) {\n return true;\n }\n\n if (navigation.isPreview(context)) {\n return context.permissions.check(context.selection.nodes, ['delete']);\n }\n\n // workaround for Shared Files\n if (navigation.isSharedFiles(context)) {\n return context.permissions.check(context.selection.nodes, ['delete'], {\n target: 'allowableOperationsOnTarget'\n });\n }\n\n return context.permissions.check(context.selection.nodes, ['delete']);\n }\n return false;\n}\n\n/**\n * Checks if user can un-share selected nodes.\n * JSON ref: `app.selection.canUnshare`\n */\nexport function canUnshareNodes(context: RuleContext): boolean {\n if (!context.selection.isEmpty) {\n return context.permissions.check(context.selection.nodes, ['delete'], {\n target: 'allowableOperationsOnTarget'\n });\n }\n return false;\n}\n\n/**\n * Checks if user selected anything.\n * JSON ref: `app.selection.notEmpty`\n */\nexport const hasSelection = (context: RuleContext): boolean => !context.selection.isEmpty;\n\n/**\n * Checks if user can create a new folder with current path.\n * JSON ref: `app.navigation.folder.canCreate`\n */\nexport function canCreateFolder(context: AcaRuleContext): boolean {\n if (isContentServiceEnabled(context) && (navigation.isPersonalFiles(context) || navigation.isLibraryContent(context))) {\n const { currentFolder } = context.navigation;\n\n if (currentFolder) {\n return context.permissions.check(currentFolder, ['create']);\n }\n }\n return false;\n}\n\n/**\n * Checks if user can create a Library\n * JSON ref: `app.canCreateLibrary`\n *\n * @param context Rule execution context\n */\nexport const canCreateLibrary = (context: AcaRuleContext): boolean =>\n [isContentServiceEnabled(context), navigation.isLibraries(context)].every(Boolean);\n\n/**\n * Checks if user can upload content to current folder.\n * JSON ref: `app.navigation.folder.canUpload`\n */\nexport function canUpload(context: AcaRuleContext): boolean {\n if (isContentServiceEnabled(context) && (navigation.isPersonalFiles(context) || navigation.isLibraryContent(context))) {\n const { currentFolder } = context.navigation;\n\n if (currentFolder) {\n return context.permissions.check(currentFolder, ['create']);\n }\n }\n return false;\n}\n\n/**\n * Checks if user can download selected nodes (either files or folders).\n * JSON ref: `app.selection.canDownload`\n */\nexport function canDownloadSelection(context: RuleContext): boolean {\n if (!context.selection.isEmpty && navigation.isNotTrashcan(context)) {\n return context.selection.nodes.every((node: any) => node.entry && (node.entry.isFile || node.entry.isFolder || !!node.entry.nodeId));\n }\n return false;\n}\n\n/**\n * Checks if user has selected a folder.\n * JSON ref: `app.selection.folder`\n */\nexport const hasFolderSelected = (context: RuleContext): boolean => !!context.selection.folder;\n\n/**\n * Checks if user has selected a library (site).\n * JSON ref: `app.selection.library`\n */\nexport const hasLibrarySelected = (context: RuleContext): boolean => !!context.selection.library;\n\n/**\n * Checks if user has selected a **private** library (site)\n * JSON ref: `app.selection.isPrivateLibrary`\n */\nexport function isPrivateLibrary(context: RuleContext): boolean {\n const library = context.selection.library;\n return library ? !!(library.entry && library.entry.visibility && library.entry.visibility === 'PRIVATE') : false;\n}\n\n/**\n * Checks if the selected library has a **role** property defined.\n * JSON ref: `app.selection.hasLibraryRole`\n */\nexport function hasLibraryRole(context: RuleContext): boolean {\n const library = context.selection.library;\n return library ? !!(library.entry && library.entry.role) : false;\n}\n\n/**\n * Checks if the selected library has no **role** property defined.\n * JSON ref: `app.selection.hasNoLibraryRole`\n */\nexport const hasNoLibraryRole = (context: RuleContext): boolean => !hasLibraryRole(context);\n\n/**\n * Checks if user has selected a file.\n * JSON ref: `app.selection.file`\n */\nexport const hasFileSelected = (context: RuleContext): boolean => !!(context && context.selection && context.selection.file);\n\n/**\n * Checks if user can update the first selected node.\n * JSON ref: `app.selection.first.canUpdate`\n */\nexport function canUpdateSelectedNode(context: RuleContext): boolean {\n if (context.selection && !context.selection.isEmpty) {\n const node = context.selection.first;\n\n if (node?.entry.isFile && hasLockedFiles(context)) {\n return false;\n }\n\n return context.permissions.check(node, ['update']);\n }\n return false;\n}\n\nexport function isMultiselection(context: RuleContext): boolean {\n let isMultiNodeSelected = false;\n if (context.selection && !context.selection.isEmpty) {\n isMultiNodeSelected = context.selection.count > 1;\n }\n return isMultiNodeSelected;\n}\n\n/**\n * Checks if user can update the first selected folder.\n * JSON ref: `app.selection.folder.canUpdate`\n */\nexport function canUpdateSelectedFolder(context: RuleContext): boolean {\n const { folder } = context.selection;\n if (folder) {\n return (\n // workaround for Favorites Api\n navigation.isFavorites(context) || context.permissions.check(folder.entry, ['update'])\n );\n }\n return false;\n}\n\n/**\n * Checks if user has selected a **locked** file node.\n * JSON ref: `app.selection.file.isLocked`\n */\nexport function hasLockedFiles(context: RuleContext): boolean {\n if (context && context.selection && context.selection.nodes) {\n return context.selection.nodes.some((node) => {\n if (!node.entry.isFile) {\n return false;\n }\n\n return node.entry.isLocked || (node.entry.properties && node.entry.properties['cm:lockType'] === 'READ_ONLY_LOCK');\n });\n }\n\n return false;\n}\n\n/**\n * Checks if the selected file has **write** or **read-only** locks specified.\n * JSON ref: `app.selection.file.isLocked`\n */\nexport const isWriteLocked = (context: RuleContext): boolean =>\n !!(\n context &&\n context.selection &&\n context.selection.file &&\n context.selection.file.entry &&\n context.selection.file.entry.properties &&\n (context.selection.file.entry.properties['cm:lockType'] === 'WRITE_LOCK' ||\n context.selection.file.entry.properties['cm:lockType'] === 'READ_ONLY_LOCK')\n );\n\n/**\n * Checks if the selected file has **write** or **read-only** locks specified,\n * and that current user is the owner of the lock.\n * JSON ref: `app.selection.file.isLockOwner`\n */\nexport const isUserWriteLockOwner = (context: RuleContext): boolean =>\n isWriteLocked(context) &&\n context.selection.file?.entry.properties['cm:lockOwner'] &&\n context.selection.file?.entry.properties['cm:lockOwner'].id === context.profile.id;\n\n/**\n * Checks if user can lock selected file.\n * JSON ref: `app.selection.file.canLock`\n */\nexport const canLockFile = (context: RuleContext): boolean => !isWriteLocked(context) && canUpdateSelectedNode(context);\n\n/**\n * Checks if user can unlock selected file.\n * JSON ref: `app.selection.file.canUnlock`\n */\nexport function canUnlockFile(context: RuleContext): boolean {\n const { file } = context.selection;\n return isWriteLocked(context) && (context.permissions.check(file?.entry, ['delete']) || isUserWriteLockOwner(context));\n}\n\n/**\n * Checks if user can upload a new version of the file.\n * JSON ref: `app.selection.file.canUploadVersion`\n */\nexport function canUploadVersion(context: RuleContext): boolean {\n if (navigation.isFavorites(context) || navigation.isSharedFiles(context)) {\n return hasFileSelected(context);\n }\n\n return [\n hasFileSelected(context),\n navigation.isNotTrashcan(context),\n isWriteLocked(context) ? isUserWriteLockOwner(context) : canUpdateSelectedNode(context)\n ].every(Boolean);\n}\n\n/**\n * Checks if user has trashcan item selected.\n * JSON ref: `isTrashcanItemSelected`\n *\n * @param context Rule execution context\n */\nexport const isTrashcanItemSelected = (context: RuleContext): boolean => [navigation.isTrashcan(context), hasSelection(context)].every(Boolean);\n\n/**\n * Checks if user can view the file.\n * JSON ref: `canViewFile`\n *\n * @param context Rule execution context\n */\nexport const canViewFile = (context: RuleContext): boolean => [hasFileSelected(context), navigation.isNotTrashcan(context)].every(Boolean);\n\n/**\n * Checks if user can **Leave** selected library.\n * JSON ref: `canLeaveLibrary`\n *\n * @param context Rule execution context\n */\nexport const canLeaveLibrary = (context: RuleContext): boolean => [hasLibrarySelected(context), hasLibraryRole(context)].every(Boolean);\n\n/**\n * Checks if user can toggle shared link mode.\n * JSON ref: `canToggleSharedLink`\n *\n * @param context Rule execution context\n */\nexport const canToggleSharedLink = (context: RuleContext): boolean =>\n [hasFileSelected(context), [canShareFile(context), isShared(context)].some(Boolean)].every(Boolean);\n\n/**\n * Checks if user can show **Info Drawer** for the selected node.\n * JSON ref: `canShowInfoDrawer`\n *\n * @param context Rule execution context\n */\nexport const canShowInfoDrawer = (context: RuleContext): boolean =>\n [hasSelection(context), navigation.isNotLibraries(context), navigation.isNotTrashcan(context)].every(Boolean);\n\n/**\n * Checks if user can manage file versions for the selected node.\n * JSON ref: `canManageFileVersions`\n *\n * @param context Rule execution context\n */\nexport const canManageFileVersions = (context: RuleContext): boolean =>\n [hasFileSelected(context), navigation.isNotTrashcan(context), !hasLockedFiles(context)].every(Boolean);\n\n/**\n * Checks if user can edit aspects for the selected node.\n * JSON ref: `canEditAspects`\n *\n * @param context Rule execution context\n */\nexport const canEditAspects = (context: RuleContext): boolean =>\n [\n !isMultiselection(context),\n canUpdateSelectedNode(context),\n !isWriteLocked(context),\n navigation.isNotTrashcan(context),\n repository.isMajorVersionAvailable(context, '7')\n ].every(Boolean);\n\n/**\n * Checks if user can manage permissions for the selected node.\n * JSON ref: `canManagePermissions`\n *\n * @param context Rule execution context\n */\nexport const canManagePermissions = (context: RuleContext): boolean =>\n [canUpdateSelectedNode(context), navigation.isNotTrashcan(context)].every(Boolean);\n\n/**\n * Checks if user can toggle **Edit Offline** mode for selected node.\n * JSON ref: `canToggleEditOffline`\n *\n * @param context Rule execution context\n */\nexport const canToggleEditOffline = (context: RuleContext): boolean =>\n [hasFileSelected(context), navigation.isNotTrashcan(context), canLockFile(context) || canUnlockFile(context)].every(Boolean);\n\n/**\n * @deprecated Uses workarounds for for recent files and search api issues.\n * Checks if user can toggle **Favorite** state for a node.\n * @param context Rule execution context\n */\nexport const canToggleFavorite = (context: RuleContext): boolean =>\n [\n [canAddFavorite(context), canRemoveFavorite(context)].some(Boolean),\n [navigation.isRecentFiles(context), navigation.isSharedFiles(context), navigation.isSearchResults(context), navigation.isFavorites(context)].some(\n Boolean\n )\n ].every(Boolean);\n\n/**\n * Checks if application should render logout option.\n * JSON ref: `canShowLogout`\n *\n * @param context Rule execution context\n */\nexport const canShowLogout = (context: AcaRuleContext): boolean => !context.withCredentials;\n\n/**\n * Checks if user is library manager\n * JSON ref: `isLibraryManager`\n *\n * @param context Rule execution context\n */\nexport const isLibraryManager = (context: RuleContext): boolean =>\n hasLibrarySelected(context) && context.selection.library?.entry.role === 'SiteManager';\n\n/**\n * Checks if the preview button for search results can be showed\n * JSON ref: `canInfoPreview`\n *\n * @param context Rule execution context\n */\nexport const canInfoPreview = (context: RuleContext): boolean => {\n const isSearchResult = navigation.isSearchResults(context);\n const isNotMultiselect = !isMultiselection(context);\n const isFileSelected = !hasFolderSelected(context);\n const isPreview = !navigation.isPreview(context);\n\n return isSearchResult && isNotMultiselect && isFileSelected && isPreview;\n};\n\nexport const showInfoSelectionButton = (context: RuleContext): boolean => navigation.isSearchResults(context) && !navigation.isPreview(context);\n\n/**\n * Checks if the file can be opened with MS Office\n * JSON ref: `aos.canOpenWithOffice`\n *\n * @param context Rule execution context\n */\nexport function canOpenWithOffice(context: AcaRuleContext): boolean {\n const flag = `${context.appConfig.get<boolean | string>('plugins.aosPlugin', false)}`;\n\n if (flag !== 'true') {\n return false;\n }\n\n if (context.navigation && context.navigation.url && context.navigation.url.startsWith('/trashcan')) {\n return false;\n }\n\n if (!context || !context.selection) {\n return false;\n }\n\n const { file } = context.selection;\n\n if (!file || !file.entry) {\n return false;\n }\n\n const extension = getFileExtension(file.entry.name);\n if (!extension || !supportedExtensions[extension]) {\n return false;\n }\n\n if (!file.entry.properties) {\n return false;\n }\n\n if (file.entry.isLocked) {\n return false;\n }\n\n if (file.entry.properties['cm:lockType'] === 'WRITE_LOCK' || file.entry.properties['cm:lockType'] === 'READ_ONLY_LOCK') {\n return false;\n }\n\n const lockOwner = file.entry.properties['cm:lockOwner'];\n if (lockOwner && lockOwner.id !== context.profile.id) {\n return false;\n }\n\n // workaround for Shared files\n if (context.navigation && context.navigation.url && context.navigation.url.startsWith('/shared')) {\n // eslint-disable-next-line no-prototype-builtins\n if (file.entry.hasOwnProperty('allowableOperationsOnTarget')) {\n return context.permissions.check(file, ['update'], {\n target: 'allowableOperationsOnTarget'\n });\n }\n }\n\n return context.permissions.check(file, ['update']);\n}\n","/*!\n * Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved.\n *\n * Alfresco Example Content Application\n *\n * This file is part of the Alfresco Example Content Application.\n * If the software was purchased under a paid Alfresco license, the terms of\n * the paid license agreement will prevail. Otherwise, the software is\n * provided under the following open source license terms:\n *\n * The Alfresco Example Content Application is free software: you can redistribute it and/or modify\n * it under the terms of the GNU Lesser General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * The Alfresco Example Content Application is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU Lesser General Public License for more details.\n *\n * You should have received a copy of the GNU Lesser General Public License\n * from Hyland Software. If not, see <http://www.gnu.org/licenses/>.\n */\n\nexport * from './app.rules';\nexport * from './navigation.rules';\nexport * from './repository.rules';\nexport * from './user.rules';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":["navigation.isNotSearchResults","navigation.isPersonalFiles","navigation.isLibraryContent","navigation.isNotTrashcan","navigation.isNotLibraries","navigation.isFavorites","navigation.isLibraries","navigation.isTrashcan","repository.hasQuickShareEnabled","navigation.isSharedFiles","navigation.isPreview","repository.isMajorVersionAvailable","navigation.isRecentFiles","navigation.isSearchResults","isPreview"],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;AAsBG;AAIH;;;AAGG;AACG,SAAU,SAAS,CAAC,OAAoB,EAAA;AAC5C,IAAA,MAAM,EAAE,GAAG,EAAE,GAAG,OAAO,CAAC,UAAU,CAAC;IACnC,OAAO,GAAG,KAAK,GAAG,CAAC,QAAQ,CAAC,WAAW,CAAC,IAAI,GAAG,CAAC,QAAQ,CAAC,aAAa,CAAC,IAAI,GAAG,CAAC,QAAQ,CAAC,QAAQ,CAAC,CAAC,C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1
1
  import * as i0 from '@angular/core';
2
- import { InjectionToken, Injectable, Inject, Component, ViewEncapsulation, ChangeDetectionStrategy, Input, HostBinding, NgModule, ViewChild, QueryList, ViewChildren, HostListener, inject, Directive } from '@angular/core';
2
+ import { InjectionToken, Injectable, Inject, Component, ViewEncapsulation, ChangeDetectionStrategy, Input, HostBinding, inject, NgModule, ViewChild, QueryList, ViewChildren, HostListener, Directive } from '@angular/core';
3
3
  import { of, forkJoin, from, BehaviorSubject, Subject } from 'rxjs';
4
- import { map, tap, catchError, filter, takeUntil, debounceTime, take } from 'rxjs/operators';
4
+ import { map, tap, catchError, filter, takeUntil, debounceTime } from 'rxjs/operators';
5
5
  import { __awaiter } from 'tslib';
6
6
  import * as i3 from '@angular/router';
7
7
  import { ActivationEnd, NavigationStart, Router } from '@angular/router';
8
8
  import { CloseModalDialogsAction, SetCurrentUrlAction, ResetSelectionAction, SnackbarErrorAction, SetRepositoryInfoAction, SetUserProfileAction, SetInitialStateAction, getCustomCssPath, getCustomWebFontPath, STORE_INITIAL_APP_DATA, getRuleContext, infoDrawerPreview, SetInfoDrawerStateAction, ToggleInfoDrawerAction, getSharedUrl, isInfoDrawerOpened, getDocumentDisplayMode, getAppSelection, getCurrentFolder, SetSelectedNodesAction, ViewNodeAction, ReloadDocumentListAction, ContextMenu, isQuickShareEnabled } from '@alfresco/aca-shared/store';
9
9
  import * as i1 from '@alfresco/adf-core';
10
- import { CoreModule, InfoDrawerModule, ToolbarModule, ShowHeaderMode, PipeModule, AlfrescoApiService, AlfrescoApiServiceMock, TranslationService, TranslationMock, TranslateLoaderService } from '@alfresco/adf-core';
10
+ import { AppConfigService, CoreModule, InfoDrawerModule, ToolbarModule, ShowHeaderMode, PipeModule, AlfrescoApiService, AlfrescoApiServiceMock, TranslationService, TranslationMock, TranslateLoaderService } from '@alfresco/adf-core';
11
11
  import * as i1$2 from '@ngrx/store';
12
12
  import { Store, StoreModule } from '@ngrx/store';
13
13
  import * as i4$1 from '@alfresco/adf-content-services';
@@ -17,7 +17,7 @@ import { sortByOrder, reduceEmptyMenus, mergeObjects, mergeArrays, ContentAction
17
17
  import { NodesApi, TrashcanApi, SharedlinksApi, DiscoveryApi, FavoritesApi, ContentApi, SitesApi, SearchApi, PeopleApi, VersionsApi } from '@alfresco/js-api';
18
18
  import * as i7 from '@angular/cdk/overlay';
19
19
  import * as i1$1 from '@angular/material/dialog';
20
- import { MAT_DIALOG_DATA, MatDialogModule } from '@angular/material/dialog';
20
+ import { MAT_DIALOG_DATA, MatDialog, MatDialogModule } from '@angular/material/dialog';
21
21
  import * as i2 from '@angular/common';
22
22
  import { CommonModule } from '@angular/common';
23
23
  import * as i3$2 from '@angular/material/icon';
@@ -656,11 +656,49 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.1.3", ngImpor
656
656
  }] }, { type: i1$1.MatDialogRef }];
657
657
  } });
658
658
 
659
+ /*!
660
+ * Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved.
661
+ *
662
+ * Alfresco Example Content Application
663
+ *
664
+ * This file is part of the Alfresco Example Content Application.
665
+ * If the software was purchased under a paid Alfresco license, the terms of
666
+ * the paid license agreement will prevail. Otherwise, the software is
667
+ * provided under the following open source license terms:
668
+ *
669
+ * The Alfresco Example Content Application is free software: you can redistribute it and/or modify
670
+ * it under the terms of the GNU Lesser General Public License as published by
671
+ * the Free Software Foundation, either version 3 of the License, or
672
+ * (at your option) any later version.
673
+ *
674
+ * The Alfresco Example Content Application is distributed in the hope that it will be useful,
675
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
676
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
677
+ * GNU Lesser General Public License for more details.
678
+ *
679
+ * You should have received a copy of the GNU Lesser General Public License
680
+ * from Hyland Software. If not, see <http://www.gnu.org/licenses/>.
681
+ */
659
682
  class AcaMobileAppSwitcherService {
660
- constructor(config, dialog) {
661
- this.config = config;
662
- this.dialog = dialog;
663
- this.mobileAppSwitchConfig = this.config.get('mobileAppSwitch');
683
+ constructor() {
684
+ this.config = inject(AppConfigService);
685
+ this.dialog = inject(MatDialog);
686
+ }
687
+ get appStoreUrl() {
688
+ const defaultValue = 'https://apps.apple.com/us/app/alfresco-mobile-workspace/id1514434480';
689
+ return this.config.get('mobileAppSwitch.appStoreUrl', defaultValue);
690
+ }
691
+ get sessionTimeout() {
692
+ return this.config.get('mobileAppSwitch.sessionTimeout', 12);
693
+ }
694
+ getIPhoneRedirectUrl(url) {
695
+ const prefix = this.config.get('mobileAppSwitch.iphoneUrl', 'iosamw://');
696
+ return prefix + url;
697
+ }
698
+ getAndroidRedirectUrl(url) {
699
+ const prefix = this.config.get('mobileAppSwitch.androidUrlPart1', 'intent:///');
700
+ const suffix = this.config.get('mobileAppSwitch.androidUrlPart2', '#Intent;scheme=androidamw;package=com.alfresco.content.app;end');
701
+ return prefix + url + suffix;
664
702
  }
665
703
  resolveExistenceOfDialog() {
666
704
  const url = this.getCurrentUrl();
@@ -681,8 +719,7 @@ class AcaMobileAppSwitcherService {
681
719
  const currentTime = new Date().getTime();
682
720
  const sessionConvertedTime = parseFloat(sessionTime);
683
721
  const timeDifference = (currentTime - sessionConvertedTime) / (1000 * 60 * 60);
684
- const sessionTimeForOpenAppDialogDisplay = parseFloat(this.mobileAppSwitchConfig.sessionTimeForOpenAppDialogDisplay);
685
- if (timeDifference > sessionTimeForOpenAppDialogDisplay) {
722
+ if (timeDifference > this.sessionTimeout) {
686
723
  this.clearSessionExpireTime();
687
724
  this.identifyBrowserAndSetRedirectURL();
688
725
  }
@@ -698,11 +735,10 @@ class AcaMobileAppSwitcherService {
698
735
  const isIOS = ua.indexOf('iphone') > -1 || ua.indexOf('ipad') > -1 || ua.indexOf('ipod') > -1 || isIPadInSafari;
699
736
  const currentUrl = this.getCurrentUrl();
700
737
  if (isIOS === true) {
701
- this.redirectUrl = this.mobileAppSwitchConfig.iphoneUrl + currentUrl;
702
- this.appStoreUrl = this.mobileAppSwitchConfig.appStoreUrl;
738
+ this.redirectUrl = this.getIPhoneRedirectUrl(currentUrl);
703
739
  }
704
740
  else if (isAndroid === true) {
705
- this.redirectUrl = this.mobileAppSwitchConfig.androidUrlPart1 + currentUrl + this.mobileAppSwitchConfig.androidUrlPart2;
741
+ this.redirectUrl = this.getAndroidRedirectUrl(currentUrl);
706
742
  }
707
743
  if (this.redirectUrl !== undefined && this.redirectUrl !== null) {
708
744
  this.openDialog(this.redirectUrl, this.appStoreUrl);
@@ -735,14 +771,14 @@ class AcaMobileAppSwitcherService {
735
771
  }
736
772
  }
737
773
  }
738
- AcaMobileAppSwitcherService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.1.3", ngImport: i0, type: AcaMobileAppSwitcherService, deps: [{ token: i1.AppConfigService }, { token: i1$1.MatDialog }], target: i0.ɵɵFactoryTarget.Injectable });
774
+ AcaMobileAppSwitcherService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.1.3", ngImport: i0, type: AcaMobileAppSwitcherService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
739
775
  AcaMobileAppSwitcherService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.1.3", ngImport: i0, type: AcaMobileAppSwitcherService, providedIn: 'root' });
740
776
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.1.3", ngImport: i0, type: AcaMobileAppSwitcherService, decorators: [{
741
777
  type: Injectable,
742
778
  args: [{
743
779
  providedIn: 'root'
744
780
  }]
745
- }], ctorParameters: function () { return [{ type: i1.AppConfigService }, { type: i1$1.MatDialog }]; } });
781
+ }] });
746
782
 
747
783
  // After moving shell to ADF to core, AppService will implement ShellAppService
748
784
  class AppService {
@@ -2628,64 +2664,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.1.3", ngImpor
2628
2664
  }]
2629
2665
  }] });
2630
2666
 
2631
- /*!
2632
- * Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved.
2633
- *
2634
- * Alfresco Example Content Application
2635
- *
2636
- * This file is part of the Alfresco Example Content Application.
2637
- * If the software was purchased under a paid Alfresco license, the terms of
2638
- * the paid license agreement will prevail. Otherwise, the software is
2639
- * provided under the following open source license terms:
2640
- *
2641
- * The Alfresco Example Content Application is free software: you can redistribute it and/or modify
2642
- * it under the terms of the GNU Lesser General Public License as published by
2643
- * the Free Software Foundation, either version 3 of the License, or
2644
- * (at your option) any later version.
2645
- *
2646
- * The Alfresco Example Content Application is distributed in the hope that it will be useful,
2647
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
2648
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
2649
- * GNU Lesser General Public License for more details.
2650
- *
2651
- * You should have received a copy of the GNU Lesser General Public License
2652
- * from Hyland Software. If not, see <http://www.gnu.org/licenses/>.
2653
- */
2654
- class AlfrescoOfficeExtensionService {
2655
- constructor(appConfigService) {
2656
- this.appConfigService = appConfigService;
2657
- this.appConfigService.onLoad
2658
- .pipe(take(1), map((appConfig) => appConfig.plugins && appConfig.plugins.aosPlugin))
2659
- .subscribe((aosPlugin) => {
2660
- if (aosPlugin) {
2661
- this.enablePlugin();
2662
- }
2663
- else {
2664
- this.disablePlugin();
2665
- }
2666
- });
2667
- }
2668
- enablePlugin() {
2669
- if (localStorage && localStorage.getItem('aosPlugin') === null) {
2670
- localStorage.setItem('aosPlugin', 'true');
2671
- }
2672
- }
2673
- disablePlugin() {
2674
- localStorage.removeItem('aosPlugin');
2675
- }
2676
- isAosPluginEnabled() {
2677
- return localStorage && localStorage.getItem('aosPlugin') === 'true';
2678
- }
2679
- }
2680
- AlfrescoOfficeExtensionService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.1.3", ngImport: i0, type: AlfrescoOfficeExtensionService, deps: [{ token: i1.AppConfigService }], target: i0.ɵɵFactoryTarget.Injectable });
2681
- AlfrescoOfficeExtensionService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.1.3", ngImport: i0, type: AlfrescoOfficeExtensionService, providedIn: 'root' });
2682
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.1.3", ngImport: i0, type: AlfrescoOfficeExtensionService, decorators: [{
2683
- type: Injectable,
2684
- args: [{
2685
- providedIn: 'root'
2686
- }]
2687
- }], ctorParameters: function () { return [{ type: i1.AppConfigService }]; } });
2688
-
2689
2667
  /*!
2690
2668
  * Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved.
2691
2669
  *
@@ -2854,5 +2832,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.1.3", ngImpor
2854
2832
  * Generated bundle index. Do not edit.
2855
2833
  */
2856
2834
 
2857
- export { AcaFileAutoDownloadService, AlfrescoOfficeExtensionService, AppExtensionService, AppHookService, AppService, AppSharedRuleGuard, ContentApiService, ContextActionsDirective, ContextActionsModule, DefaultExtensionLoaderFactory, DocumentBasePageService, EXTENSION_DATA_LOADERS, ExtensionsDataLoaderGuard, GenericErrorComponent, InfoDrawerComponent, LibTestingModule, LockedByComponent, NodePermissionService, OpenInAppComponent, OpenInAppModule, PageComponent, PageLayoutComponent, PageLayoutContentComponent, PageLayoutErrorComponent, PageLayoutHeaderComponent, PageLayoutModule, PaginationDirective, RouterExtensionService, SharedDirectivesModule, SharedModule, SharedToolbarModule, ToolbarActionComponent, ToolbarButtonComponent, ToolbarButtonType, ToolbarMenuComponent, ToolbarMenuItemComponent, initialState, isLibrary, isLocked };
2835
+ export { AcaFileAutoDownloadService, AppExtensionService, AppHookService, AppService, AppSharedRuleGuard, ContentApiService, ContextActionsDirective, ContextActionsModule, DefaultExtensionLoaderFactory, DocumentBasePageService, EXTENSION_DATA_LOADERS, ExtensionsDataLoaderGuard, GenericErrorComponent, InfoDrawerComponent, LibTestingModule, LockedByComponent, NodePermissionService, OpenInAppComponent, OpenInAppModule, PageComponent, PageLayoutComponent, PageLayoutContentComponent, PageLayoutErrorComponent, PageLayoutHeaderComponent, PageLayoutModule, PaginationDirective, RouterExtensionService, SharedDirectivesModule, SharedModule, SharedToolbarModule, ToolbarActionComponent, ToolbarButtonComponent, ToolbarButtonType, ToolbarMenuComponent, ToolbarMenuItemComponent, initialState, isLibrary, isLocked };
2858
2836
  //# sourceMappingURL=alfresco-aca-shared.mjs.map