Skip to content

Commit 35714b7

Browse files
committed
[DURACOM-234] rename guards in order to be complaint to function name convention
1 parent f1686d5 commit 35714b7

43 files changed

Lines changed: 119 additions & 119 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

src/app/admin/admin-notifications/admin-notifications-routes.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { Route } from '@angular/router';
22

3-
import { AuthenticatedGuard } from '../../core/auth/authenticated.guard';
3+
import { authenticatedGuard } from '../../core/auth/authenticated.guard';
44
import { i18nBreadcrumbResolver } from '../../core/breadcrumbs/i18n-breadcrumb.resolver';
55
import { qualityAssuranceBreadcrumbResolver } from '../../core/breadcrumbs/quality-assurance-breadcrumb.resolver';
66
import { AdminNotificationsPublicationClaimPageResolver } from '../../quality-assurance-notifications-pages/notifications-suggestion-targets-page/notifications-suggestion-targets-page-resolver.service';
@@ -19,7 +19,7 @@ import {
1919

2020
export const ROUTES: Route[] = [
2121
{
22-
canActivate: [ AuthenticatedGuard ],
22+
canActivate: [ authenticatedGuard ],
2323
path: `${PUBLICATION_CLAIMS_PATH}`,
2424
component: AdminNotificationsPublicationClaimPageComponent,
2525
pathMatch: 'full',
@@ -34,7 +34,7 @@ export const ROUTES: Route[] = [
3434
},
3535
},
3636
{
37-
canActivate: [AuthenticatedGuard],
37+
canActivate: [authenticatedGuard],
3838
path: `${QUALITY_ASSURANCE_EDIT_PATH}/:sourceId`,
3939
component: QualityAssuranceTopicsPageComponent,
4040
pathMatch: 'full',
@@ -49,7 +49,7 @@ export const ROUTES: Route[] = [
4949
},
5050
},
5151
{
52-
canActivate: [ AuthenticatedGuard ],
52+
canActivate: [ authenticatedGuard ],
5353
path: `${QUALITY_ASSURANCE_EDIT_PATH}/:sourceId/target/:targetId`,
5454
component: QualityAssuranceTopicsPageComponent,
5555
pathMatch: 'full',
@@ -64,7 +64,7 @@ export const ROUTES: Route[] = [
6464
},
6565
},
6666
{
67-
canActivate: [AuthenticatedGuard],
67+
canActivate: [authenticatedGuard],
6868
path: `${QUALITY_ASSURANCE_EDIT_PATH}`,
6969
component: QualityAssuranceSourcePageComponent,
7070
pathMatch: 'full',
@@ -80,7 +80,7 @@ export const ROUTES: Route[] = [
8080
},
8181
},
8282
{
83-
canActivate: [AuthenticatedGuard],
83+
canActivate: [authenticatedGuard],
8484
path: `${QUALITY_ASSURANCE_EDIT_PATH}/:sourceId/:topicId`,
8585
component: QualityAssuranceEventsPageComponent,
8686
pathMatch: 'full',

src/app/admin/admin-notify-dashboard/admin-notify-dashboard-routes.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,15 +4,15 @@ import {
44
} from '@angular/router';
55

66
import { i18nBreadcrumbResolver } from '../../core/breadcrumbs/i18n-breadcrumb.resolver';
7-
import { NotifyInfoGuard } from '../../core/coar-notify/notify-info/notify-info.guard';
7+
import { notifyInfoGuard } from '../../core/coar-notify/notify-info/notify-info.guard';
88
import { SiteAdministratorGuard } from '../../core/data/feature-authorization/feature-authorization-guard/site-administrator.guard';
99
import { AdminNotifyDashboardComponent } from './admin-notify-dashboard.component';
1010
import { AdminNotifyIncomingComponent } from './admin-notify-logs/admin-notify-incoming/admin-notify-incoming.component';
1111
import { AdminNotifyOutgoingComponent } from './admin-notify-logs/admin-notify-outgoing/admin-notify-outgoing.component';
1212

1313
export const ROUTES: Route[] = [
1414
{
15-
canActivate: [...mapToCanActivate([SiteAdministratorGuard]), NotifyInfoGuard],
15+
canActivate: [...mapToCanActivate([SiteAdministratorGuard]), notifyInfoGuard],
1616
path: '',
1717
resolve: {
1818
breadcrumb: i18nBreadcrumbResolver,
@@ -30,7 +30,7 @@ export const ROUTES: Route[] = [
3030
breadcrumb: i18nBreadcrumbResolver,
3131
},
3232
component: AdminNotifyIncomingComponent,
33-
canActivate: [...mapToCanActivate([SiteAdministratorGuard]), NotifyInfoGuard],
33+
canActivate: [...mapToCanActivate([SiteAdministratorGuard]), notifyInfoGuard],
3434
data: {
3535
title: 'admin.notify.dashboard.page.title',
3636
breadcrumbKey: 'admin.notify.dashboard',
@@ -42,7 +42,7 @@ export const ROUTES: Route[] = [
4242
breadcrumb: i18nBreadcrumbResolver,
4343
},
4444
component: AdminNotifyOutgoingComponent,
45-
canActivate: [...mapToCanActivate([SiteAdministratorGuard]), NotifyInfoGuard],
45+
canActivate: [...mapToCanActivate([SiteAdministratorGuard]), notifyInfoGuard],
4646
data: {
4747
title: 'admin.notify.dashboard.page.title',
4848
breadcrumbKey: 'admin.notify.dashboard',

src/app/app-routes.ts

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -24,13 +24,13 @@ import {
2424
} from './app-routing-paths';
2525
import { COLLECTION_MODULE_PATH } from './collection-page/collection-page-routing-paths';
2626
import { COMMUNITY_MODULE_PATH } from './community-page/community-page-routing-paths';
27-
import { AuthBlockingGuard } from './core/auth/auth-blocking.guard';
28-
import { AuthenticatedGuard } from './core/auth/authenticated.guard';
27+
import { authBlockingGuard } from './core/auth/auth-blocking.guard';
28+
import { authenticatedGuard } from './core/auth/authenticated.guard';
2929
import { GroupAdministratorGuard } from './core/data/feature-authorization/feature-authorization-guard/group-administrator.guard';
3030
import { SiteAdministratorGuard } from './core/data/feature-authorization/feature-authorization-guard/site-administrator.guard';
3131
import { SiteRegisterGuard } from './core/data/feature-authorization/feature-authorization-guard/site-register.guard';
3232
import { EndUserAgreementCurrentUserGuard } from './core/end-user-agreement/end-user-agreement-current-user.guard';
33-
import { ReloadGuard } from './core/reload/reload.guard';
33+
import { reloadGuard } from './core/reload/reload.guard';
3434
import { ForgotPasswordCheckGuard } from './core/rest-property/forgot-password-check-guard.guard';
3535
import { ServerCheckGuard } from './core/server-check/server-check.guard';
3636
import { ThemedForbiddenComponent } from './forbidden/themed-forbidden.component';
@@ -49,7 +49,7 @@ export const APP_ROUTES: Route[] = [
4949
{ path: ERROR_PAGE, component: ThemedPageErrorComponent },
5050
{
5151
path: '',
52-
canActivate: [AuthBlockingGuard],
52+
canActivate: [authBlockingGuard],
5353
canActivateChild: [ServerCheckGuard],
5454
resolve: [menuResolver],
5555
children: [
@@ -58,7 +58,7 @@ export const APP_ROUTES: Route[] = [
5858
path: 'reload/:rnd',
5959
component: ThemedPageNotFoundComponent,
6060
pathMatch: 'full',
61-
canActivate: [ReloadGuard],
61+
canActivate: [reloadGuard],
6262
},
6363
{
6464
path: 'home',
@@ -139,7 +139,7 @@ export const APP_ROUTES: Route[] = [
139139
loadChildren: () => import('./my-dspace-page/my-dspace-page-routes')
140140
.then((m) => m.ROUTES),
141141
providers: [provideSuggestionNotificationsState()],
142-
canActivate: [AuthenticatedGuard, ...mapToCanActivate([EndUserAgreementCurrentUserGuard])],
142+
canActivate: [authenticatedGuard, ...mapToCanActivate([EndUserAgreementCurrentUserGuard])],
143143
},
144144
{
145145
path: 'search',
@@ -164,7 +164,7 @@ export const APP_ROUTES: Route[] = [
164164
loadChildren: () => import('./quality-assurance-notifications-pages/notifications-pages-routes')
165165
.then((m) => m.ROUTES),
166166
providers: [provideSuggestionNotificationsState()],
167-
canActivate: [AuthenticatedGuard, ...mapToCanActivate([EndUserAgreementCurrentUserGuard])],
167+
canActivate: [authenticatedGuard, ...mapToCanActivate([EndUserAgreementCurrentUserGuard])],
168168
},
169169
{
170170
path: 'login',
@@ -208,20 +208,20 @@ export const APP_ROUTES: Route[] = [
208208
loadChildren: () => import('./profile-page/profile-page-routes')
209209
.then((m) => m.ROUTES),
210210
providers: [provideSuggestionNotificationsState()],
211-
canActivate: [AuthenticatedGuard, ...mapToCanActivate([EndUserAgreementCurrentUserGuard])],
211+
canActivate: [authenticatedGuard, ...mapToCanActivate([EndUserAgreementCurrentUserGuard])],
212212
},
213213
{
214214
path: PROCESS_MODULE_PATH,
215215
loadChildren: () => import('./process-page/process-page-routes')
216216
.then((m) => m.ROUTES),
217-
canActivate: [AuthenticatedGuard, ...mapToCanActivate([EndUserAgreementCurrentUserGuard])],
217+
canActivate: [authenticatedGuard, ...mapToCanActivate([EndUserAgreementCurrentUserGuard])],
218218
},
219219
{
220220
path: SUGGESTION_MODULE_PATH,
221221
loadChildren: () => import('./suggestions-page/suggestions-page-routes')
222222
.then((m) => m.ROUTES),
223223
providers: [provideSuggestionNotificationsState()],
224-
canActivate: [AuthenticatedGuard, ...mapToCanActivate([EndUserAgreementCurrentUserGuard])],
224+
canActivate: [authenticatedGuard, ...mapToCanActivate([EndUserAgreementCurrentUserGuard])],
225225
},
226226
{
227227
path: INFO_MODULE_PATH,
@@ -256,7 +256,7 @@ export const APP_ROUTES: Route[] = [
256256
path: 'subscriptions',
257257
loadChildren: () => import('./subscriptions-page/subscriptions-page-routes')
258258
.then((m) => m.ROUTES),
259-
canActivate: [AuthenticatedGuard],
259+
canActivate: [authenticatedGuard],
260260
},
261261
{ path: '**', pathMatch: 'full', component: ThemedPageNotFoundComponent },
262262
],

src/app/bitstream-page/bitstream-page-routes.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { Route } from '@angular/router';
22

3-
import { AuthenticatedGuard } from '../core/auth/authenticated.guard';
3+
import { authenticatedGuard } from '../core/auth/authenticated.guard';
44
import { bitstreamBreadcrumbResolver } from '../core/breadcrumbs/bitstream-breadcrumb.resolver';
55
import { i18nBreadcrumbResolver } from '../core/breadcrumbs/i18n-breadcrumb.resolver';
66
import { ResourcePolicyCreateComponent } from '../shared/resource-policies/create/resource-policy-create.component';
@@ -51,7 +51,7 @@ export const ROUTES: Route[] = [
5151
bitstream: bitstreamPageResolver,
5252
breadcrumb: bitstreamBreadcrumbResolver,
5353
},
54-
canActivate: [AuthenticatedGuard],
54+
canActivate: [authenticatedGuard],
5555
},
5656
{
5757
path: EDIT_BITSTREAM_AUTHORIZATIONS_PATH,

src/app/browse-by/browse-by-guard.spec.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,10 @@ import {
66
createSuccessfulRemoteDataObject$,
77
} from '../shared/remote-data.utils';
88
import { RouterStub } from '../shared/testing/router.stub';
9-
import { BrowseByGuard } from './browse-by-guard';
9+
import { browseByGuard } from './browse-by-guard';
1010
import { BrowseByDataType } from './browse-by-switcher/browse-by-data-type';
1111

12-
describe('BrowseByGuard', () => {
12+
describe('browseByGuard', () => {
1313
describe('canActivate', () => {
1414
let guard: any;
1515
let translateService: any;
@@ -35,7 +35,7 @@ describe('BrowseByGuard', () => {
3535

3636
router = new RouterStub() as any;
3737

38-
guard = BrowseByGuard;
38+
guard = browseByGuard;
3939
});
4040

4141
it('should return true, and sets up the data correctly, with a scope and value', () => {

src/app/browse-by/browse-by-guard.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ import {
2626
hasValue,
2727
} from '../shared/empty.util';
2828

29-
export const BrowseByGuard: CanActivateFn = (
29+
export const browseByGuard: CanActivateFn = (
3030
route: ActivatedRouteSnapshot,
3131
state: RouterStateSnapshot,
3232
browseDefinitionService: BrowseDefinitionDataService = inject(BrowseDefinitionDataService),

src/app/browse-by/browse-by-page-routes.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import { Route } from '@angular/router';
22

33
import { dsoEditMenuResolver } from '../shared/dso-page/dso-edit-menu.resolver';
44
import { browseByDSOBreadcrumbResolver } from './browse-by-dso-breadcrumb.resolver';
5-
import { BrowseByGuard } from './browse-by-guard';
5+
import { browseByGuard } from './browse-by-guard';
66
import { browseByI18nBreadcrumbResolver } from './browse-by-i18n-breadcrumb.resolver';
77
import { BrowseByPageComponent } from './browse-by-page/browse-by-page.component';
88

@@ -17,7 +17,7 @@ export const ROUTES: Route[] = [
1717
{
1818
path: ':id',
1919
component: BrowseByPageComponent,
20-
canActivate: [BrowseByGuard],
20+
canActivate: [browseByGuard],
2121
resolve: { breadcrumb: browseByI18nBreadcrumbResolver },
2222
data: { title: 'browse.title.page', breadcrumbKey: 'browse.metadata' },
2323
},

src/app/collection-page/collection-page-routes.ts

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,9 @@ import {
33
Route,
44
} from '@angular/router';
55

6-
import { BrowseByGuard } from '../browse-by/browse-by-guard';
6+
import { browseByGuard } from '../browse-by/browse-by-guard';
77
import { browseByI18nBreadcrumbResolver } from '../browse-by/browse-by-i18n-breadcrumb.resolver';
8-
import { AuthenticatedGuard } from '../core/auth/authenticated.guard';
8+
import { authenticatedGuard } from '../core/auth/authenticated.guard';
99
import { collectionBreadcrumbResolver } from '../core/breadcrumbs/collection-breadcrumb.resolver';
1010
import { i18nBreadcrumbResolver } from '../core/breadcrumbs/i18n-breadcrumb.resolver';
1111
import { ComcolBrowseByComponent } from '../shared/comcol/sections/comcol-browse-by/comcol-browse-by.component';
@@ -21,7 +21,7 @@ import {
2121
ITEMTEMPLATE_PATH,
2222
} from './collection-page-routing-paths';
2323
import { CreateCollectionPageComponent } from './create-collection-page/create-collection-page.component';
24-
import { CreateCollectionPageGuard } from './create-collection-page/create-collection-page.guard';
24+
import { createCollectionPageGuard } from './create-collection-page/create-collection-page.guard';
2525
import { DeleteCollectionPageComponent } from './delete-collection-page/delete-collection-page.component';
2626
import { itemTemplatePageResolver } from './edit-item-template-page/item-template-page.resolver';
2727
import { ThemedEditItemTemplatePageComponent } from './edit-item-template-page/themed-edit-item-template-page.component';
@@ -32,7 +32,7 @@ export const ROUTES: Route[] = [
3232
{
3333
path: COLLECTION_CREATE_PATH,
3434
component: CreateCollectionPageComponent,
35-
canActivate: [AuthenticatedGuard, CreateCollectionPageGuard],
35+
canActivate: [authenticatedGuard, createCollectionPageGuard],
3636
},
3737
{
3838
path: ':id',
@@ -53,12 +53,12 @@ export const ROUTES: Route[] = [
5353
path: 'delete',
5454
pathMatch: 'full',
5555
component: DeleteCollectionPageComponent,
56-
canActivate: [AuthenticatedGuard],
56+
canActivate: [authenticatedGuard],
5757
},
5858
{
5959
path: ITEMTEMPLATE_PATH,
6060
component: ThemedEditItemTemplatePageComponent,
61-
canActivate: [AuthenticatedGuard],
61+
canActivate: [authenticatedGuard],
6262
resolve: {
6363
item: itemTemplatePageResolver,
6464
breadcrumb: i18nBreadcrumbResolver,
@@ -78,7 +78,7 @@ export const ROUTES: Route[] = [
7878
path: 'browse/:id',
7979
pathMatch: 'full',
8080
component: ComcolBrowseByComponent,
81-
canActivate: [BrowseByGuard],
81+
canActivate: [browseByGuard],
8282
resolve: {
8383
breadcrumb: browseByI18nBreadcrumbResolver,
8484
},

src/app/collection-page/create-collection-page/create-collection-page.guard.spec.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,9 @@ import {
66
createFailedRemoteDataObject$,
77
createSuccessfulRemoteDataObject$,
88
} from '../../shared/remote-data.utils';
9-
import { CreateCollectionPageGuard } from './create-collection-page.guard';
9+
import { createCollectionPageGuard } from './create-collection-page.guard';
1010

11-
describe('CreateCollectionPageGuard', () => {
11+
describe('createCollectionPageGuard', () => {
1212
describe('canActivate', () => {
1313
let guard: any;
1414
let router;
@@ -28,7 +28,7 @@ describe('CreateCollectionPageGuard', () => {
2828
};
2929
router = new RouterMock();
3030

31-
guard = CreateCollectionPageGuard;
31+
guard = createCollectionPageGuard;
3232
});
3333

3434
it('should return true when the parent ID resolves to a community', () => {

src/app/collection-page/create-collection-page/create-collection-page.guard.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ import {
2727
* True when either a parent ID query parameter has been provided and the parent ID resolves to a valid parent community
2828
* Reroutes to a 404 page when the page cannot be activated
2929
*/
30-
export const CreateCollectionPageGuard: CanActivateFn = (
30+
export const createCollectionPageGuard: CanActivateFn = (
3131
route: ActivatedRouteSnapshot,
3232
state: RouterStateSnapshot,
3333
communityService: CommunityDataService = inject(CommunityDataService),

0 commit comments

Comments
 (0)