From 0dcd942111930b11a4825fc46cad6335b8d83d06 Mon Sep 17 00:00:00 2001 From: DominikIwanek Date: Tue, 30 Jan 2024 15:58:57 +0100 Subject: [PATCH] [MNT-24151] - ADW: Users can see some actions Edit Offline" and "Upload New Version" for the declared record --- .../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;