[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:
Denys Vuika
2020-10-28 12:25:21 +00:00
committed by GitHub
parent 328cd8ccdc
commit 7c894b250f
15 changed files with 4 additions and 553 deletions

View File

@@ -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({

View File

@@ -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));
}