mirror of
https://github.com/Alfresco/alfresco-content-app.git
synced 2025-07-24 17:31:52 +00:00
[AAE-8201] - Add a way to hide libraries and secondary navbar sections (#2492)
* [AAE-8201] - Add a way to hide libraries and secondary navbar sections * Add new variable * Rename variable for toggling content service sections * Fix lint errors * Remove unnecessary or condition
This commit is contained in:
@@ -530,4 +530,21 @@ describe('app.evaluators', () => {
|
||||
expect(app.isLibraryManager(context)).toBe(false);
|
||||
});
|
||||
});
|
||||
|
||||
describe('isContentServiceEnabled', () => {
|
||||
it('should return true when local storage has contentService set to true', () => {
|
||||
localStorage.setItem('contentService', 'true');
|
||||
expect(app.isContentServiceEnabled()).toBe(true);
|
||||
});
|
||||
|
||||
it('should return false when local storage has contentService set to false', () => {
|
||||
localStorage.setItem('contentService', 'false');
|
||||
expect(app.isContentServiceEnabled()).toBe(false);
|
||||
});
|
||||
|
||||
it('should return true when contentService is not defined in local storage', () => {
|
||||
localStorage.clear();
|
||||
expect(app.isContentServiceEnabled()).toBe(true);
|
||||
});
|
||||
});
|
||||
});
|
||||
|
@@ -32,6 +32,12 @@ export interface AcaRuleContext extends RuleContext {
|
||||
withCredentials: boolean;
|
||||
}
|
||||
|
||||
/**
|
||||
* Checks if the content plugin is enabled.
|
||||
* JSON ref: `app.isContentServiceEnabled`
|
||||
*/
|
||||
export const isContentServiceEnabled = (): boolean => localStorage && localStorage.getItem('contentService') !== 'false';
|
||||
|
||||
/**
|
||||
* Checks if user can copy selected node.
|
||||
* JSON ref: `app.canCopyNode`
|
||||
|
Reference in New Issue
Block a user