Skip to content

Commit

Permalink
[MNT-24151] - ADW: Users can see some actions Edit Offline" and "Uplo…
Browse files Browse the repository at this point in the history
…ad New Version" for the declared record (#3622)
  • Loading branch information
dominikiwanekhyland authored and katarzynakita committed Feb 12, 2024
1 parent 3ba6c79 commit da7cad5
Showing 1 changed file with 18 additions and 15 deletions.
33 changes: 18 additions & 15 deletions projects/aca-shared/src/lib/services/app.extension.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down Expand Up @@ -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;
Expand Down

0 comments on commit da7cad5

Please sign in to comment.