From 2d2ca2016afee28f7ef31176df9f9b1a42d2b276 Mon Sep 17 00:00:00 2001 From: FrancescoMolinaro Date: Mon, 18 Dec 2023 11:40:09 +0100 Subject: [PATCH] refactor --- .../qa/models/quality-assurance-event.model.ts | 8 ++++---- .../quality-assurance-events.component.html | 2 +- .../quality-assurance-events.component.ts | 10 +++++----- .../project-entry-import-modal.component.ts | 4 ++-- src/app/shared/mocks/notifications.mock.ts | 18 +++++++++--------- src/config/default-app-config.ts | 2 +- src/config/quality-assurance.config.ts | 4 ++-- src/environments/environment.test.ts | 2 +- 8 files changed, 25 insertions(+), 25 deletions(-) diff --git a/src/app/core/notifications/qa/models/quality-assurance-event.model.ts b/src/app/core/notifications/qa/models/quality-assurance-event.model.ts index 7517148def..0cdb4a5745 100644 --- a/src/app/core/notifications/qa/models/quality-assurance-event.model.ts +++ b/src/app/core/notifications/qa/models/quality-assurance-event.model.ts @@ -22,7 +22,7 @@ export interface QualityAssuranceEventMessageObject { /** * The interface representing the Quality Assurance event message */ -export interface OpenaireQualityAssuranceEventMessageObject { +export interface SourceQualityAssuranceEventMessageObject { /** * The type of 'value' */ @@ -69,9 +69,9 @@ export interface OpenaireQualityAssuranceEventMessageObject { title: string; /** - * The OPENAIRE ID. + * The Source ID. */ - openaireId: string; + sourceId: string; /** * The PID href. @@ -136,7 +136,7 @@ export class QualityAssuranceEventObject implements CacheableObject { * The suggestion data. Data may vary depending on the source */ @autoserialize - message: OpenaireQualityAssuranceEventMessageObject; + message: SourceQualityAssuranceEventMessageObject; /** * The type of this ConfigObject diff --git a/src/app/notifications/qa/events/quality-assurance-events.component.html b/src/app/notifications/qa/events/quality-assurance-events.component.html index dde372f4dd..f12714b389 100644 --- a/src/app/notifications/qa/events/quality-assurance-events.component.html +++ b/src/app/notifications/qa/events/quality-assurance-events.component.html @@ -85,7 +85,7 @@

{{'quality-assurance.event.table.project' | translate}}
- {{eventElement.event.message.title}} + {{eventElement.event.message.title}}

{{'quality-assurance.event.table.acronym' | translate}} {{eventElement.event.message.acronym}}
diff --git a/src/app/notifications/qa/events/quality-assurance-events.component.ts b/src/app/notifications/qa/events/quality-assurance-events.component.ts index aa2f6c262e..a54186f957 100644 --- a/src/app/notifications/qa/events/quality-assurance-events.component.ts +++ b/src/app/notifications/qa/events/quality-assurance-events.component.ts @@ -10,7 +10,7 @@ import { SortDirection, SortOptions } from '../../../core/cache/models/sort-opti import { PaginatedList } from '../../../core/data/paginated-list.model'; import { RemoteData } from '../../../core/data/remote-data'; import { - OpenaireQualityAssuranceEventMessageObject, + SourceQualityAssuranceEventMessageObject, QualityAssuranceEventObject } from '../../../core/notifications/qa/models/quality-assurance-event.model'; import { @@ -97,9 +97,9 @@ export class QualityAssuranceEventsComponent implements OnInit, OnDestroy { */ public showMore = false; /** - * The Open Aire base url for project search + * The quality assurance source base url for project search */ - public openAireUrl = environment.qualityAssuranceConfig.openAireUrl; + public sourceUrlForProjectSearch = environment.qualityAssuranceConfig.sourceUrlForProjectSearch; /** * The FindListOptions object */ @@ -332,7 +332,7 @@ export class QualityAssuranceEventsComponent implements OnInit, OnDestroy { * Check if the event has a valid href. * @param event */ - public hasPIDHref(event: OpenaireQualityAssuranceEventMessageObject): boolean { + public hasPIDHref(event: SourceQualityAssuranceEventMessageObject): boolean { return this.getPIDHref(event) !== null; } @@ -340,7 +340,7 @@ export class QualityAssuranceEventsComponent implements OnInit, OnDestroy { * Get the event pid href. * @param event */ - public getPIDHref(event: OpenaireQualityAssuranceEventMessageObject): string { + public getPIDHref(event: SourceQualityAssuranceEventMessageObject): string { return event.pidHref; } diff --git a/src/app/notifications/qa/project-entry-import-modal/project-entry-import-modal.component.ts b/src/app/notifications/qa/project-entry-import-modal/project-entry-import-modal.component.ts index 6872baeb90..ad9c1035a5 100644 --- a/src/app/notifications/qa/project-entry-import-modal/project-entry-import-modal.component.ts +++ b/src/app/notifications/qa/project-entry-import-modal/project-entry-import-modal.component.ts @@ -13,7 +13,7 @@ import { PaginationComponentOptions } from '../../../shared/pagination/paginatio import { SearchService } from '../../../core/shared/search/search.service'; import { DSpaceObject } from '../../../core/shared/dspace-object.model'; import { - OpenaireQualityAssuranceEventMessageObject, + SourceQualityAssuranceEventMessageObject, QualityAssuranceEventObject, } from '../../../core/notifications/qa/models/quality-assurance-event.model'; import { hasValue, isNotEmpty } from '../../../shared/empty.util'; @@ -180,7 +180,7 @@ export class ProjectEntryImportModalComponent implements OnInit { public ngOnInit(): void { this.pagination = Object.assign(new PaginationComponentOptions(), { id: 'notifications-project-bound', pageSize: this.pageSize }); this.projectTitle = (this.externalSourceEntry.projectTitle !== null) ? this.externalSourceEntry.projectTitle - : (this.externalSourceEntry.event.message as OpenaireQualityAssuranceEventMessageObject).title; + : (this.externalSourceEntry.event.message as SourceQualityAssuranceEventMessageObject).title; this.searchOptions = Object.assign(new PaginatedSearchOptions( { configuration: this.configuration, diff --git a/src/app/shared/mocks/notifications.mock.ts b/src/app/shared/mocks/notifications.mock.ts index 8c8193071a..707b9a9e6a 100644 --- a/src/app/shared/mocks/notifications.mock.ts +++ b/src/app/shared/mocks/notifications.mock.ts @@ -1476,7 +1476,7 @@ export const qualityAssuranceEventObjectMissingPid: QualityAssuranceEventObject value: '10.18848/1447-9494/cgp/v15i09/45934', pidHref: 'https://doi.org/10.18848/1447-9494/cgp/v15i09/45934', abstract: null, - openaireId: null, + sourceId: null, acronym: null, code: null, funder: null, @@ -1513,7 +1513,7 @@ export const qualityAssuranceEventObjectMissingPid2: QualityAssuranceEventObject value: 'http://thesis2.sba.units.it/store/handle/item/12238', pidHref:'http://thesis2.sba.units.it/store/handle/item/12238', abstract: null, - openaireId: null, + sourceId: null, acronym: null, code: null, funder: null, @@ -1550,7 +1550,7 @@ export const qualityAssuranceEventObjectMissingPid3: QualityAssuranceEventObject value: '10.4324/9780203408889', pidHref: 'https://doi.org/10.4324/9780203408889', abstract: null, - openaireId: null, + sourceId: null, acronym: null, code: null, funder: null, @@ -1587,7 +1587,7 @@ export const qualityAssuranceEventObjectMissingPid4: QualityAssuranceEventObject value: '10.1080/13698230.2018.1430104', pidHref: 'https://doi.org/10.1080/13698230.2018.1430104', abstract: null, - openaireId: null, + sourceId: null, acronym: null, code: null, funder: null, @@ -1624,7 +1624,7 @@ export const qualityAssuranceEventObjectMissingPid5: QualityAssuranceEventObject value: 'http://thesis2.sba.units.it/store/handle/item/12477', pidHref:'http://thesis2.sba.units.it/store/handle/item/12477', abstract: null, - openaireId: null, + sourceId: null, acronym: null, code: null, funder: null, @@ -1661,7 +1661,7 @@ export const qualityAssuranceEventObjectMissingPid6: QualityAssuranceEventObject value: '10.1111/j.1475-4975.2004.00098.x', pidHref: 'https://doi.org/10.1111/j.1475-4975.2004.00098.x', abstract: null, - openaireId: null, + sourceId: null, acronym: null, code: null, funder: null, @@ -1698,7 +1698,7 @@ export const qualityAssuranceEventObjectMissingAbstract: QualityAssuranceEventOb value: null, pidHref: null, abstract: 'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nulla scelerisque vestibulum tellus sed lacinia. Aenean vitae sapien a quam congue ultrices. Sed vehicula sollicitudin ligula, vitae lacinia velit. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nulla scelerisque vestibulum tellus sed lacinia. Aenean vitae sapien a quam congue ultrices. Sed vehicula sollicitudin ligula, vitae lacinia velit.', - openaireId: null, + sourceId: null, acronym: null, code: null, funder: null, @@ -1735,7 +1735,7 @@ export const qualityAssuranceEventObjectMissingProjectFound: QualityAssuranceEve value: null, pidHref: null, abstract: null, - openaireId: null, + sourceId: null, acronym: 'PAThs', code: '687567', funder: 'EC', @@ -1772,7 +1772,7 @@ export const qualityAssuranceEventObjectMissingProjectNotFound: QualityAssurance value: null, pidHref: null, abstract: null, - openaireId: null, + sourceId: null, acronym: 'PAThs', code: '687567B', funder: 'EC', diff --git a/src/config/default-app-config.ts b/src/config/default-app-config.ts index e379b365e0..16de9b2e1c 100644 --- a/src/config/default-app-config.ts +++ b/src/config/default-app-config.ts @@ -435,7 +435,7 @@ export class DefaultAppConfig implements AppConfig { }; qualityAssuranceConfig: QualityAssuranceConfig = { - openAireUrl: 'https://explore.openaire.eu/search/project?projectId=', + sourceUrlForProjectSearch: 'https://explore.openaire.eu/search/project?projectId=', pageSize: 5, }; } diff --git a/src/config/quality-assurance.config.ts b/src/config/quality-assurance.config.ts index 14161b4113..10f4106d7f 100644 --- a/src/config/quality-assurance.config.ts +++ b/src/config/quality-assurance.config.ts @@ -7,9 +7,9 @@ import { Config } from './config.interface'; export class QualityAssuranceConfig implements Config { /** - * Url for OAIRE resources + * Url for project search on quality assurance resource */ - public openAireUrl: string; + public sourceUrlForProjectSearch: string; /** * default count of QA sources to load */ diff --git a/src/environments/environment.test.ts b/src/environments/environment.test.ts index 89a8e2bc0f..e882527ee8 100644 --- a/src/environments/environment.test.ts +++ b/src/environments/environment.test.ts @@ -307,7 +307,7 @@ export const environment: BuildConfig = { sortDirection:'ASC', }, qualityAssuranceConfig: { - openAireUrl: 'https://explore.openaire.eu/search/project?projectId=', + sourceUrlForProjectSearch: 'https://explore.openaire.eu/search/project?projectId=', pageSize: 5, },