[DURACOM-234] rename guards in order to be complaint to function name convention

This commit is contained in:
Giuseppe Digilio
2024-04-03 18:57:11 +02:00
parent f1686d5499
commit 35714b7a45
43 changed files with 119 additions and 119 deletions

View File

@@ -1,6 +1,6 @@
import { Route } from '@angular/router';
import { AuthenticatedGuard } from '../../core/auth/authenticated.guard';
import { authenticatedGuard } from '../../core/auth/authenticated.guard';
import { i18nBreadcrumbResolver } from '../../core/breadcrumbs/i18n-breadcrumb.resolver';
import { qualityAssuranceBreadcrumbResolver } from '../../core/breadcrumbs/quality-assurance-breadcrumb.resolver';
import { AdminNotificationsPublicationClaimPageResolver } from '../../quality-assurance-notifications-pages/notifications-suggestion-targets-page/notifications-suggestion-targets-page-resolver.service';
@@ -19,7 +19,7 @@ import {
export const ROUTES: Route[] = [
{
canActivate: [ AuthenticatedGuard ],
canActivate: [ authenticatedGuard ],
path: `${PUBLICATION_CLAIMS_PATH}`,
component: AdminNotificationsPublicationClaimPageComponent,
pathMatch: 'full',
@@ -34,7 +34,7 @@ export const ROUTES: Route[] = [
},
},
{
canActivate: [AuthenticatedGuard],
canActivate: [authenticatedGuard],
path: `${QUALITY_ASSURANCE_EDIT_PATH}/:sourceId`,
component: QualityAssuranceTopicsPageComponent,
pathMatch: 'full',
@@ -49,7 +49,7 @@ export const ROUTES: Route[] = [
},
},
{
canActivate: [ AuthenticatedGuard ],
canActivate: [ authenticatedGuard ],
path: `${QUALITY_ASSURANCE_EDIT_PATH}/:sourceId/target/:targetId`,
component: QualityAssuranceTopicsPageComponent,
pathMatch: 'full',
@@ -64,7 +64,7 @@ export const ROUTES: Route[] = [
},
},
{
canActivate: [AuthenticatedGuard],
canActivate: [authenticatedGuard],
path: `${QUALITY_ASSURANCE_EDIT_PATH}`,
component: QualityAssuranceSourcePageComponent,
pathMatch: 'full',
@@ -80,7 +80,7 @@ export const ROUTES: Route[] = [
},
},
{
canActivate: [AuthenticatedGuard],
canActivate: [authenticatedGuard],
path: `${QUALITY_ASSURANCE_EDIT_PATH}/:sourceId/:topicId`,
component: QualityAssuranceEventsPageComponent,
pathMatch: 'full',

View File

@@ -4,7 +4,7 @@ import {
} from '@angular/router';
import { i18nBreadcrumbResolver } from '../../core/breadcrumbs/i18n-breadcrumb.resolver';
import { NotifyInfoGuard } from '../../core/coar-notify/notify-info/notify-info.guard';
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';
@@ -12,7 +12,7 @@ import { AdminNotifyOutgoingComponent } from './admin-notify-logs/admin-notify-o
export const ROUTES: Route[] = [
{
canActivate: [...mapToCanActivate([SiteAdministratorGuard]), NotifyInfoGuard],
canActivate: [...mapToCanActivate([SiteAdministratorGuard]), notifyInfoGuard],
path: '',
resolve: {
breadcrumb: i18nBreadcrumbResolver,
@@ -30,7 +30,7 @@ export const ROUTES: Route[] = [
breadcrumb: i18nBreadcrumbResolver,
},
component: AdminNotifyIncomingComponent,
canActivate: [...mapToCanActivate([SiteAdministratorGuard]), NotifyInfoGuard],
canActivate: [...mapToCanActivate([SiteAdministratorGuard]), notifyInfoGuard],
data: {
title: 'admin.notify.dashboard.page.title',
breadcrumbKey: 'admin.notify.dashboard',
@@ -42,7 +42,7 @@ export const ROUTES: Route[] = [
breadcrumb: i18nBreadcrumbResolver,
},
component: AdminNotifyOutgoingComponent,
canActivate: [...mapToCanActivate([SiteAdministratorGuard]), NotifyInfoGuard],
canActivate: [...mapToCanActivate([SiteAdministratorGuard]), notifyInfoGuard],
data: {
title: 'admin.notify.dashboard.page.title',
breadcrumbKey: 'admin.notify.dashboard',

View File

@@ -24,13 +24,13 @@ import {
} from './app-routing-paths';
import { COLLECTION_MODULE_PATH } from './collection-page/collection-page-routing-paths';
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 { 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';
import { reloadGuard } from './core/reload/reload.guard';
import { ForgotPasswordCheckGuard } from './core/rest-property/forgot-password-check-guard.guard';
import { ServerCheckGuard } from './core/server-check/server-check.guard';
import { ThemedForbiddenComponent } from './forbidden/themed-forbidden.component';
@@ -49,7 +49,7 @@ export const APP_ROUTES: Route[] = [
{ path: ERROR_PAGE, component: ThemedPageErrorComponent },
{
path: '',
canActivate: [AuthBlockingGuard],
canActivate: [authBlockingGuard],
canActivateChild: [ServerCheckGuard],
resolve: [menuResolver],
children: [
@@ -58,7 +58,7 @@ export const APP_ROUTES: Route[] = [
path: 'reload/:rnd',
component: ThemedPageNotFoundComponent,
pathMatch: 'full',
canActivate: [ReloadGuard],
canActivate: [reloadGuard],
},
{
path: 'home',
@@ -139,7 +139,7 @@ export const APP_ROUTES: Route[] = [
loadChildren: () => import('./my-dspace-page/my-dspace-page-routes')
.then((m) => m.ROUTES),
providers: [provideSuggestionNotificationsState()],
canActivate: [AuthenticatedGuard, ...mapToCanActivate([EndUserAgreementCurrentUserGuard])],
canActivate: [authenticatedGuard, ...mapToCanActivate([EndUserAgreementCurrentUserGuard])],
},
{
path: 'search',
@@ -164,7 +164,7 @@ export const APP_ROUTES: Route[] = [
loadChildren: () => import('./quality-assurance-notifications-pages/notifications-pages-routes')
.then((m) => m.ROUTES),
providers: [provideSuggestionNotificationsState()],
canActivate: [AuthenticatedGuard, ...mapToCanActivate([EndUserAgreementCurrentUserGuard])],
canActivate: [authenticatedGuard, ...mapToCanActivate([EndUserAgreementCurrentUserGuard])],
},
{
path: 'login',
@@ -208,20 +208,20 @@ export const APP_ROUTES: Route[] = [
loadChildren: () => import('./profile-page/profile-page-routes')
.then((m) => m.ROUTES),
providers: [provideSuggestionNotificationsState()],
canActivate: [AuthenticatedGuard, ...mapToCanActivate([EndUserAgreementCurrentUserGuard])],
canActivate: [authenticatedGuard, ...mapToCanActivate([EndUserAgreementCurrentUserGuard])],
},
{
path: PROCESS_MODULE_PATH,
loadChildren: () => import('./process-page/process-page-routes')
.then((m) => m.ROUTES),
canActivate: [AuthenticatedGuard, ...mapToCanActivate([EndUserAgreementCurrentUserGuard])],
canActivate: [authenticatedGuard, ...mapToCanActivate([EndUserAgreementCurrentUserGuard])],
},
{
path: SUGGESTION_MODULE_PATH,
loadChildren: () => import('./suggestions-page/suggestions-page-routes')
.then((m) => m.ROUTES),
providers: [provideSuggestionNotificationsState()],
canActivate: [AuthenticatedGuard, ...mapToCanActivate([EndUserAgreementCurrentUserGuard])],
canActivate: [authenticatedGuard, ...mapToCanActivate([EndUserAgreementCurrentUserGuard])],
},
{
path: INFO_MODULE_PATH,
@@ -256,7 +256,7 @@ export const APP_ROUTES: Route[] = [
path: 'subscriptions',
loadChildren: () => import('./subscriptions-page/subscriptions-page-routes')
.then((m) => m.ROUTES),
canActivate: [AuthenticatedGuard],
canActivate: [authenticatedGuard],
},
{ path: '**', pathMatch: 'full', component: ThemedPageNotFoundComponent },
],

View File

@@ -1,6 +1,6 @@
import { Route } from '@angular/router';
import { AuthenticatedGuard } from '../core/auth/authenticated.guard';
import { authenticatedGuard } from '../core/auth/authenticated.guard';
import { bitstreamBreadcrumbResolver } from '../core/breadcrumbs/bitstream-breadcrumb.resolver';
import { i18nBreadcrumbResolver } from '../core/breadcrumbs/i18n-breadcrumb.resolver';
import { ResourcePolicyCreateComponent } from '../shared/resource-policies/create/resource-policy-create.component';
@@ -51,7 +51,7 @@ export const ROUTES: Route[] = [
bitstream: bitstreamPageResolver,
breadcrumb: bitstreamBreadcrumbResolver,
},
canActivate: [AuthenticatedGuard],
canActivate: [authenticatedGuard],
},
{
path: EDIT_BITSTREAM_AUTHORIZATIONS_PATH,

View File

@@ -6,10 +6,10 @@ import {
createSuccessfulRemoteDataObject$,
} from '../shared/remote-data.utils';
import { RouterStub } from '../shared/testing/router.stub';
import { BrowseByGuard } from './browse-by-guard';
import { browseByGuard } from './browse-by-guard';
import { BrowseByDataType } from './browse-by-switcher/browse-by-data-type';
describe('BrowseByGuard', () => {
describe('browseByGuard', () => {
describe('canActivate', () => {
let guard: any;
let translateService: any;
@@ -35,7 +35,7 @@ describe('BrowseByGuard', () => {
router = new RouterStub() as any;
guard = BrowseByGuard;
guard = browseByGuard;
});
it('should return true, and sets up the data correctly, with a scope and value', () => {

View File

@@ -26,7 +26,7 @@ import {
hasValue,
} from '../shared/empty.util';
export const BrowseByGuard: CanActivateFn = (
export const browseByGuard: CanActivateFn = (
route: ActivatedRouteSnapshot,
state: RouterStateSnapshot,
browseDefinitionService: BrowseDefinitionDataService = inject(BrowseDefinitionDataService),

View File

@@ -2,7 +2,7 @@ import { Route } from '@angular/router';
import { dsoEditMenuResolver } from '../shared/dso-page/dso-edit-menu.resolver';
import { browseByDSOBreadcrumbResolver } from './browse-by-dso-breadcrumb.resolver';
import { BrowseByGuard } from './browse-by-guard';
import { browseByGuard } from './browse-by-guard';
import { browseByI18nBreadcrumbResolver } from './browse-by-i18n-breadcrumb.resolver';
import { BrowseByPageComponent } from './browse-by-page/browse-by-page.component';
@@ -17,7 +17,7 @@ export const ROUTES: Route[] = [
{
path: ':id',
component: BrowseByPageComponent,
canActivate: [BrowseByGuard],
canActivate: [browseByGuard],
resolve: { breadcrumb: browseByI18nBreadcrumbResolver },
data: { title: 'browse.title.page', breadcrumbKey: 'browse.metadata' },
},

View File

@@ -3,9 +3,9 @@ import {
Route,
} from '@angular/router';
import { BrowseByGuard } from '../browse-by/browse-by-guard';
import { browseByGuard } from '../browse-by/browse-by-guard';
import { browseByI18nBreadcrumbResolver } from '../browse-by/browse-by-i18n-breadcrumb.resolver';
import { AuthenticatedGuard } from '../core/auth/authenticated.guard';
import { authenticatedGuard } from '../core/auth/authenticated.guard';
import { collectionBreadcrumbResolver } from '../core/breadcrumbs/collection-breadcrumb.resolver';
import { i18nBreadcrumbResolver } from '../core/breadcrumbs/i18n-breadcrumb.resolver';
import { ComcolBrowseByComponent } from '../shared/comcol/sections/comcol-browse-by/comcol-browse-by.component';
@@ -21,7 +21,7 @@ import {
ITEMTEMPLATE_PATH,
} from './collection-page-routing-paths';
import { CreateCollectionPageComponent } from './create-collection-page/create-collection-page.component';
import { CreateCollectionPageGuard } from './create-collection-page/create-collection-page.guard';
import { createCollectionPageGuard } from './create-collection-page/create-collection-page.guard';
import { DeleteCollectionPageComponent } from './delete-collection-page/delete-collection-page.component';
import { itemTemplatePageResolver } from './edit-item-template-page/item-template-page.resolver';
import { ThemedEditItemTemplatePageComponent } from './edit-item-template-page/themed-edit-item-template-page.component';
@@ -32,7 +32,7 @@ export const ROUTES: Route[] = [
{
path: COLLECTION_CREATE_PATH,
component: CreateCollectionPageComponent,
canActivate: [AuthenticatedGuard, CreateCollectionPageGuard],
canActivate: [authenticatedGuard, createCollectionPageGuard],
},
{
path: ':id',
@@ -53,12 +53,12 @@ export const ROUTES: Route[] = [
path: 'delete',
pathMatch: 'full',
component: DeleteCollectionPageComponent,
canActivate: [AuthenticatedGuard],
canActivate: [authenticatedGuard],
},
{
path: ITEMTEMPLATE_PATH,
component: ThemedEditItemTemplatePageComponent,
canActivate: [AuthenticatedGuard],
canActivate: [authenticatedGuard],
resolve: {
item: itemTemplatePageResolver,
breadcrumb: i18nBreadcrumbResolver,
@@ -78,7 +78,7 @@ export const ROUTES: Route[] = [
path: 'browse/:id',
pathMatch: 'full',
component: ComcolBrowseByComponent,
canActivate: [BrowseByGuard],
canActivate: [browseByGuard],
resolve: {
breadcrumb: browseByI18nBreadcrumbResolver,
},

View File

@@ -6,9 +6,9 @@ import {
createFailedRemoteDataObject$,
createSuccessfulRemoteDataObject$,
} from '../../shared/remote-data.utils';
import { CreateCollectionPageGuard } from './create-collection-page.guard';
import { createCollectionPageGuard } from './create-collection-page.guard';
describe('CreateCollectionPageGuard', () => {
describe('createCollectionPageGuard', () => {
describe('canActivate', () => {
let guard: any;
let router;
@@ -28,7 +28,7 @@ describe('CreateCollectionPageGuard', () => {
};
router = new RouterMock();
guard = CreateCollectionPageGuard;
guard = createCollectionPageGuard;
});
it('should return true when the parent ID resolves to a community', () => {

View File

@@ -27,7 +27,7 @@ import {
* True when either a parent ID query parameter has been provided and the parent ID resolves to a valid parent community
* Reroutes to a 404 page when the page cannot be activated
*/
export const CreateCollectionPageGuard: CanActivateFn = (
export const createCollectionPageGuard: CanActivateFn = (
route: ActivatedRouteSnapshot,
state: RouterStateSnapshot,
communityService: CommunityDataService = inject(CommunityDataService),

View File

@@ -3,9 +3,9 @@ import {
Route,
} from '@angular/router';
import { BrowseByGuard } from '../browse-by/browse-by-guard';
import { browseByGuard } from '../browse-by/browse-by-guard';
import { browseByI18nBreadcrumbResolver } from '../browse-by/browse-by-i18n-breadcrumb.resolver';
import { AuthenticatedGuard } from '../core/auth/authenticated.guard';
import { authenticatedGuard } from '../core/auth/authenticated.guard';
import { communityBreadcrumbResolver } from '../core/breadcrumbs/community-breadcrumb.resolver';
import { i18nBreadcrumbResolver } from '../core/breadcrumbs/i18n-breadcrumb.resolver';
import { ComcolBrowseByComponent } from '../shared/comcol/sections/comcol-browse-by/comcol-browse-by.component';
@@ -20,7 +20,7 @@ import {
COMMUNITY_EDIT_PATH,
} from './community-page-routing-paths';
import { CreateCommunityPageComponent } from './create-community-page/create-community-page.component';
import { CreateCommunityPageGuard } from './create-community-page/create-community-page.guard';
import { createCommunityPageGuard } from './create-community-page/create-community-page.guard';
import { DeleteCommunityPageComponent } from './delete-community-page/delete-community-page.component';
import { SubComColSectionComponent } from './sections/sub-com-col-section/sub-com-col-section.component';
import { ThemedCommunityPageComponent } from './themed-community-page.component';
@@ -29,7 +29,7 @@ export const ROUTES: Route[] = [
{
path: COMMUNITY_CREATE_PATH,
component: CreateCommunityPageComponent,
canActivate: [AuthenticatedGuard, CreateCommunityPageGuard],
canActivate: [authenticatedGuard, createCommunityPageGuard],
},
{
path: ':id',
@@ -50,7 +50,7 @@ export const ROUTES: Route[] = [
path: 'delete',
pathMatch: 'full',
component: DeleteCommunityPageComponent,
canActivate: [AuthenticatedGuard],
canActivate: [authenticatedGuard],
},
{
path: '',
@@ -74,7 +74,7 @@ export const ROUTES: Route[] = [
path: 'browse/:id',
pathMatch: 'full',
component: ComcolBrowseByComponent,
canActivate: [BrowseByGuard],
canActivate: [browseByGuard],
resolve: {
breadcrumb: browseByI18nBreadcrumbResolver,
},

View File

@@ -6,9 +6,9 @@ import {
createFailedRemoteDataObject$,
createSuccessfulRemoteDataObject$,
} from '../../shared/remote-data.utils';
import { CreateCommunityPageGuard } from './create-community-page.guard';
import { createCommunityPageGuard } from './create-community-page.guard';
describe('CreateCommunityPageGuard', () => {
describe('createCommunityPageGuard', () => {
describe('canActivate', () => {
let guard: any;
let router;
@@ -28,7 +28,7 @@ describe('CreateCommunityPageGuard', () => {
};
router = new RouterMock();
guard = CreateCommunityPageGuard;
guard = createCommunityPageGuard;
});
it('should return true when the parent ID resolves to a community', () => {

View File

@@ -27,7 +27,7 @@ import {
* True when either NO parent ID query parameter has been provided, or the parent ID resolves to a valid parent community
* Reroutes to a 404 page when the page cannot be activated
*/
export const CreateCommunityPageGuard: CanActivateFn = (
export const createCommunityPageGuard: CanActivateFn = (
route: ActivatedRouteSnapshot,
state: RouterStateSnapshot,
communityService: CommunityDataService = inject(CommunityDataService),

View File

@@ -17,9 +17,9 @@ import {
storeModuleConfig,
} from '../../app.reducer';
import { authReducer } from './auth.reducer';
import { AuthBlockingGuard } from './auth-blocking.guard';
import { authBlockingGuard } from './auth-blocking.guard';
describe('AuthBlockingGuard', () => {
describe('authBlockingGuard', () => {
let guard: any;
let initialState;
let store: Store<AppState>;
@@ -44,7 +44,7 @@ describe('AuthBlockingGuard', () => {
],
providers: [
provideMockStore({ initialState }),
{ provide: AuthBlockingGuard, useValue: guard },
{ provide: authBlockingGuard, useValue: guard },
],
}).compileComponents();
}));
@@ -52,7 +52,7 @@ describe('AuthBlockingGuard', () => {
beforeEach(() => {
store = TestBed.inject(Store);
mockStore = store as MockStore<AppState>;
guard = AuthBlockingGuard;
guard = authBlockingGuard;
});
describe(`canActivate`, () => {

View File

@@ -24,7 +24,7 @@ import { isAuthenticationBlocking } from './selectors';
* route until the authentication status has loaded.
* To ensure all rest requests get the correct auth header.
*/
export const AuthBlockingGuard: CanActivateFn = (
export const authBlockingGuard: CanActivateFn = (
route: ActivatedRouteSnapshot,
state: RouterStateSnapshot,
store: Store<AppState> = inject(Store<AppState>),

View File

@@ -34,7 +34,7 @@ import {
* UrlTree with redirect to login page when user isn't authenticated
* @method canActivate
*/
export const AuthenticatedGuard: CanActivateFn = (
export const authenticatedGuard: CanActivateFn = (
route: ActivatedRouteSnapshot,
state: RouterStateSnapshot,
authService: AuthService = inject(AuthService),
@@ -61,4 +61,4 @@ export const AuthenticatedGuard: CanActivateFn = (
export const AuthenticatedGuardChild: CanActivateChildFn = (
route: ActivatedRouteSnapshot,
state: RouterStateSnapshot,
) => AuthenticatedGuard(route, state);
) => authenticatedGuard(route, state);

View File

@@ -1,8 +1,8 @@
import { of } from 'rxjs';
import { NotifyInfoGuard } from './notify-info.guard';
import { notifyInfoGuard } from './notify-info.guard';
describe('NotifyInfoGuard', () => {
describe('notifyInfoGuard', () => {
let guard: any;
let notifyInfoServiceSpy: any;
let router: any;
@@ -10,7 +10,7 @@ describe('NotifyInfoGuard', () => {
beforeEach(() => {
notifyInfoServiceSpy = jasmine.createSpyObj('NotifyInfoService', ['isCoarConfigEnabled']);
router = jasmine.createSpyObj('Router', ['parseUrl']);
guard = NotifyInfoGuard;
guard = notifyInfoGuard;
});
it('should be created', () => {

View File

@@ -11,7 +11,7 @@ import { map } from 'rxjs/operators';
import { NotifyInfoService } from './notify-info.service';
export const NotifyInfoGuard: CanActivateFn = (
export const notifyInfoGuard: CanActivateFn = (
route: ActivatedRouteSnapshot,
state: RouterStateSnapshot,
notifyInfoService: NotifyInfoService = inject(NotifyInfoService),

View File

@@ -91,7 +91,7 @@ export class DsoRedirectService {
/**
* Redirect to a DSpaceObject's path using the given identifier type and ID.
* This is used to redirect paths like "/handle/[prefix]/[suffix]" to the object's path (e.g. /items/[uuid]).
* See LookupGuard for more examples.
* See lookupGuard for more examples.
*
* @param id the identifier of the object to retrieve
* @param identifierType the type of the given identifier (defaults to UUID)

View File

@@ -13,7 +13,7 @@ import { FeatureID } from '../data/feature-authorization/feature-id';
/**
* A guard for redirecting users to the feedback page if user is authorized
*/
export const FeedbackGuard: CanActivateFn = (
export const feedbackGuard: CanActivateFn = (
route: ActivatedRouteSnapshot,
state: RouterStateSnapshot,
authorizationService: AuthorizationDataService = inject(AuthorizationDataService),

View File

@@ -2,9 +2,9 @@ import { Router } from '@angular/router';
import { AppConfig } from '../../../config/app-config.interface';
import { DefaultAppConfig } from '../../../config/default-app-config';
import { ReloadGuard } from './reload.guard';
import { reloadGuard } from './reload.guard';
describe('ReloadGuard', () => {
describe('reloadGuard', () => {
let guard: any;
let router: Router;
let appConfig: AppConfig;
@@ -12,7 +12,7 @@ describe('ReloadGuard', () => {
beforeEach(() => {
router = jasmine.createSpyObj('router', ['parseUrl', 'createUrlTree']);
appConfig = new DefaultAppConfig();
guard = ReloadGuard;
guard = reloadGuard;
});
describe('canActivate', () => {

View File

@@ -18,7 +18,7 @@ import { isNotEmpty } from '../../shared/empty.util';
* A guard redirecting the user to the URL provided in the route's query params
* When no redirect url is found, the user is redirected to the homepage
*/
export const ReloadGuard: CanActivateFn = (
export const reloadGuard: CanActivateFn = (
route: ActivatedRouteSnapshot,
state: RouterStateSnapshot,
appConfig: AppConfig = inject(APP_CONFIG),

View File

@@ -1,6 +1,6 @@
import { Route } from '@angular/router';
import { RegistrationGuard } from '../register-page/registration.guard';
import { registrationGuard } from '../register-page/registration.guard';
import { ThemedForgotEmailComponent } from './forgot-password-email/themed-forgot-email.component';
import { ThemedForgotPasswordFormComponent } from './forgot-password-form/themed-forgot-password-form.component';
@@ -13,6 +13,6 @@ export const ROUTES: Route[] = [
{
path: ':token',
component: ThemedForgotPasswordFormComponent,
canActivate: [RegistrationGuard],
canActivate: [registrationGuard],
},
];

View File

@@ -1,11 +1,11 @@
import { Route } from '@angular/router';
import { AuthenticatedGuard } from '../core/auth/authenticated.guard';
import { authenticatedGuard } from '../core/auth/authenticated.guard';
import { ThemedSubmissionImportExternalComponent } from '../submission/import-external/themed-submission-import-external.component';
export const ROUTES: Route[] = [
{
canActivate: [AuthenticatedGuard],
canActivate: [authenticatedGuard],
path: '',
component: ThemedSubmissionImportExternalComponent,
pathMatch: 'full',

View File

@@ -1,6 +1,6 @@
import { environment } from '../../environments/environment';
import { i18nBreadcrumbResolver } from '../core/breadcrumbs/i18n-breadcrumb.resolver';
import { FeedbackGuard } from '../core/feedback/feedback.guard';
import { feedbackGuard } from '../core/feedback/feedback.guard';
import { ThemedEndUserAgreementComponent } from './end-user-agreement/themed-end-user-agreement.component';
import { ThemedFeedbackComponent } from './feedback/themed-feedback.component';
import {
@@ -17,7 +17,7 @@ export const ROUTES = [
component: ThemedFeedbackComponent,
resolve: { breadcrumb: i18nBreadcrumbResolver },
data: { title: 'info.feedback.title', breadcrumbKey: 'info.feedback' },
canActivate: [FeedbackGuard],
canActivate: [feedbackGuard],
},
environment.info.enableEndUserAgreement ? {
path: END_USER_AGREEMENT_PATH,

View File

@@ -4,7 +4,7 @@ import {
} from '@angular/router';
import { REQUEST_COPY_MODULE_PATH } from '../app-routing-paths';
import { AuthenticatedGuard } from '../core/auth/authenticated.guard';
import { authenticatedGuard } from '../core/auth/authenticated.guard';
import { itemBreadcrumbResolver } from '../core/breadcrumbs/item-breadcrumb.resolver';
import { dsoEditMenuResolver } from '../shared/dso-page/dso-edit-menu.resolver';
import { LinkMenuItemModel } from '../shared/menu/menu-item/models/link.model';
@@ -51,7 +51,7 @@ export const ROUTES: Route[] = [
{
path: UPLOAD_BITSTREAM_PATH,
component: UploadBitstreamComponent,
canActivate: [AuthenticatedGuard],
canActivate: [authenticatedGuard],
},
{
path: REQUEST_COPY_MODULE_PATH,
@@ -60,7 +60,7 @@ export const ROUTES: Route[] = [
{
path: ORCID_PATH,
component: OrcidPageComponent,
canActivate: [AuthenticatedGuard, ...mapToCanActivate([OrcidPageGuard])],
canActivate: [authenticatedGuard, ...mapToCanActivate([OrcidPageGuard])],
},
],
data: {

View File

@@ -1,11 +1,11 @@
import { Route } from '@angular/router';
import { AuthenticatedGuard } from '../core/auth/authenticated.guard';
import { authenticatedGuard } from '../core/auth/authenticated.guard';
import { ThemedLogoutPageComponent } from './themed-logout-page.component';
export const ROUTES: Route[] = [
{
canActivate: [AuthenticatedGuard],
canActivate: [authenticatedGuard],
path: '',
component: ThemedLogoutPageComponent,
data: { title: 'logout.title' },

View File

@@ -4,13 +4,13 @@ import {
} from '@angular/router';
import { isNotEmpty } from '../shared/empty.util';
import { LookupGuard } from './lookup-guard';
import { lookupGuard } from './lookup-guard';
import { ThemedObjectNotFoundComponent } from './objectnotfound/themed-objectnotfound.component';
export const ROUTES: Route[] = [
{
matcher: urlMatcher,
canActivate: [LookupGuard],
canActivate: [lookupGuard],
component: ThemedObjectNotFoundComponent,
},
];

View File

@@ -1,9 +1,9 @@
import { of as observableOf } from 'rxjs';
import { IdentifierType } from '../core/data/request.models';
import { LookupGuard } from './lookup-guard';
import { lookupGuard } from './lookup-guard';
describe('LookupGuard', () => {
describe('lookupGuard', () => {
let dsoService: any;
let guard: any;
@@ -12,7 +12,7 @@ describe('LookupGuard', () => {
findByIdAndIDType: jasmine.createSpy('findByIdAndIDType').and.returnValue(observableOf({ hasFailed: false,
hasSucceeded: true })),
};
guard = LookupGuard;
guard = lookupGuard;
});
it('should call findByIdAndIDType with handle params', () => {

View File

@@ -17,7 +17,7 @@ interface LookupParams {
id: string;
}
export const LookupGuard: CanActivateFn = (
export const lookupGuard: CanActivateFn = (
route: ActivatedRouteSnapshot,
state: RouterStateSnapshot,
dsoService: DsoRedirectService = inject(DsoRedirectService),

View File

@@ -1,7 +1,7 @@
import { Route } from '@angular/router';
import { i18nBreadcrumbResolver } from '../core/breadcrumbs/i18n-breadcrumb.resolver';
import { MyDSpaceGuard } from './my-dspace.guard';
import { myDSpaceGuard } from './my-dspace.guard';
import { ThemedMyDSpacePageComponent } from './themed-my-dspace-page.component';
export const ROUTES: Route[] = [
@@ -13,7 +13,7 @@ export const ROUTES: Route[] = [
},
data: { title: 'mydspace.title', breadcrumbKey: 'mydspace' },
canActivate: [
MyDSpaceGuard,
myDSpaceGuard,
],
},
];

View File

@@ -20,7 +20,7 @@ import { MYDSPACE_ROUTE } from './my-dspace-page.component';
/**
* Prevent unauthorized activating and loading of mydspace configuration
*/
export const MyDSpaceGuard: CanActivateFn = (
export const myDSpaceGuard: CanActivateFn = (
route: ActivatedRouteSnapshot,
state: RouterStateSnapshot,
configurationService: MyDSpaceConfigurationService = inject(MyDSpaceConfigurationService),

View File

@@ -1,6 +1,6 @@
import { Route } from '@angular/router';
import { AuthenticatedGuard } from '../core/auth/authenticated.guard';
import { authenticatedGuard } from '../core/auth/authenticated.guard';
import { i18nBreadcrumbResolver } from '../core/breadcrumbs/i18n-breadcrumb.resolver';
import { ProcessDetailComponent } from './detail/process-detail.component';
import { NewProcessComponent } from './new/new-process.component';
@@ -13,7 +13,7 @@ export const ROUTES: Route[] = [
path: '',
resolve: { breadcrumb: i18nBreadcrumbResolver },
data: { breadcrumbKey: 'process.overview' },
canActivate: [AuthenticatedGuard],
canActivate: [authenticatedGuard],
children: [
{
path: '',

View File

@@ -1,6 +1,6 @@
import { Route } from '@angular/router';
import { AuthenticatedGuard } from '../core/auth/authenticated.guard';
import { authenticatedGuard } from '../core/auth/authenticated.guard';
import { i18nBreadcrumbResolver } from '../core/breadcrumbs/i18n-breadcrumb.resolver';
import { qualityAssuranceBreadcrumbResolver } from '../core/breadcrumbs/quality-assurance-breadcrumb.resolver';
import {
@@ -19,7 +19,7 @@ import { QualityAssuranceTopicsPageResolver } from './quality-assurance-topics-p
export const ROUTES: Route[] = [
{
canActivate: [AuthenticatedGuard],
canActivate: [authenticatedGuard],
path: `${NOTIFICATIONS_RECITER_SUGGESTION_PATH}`,
component: NotificationsSuggestionTargetsPageComponent,
pathMatch: 'full',
@@ -34,7 +34,7 @@ export const ROUTES: Route[] = [
},
},
{
canActivate: [AuthenticatedGuard],
canActivate: [authenticatedGuard],
path: `${QUALITY_ASSURANCE_EDIT_PATH}/:sourceId`,
component: QualityAssuranceTopicsPageComponent,
pathMatch: 'full',
@@ -49,7 +49,7 @@ export const ROUTES: Route[] = [
},
},
{
canActivate: [AuthenticatedGuard],
canActivate: [authenticatedGuard],
path: `${QUALITY_ASSURANCE_EDIT_PATH}/:sourceId/target/:targetId`,
component: QualityAssuranceTopicsPageComponent,
pathMatch: 'full',
@@ -64,7 +64,7 @@ export const ROUTES: Route[] = [
},
},
{
canActivate: [AuthenticatedGuard],
canActivate: [authenticatedGuard],
path: `${QUALITY_ASSURANCE_EDIT_PATH}`,
component: QualityAssuranceSourcePageComponent,
pathMatch: 'full',
@@ -80,7 +80,7 @@ export const ROUTES: Route[] = [
},
},
{
canActivate: [AuthenticatedGuard],
canActivate: [authenticatedGuard],
path: `${QUALITY_ASSURANCE_EDIT_PATH}/:sourceId/:topicId`,
component: QualityAssuranceEventsPageComponent,
pathMatch: 'full',

View File

@@ -6,7 +6,7 @@ import {
import { EndUserAgreementCookieGuard } from '../core/end-user-agreement/end-user-agreement-cookie.guard';
import { ThemedCreateProfileComponent } from './create-profile/themed-create-profile.component';
import { ThemedRegisterEmailComponent } from './register-email/themed-register-email.component';
import { RegistrationGuard } from './registration.guard';
import { registrationGuard } from './registration.guard';
export const ROUTES: Route[] = [
@@ -19,7 +19,7 @@ export const ROUTES: Route[] = [
path: ':token',
component: ThemedCreateProfileComponent,
canActivate: [
RegistrationGuard,
registrationGuard,
...mapToCanActivate([EndUserAgreementCookieGuard]),
],
},

View File

@@ -13,9 +13,9 @@ import {
createFailedRemoteDataObject$,
createSuccessfulRemoteDataObject,
} from '../shared/remote-data.utils';
import { RegistrationGuard } from './registration.guard';
import { registrationGuard } from './registration.guard';
describe('RegistrationGuard', () => {
describe('registrationGuard', () => {
let guard: any;
let epersonRegistrationService: EpersonRegistrationService;
@@ -65,7 +65,7 @@ describe('RegistrationGuard', () => {
setRedirectUrl: {},
});
guard = RegistrationGuard;
guard = registrationGuard;
});
describe('canActivate', () => {

View File

@@ -18,7 +18,7 @@ import { getFirstCompletedRemoteData } from '../core/shared/operators';
* The guard also adds the resulting RemoteData<Registration> object to the route's data for further usage in components
* The reason this is a guard and not a resolver, is because it has to run before the EndUserAgreementCookieGuard
*/
export const RegistrationGuard: CanActivateFn = (
export const registrationGuard: CanActivateFn = (
route: ActivatedRouteSnapshot,
state: RouterStateSnapshot,
authService: AuthService = inject(AuthService),

View File

@@ -9,7 +9,7 @@ import {
* The format of the key will be "{configuration}.search.title" with:
* - configuration: The current configuration stored in route.params
*/
export const ConfigurationSearchPageGuard: CanActivateFn = (
export const configurationSearchPageGuard: CanActivateFn = (
route: ActivatedRouteSnapshot,
state: RouterStateSnapshot,
): boolean => {

View File

@@ -1,7 +1,7 @@
import { Route } from '@angular/router';
import { i18nBreadcrumbResolver } from '../core/breadcrumbs/i18n-breadcrumb.resolver';
import { ConfigurationSearchPageGuard } from './configuration-search-page.guard';
import { configurationSearchPageGuard } from './configuration-search-page.guard';
import { ThemedConfigurationSearchPageComponent } from './themed-configuration-search-page.component';
import { ThemedSearchPageComponent } from './themed-search-page.component';
@@ -13,7 +13,7 @@ export const ROUTES: Route[] = [{
{
path: ':configuration',
component: ThemedConfigurationSearchPageComponent,
canActivate: [ConfigurationSearchPageGuard],
canActivate: [configurationSearchPageGuard],
},
],
}];

View File

@@ -1,12 +1,12 @@
import { Route } from '@angular/router';
import { AuthenticatedGuard } from '../core/auth/authenticated.guard';
import { authenticatedGuard } from '../core/auth/authenticated.guard';
import { i18nBreadcrumbResolver } from '../core/breadcrumbs/i18n-breadcrumb.resolver';
import { ThemedSubmissionSubmitComponent } from '../submission/submit/themed-submission-submit.component';
export const ROUTES: Route[] = [
{
canActivate: [AuthenticatedGuard],
canActivate: [authenticatedGuard],
path: '',
pathMatch: 'full',
component: ThemedSubmissionSubmitComponent,

View File

@@ -1,6 +1,6 @@
import { Route } from '@angular/router';
import { AuthenticatedGuard } from '../core/auth/authenticated.guard';
import { authenticatedGuard } from '../core/auth/authenticated.guard';
import { publicationClaimBreadcrumbResolver } from '../core/breadcrumbs/publication-claim-breadcrumb.resolver';
import { SuggestionsPageComponent } from './suggestions-page.component';
import { suggestionsPageResolver } from './suggestions-page.resolver';
@@ -17,7 +17,7 @@ export const ROUTES: Route[] = [
breadcrumbKey: 'admin.notifications.publicationclaim',
showBreadcrumbsFluid: false,
},
canActivate: [AuthenticatedGuard],
canActivate: [authenticatedGuard],
runGuardsAndResolvers: 'always',
component: SuggestionsPageComponent,
},

View File

@@ -1,6 +1,6 @@
import { Routes } from '@angular/router';
import { AuthenticatedGuard } from '../core/auth/authenticated.guard';
import { authenticatedGuard } from '../core/auth/authenticated.guard';
import { i18nBreadcrumbResolver } from '../core/breadcrumbs/i18n-breadcrumb.resolver';
import { ThemedFullItemPageComponent } from '../item-page/full/themed-full-item-page.component';
import { ThemedSubmissionEditComponent } from '../submission/edit/themed-submission-edit.component';
@@ -23,7 +23,7 @@ export const ROUTES: Routes = [
resolve: { wfi: workflowItemPageResolver },
children: [
{
canActivate: [AuthenticatedGuard],
canActivate: [authenticatedGuard],
path: WORKFLOW_ITEM_EDIT_PATH,
component: ThemedSubmissionEditComponent,
resolve: {
@@ -36,7 +36,7 @@ export const ROUTES: Routes = [
},
},
{
canActivate: [AuthenticatedGuard],
canActivate: [authenticatedGuard],
path: WORKFLOW_ITEM_VIEW_PATH,
component: ThemedFullItemPageComponent,
resolve: {
@@ -46,7 +46,7 @@ export const ROUTES: Routes = [
data: { title: 'workflow-item.view.title', breadcrumbKey: 'workflow-item.view' },
},
{
canActivate: [AuthenticatedGuard],
canActivate: [authenticatedGuard],
path: WORKFLOW_ITEM_DELETE_PATH,
component: ThemedWorkflowItemDeleteComponent,
resolve: {
@@ -55,7 +55,7 @@ export const ROUTES: Routes = [
data: { title: 'workflow-item.delete.title', breadcrumbKey: 'workflow-item.edit' },
},
{
canActivate: [AuthenticatedGuard],
canActivate: [authenticatedGuard],
path: WORKFLOW_ITEM_SEND_BACK_PATH,
component: ThemedWorkflowItemSendBackComponent,
resolve: {
@@ -64,7 +64,7 @@ export const ROUTES: Routes = [
data: { title: 'workflow-item.send-back.title', breadcrumbKey: 'workflow-item.edit' },
},
{
canActivate: [AuthenticatedGuard],
canActivate: [authenticatedGuard],
path: ADVANCED_WORKFLOW_PATH,
component: AdvancedWorkflowActionPageComponent,
resolve: {

View File

@@ -1,6 +1,6 @@
import { Route } from '@angular/router';
import { AuthenticatedGuard } from '../core/auth/authenticated.guard';
import { authenticatedGuard } from '../core/auth/authenticated.guard';
import { i18nBreadcrumbResolver } from '../core/breadcrumbs/i18n-breadcrumb.resolver';
import { ThemedFullItemPageComponent } from '../item-page/full/themed-full-item-page.component';
import { ThemedSubmissionEditComponent } from '../submission/edit/themed-submission-edit.component';
@@ -19,7 +19,7 @@ export const ROUTES: Route[] = [
resolve: { wsi: workspaceItemPageResolver },
children: [
{
canActivate: [AuthenticatedGuard],
canActivate: [authenticatedGuard],
path: 'edit',
component: ThemedSubmissionEditComponent,
resolve: {
@@ -28,7 +28,7 @@ export const ROUTES: Route[] = [
data: { title: 'submission.edit.title', breadcrumbKey: 'submission.edit' },
},
{
canActivate: [AuthenticatedGuard],
canActivate: [authenticatedGuard],
path: 'view',
component: ThemedFullItemPageComponent,
resolve: {
@@ -38,7 +38,7 @@ export const ROUTES: Route[] = [
data: { title: 'workspace-item.view.title', breadcrumbKey: 'workspace-item.view' },
},
{
canActivate: [AuthenticatedGuard],
canActivate: [authenticatedGuard],
path: 'delete',
component: WorkspaceItemsDeletePageComponent,
resolve: {
@@ -48,7 +48,7 @@ export const ROUTES: Route[] = [
data: { title: 'workspace-item.delete', breadcrumbKey: 'workspace-item.delete' },
},
{
canActivate: [AuthenticatedGuard],
canActivate: [authenticatedGuard],
path: 'delete',
component: ThemedWorkspaceItemsDeletePageComponent,
resolve: {