mirror of
https://github.com/Alfresco/alfresco-content-app.git
synced 2025-07-24 17:31:52 +00:00
[ACS-5645] Property Panel Feature (#3477)
* [ACS-5540] changes for edit aspect button * added aspect edit button * [ACS-5540]fixed unit test cases and added unit test cases * [ACS-5540] Modified changes * [ACS-5540] fixed file lock issue * [ACS-5645]Implemented changes as per review comments * [ACS-5540]Modified the test case title * [ACS-5645] changes for aspect icon * [ACS-5645] fixed aspect lock issue in small screen * [ACS-5540] modified the aspect button changes * [ACS-5540] modified the changes * [ACS-5645] added unit test cases * [ACS-5540] removed unwanted code * [ACS-5540] fixed lock-file bug * [ACS-5540] revert the unwanted changes * [ACS-5540] modified changes * [ACS-5540]Implemented the changes as per the review comments * [ACS-5540] added group lock changes * [ACS-5540] added tooltip * [ACS-5540] Implemented the review comments * [ACS-5540] added tooltips * [ACS-5540] Added styles * [ACS-5540]Added focus * [ACS-5551]updated property panel design * [ACS-5551]added null checks * [ACS-5551] update style * [ACS-5540] changes for edit aspect button * added aspect edit button * [ACS-5540]fixed unit test cases and added unit test cases * [ACS-5540] Modified changes * [ACS-5645]Implemented changes as per review comments * [ACS-5645] changes for aspect icon * [ACS-5540] modified the aspect button changes * [ACS-5540] modified the changes * [ACS-5540] revert the unwanted changes * [ACS-5540] added group lock changes * [ACS-5551]updated property panel design * [ACS-5551]added null checks * [ACS-5551] update style * [ACS-5551] name updated * [ACS-5551] unit test fix * [ACS-5551] header issue fixed * [ACS-5645] style updated * [ACS-5645] border updated * [ACS-6117] fixed aspect dispaly issue * [ACS-5645] different node open issu fixed * [ACS-5645] unit test issue fix * [ACS-5645] unit test fix * [ACS-5645] tabs design modify * [ACS-5645] dependency updated * [link-adf:ACS-564 5-property-panel-feature] test linking * "[link-adf:ACS-5645-property-panel-feature]" * [ACS-5645] revert adf linking changes * add adf configs to libs * fix issue with empty paths * try using adf target * [link-adf:ACS-5645-property-panel-feature] fix core mapping * [link-adf:ACS-5645-property-panel-feature] revert target changes * remove useless styles * remove css hacks * cleanup useless properties * remove useless properties * remove useless code * [ACS-5645] added missing code * [ACS-5654] add icon for full screen * [ACS-5654] nodei con methods moved to thumbnail * [ACS-5654] unit test added and code refactor * [ACS-5645] unit test added * [ACS-5645] panel issue fix * [ACS-5645] removed unit test for editable property * [ACS-5645] removed unused unit test * [ACS-5645] unit test updated * [ACS-5645] updated the unit test * Modified the unit test cases for getNodeIcon * Upsteam ADF-6.6.0-7287333895, Js-api-7.5.0-7287333895 version * Fix failing test cases * Fix failing e2e --------- Co-authored-by: Yasa-Nataliya <yasa.nataliya@globallogic.com> Co-authored-by: pkundu <priyanka.kundu@hyland.com> Co-authored-by: Denys Vuika <denys.vuika@gmail.com> Co-authored-by: rbahirsheth <raviraj.bahirsheth@globallogic.com>
This commit is contained in:
@@ -121,6 +121,28 @@ describe('app.evaluators', () => {
|
||||
});
|
||||
});
|
||||
|
||||
describe('canShowExpand', () => {
|
||||
it('should return false when isLibraries returns true', () => {
|
||||
const context: any = {
|
||||
navigation: {
|
||||
url: '/libraries'
|
||||
}
|
||||
};
|
||||
|
||||
expect(app.canShowExpand(context)).toBe(false);
|
||||
});
|
||||
|
||||
it('should return false when isDetails returns true', () => {
|
||||
const context: any = {
|
||||
navigation: {
|
||||
url: '/details'
|
||||
}
|
||||
};
|
||||
|
||||
expect(app.canShowExpand(context)).toBe(false);
|
||||
});
|
||||
});
|
||||
|
||||
describe('hasLockedFiles', () => {
|
||||
it('should return [false] if selection not present', () => {
|
||||
const context: any = {};
|
||||
@@ -830,6 +852,42 @@ describe('app.evaluators', () => {
|
||||
});
|
||||
});
|
||||
|
||||
describe('editAspects', () => {
|
||||
let context: TestRuleContext;
|
||||
|
||||
beforeEach(() => {
|
||||
context = createTestContext();
|
||||
});
|
||||
|
||||
it('should return true for multiselection', () => {
|
||||
context.selection.count = 2;
|
||||
|
||||
expect(app.editAspects(context)).toBe(true);
|
||||
});
|
||||
|
||||
it('should return false if user cannot update the selected node', () => {
|
||||
context.permissions.check = spyOn(context.permissions, 'check').and.returnValue(false);
|
||||
|
||||
expect(app.editAspects(context)).toBe(false);
|
||||
});
|
||||
|
||||
it('should return false if the selected node is write locked', () => {
|
||||
context.selection.file = { entry: { properties: { 'cm:lockType': 'WRITE_LOCK' } } } as NodeEntry;
|
||||
|
||||
expect(app.editAspects(context)).toBe(false);
|
||||
});
|
||||
|
||||
it('should return false if the context is trashcan', () => {
|
||||
context.navigation = { url: '/trashcan' };
|
||||
|
||||
expect(app.editAspects(context)).toBe(false);
|
||||
});
|
||||
|
||||
it('should return true if all conditions are met', () => {
|
||||
expect(app.editAspects(context)).toBe(true);
|
||||
});
|
||||
});
|
||||
|
||||
describe('canManagePermissions', () => {
|
||||
let context: TestRuleContext;
|
||||
|
||||
|
@@ -498,6 +498,16 @@ export const canEditAspects = (context: RuleContext): boolean =>
|
||||
repository.isMajorVersionAvailable(context, '7')
|
||||
].every(Boolean);
|
||||
|
||||
export const editAspects = (context: RuleContext): boolean =>
|
||||
[
|
||||
canUpdateSelectedNode(context),
|
||||
!isWriteLocked(context),
|
||||
navigation.isNotTrashcan(context),
|
||||
repository.isMajorVersionAvailable(context, '7')
|
||||
].every(Boolean);
|
||||
|
||||
export const canShowExpand = (context: RuleContext): boolean => [!navigation.isLibraries(context), !navigation.isDetails(context)].every(Boolean);
|
||||
|
||||
/**
|
||||
* Checks if user can manage permissions for the selected node.
|
||||
* JSON ref: `canManagePermissions`
|
||||
|
@@ -225,6 +225,28 @@ describe('navigation.evaluators', () => {
|
||||
});
|
||||
});
|
||||
|
||||
describe('isDetails', () => {
|
||||
it('should return true if url includes with `/details`', () => {
|
||||
const context: any = {
|
||||
navigation: {
|
||||
url: '/details/path'
|
||||
}
|
||||
};
|
||||
|
||||
expect(app.isDetails(context)).toBe(true);
|
||||
});
|
||||
|
||||
it('should return false if url not includes with `/details`', () => {
|
||||
const context: any = {
|
||||
navigation: {
|
||||
url: '/path'
|
||||
}
|
||||
};
|
||||
|
||||
expect(app.isDetails(context)).toBe(false);
|
||||
});
|
||||
});
|
||||
|
||||
describe('isRecentFiles', () => {
|
||||
it('should return [true] if url starts with `/recent-files`', () => {
|
||||
const context: any = {
|
||||
|
@@ -110,6 +110,11 @@ export function isLibraryContent(context: RuleContext): boolean {
|
||||
return url?.endsWith('/libraries') || url?.includes('/libraries/') || url?.startsWith('/search-libraries');
|
||||
}
|
||||
|
||||
export function isDetails(context: RuleContext): boolean {
|
||||
const { url } = context.navigation;
|
||||
return url?.includes('/details');
|
||||
}
|
||||
|
||||
/**
|
||||
* Checks if the activated route is neither **Libraries** nor **Library Search Results**.
|
||||
* JSON ref: `app.navigation.isNotLibraries`
|
||||
|
Reference in New Issue
Block a user