From da7cad5a3d2427c4a4625ae8548335e4e5273d46 Mon Sep 17 00:00:00 2001 From: DominikIwanek <141320833+DominikIwanek@users.noreply.github.com> Date: Mon, 12 Feb 2024 16:08:54 +0100 Subject: [PATCH] [MNT-24151] - ADW: Users can see some actions Edit Offline" and "Upload New Version" for the declared record (#3622) --- .../src/lib/services/app.extension.service.ts | 33 ++++++++++--------- 1 file changed, 18 insertions(+), 15 deletions(-) diff --git a/projects/aca-shared/src/lib/services/app.extension.service.ts b/projects/aca-shared/src/lib/services/app.extension.service.ts index 25c1330da5..74b198ed31 100644 --- a/projects/aca-shared/src/lib/services/app.extension.service.ts +++ b/projects/aca-shared/src/lib/services/app.extension.service.ts @@ -28,30 +28,30 @@ import { MatIconRegistry } from '@angular/material/icon'; import { DomSanitizer } from '@angular/platform-browser'; import { AppStore, getRuleContext } from '@alfresco/aca-shared/store'; import { - SelectionState, - NavigationState, - ExtensionConfig, - RuleEvaluator, ContentActionRef, ContentActionType, + DocumentListPresetRef, + ExtensionConfig, ExtensionLoaderService, - SidebarTabRef, - NavBarGroupRef, - sortByOrder, - reduceSeparators, - reduceEmptyMenus, + ExtensionRef, ExtensionService, - ProfileState, + IconRef, + mergeArrays, mergeObjects, - ExtensionRef, + NavBarGroupRef, + NavigationState, + ProfileState, + reduceEmptyMenus, + reduceSeparators, RuleContext, - DocumentListPresetRef, - IconRef, - mergeArrays + RuleEvaluator, + SelectionState, + SidebarTabRef, + sortByOrder } from '@alfresco/adf-extensions'; import { AppConfigService, AuthenticationService, LogService } from '@alfresco/adf-core'; import { BehaviorSubject, Observable } from 'rxjs'; -import { RepositoryInfo, NodeEntry } from '@alfresco/js-api'; +import { NodeEntry, RepositoryInfo } from '@alfresco/js-api'; import { ViewerRules } from '../models/viewer.rules'; import { Badge, SettingsGroupRef } from '../models/types'; import { NodePermissionService } from '../services/node-permission.service'; @@ -496,6 +496,9 @@ export class AppExtensionService implements RuleContext { filterVisible(action: ContentActionRef | SettingsGroupRef | SidebarTabRef | DocumentListPresetRef | SearchCategory): boolean { if (action?.rules?.visible) { + if (Array.isArray(action.rules.visible)) { + return action.rules.visible.every((rule) => this.extensions.evaluateRule(rule, this)); + } return this.extensions.evaluateRule(action.rules.visible, this); } return true;