diff --git a/src/app/app-routing.module.ts b/src/app/app-routing.module.ts index 568cfb0244..f14ba3aed6 100644 --- a/src/app/app-routing.module.ts +++ b/src/app/app-routing.module.ts @@ -32,12 +32,10 @@ import { ReloadGuard } from './core/reload/reload.guard'; import { ServerCheckGuard } from './core/server-check/server-check.guard'; import { ThemedForbiddenComponent } from './forbidden/themed-forbidden.component'; import { ITEM_MODULE_PATH } from './item-page/item-page-routing-paths'; -import { MenuResolver } from './menu.resolver'; import { ThemedPageErrorComponent } from './page-error/themed-page-error.component'; import { ThemedPageInternalServerErrorComponent } from './page-internal-server-error/themed-page-internal-server-error.component'; import { ThemedPageNotFoundComponent } from './pagenotfound/themed-pagenotfound.component'; import { PROCESS_MODULE_PATH } from './process-page/process-page-routing.paths'; -import { MenuProviderService } from './shared/menu/menu-provider.service'; import { resolveStaticMenus } from './shared/menu/menu.resolver'; @NgModule({ diff --git a/src/app/community-page/community-page-routing.module.ts b/src/app/community-page/community-page-routing.module.ts index 493908ce0c..6b71940e2f 100644 --- a/src/app/community-page/community-page-routing.module.ts +++ b/src/app/community-page/community-page-routing.module.ts @@ -4,7 +4,6 @@ import { AuthenticatedGuard } from '../core/auth/authenticated.guard'; import { CommunityBreadcrumbResolver } from '../core/breadcrumbs/community-breadcrumb.resolver'; import { DSOBreadcrumbsService } from '../core/breadcrumbs/dso-breadcrumbs.service'; import { LinkService } from '../core/cache/builders/link.service'; -import { DSOEditMenuResolver } from '../shared/dso-page/dso-edit-menu.resolver'; import { resolveRouteMenus } from '../shared/menu/menu.resolver'; import { SubscribeMenuProvider } from '../shared/menu/providers/comcol-subscribe.menu'; import { DSpaceObjectEditMenuProvider } from '../shared/menu/providers/dso-edit.menu'; diff --git a/src/app/home-page/home-page-routing.module.ts b/src/app/home-page/home-page-routing.module.ts index 92aa86b3da..27721a18f9 100644 --- a/src/app/home-page/home-page-routing.module.ts +++ b/src/app/home-page/home-page-routing.module.ts @@ -1,13 +1,10 @@ import { NgModule } from '@angular/core'; import { RouterModule } from '@angular/router'; -import { MenuProviderService } from '../shared/menu/menu-provider.service'; import { resolveRouteMenus } from '../shared/menu/menu.resolver'; import { StatisticsMenuProvider } from '../shared/menu/providers/statistics.menu'; import { HomePageResolver } from './home-page.resolver'; -import { LinkMenuItemModel } from '../shared/menu/menu-item/models/link.model'; import { ThemedHomePageComponent } from './themed-home-page.component'; -import { MenuItemType } from '../shared/menu/menu-item-type.model'; @NgModule({ imports: [ diff --git a/src/app/shared/dso-page/dso-edit-menu/dso-edit-menu-section/dso-edit-menu-section.component.spec.ts b/src/app/shared/dso-page/dso-edit-menu/dso-edit-menu-section/dso-edit-menu-section.component.spec.ts index f0815c5415..bfd881aea2 100644 --- a/src/app/shared/dso-page/dso-edit-menu/dso-edit-menu-section/dso-edit-menu-section.component.spec.ts +++ b/src/app/shared/dso-page/dso-edit-menu/dso-edit-menu-section/dso-edit-menu-section.component.spec.ts @@ -127,17 +127,17 @@ describe('DsoEditMenuSectionComponent', () => { stopPropagation: jasmine.createSpy('stopPropagation'), }); it('should call the item model function when not disabled', () => { - spyOn(component.section.model as OnClickMenuItemModel, 'function'); + spyOn((component as any).section.model as OnClickMenuItemModel, 'function'); component.activate(mockEvent); - expect((component.section.model as OnClickMenuItemModel).function).toHaveBeenCalled(); + expect(((component as any).section.model as OnClickMenuItemModel).function).toHaveBeenCalled(); }); it('should call not the item model function when disabled', () => { - spyOn(component.section.model as OnClickMenuItemModel, 'function'); + spyOn((component as any).section.model as OnClickMenuItemModel, 'function'); component.itemModel.disabled = true; component.activate(mockEvent); - expect((component.section.model as OnClickMenuItemModel).function).not.toHaveBeenCalled(); + expect(((component as any).section.model as OnClickMenuItemModel).function).not.toHaveBeenCalled(); component.itemModel.disabled = false; }); }); diff --git a/src/app/shared/dso-page/dso-edit-menu/dso-edit-menu.component.spec.ts b/src/app/shared/dso-page/dso-edit-menu/dso-edit-menu.component.spec.ts index 5616e8ea10..2aaf5a6b03 100644 --- a/src/app/shared/dso-page/dso-edit-menu/dso-edit-menu.component.spec.ts +++ b/src/app/shared/dso-page/dso-edit-menu/dso-edit-menu.component.spec.ts @@ -10,12 +10,12 @@ import { AuthorizationDataService } from '../../../core/data/feature-authorizati import { AuthService } from '../../../core/auth/auth.service'; import { AuthServiceStub } from '../../testing/auth-service.stub'; import { MenuService } from '../../menu/menu.service'; -import { MenuItemModel } from '../../menu/menu-item/models/menu-item.model'; import { ThemeService } from '../../theme-support/theme.service'; import { getMockThemeService } from '../../mocks/theme-service.mock'; import { DsoPageModule } from '../dso-page.module'; +import { TextMenuItemModel } from '../../menu/menu-item/models/text.model'; describe('DsoEditMenuComponent', () => { let comp: DsoEditMenuComponent; @@ -34,7 +34,8 @@ describe('DsoEditMenuComponent', () => { model: { type: null, disabled: false, - } as MenuItemModel, + text: 'dummy-text' + } as TextMenuItemModel, icon: 'pencil-alt', index: 1 }; diff --git a/src/app/shared/menu/menu-section/menu-section.component.spec.ts b/src/app/shared/menu/menu-section/menu-section.component.spec.ts index 8949c6c1b0..9f2deae0e9 100644 --- a/src/app/shared/menu/menu-section/menu-section.component.spec.ts +++ b/src/app/shared/menu/menu-section/menu-section.component.spec.ts @@ -1,6 +1,5 @@ import { ComponentFixture, TestBed, waitForAsync } from '@angular/core/testing'; import { NoopAnimationsModule } from '@angular/platform-browser/animations'; -import { Router } from '@angular/router'; import { TranslateModule } from '@ngx-translate/core'; import { ChangeDetectionStrategy, diff --git a/src/app/shared/menu/menu.component.spec.ts b/src/app/shared/menu/menu.component.spec.ts index f0660fab4a..f7cf0c9528 100644 --- a/src/app/shared/menu/menu.component.spec.ts +++ b/src/app/shared/menu/menu.component.spec.ts @@ -8,7 +8,6 @@ import { MenuServiceStub } from '../testing/menu-service.stub'; import { of as observableOf } from 'rxjs'; import { Router, ActivatedRoute } from '@angular/router'; import { RouterTestingModule } from '@angular/router/testing'; -import { MenuSection } from './menu-section.model'; import { MenuID } from './menu-id.model'; import { Item } from '../../core/shared/item.model'; import { AuthorizationDataService } from '../../core/data/feature-authorization/authorization-data.service'; @@ -76,7 +75,7 @@ describe('MenuComponent', () => { comp.menuID = mockMenuID; menuService = (comp as any).menuService; router = TestBed.inject(Router); - spyOn(comp as any, 'getSectionDataInjector').and.returnValue(MenuSection); + // spyOn(comp as any, 'getSectionDataInjector').and.returnValue(MenuSection); spyOn(comp as any, 'getSectionComponent').and.returnValue(observableOf({})); fixture.detectChanges(); });