[ACS-6278] - disable manage rules for smart folders (#3518)

This commit is contained in:
DominikIwanek
2023-11-14 12:08:07 +01:00
committed by GitHub
parent c9e0f7abe6
commit 57ac20a8c5
4 changed files with 14 additions and 13 deletions

View File

@@ -23,9 +23,9 @@
*/
import * as app from './app.rules';
import { getFileExtension } from './app.rules';
import { TestRuleContext } from './test-rule-context';
import { NodeEntry, RepositoryInfo } from '@alfresco/js-api';
import { getFileExtension } from './app.rules';
describe('app.evaluators', () => {
describe('getFileExtension', () => {
@@ -825,12 +825,6 @@ describe('app.evaluators', () => {
expect(app.canEditAspects(context)).toBe(false);
});
it('should return false if the selected node is a smart folder', () => {
context.selection.first = { entry: { aspectNames: ['smf:customConfigSmartFolder'], isFolder: true } } as NodeEntry;
expect(app.canEditAspects(context)).toBe(false);
});
it('should return true if all conditions are met', () => {
expect(app.canEditAspects(context)).toBe(true);
});

View File

@@ -495,8 +495,7 @@ export const canEditAspects = (context: RuleContext): boolean =>
canUpdateSelectedNode(context),
!isWriteLocked(context),
navigation.isNotTrashcan(context),
repository.isMajorVersionAvailable(context, '7'),
!isSmartFolder(context)
repository.isMajorVersionAvailable(context, '7')
].every(Boolean);
/**
@@ -626,7 +625,7 @@ export function canOpenWithOffice(context: AcaRuleContext): boolean {
return context.permissions.check(file, ['update']);
}
function isSmartFolder(context: RuleContext): boolean {
export function isSmartFolder(context: RuleContext): boolean {
if (!context.selection?.isEmpty) {
const node = context.selection.first;
if (!node?.entry.isFolder) {