mirror of
https://github.com/Alfresco/alfresco-content-app.git
synced 2025-05-12 17:04:46 +00:00
[MNT-24334] allow to delete or move on search result page (#3898)
This commit is contained in:
parent
85cad50a62
commit
4f41b96695
@ -793,18 +793,15 @@ describe('app.evaluators', () => {
|
||||
expect(app.canDeleteSelection(context)).toBeFalse();
|
||||
});
|
||||
|
||||
it('should return false when user is in trashcan, library or search results page', () => {
|
||||
it('should return false when user is in trashcan or library', () => {
|
||||
context.selection.isEmpty = false;
|
||||
context.navigation.url = '/trashcan/tets';
|
||||
context.navigation.url = '/trashcan/test';
|
||||
expect(app.canDeleteSelection(context)).toBeFalse();
|
||||
|
||||
context.navigation.url = '/test/libraries';
|
||||
expect(app.canDeleteSelection(context)).toBeFalse();
|
||||
|
||||
context.navigation.url = '/search-libraries/tets';
|
||||
expect(app.canDeleteSelection(context)).toBeFalse();
|
||||
|
||||
context.navigation.url = '/search/tets';
|
||||
context.navigation.url = '/search-libraries/test';
|
||||
expect(app.canDeleteSelection(context)).toBeFalse();
|
||||
});
|
||||
|
||||
@ -815,6 +812,12 @@ describe('app.evaluators', () => {
|
||||
expect(app.canDeleteSelection(context)).toBeFalse();
|
||||
});
|
||||
|
||||
it('should return true when user is in search result page', () => {
|
||||
context.selection.isEmpty = false;
|
||||
context.navigation.url = '/search/test';
|
||||
expect(app.canDeleteSelection(context)).toBeTrue();
|
||||
});
|
||||
|
||||
it('should return true when user is in favorites', () => {
|
||||
context.selection.isEmpty = false;
|
||||
context.navigation.url = '/favorites/test';
|
||||
|
@ -67,6 +67,7 @@ export const supportedExtensions = {
|
||||
vstx: 'ms-visio',
|
||||
vstm: 'ms-visio'
|
||||
};
|
||||
|
||||
/* cspell:enable */
|
||||
|
||||
export function getFileExtension(fileName: string): string | null {
|
||||
@ -182,7 +183,7 @@ export function isShared(context: RuleContext): boolean {
|
||||
* JSON ref: `app.selection.canDelete`
|
||||
*/
|
||||
export function canDeleteSelection(context: RuleContext): boolean {
|
||||
if (navigation.isNotTrashcan(context) && navigation.isNotLibraries(context) && navigation.isNotSearchResults(context) && hasSelection(context)) {
|
||||
if (navigation.isNotTrashcan(context) && navigation.isNotLibraries(context) && hasSelection(context)) {
|
||||
if (hasLockedFiles(context)) {
|
||||
return false;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user