Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[MNT-24151] - ADW: Users can see some actions Edit Offline" and "Upload New Version" for the declared record #3622

Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading