mirror of
https://github.com/Alfresco/alfresco-content-app.git
synced 2025-07-31 17:38:28 +00:00
[ACA-1751] fix move/delete commands for shared preview (#598)
This commit is contained in:
@@ -113,7 +113,8 @@ export class CoreExtensionsModule {
|
||||
'app.navigation.isRecentFiles': nav.isRecentFiles,
|
||||
'app.navigation.isNotRecentFiles': nav.isNotRecentFiles,
|
||||
'app.navigation.isSearchResults': nav.isSearchResults,
|
||||
'app.navigation.isNotSearchResults': nav.isNotSearchResults
|
||||
'app.navigation.isNotSearchResults': nav.isNotSearchResults,
|
||||
'app.navigation.isPreview': nav.isPreview
|
||||
});
|
||||
}
|
||||
}
|
||||
|
@@ -32,7 +32,8 @@ import {
|
||||
isLibraries,
|
||||
isTrashcan,
|
||||
isSharedFiles,
|
||||
isNotSearchResults
|
||||
isNotSearchResults,
|
||||
isPreview
|
||||
} from './navigation.evaluators';
|
||||
|
||||
export function canAddFavorite(
|
||||
@@ -94,12 +95,19 @@ export function canDeleteSelection(
|
||||
return true;
|
||||
}
|
||||
|
||||
if (isPreview(context, ...args)) {
|
||||
return context.permissions.check(context.selection.nodes, [
|
||||
'delete'
|
||||
]);
|
||||
}
|
||||
|
||||
// workaround for Shared Files
|
||||
if (isSharedFiles(context, ...args)) {
|
||||
return context.permissions.check(
|
||||
context.selection.nodes,
|
||||
['delete'],
|
||||
{ target: 'allowableOperationsOnTarget' });
|
||||
{ target: 'allowableOperationsOnTarget' }
|
||||
);
|
||||
}
|
||||
|
||||
return context.permissions.check(context.selection.nodes, ['delete']);
|
||||
|
@@ -114,3 +114,11 @@ export function isNotSearchResults(
|
||||
): boolean {
|
||||
return !isSearchResults(context, ...args);
|
||||
}
|
||||
|
||||
export function isPreview(
|
||||
context: RuleContext,
|
||||
...args: RuleParameter[]
|
||||
): boolean {
|
||||
const { url } = context.navigation;
|
||||
return url && url.includes('/preview/');
|
||||
}
|
||||
|
Reference in New Issue
Block a user