@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.
@@ -290,7 +290,10 @@ function getFileExtension(fileName) {
290
290
  * Checks if the content plugin is enabled.
291
291
  * JSON ref: `app.isContentServiceEnabled`
292
292
  */
293
- const isContentServiceEnabled = () => localStorage && localStorage.getItem('contentService') !== 'false';
293
+ const isContentServiceEnabled = (context) => {
294
+ const flag = context.appConfig.get('plugins.contentService');
295
+ return flag === true || flag === 'true';
296
+ };
294
297
  /**
295
298
  * Checks if Search is supported for active view
296
299
  * JSON ref: `app.isSearchSupported`
@@ -300,9 +303,9 @@ const isSearchSupported = (context) => [isNotSearchResults(context) /* , !hasSel
300
303
  * Checks if upload action is supported for the given context
301
304
  * JSON ref: `app.isUploadSupported`
302
305
  *
303
- * @param content Rule execution context
306
+ * @param context Rule execution context
304
307
  */
305
- const isUploadSupported = (context) => [isContentServiceEnabled(), isPersonalFiles(context) || isLibraryContent(context), canUpload(context)].every(Boolean);
308
+ const isUploadSupported = (context) => [isContentServiceEnabled(context), isPersonalFiles(context) || isLibraryContent(context), canUpload(context)].every(Boolean);
306
309
  /**
307
310
  * Checks if user can copy selected node.
308
311
  * JSON ref: `app.canCopyNode`
@@ -418,7 +421,7 @@ const hasSelection = (context) => !context.selection.isEmpty;
418
421
  * JSON ref: `app.navigation.folder.canCreate`
419
422
  */
420
423
  function canCreateFolder(context) {
421
- if (isContentServiceEnabled() && (isPersonalFiles(context) || isLibraryContent(context))) {
424
+ if (isContentServiceEnabled(context) && (isPersonalFiles(context) || isLibraryContent(context))) {
422
425
  const { currentFolder } = context.navigation;
423
426
  if (currentFolder) {
424
427
  return context.permissions.check(currentFolder, ['create']);
@@ -432,13 +435,13 @@ function canCreateFolder(context) {
432
435
  *
433
436
  * @param context Rule execution context
434
437
  */
435
- const canCreateLibrary = (context) => [isContentServiceEnabled(), isLibraries(context)].every(Boolean);
438
+ const canCreateLibrary = (context) => [isContentServiceEnabled(context), isLibraries(context)].every(Boolean);
436
439
  /**
437
440
  * Checks if user can upload content to current folder.
438
441
  * JSON ref: `app.navigation.folder.canUpload`
439
442
  */
440
443
  function canUpload(context) {
441
- if (isContentServiceEnabled() && (isPersonalFiles(context) || isLibraryContent(context))) {
444
+ if (isContentServiceEnabled(context) && (isPersonalFiles(context) || isLibraryContent(context))) {
442
445
  const { currentFolder } = context.navigation;
443
446
  if (currentFolder) {
444
447
  return context.permissions.check(currentFolder, ['create']);
@@ -700,6 +703,10 @@ const showInfoSelectionButton = (context) => isSearchResults(context) && !isPrev
700
703
  * @param context Rule execution context
701
704
  */
702
705
  function canOpenWithOffice(context) {
706
+ const flag = `${context.appConfig.get('plugins.aosPlugin', false)}`;
707
+ if (flag !== 'true') {
708
+ return false;
709
+ }
703
710
  if (context.navigation && context.navigation.url && context.navigation.url.startsWith('/trashcan')) {
704
711
  return false;
705
712
  }
@@ -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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AC;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,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,CAAC,SAAS,CAAC,OAAO,CAAC,CAAC;AACpE,CAAC;AAED;;;AAGG;AACI,MAAM,cAAc,GAAG,CAAC,OAAoB,KAAc,CAAC,WAAW,CAAC,OAAO,EAAE;AAEvF;;;AAGG;AACG,SAAU,aAAa,CAAC,OAAoB,EAAA;AAChD,IAAA,MAAM,EAAE,GAAG,EAAE,GAAG,OAAO,CAAC,UAAU,CAAC;AACnC,IAAA,OAAO,GAAG,IAAI,GAAG,CAAC,UAAU,CAAC,SAAS,CAAC,IAAI,CAAC,SAAS,CAAC,OAAO,CAAC,CAAC;AACjE,CAAC;AAED;;;AAGG;A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AsBG;;ACtBH;;AAEG;;;;"}
@@ -1,9 +1,9 @@
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 * as i1 from '@alfresco/adf-core';
6
- import { CoreModule, InfoDrawerModule, ToolbarModule, ShowHeaderMode, PipeModule, AlfrescoApiService, AlfrescoApiServiceMock, TranslationService, TranslationMock, TranslateLoaderService } from '@alfresco/adf-core';
6
+ import { AppConfigService, CoreModule, InfoDrawerModule, ToolbarModule, ShowHeaderMode, PipeModule, AlfrescoApiService, AlfrescoApiServiceMock, TranslationService, TranslationMock, TranslateLoaderService } from '@alfresco/adf-core';
7
7
  import * as i4$1 from '@alfresco/adf-content-services';
8
8
  import { FileAutoDownloadComponent, UploadService, DocumentListComponent } from '@alfresco/adf-content-services';
9
9
  import * as i7 from '@angular/cdk/overlay';
@@ -16,7 +16,7 @@ import { sortByOrder, reduceEmptyMenus, mergeObjects, mergeArrays, ContentAction
16
16
  import * as i1$2 from '@ngrx/store';
17
17
  import { Store, StoreModule } from '@ngrx/store';
18
18
  import * as i1$1 from '@angular/material/dialog';
19
- import { MAT_DIALOG_DATA, MatDialogModule } from '@angular/material/dialog';
19
+ import { MAT_DIALOG_DATA, MatDialog, MatDialogModule } from '@angular/material/dialog';
20
20
  import * as i2 from '@angular/common';
21
21
  import { CommonModule } from '@angular/common';
22
22
  import * as i3$2 from '@angular/material/icon';
@@ -667,10 +667,25 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.1.3", ngImpor
667
667
  * from Hyland Software. If not, see <http://www.gnu.org/licenses/>.
668
668
  */
669
669
  class AcaMobileAppSwitcherService {
670
- constructor(config, dialog) {
671
- this.config = config;
672
- this.dialog = dialog;
673
- this.mobileAppSwitchConfig = this.config.get('mobileAppSwitch');
670
+ constructor() {
671
+ this.config = inject(AppConfigService);
672
+ this.dialog = inject(MatDialog);
673
+ }
674
+ get appStoreUrl() {
675
+ const defaultValue = 'https://apps.apple.com/us/app/alfresco-mobile-workspace/id1514434480';
676
+ return this.config.get('mobileAppSwitch.appStoreUrl', defaultValue);
677
+ }
678
+ get sessionTimeout() {
679
+ return this.config.get('mobileAppSwitch.sessionTimeout', 12);
680
+ }
681
+ getIPhoneRedirectUrl(url) {
682
+ const prefix = this.config.get('mobileAppSwitch.iphoneUrl', 'iosamw://');
683
+ return prefix + url;
684
+ }
685
+ getAndroidRedirectUrl(url) {
686
+ const prefix = this.config.get('mobileAppSwitch.androidUrlPart1', 'intent:///');
687
+ const suffix = this.config.get('mobileAppSwitch.androidUrlPart2', '#Intent;scheme=androidamw;package=com.alfresco.content.app;end');
688
+ return prefix + url + suffix;
674
689
  }
675
690
  resolveExistenceOfDialog() {
676
691
  const url = this.getCurrentUrl();
@@ -691,8 +706,7 @@ class AcaMobileAppSwitcherService {
691
706
  const currentTime = new Date().getTime();
692
707
  const sessionConvertedTime = parseFloat(sessionTime);
693
708
  const timeDifference = (currentTime - sessionConvertedTime) / (1000 * 60 * 60);
694
- const sessionTimeForOpenAppDialogDisplay = parseFloat(this.mobileAppSwitchConfig.sessionTimeForOpenAppDialogDisplay);
695
- if (timeDifference > sessionTimeForOpenAppDialogDisplay) {
709
+ if (timeDifference > this.sessionTimeout) {
696
710
  this.clearSessionExpireTime();
697
711
  this.identifyBrowserAndSetRedirectURL();
698
712
  }
@@ -708,11 +722,10 @@ class AcaMobileAppSwitcherService {
708
722
  const isIOS = ua.indexOf('iphone') > -1 || ua.indexOf('ipad') > -1 || ua.indexOf('ipod') > -1 || isIPadInSafari;
709
723
  const currentUrl = this.getCurrentUrl();
710
724
  if (isIOS === true) {
711
- this.redirectUrl = this.mobileAppSwitchConfig.iphoneUrl + currentUrl;
712
- this.appStoreUrl = this.mobileAppSwitchConfig.appStoreUrl;
725
+ this.redirectUrl = this.getIPhoneRedirectUrl(currentUrl);
713
726
  }
714
727
  else if (isAndroid === true) {
715
- this.redirectUrl = this.mobileAppSwitchConfig.androidUrlPart1 + currentUrl + this.mobileAppSwitchConfig.androidUrlPart2;
728
+ this.redirectUrl = this.getAndroidRedirectUrl(currentUrl);
716
729
  }
717
730
  if (this.redirectUrl !== undefined && this.redirectUrl !== null) {
718
731
  this.openDialog(this.redirectUrl, this.appStoreUrl);
@@ -745,14 +758,14 @@ class AcaMobileAppSwitcherService {
745
758
  }
746
759
  }
747
760
  }
748
- 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 });
761
+ AcaMobileAppSwitcherService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.1.3", ngImport: i0, type: AcaMobileAppSwitcherService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
749
762
  AcaMobileAppSwitcherService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.1.3", ngImport: i0, type: AcaMobileAppSwitcherService, providedIn: 'root' });
750
763
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.1.3", ngImport: i0, type: AcaMobileAppSwitcherService, decorators: [{
751
764
  type: Injectable,
752
765
  args: [{
753
766
  providedIn: 'root'
754
767
  }]
755
- }], ctorParameters: function () { return [{ type: i1.AppConfigService }, { type: i1$1.MatDialog }]; } });
768
+ }] });
756
769
 
757
770
  /*!
758
771
  * Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved.
@@ -2775,64 +2788,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.1.3", ngImpor
2775
2788
  }]
2776
2789
  }] });
2777
2790
 
2778
- /*!
2779
- * Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved.
2780
- *
2781
- * Alfresco Example Content Application
2782
- *
2783
- * This file is part of the Alfresco Example Content Application.
2784
- * If the software was purchased under a paid Alfresco license, the terms of
2785
- * the paid license agreement will prevail. Otherwise, the software is
2786
- * provided under the following open source license terms:
2787
- *
2788
- * The Alfresco Example Content Application is free software: you can redistribute it and/or modify
2789
- * it under the terms of the GNU Lesser General Public License as published by
2790
- * the Free Software Foundation, either version 3 of the License, or
2791
- * (at your option) any later version.
2792
- *
2793
- * The Alfresco Example Content Application is distributed in the hope that it will be useful,
2794
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
2795
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
2796
- * GNU Lesser General Public License for more details.
2797
- *
2798
- * You should have received a copy of the GNU Lesser General Public License
2799
- * from Hyland Software. If not, see <http://www.gnu.org/licenses/>.
2800
- */
2801
- class AlfrescoOfficeExtensionService {
2802
- constructor(appConfigService) {
2803
- this.appConfigService = appConfigService;
2804
- this.appConfigService.onLoad
2805
- .pipe(take(1), map((appConfig) => appConfig.plugins && appConfig.plugins.aosPlugin))
2806
- .subscribe((aosPlugin) => {
2807
- if (aosPlugin) {
2808
- this.enablePlugin();
2809
- }
2810
- else {
2811
- this.disablePlugin();
2812
- }
2813
- });
2814
- }
2815
- enablePlugin() {
2816
- if (localStorage && localStorage.getItem('aosPlugin') === null) {
2817
- localStorage.setItem('aosPlugin', 'true');
2818
- }
2819
- }
2820
- disablePlugin() {
2821
- localStorage.removeItem('aosPlugin');
2822
- }
2823
- isAosPluginEnabled() {
2824
- return localStorage && localStorage.getItem('aosPlugin') === 'true';
2825
- }
2826
- }
2827
- AlfrescoOfficeExtensionService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.1.3", ngImport: i0, type: AlfrescoOfficeExtensionService, deps: [{ token: i1.AppConfigService }], target: i0.ɵɵFactoryTarget.Injectable });
2828
- AlfrescoOfficeExtensionService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.1.3", ngImport: i0, type: AlfrescoOfficeExtensionService, providedIn: 'root' });
2829
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.1.3", ngImport: i0, type: AlfrescoOfficeExtensionService, decorators: [{
2830
- type: Injectable,
2831
- args: [{
2832
- providedIn: 'root'
2833
- }]
2834
- }], ctorParameters: function () { return [{ type: i1.AppConfigService }]; } });
2835
-
2836
2791
  /*!
2837
2792
  * Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved.
2838
2793
  *
@@ -3001,5 +2956,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.1.3", ngImpor
3001
2956
  * Generated bundle index. Do not edit.
3002
2957
  */
3003
2958
 
3004
- 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 };
2959
+ 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 };
3005
2960
  //# sourceMappingURL=alfresco-aca-shared.mjs.map