mirror of
https://github.com/DSpace/dspace-angular.git
synced 2025-10-07 10:04:11 +00:00
97183 Fixed linting issues
This commit is contained in:
@@ -275,7 +275,7 @@ export class MenuResolver implements Resolve<boolean> {
|
|||||||
} as TextMenuItemModel,
|
} as TextMenuItemModel,
|
||||||
icon: 'plus',
|
icon: 'plus',
|
||||||
index: 0
|
index: 0
|
||||||
}
|
};
|
||||||
const editSubMenu = {
|
const editSubMenu = {
|
||||||
id: 'edit',
|
id: 'edit',
|
||||||
active: false,
|
active: false,
|
||||||
@@ -286,7 +286,7 @@ export class MenuResolver implements Resolve<boolean> {
|
|||||||
} as TextMenuItemModel,
|
} as TextMenuItemModel,
|
||||||
icon: 'pencil-alt',
|
icon: 'pencil-alt',
|
||||||
index: 1
|
index: 1
|
||||||
}
|
};
|
||||||
|
|
||||||
const menuList = [
|
const menuList = [
|
||||||
...newSubMenuList,
|
...newSubMenuList,
|
||||||
|
@@ -245,7 +245,7 @@ describe('MenuService', () => {
|
|||||||
|
|
||||||
describe('isMenuVisibleWithVisibleSections', () => {
|
describe('isMenuVisibleWithVisibleSections', () => {
|
||||||
it('should return false when the menu is empty', () => {
|
it('should return false when the menu is empty', () => {
|
||||||
const fakeMenu = {
|
const testMenu = {
|
||||||
id: MenuID.ADMIN,
|
id: MenuID.ADMIN,
|
||||||
collapsed: false,
|
collapsed: false,
|
||||||
visible: true,
|
visible: true,
|
||||||
@@ -253,7 +253,7 @@ describe('MenuService', () => {
|
|||||||
previewCollapsed: false,
|
previewCollapsed: false,
|
||||||
sectionToSubsectionIndex: {}
|
sectionToSubsectionIndex: {}
|
||||||
} as any;
|
} as any;
|
||||||
spyOn(service, 'getMenu').and.returnValue(observableOf(fakeMenu));
|
spyOn(service, 'getMenu').and.returnValue(observableOf(testMenu));
|
||||||
|
|
||||||
const result = service.isMenuVisibleWithVisibleSections(MenuID.ADMIN);
|
const result = service.isMenuVisibleWithVisibleSections(MenuID.ADMIN);
|
||||||
const expected = cold('(b|)', {
|
const expected = cold('(b|)', {
|
||||||
@@ -269,8 +269,8 @@ describe('MenuService', () => {
|
|||||||
section_3: {id: 's3', visible: false},
|
section_3: {id: 's3', visible: false},
|
||||||
section_4: {id: 's1_1', visible: true, parentID: 's1'},
|
section_4: {id: 's1_1', visible: true, parentID: 's1'},
|
||||||
section_5: {id: 's2_1', visible: true, parentID: 's2'},
|
section_5: {id: 's2_1', visible: true, parentID: 's2'},
|
||||||
}
|
};
|
||||||
const fakeMenu = {
|
const testMenu = {
|
||||||
id: MenuID.ADMIN,
|
id: MenuID.ADMIN,
|
||||||
collapsed: false,
|
collapsed: false,
|
||||||
visible: true,
|
visible: true,
|
||||||
@@ -281,7 +281,7 @@ describe('MenuService', () => {
|
|||||||
'section_2': ['section_5'],
|
'section_2': ['section_5'],
|
||||||
}
|
}
|
||||||
} as any;
|
} as any;
|
||||||
spyOn(service, 'getMenu').and.returnValue(observableOf(fakeMenu));
|
spyOn(service, 'getMenu').and.returnValue(observableOf(testMenu));
|
||||||
|
|
||||||
const result = service.isMenuVisibleWithVisibleSections(MenuID.ADMIN);
|
const result = service.isMenuVisibleWithVisibleSections(MenuID.ADMIN);
|
||||||
const expected = cold('(b|)', {
|
const expected = cold('(b|)', {
|
||||||
@@ -298,8 +298,8 @@ describe('MenuService', () => {
|
|||||||
section_3: {id: 's3', visible: false},
|
section_3: {id: 's3', visible: false},
|
||||||
section_4: {id: 's1_1', visible: true, parentID: 's1'},
|
section_4: {id: 's1_1', visible: true, parentID: 's1'},
|
||||||
section_5: {id: 's2_1', visible: true, parentID: 's2'},
|
section_5: {id: 's2_1', visible: true, parentID: 's2'},
|
||||||
}
|
};
|
||||||
const fakeMenu = {
|
const testMenu = {
|
||||||
id: MenuID.ADMIN,
|
id: MenuID.ADMIN,
|
||||||
collapsed: false,
|
collapsed: false,
|
||||||
visible: true,
|
visible: true,
|
||||||
@@ -310,7 +310,7 @@ describe('MenuService', () => {
|
|||||||
'section_2': ['section_5'],
|
'section_2': ['section_5'],
|
||||||
}
|
}
|
||||||
} as any;
|
} as any;
|
||||||
spyOn(service, 'getMenu').and.returnValue(observableOf(fakeMenu));
|
spyOn(service, 'getMenu').and.returnValue(observableOf(testMenu));
|
||||||
|
|
||||||
const result = service.isMenuVisibleWithVisibleSections(MenuID.ADMIN);
|
const result = service.isMenuVisibleWithVisibleSections(MenuID.ADMIN);
|
||||||
const expected = cold('(b|)', {
|
const expected = cold('(b|)', {
|
||||||
|
@@ -208,7 +208,7 @@ export class MenuService {
|
|||||||
* Check if a menu has at least one top-level (!) section that is visible.
|
* Check if a menu has at least one top-level (!) section that is visible.
|
||||||
* @param {MenuID} menuID The ID of the menu that is to be checked
|
* @param {MenuID} menuID The ID of the menu that is to be checked
|
||||||
* @returns {Observable<boolean>} Emits true if the given menu has visible sections, emits false otherwise
|
* @returns {Observable<boolean>} Emits true if the given menu has visible sections, emits false otherwise
|
||||||
*/
|
*/
|
||||||
menuHasVisibleSections(menuID: MenuID): Observable<boolean> {
|
menuHasVisibleSections(menuID: MenuID): Observable<boolean> {
|
||||||
return this.getMenu(menuID).pipe(
|
return this.getMenu(menuID).pipe(
|
||||||
map((state: MenuState) => hasValue(state)
|
map((state: MenuState) => hasValue(state)
|
||||||
|
Reference in New Issue
Block a user