mirror of
https://github.com/Alfresco/alfresco-content-app.git
synced 2025-07-24 17:31:52 +00:00
[ACS-6278] - disable manage rules for smart folders (#3518)
This commit is contained in:
@@ -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);
|
||||
});
|
||||
|
@@ -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) {
|
||||
|
Reference in New Issue
Block a user