From ea928378f8819fb70dea60b9fbc2fa2c03d5f177 Mon Sep 17 00:00:00 2001 From: Zahraa Chreim Date: Fri, 10 May 2024 17:13:34 +0300 Subject: [PATCH] 114858: Fix Lint Errors --- src/app/access-control/access-control-routes.ts | 9 ++------- .../admin-notify-dashboard-routes.ts | 9 ++------- src/app/app-routes.ts | 8 ++------ .../bitstream-page-authorizations.guard.spec.ts | 5 ++--- src/app/bitstream-page/bitstream-page-routes.ts | 2 +- .../item-page/edit-item-page/edit-item-page-routes.ts | 8 ++++---- 6 files changed, 13 insertions(+), 28 deletions(-) diff --git a/src/app/access-control/access-control-routes.ts b/src/app/access-control/access-control-routes.ts index ef36a19052c..cb8c4521171 100644 --- a/src/app/access-control/access-control-routes.ts +++ b/src/app/access-control/access-control-routes.ts @@ -1,14 +1,12 @@ import { AbstractControl } from '@angular/forms'; -import { - mapToCanActivate, - Route, -} from '@angular/router'; +import { Route } from '@angular/router'; import { DYNAMIC_ERROR_MESSAGES_MATCHER, DynamicErrorMessagesMatcher, } from '@ng-dynamic-forms/core'; import { i18nBreadcrumbResolver } from '../core/breadcrumbs/i18n-breadcrumb.resolver'; +import { siteAdministratorGuard } from '../core/data/feature-authorization/feature-authorization-guard/site-administrator.guard'; import { EPERSON_PATH, GROUP_PATH, @@ -19,9 +17,6 @@ import { EPersonFormComponent } from './epeople-registry/eperson-form/eperson-fo import { EPersonResolver } from './epeople-registry/eperson-resolver.service'; import { GroupFormComponent } from './group-registry/group-form/group-form.component'; import { GroupsRegistryComponent } from './group-registry/groups-registry.component'; -import { - siteAdministratorGuard -} from '../core/data/feature-authorization/feature-authorization-guard/site-administrator.guard'; /** * Condition for displaying error messages on email form field diff --git a/src/app/admin/admin-notify-dashboard/admin-notify-dashboard-routes.ts b/src/app/admin/admin-notify-dashboard/admin-notify-dashboard-routes.ts index b1fd827ba80..0316913cf62 100644 --- a/src/app/admin/admin-notify-dashboard/admin-notify-dashboard-routes.ts +++ b/src/app/admin/admin-notify-dashboard/admin-notify-dashboard-routes.ts @@ -1,16 +1,11 @@ -import { - mapToCanActivate, - Route, -} from '@angular/router'; +import { Route } from '@angular/router'; import { i18nBreadcrumbResolver } from '../../core/breadcrumbs/i18n-breadcrumb.resolver'; import { notifyInfoGuard } from '../../core/coar-notify/notify-info/notify-info.guard'; +import { siteAdministratorGuard } from '../../core/data/feature-authorization/feature-authorization-guard/site-administrator.guard'; import { AdminNotifyDashboardComponent } from './admin-notify-dashboard.component'; import { AdminNotifyIncomingComponent } from './admin-notify-logs/admin-notify-incoming/admin-notify-incoming.component'; import { AdminNotifyOutgoingComponent } from './admin-notify-logs/admin-notify-outgoing/admin-notify-outgoing.component'; -import { - siteAdministratorGuard -} from '../../core/data/feature-authorization/feature-authorization-guard/site-administrator.guard'; export const ROUTES: Route[] = [ { diff --git a/src/app/app-routes.ts b/src/app/app-routes.ts index f54d01301bd..9f9dae2b6bc 100644 --- a/src/app/app-routes.ts +++ b/src/app/app-routes.ts @@ -26,6 +26,8 @@ import { COLLECTION_MODULE_PATH } from './collection-page/collection-page-routin import { COMMUNITY_MODULE_PATH } from './community-page/community-page-routing-paths'; import { authBlockingGuard } from './core/auth/auth-blocking.guard'; import { authenticatedGuard } from './core/auth/authenticated.guard'; +import { groupAdministratorGuard } from './core/data/feature-authorization/feature-authorization-guard/group-administrator.guard'; +import { siteAdministratorGuard } from './core/data/feature-authorization/feature-authorization-guard/site-administrator.guard'; import { siteRegisterGuard } from './core/data/feature-authorization/feature-authorization-guard/site-register.guard'; import { EndUserAgreementCurrentUserGuard } from './core/end-user-agreement/end-user-agreement-current-user.guard'; import { reloadGuard } from './core/reload/reload.guard'; @@ -41,12 +43,6 @@ import { ThemedPageNotFoundComponent } from './pagenotfound/themed-pagenotfound. import { PROCESS_MODULE_PATH } from './process-page/process-page-routing.paths'; import { provideSubmissionState } from './submission/provide-submission-state'; import { SUGGESTION_MODULE_PATH } from './suggestions-page/suggestions-page-routing-paths'; -import { - siteAdministratorGuard -} from './core/data/feature-authorization/feature-authorization-guard/site-administrator.guard'; -import { - groupAdministratorGuard -} from './core/data/feature-authorization/feature-authorization-guard/group-administrator.guard'; export const APP_ROUTES: Route[] = [ { path: INTERNAL_SERVER_ERROR, component: ThemedPageInternalServerErrorComponent }, diff --git a/src/app/bitstream-page/bitstream-page-authorizations.guard.spec.ts b/src/app/bitstream-page/bitstream-page-authorizations.guard.spec.ts index 36760db787a..9b4d019058e 100644 --- a/src/app/bitstream-page/bitstream-page-authorizations.guard.spec.ts +++ b/src/app/bitstream-page/bitstream-page-authorizations.guard.spec.ts @@ -3,8 +3,6 @@ import { Router, UrlTree, } from '@angular/router'; -import { Store } from '@ngrx/store'; -import { TranslateService } from '@ngx-translate/core'; import { Observable, of as observableOf, @@ -12,10 +10,11 @@ import { import { AuthService } from 'src/app/core/auth/auth.service'; import { AuthorizationDataService } from 'src/app/core/data/feature-authorization/authorization-data.service'; import { FeatureID } from 'src/app/core/data/feature-authorization/feature-id'; -import { bitstreamPageAuthorizationsGuard } from './bitstream-page-authorizations.guard'; + import { BitstreamDataService } from '../core/data/bitstream-data.service'; import { Bitstream } from '../core/shared/bitstream.model'; import { createSuccessfulRemoteDataObject$ } from '../shared/remote-data.utils'; +import { bitstreamPageAuthorizationsGuard } from './bitstream-page-authorizations.guard'; describe('bitstreamPageAuthorizationsGuard', () => { let authorizationService: AuthorizationDataService; diff --git a/src/app/bitstream-page/bitstream-page-routes.ts b/src/app/bitstream-page/bitstream-page-routes.ts index 9312e01de7d..8b0d9d3322c 100644 --- a/src/app/bitstream-page/bitstream-page-routes.ts +++ b/src/app/bitstream-page/bitstream-page-routes.ts @@ -10,9 +10,9 @@ import { resourcePolicyTargetResolver } from '../shared/resource-policies/resolv import { BitstreamAuthorizationsComponent } from './bitstream-authorizations/bitstream-authorizations.component'; import { BitstreamDownloadPageComponent } from './bitstream-download-page/bitstream-download-page.component'; import { bitstreamPageResolver } from './bitstream-page.resolver'; +import { bitstreamPageAuthorizationsGuard } from './bitstream-page-authorizations.guard'; import { ThemedEditBitstreamPageComponent } from './edit-bitstream-page/themed-edit-bitstream-page.component'; import { legacyBitstreamUrlResolver } from './legacy-bitstream-url.resolver'; -import { bitstreamPageAuthorizationsGuard } from './bitstream-page-authorizations.guard'; const EDIT_BITSTREAM_PATH = ':id/edit'; const EDIT_BITSTREAM_AUTHORIZATIONS_PATH = ':id/authorizations'; diff --git a/src/app/item-page/edit-item-page/edit-item-page-routes.ts b/src/app/item-page/edit-item-page/edit-item-page-routes.ts index fd6edb7ed0b..a7189f98881 100644 --- a/src/app/item-page/edit-item-page/edit-item-page-routes.ts +++ b/src/app/item-page/edit-item-page/edit-item-page-routes.ts @@ -28,7 +28,11 @@ import { itemPageAccessControlGuard } from './item-page-access-control.guard'; import { itemPageBitstreamsGuard } from './item-page-bitstreams.guard'; import { itemPageCollectionMapperGuard } from './item-page-collection-mapper.guard'; import { itemPageCurateGuard } from './item-page-curate.guard'; +import { itemPageDeleteGuard } from './item-page-delete.guard'; +import { itemPageEditAuthorizationsGuard } from './item-page-edit-authorizations.guard'; import { itemPageMetadataGuard } from './item-page-metadata.guard'; +import { itemPageMoveGuard } from './item-page-move.guard'; +import { itemPagePrivateGuard } from './item-page-private.guard'; import { itemPageRegisterDoiGuard } from './item-page-register-doi.guard'; import { itemPageReinstateGuard } from './item-page-reinstate.guard'; import { itemPageRelationshipsGuard } from './item-page-relationships.guard'; @@ -43,10 +47,6 @@ import { ItemRelationshipsComponent } from './item-relationships/item-relationsh import { ThemedItemStatusComponent } from './item-status/themed-item-status.component'; import { ItemVersionHistoryComponent } from './item-version-history/item-version-history.component'; import { ItemWithdrawComponent } from './item-withdraw/item-withdraw.component'; -import { itemPageEditAuthorizationsGuard } from './item-page-edit-authorizations.guard'; -import { itemPagePrivateGuard } from './item-page-private.guard'; -import { itemPageMoveGuard } from './item-page-move.guard'; -import { itemPageDeleteGuard } from './item-page-delete.guard'; /** * Routing module that handles the routing for the Edit Item page administrator functionality