mirror of
https://github.com/Alfresco/alfresco-content-app.git
synced 2025-07-31 17:38:28 +00:00
[MNT-22754] fix context menus for records (#2706)
* fix context menus for records * fix unit tests * fix unit tests
This commit is contained in:
@@ -26,6 +26,7 @@
|
||||
import { AppConfigService } from '@alfresco/adf-core';
|
||||
import { RuleContext } from '@alfresco/adf-extensions';
|
||||
import * as navigation from './navigation.rules';
|
||||
import { isNodeRecord } from './record.rules';
|
||||
import * as repository from './repository.rules';
|
||||
import { isAdmin } from './user.rules';
|
||||
|
||||
@@ -358,6 +359,7 @@ export function canUploadVersion(context: RuleContext): boolean {
|
||||
return [
|
||||
hasFileSelected(context),
|
||||
navigation.isNotTrashcan(context),
|
||||
!isNodeRecord(context),
|
||||
isWriteLocked(context) ? isUserWriteLockOwner(context) : canUpdateSelectedNode(context)
|
||||
].every(Boolean);
|
||||
}
|
||||
@@ -444,7 +446,9 @@ export const canManagePermissions = (context: RuleContext): boolean =>
|
||||
* @param context Rule execution context
|
||||
*/
|
||||
export const canToggleEditOffline = (context: RuleContext): boolean =>
|
||||
[hasFileSelected(context), navigation.isNotTrashcan(context), canLockFile(context) || canUnlockFile(context)].every(Boolean);
|
||||
[hasFileSelected(context), navigation.isNotTrashcan(context), canLockFile(context) || canUnlockFile(context), !isNodeRecord(context)].every(
|
||||
Boolean
|
||||
);
|
||||
|
||||
/**
|
||||
* @deprecated Uses workarounds for for recent files and search api issues.
|
||||
|
Reference in New Issue
Block a user