mirror of
https://github.com/Alfresco/alfresco-content-app.git
synced 2025-07-24 17:31:52 +00:00
[ACA-4100] use ADF user info component (#1762)
* use adf user info * delete old unit test * remove e2e * fix lint
This commit is contained in:
@@ -721,68 +721,6 @@ describe('AppExtensionService', () => {
|
||||
});
|
||||
});
|
||||
|
||||
describe('userActions', () => {
|
||||
it('should load user actions from the config', () => {
|
||||
applyConfig({
|
||||
$id: 'test',
|
||||
$name: 'test',
|
||||
$version: '1.0.0',
|
||||
$license: 'MIT',
|
||||
$vendor: 'Good company',
|
||||
$runtime: '1.5.0',
|
||||
features: {
|
||||
userActions: [
|
||||
{
|
||||
id: 'aca:toolbar/separator-1',
|
||||
order: 1,
|
||||
type: ContentActionType.separator,
|
||||
title: 'action1'
|
||||
},
|
||||
{
|
||||
id: 'aca:toolbar/separator-2',
|
||||
order: 2,
|
||||
type: ContentActionType.separator,
|
||||
title: 'action2'
|
||||
}
|
||||
]
|
||||
}
|
||||
});
|
||||
|
||||
expect(service.userActions.length).toBe(2);
|
||||
});
|
||||
|
||||
it('should sort user actions by order', () => {
|
||||
applyConfig({
|
||||
$id: 'test',
|
||||
$name: 'test',
|
||||
$version: '1.0.0',
|
||||
$license: 'MIT',
|
||||
$vendor: 'Good company',
|
||||
$runtime: '1.5.0',
|
||||
features: {
|
||||
userActions: [
|
||||
{
|
||||
id: 'aca:toolbar/action-2',
|
||||
order: 2,
|
||||
type: ContentActionType.button,
|
||||
title: 'action2'
|
||||
},
|
||||
{
|
||||
id: 'aca:toolbar/action-1',
|
||||
order: 1,
|
||||
type: ContentActionType.button,
|
||||
title: 'action1'
|
||||
}
|
||||
]
|
||||
}
|
||||
});
|
||||
|
||||
const actions = service.getUserActions();
|
||||
expect(actions[0].id).toBe('aca:toolbar/action-1');
|
||||
expect(actions[1].id).toBe('aca:toolbar/action-2');
|
||||
});
|
||||
});
|
||||
|
||||
describe('getHeaderActions', () => {
|
||||
it('should load user actions from the config', () => {
|
||||
applyConfig({
|
||||
|
@@ -74,7 +74,6 @@ export class AppExtensionService implements RuleContext {
|
||||
sidebarActions: Array<ContentActionRef> = [];
|
||||
contentMetadata: any;
|
||||
viewerRules: ViewerRules = {};
|
||||
userActions: Array<ContentActionRef> = [];
|
||||
settingGroups: Array<SettingsGroupRef> = [];
|
||||
|
||||
documentListPresets: {
|
||||
@@ -150,7 +149,6 @@ export class AppExtensionService implements RuleContext {
|
||||
this.createActions = this.loader.getElements<ContentActionRef>(config, 'features.create');
|
||||
this.navbar = this.loadNavBar(config);
|
||||
this.sidebarTabs = this.loader.getElements<SidebarTabRef>(config, 'features.sidebar.tabs');
|
||||
this.userActions = this.loader.getContentActions(config, 'features.userActions');
|
||||
this.contentMetadata = this.loadContentMetadata(config);
|
||||
|
||||
this.documentListPresets = {
|
||||
@@ -416,10 +414,6 @@ export class AppExtensionService implements RuleContext {
|
||||
return this.getAllowedActions(this.contextMenuActions);
|
||||
}
|
||||
|
||||
getUserActions(): Array<ContentActionRef> {
|
||||
return this.userActions.filter((action) => this.filterVisible(action)).sort(sortByOrder);
|
||||
}
|
||||
|
||||
getSettingsGroups(): Array<SettingsGroupRef> {
|
||||
return this.settingGroups.filter((group) => this.filterVisible(group));
|
||||
}
|
||||
|
Reference in New Issue
Block a user