-
Notifications
You must be signed in to change notification settings - Fork 437
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merged in align-coar-notify-7-with-main (pull request #1366)
Align coar notify 7 with main
- Loading branch information
Showing
139 changed files
with
3,212 additions
and
963 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
32 changes: 32 additions & 0 deletions
32
...ons-publication-claim-page/admin-notifications-publication-claim-page-resolver.service.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
import { Injectable } from '@angular/core'; | ||
import { ActivatedRouteSnapshot, Resolve, RouterStateSnapshot } from '@angular/router'; | ||
|
||
/** | ||
* Interface for the route parameters. | ||
*/ | ||
export interface NotificationsSuggestionTargetsPageParams { | ||
pageId?: string; | ||
pageSize?: number; | ||
currentPage?: number; | ||
} | ||
|
||
/** | ||
* This class represents a resolver that retrieve the route data before the route is activated. | ||
*/ | ||
@Injectable() | ||
export class NotificationsSuggestionTargetsPageResolver implements Resolve<NotificationsSuggestionTargetsPageParams> { | ||
|
||
/** | ||
* Method for resolving the parameters in the current route. | ||
* @param {ActivatedRouteSnapshot} route The current ActivatedRouteSnapshot | ||
* @param {RouterStateSnapshot} state The current RouterStateSnapshot | ||
* @returns AdminNotificationsSuggestionTargetsPageParams Emits the route parameters | ||
*/ | ||
resolve(route: ActivatedRouteSnapshot, state: RouterStateSnapshot): NotificationsSuggestionTargetsPageParams { | ||
return { | ||
pageId: route.queryParams.pageId, | ||
pageSize: parseInt(route.queryParams.pageSize, 10), | ||
currentPage: parseInt(route.queryParams.page, 10) | ||
}; | ||
} | ||
} |
1 change: 1 addition & 0 deletions
1
...ications-publication-claim-page/admin-notifications-publication-claim-page.component.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
<ds-publication-claim [source]="'openaire'"></ds-publication-claim> |
Empty file.
40 changes: 40 additions & 0 deletions
40
...tions-publication-claim-page/admin-notifications-publication-claim-page.component.spec.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
import { async, ComponentFixture, TestBed } from '@angular/core/testing'; | ||
|
||
import { NO_ERRORS_SCHEMA } from '@angular/core'; | ||
import { CommonModule } from '@angular/common'; | ||
import { TranslateModule } from '@ngx-translate/core'; | ||
import { | ||
NotificationsSuggestionTargetsPageComponent | ||
} from '../../../quality-assurance-notifications-pages/notifications-suggestion-targets-page/notifications-suggestion-targets-page.component'; | ||
|
||
describe('NotificationsSuggestionTargetsPageComponent', () => { | ||
let component: NotificationsSuggestionTargetsPageComponent; | ||
let fixture: ComponentFixture<NotificationsSuggestionTargetsPageComponent>; | ||
|
||
beforeEach(async(() => { | ||
TestBed.configureTestingModule({ | ||
imports: [ | ||
CommonModule, | ||
TranslateModule.forRoot() | ||
], | ||
declarations: [ | ||
NotificationsSuggestionTargetsPageComponent | ||
], | ||
providers: [ | ||
NotificationsSuggestionTargetsPageComponent | ||
], | ||
schemas: [NO_ERRORS_SCHEMA] | ||
}) | ||
.compileComponents(); | ||
})); | ||
|
||
beforeEach(() => { | ||
fixture = TestBed.createComponent(NotificationsSuggestionTargetsPageComponent); | ||
component = fixture.componentInstance; | ||
fixture.detectChanges(); | ||
}); | ||
|
||
it('should create', () => { | ||
expect(component).toBeTruthy(); | ||
}); | ||
}); |
10 changes: 10 additions & 0 deletions
10
...ifications-publication-claim-page/admin-notifications-publication-claim-page.component.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
import { Component } from '@angular/core'; | ||
|
||
@Component({ | ||
selector: 'ds-admin-notifications-publication-claim-page', | ||
templateUrl: './admin-notifications-publication-claim-page.component.html', | ||
styleUrls: ['./admin-notifications-publication-claim-page.component.scss'] | ||
}) | ||
export class AdminNotificationsPublicationClaimPageComponent { | ||
|
||
} |
9 changes: 9 additions & 0 deletions
9
src/app/admin/admin-notifications/admin-notifications-routing-paths.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
import { URLCombiner } from '../../core/url-combiner/url-combiner'; | ||
import { getNotificationsModuleRoute } from '../admin-routing-paths'; | ||
|
||
export const QUALITY_ASSURANCE_EDIT_PATH = 'quality-assurance'; | ||
export const PUBLICATION_CLAIMS_PATH = 'publication-claim'; | ||
|
||
export function getQualityAssuranceRoute(id: string) { | ||
return new URLCombiner(getNotificationsModuleRoute(), QUALITY_ASSURANCE_EDIT_PATH, id).toString(); | ||
} |
122 changes: 122 additions & 0 deletions
122
src/app/admin/admin-notifications/admin-notifications-routing.module.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,122 @@ | ||
import { NgModule } from '@angular/core'; | ||
import { RouterModule } from '@angular/router'; | ||
|
||
import { AuthenticatedGuard } from '../../core/auth/authenticated.guard'; | ||
import { I18nBreadcrumbResolver } from '../../core/breadcrumbs/i18n-breadcrumb.resolver'; | ||
import { I18nBreadcrumbsService } from '../../core/breadcrumbs/i18n-breadcrumbs.service'; | ||
import { PUBLICATION_CLAIMS_PATH } from './admin-notifications-routing-paths'; | ||
import { AdminNotificationsPublicationClaimPageComponent } from './admin-notifications-publication-claim-page/admin-notifications-publication-claim-page.component'; | ||
import { QUALITY_ASSURANCE_EDIT_PATH } from './admin-notifications-routing-paths'; | ||
import { QualityAssuranceBreadcrumbResolver } from '../../core/breadcrumbs/quality-assurance-breadcrumb.resolver'; | ||
import { QualityAssuranceBreadcrumbService } from '../../core/breadcrumbs/quality-assurance-breadcrumb.service'; | ||
import { | ||
AdminNotificationsPublicationClaimPageResolver | ||
} from '../../quality-assurance-notifications-pages/notifications-suggestion-targets-page/notifications-suggestion-targets-page-resolver.service'; | ||
import { | ||
QualityAssuranceTopicsPageComponent | ||
} from '../../quality-assurance-notifications-pages/quality-assurance-topics-page/quality-assurance-topics-page.component'; | ||
import { | ||
QualityAssuranceTopicsPageResolver | ||
} from '../../quality-assurance-notifications-pages/quality-assurance-topics-page/quality-assurance-topics-page-resolver.service'; | ||
import { | ||
SourceDataResolver | ||
} from '../../quality-assurance-notifications-pages/quality-assurance-source-page-component/quality-assurance-source-data.resolver'; | ||
import { | ||
QualityAssuranceEventsPageResolver | ||
} from '../../quality-assurance-notifications-pages/quality-assurance-events-page/quality-assurance-events-page.resolver'; | ||
import { | ||
QualityAssuranceEventsPageComponent | ||
} from '../../quality-assurance-notifications-pages/quality-assurance-events-page/quality-assurance-events-page.component'; | ||
import { | ||
QualityAssuranceSourcePageResolver | ||
} from '../../quality-assurance-notifications-pages/quality-assurance-source-page-component/quality-assurance-source-page-resolver.service'; | ||
import { | ||
QualityAssuranceSourcePageComponent | ||
} from '../../quality-assurance-notifications-pages/quality-assurance-source-page-component/quality-assurance-source-page.component'; | ||
|
||
|
||
@NgModule({ | ||
imports: [ | ||
RouterModule.forChild([ | ||
{ | ||
canActivate: [ AuthenticatedGuard ], | ||
path: `${PUBLICATION_CLAIMS_PATH}`, | ||
component: AdminNotificationsPublicationClaimPageComponent, | ||
pathMatch: 'full', | ||
resolve: { | ||
breadcrumb: I18nBreadcrumbResolver, | ||
suggestionTargetParams: AdminNotificationsPublicationClaimPageResolver | ||
}, | ||
data: { | ||
title: 'admin.notifications.publicationclaim.page.title', | ||
breadcrumbKey: 'admin.notifications.publicationclaim', | ||
showBreadcrumbsFluid: false | ||
} | ||
}, | ||
{ | ||
canActivate: [ AuthenticatedGuard ], | ||
path: `${QUALITY_ASSURANCE_EDIT_PATH}/:sourceId`, | ||
component: QualityAssuranceTopicsPageComponent, | ||
pathMatch: 'full', | ||
resolve: { | ||
breadcrumb: QualityAssuranceBreadcrumbResolver, | ||
openaireQualityAssuranceTopicsParams: QualityAssuranceTopicsPageResolver | ||
}, | ||
data: { | ||
title: 'admin.quality-assurance.page.title', | ||
breadcrumbKey: 'admin.quality-assurance', | ||
showBreadcrumbsFluid: false | ||
} | ||
}, | ||
{ | ||
canActivate: [ AuthenticatedGuard ], | ||
path: `${QUALITY_ASSURANCE_EDIT_PATH}`, | ||
component: QualityAssuranceSourcePageComponent, | ||
pathMatch: 'full', | ||
resolve: { | ||
breadcrumb: I18nBreadcrumbResolver, | ||
openaireQualityAssuranceSourceParams: QualityAssuranceSourcePageResolver, | ||
sourceData: SourceDataResolver | ||
}, | ||
data: { | ||
title: 'admin.notifications.source.breadcrumbs', | ||
breadcrumbKey: 'admin.notifications.source', | ||
showBreadcrumbsFluid: false | ||
} | ||
}, | ||
{ | ||
canActivate: [ AuthenticatedGuard ], | ||
path: `${QUALITY_ASSURANCE_EDIT_PATH}/:sourceId/:topicId`, | ||
component: QualityAssuranceEventsPageComponent, | ||
pathMatch: 'full', | ||
resolve: { | ||
breadcrumb: QualityAssuranceBreadcrumbResolver, | ||
openaireQualityAssuranceEventsParams: QualityAssuranceEventsPageResolver | ||
}, | ||
data: { | ||
title: 'admin.notifications.event.page.title', | ||
breadcrumbKey: 'admin.notifications.event', | ||
showBreadcrumbsFluid: false | ||
} | ||
} | ||
]) | ||
], | ||
providers: [ | ||
I18nBreadcrumbResolver, | ||
I18nBreadcrumbsService, | ||
AdminNotificationsPublicationClaimPageResolver, | ||
SourceDataResolver, | ||
QualityAssuranceSourcePageResolver, | ||
QualityAssuranceTopicsPageResolver, | ||
QualityAssuranceEventsPageResolver, | ||
QualityAssuranceSourcePageResolver, | ||
QualityAssuranceBreadcrumbResolver, | ||
QualityAssuranceBreadcrumbService | ||
] | ||
}) | ||
/** | ||
* Routing module for the Notifications section of the admin sidebar | ||
*/ | ||
export class AdminNotificationsRoutingModule { | ||
|
||
} |
33 changes: 33 additions & 0 deletions
33
src/app/admin/admin-notifications/admin-notifications.module.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
import { CommonModule } from '@angular/common'; | ||
import { NgModule } from '@angular/core'; | ||
import { CoreModule } from '../../core/core.module'; | ||
import { SharedModule } from '../../shared/shared.module'; | ||
import { AdminNotificationsRoutingModule } from './admin-notifications-routing.module'; | ||
import { AdminNotificationsPublicationClaimPageComponent } from './admin-notifications-publication-claim-page/admin-notifications-publication-claim-page.component'; | ||
import { NotificationsModule } from '../../notifications/notifications.module'; | ||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
@NgModule({ | ||
imports: [ | ||
CommonModule, | ||
SharedModule, | ||
CoreModule.forRoot(), | ||
AdminNotificationsRoutingModule, | ||
NotificationsModule | ||
], | ||
declarations: [ | ||
AdminNotificationsPublicationClaimPageComponent, | ||
], | ||
entryComponents: [] | ||
}) | ||
/** | ||
* This module handles all components related to the notifications pages | ||
*/ | ||
export class AdminNotificationsModule { | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
31 changes: 31 additions & 0 deletions
31
src/app/core/breadcrumbs/publication-claim-breadcrumb.resolver.spec.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
import { PublicationClaimBreadcrumbResolver } from './publication-claim-breadcrumb.resolver'; | ||
|
||
describe('PublicationClaimBreadcrumbResolver', () => { | ||
describe('resolve', () => { | ||
let resolver: PublicationClaimBreadcrumbResolver; | ||
let publicationClaimBreadcrumbService: any; | ||
const fullPath = '/test/publication-claim/openaire:6bee076d-4f2a-4555-a475-04a267769b2a'; | ||
const expectedKey = '6bee076d-4f2a-4555-a475-04a267769b2a'; | ||
const expectedId = 'openaire:6bee076d-4f2a-4555-a475-04a267769b2a'; | ||
let route; | ||
|
||
beforeEach(() => { | ||
route = { | ||
paramMap: { | ||
get: function (param) { | ||
return this[param]; | ||
}, | ||
targetId: expectedId, | ||
} | ||
}; | ||
publicationClaimBreadcrumbService = {}; | ||
resolver = new PublicationClaimBreadcrumbResolver(publicationClaimBreadcrumbService); | ||
}); | ||
|
||
it('should resolve the breadcrumb config', () => { | ||
const resolvedConfig = resolver.resolve(route as any, {url: fullPath } as any); | ||
const expectedConfig = { provider: publicationClaimBreadcrumbService, key: expectedKey }; | ||
expect(resolvedConfig).toEqual(expectedConfig); | ||
}); | ||
}); | ||
}); |
24 changes: 24 additions & 0 deletions
24
src/app/core/breadcrumbs/publication-claim-breadcrumb.resolver.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
import { Injectable } from '@angular/core'; | ||
import { ActivatedRouteSnapshot, Resolve, RouterStateSnapshot } from '@angular/router'; | ||
import {BreadcrumbConfig} from '../../breadcrumbs/breadcrumb/breadcrumb-config.model'; | ||
import { PublicationClaimBreadcrumbService } from './publication-claim-breadcrumb.service'; | ||
|
||
@Injectable({ | ||
providedIn: 'root' | ||
}) | ||
export class PublicationClaimBreadcrumbResolver implements Resolve<BreadcrumbConfig<string>> { | ||
constructor(protected breadcrumbService: PublicationClaimBreadcrumbService) { | ||
} | ||
|
||
/** | ||
* Method that resolve Publication Claim item into a breadcrumb | ||
* The parameter are retrieved by the url since part of the Publication Claim route config | ||
* @param {ActivatedRouteSnapshot} route The current ActivatedRouteSnapshot | ||
* @param {RouterStateSnapshot} state The current RouterStateSnapshot | ||
* @returns BreadcrumbConfig object | ||
*/ | ||
resolve(route: ActivatedRouteSnapshot, state: RouterStateSnapshot): BreadcrumbConfig<string> { | ||
const targetId = route.paramMap.get('targetId').split(':')[1]; | ||
return { provider: this.breadcrumbService, key: targetId }; | ||
} | ||
} |
Oops, something went wrong.