Skip to content

Commit 2d2ca20

Browse files
refactor
1 parent b3a345a commit 2d2ca20

8 files changed

Lines changed: 25 additions & 25 deletions

File tree

src/app/core/notifications/qa/models/quality-assurance-event.model.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ export interface QualityAssuranceEventMessageObject {
2222
/**
2323
* The interface representing the Quality Assurance event message
2424
*/
25-
export interface OpenaireQualityAssuranceEventMessageObject {
25+
export interface SourceQualityAssuranceEventMessageObject {
2626
/**
2727
* The type of 'value'
2828
*/
@@ -69,9 +69,9 @@ export interface OpenaireQualityAssuranceEventMessageObject {
6969
title: string;
7070

7171
/**
72-
* The OPENAIRE ID.
72+
* The Source ID.
7373
*/
74-
openaireId: string;
74+
sourceId: string;
7575

7676
/**
7777
* The PID href.
@@ -136,7 +136,7 @@ export class QualityAssuranceEventObject implements CacheableObject {
136136
* The suggestion data. Data may vary depending on the source
137137
*/
138138
@autoserialize
139-
message: OpenaireQualityAssuranceEventMessageObject;
139+
message: SourceQualityAssuranceEventMessageObject;
140140

141141
/**
142142
* The type of this ConfigObject

src/app/notifications/qa/events/quality-assurance-events.component.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ <h4 class="border-bottom pb-2">
8585
</p>
8686
<p>
8787
<span class="small">{{'quality-assurance.event.table.project' | translate}}</span><br>
88-
<a href="{{openAireUrl}}{{ eventElement.event.message.openaireId}}" rel="noopener noreferrer" target="_blank">{{eventElement.event.message.title}}</a>
88+
<a href="{{sourceUrlForProjectSearch}}{{ eventElement.event.message.sourceId}}" rel="noopener noreferrer" target="_blank">{{eventElement.event.message.title}}</a>
8989
</p>
9090
<p>
9191
<span *ngIf="eventElement.event.message.acronym"><span class="small">{{'quality-assurance.event.table.acronym' | translate}}</span>&nbsp;<span class="badge badge-info">{{eventElement.event.message.acronym}}</span><br></span>

src/app/notifications/qa/events/quality-assurance-events.component.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ import { SortDirection, SortOptions } from '../../../core/cache/models/sort-opti
1010
import { PaginatedList } from '../../../core/data/paginated-list.model';
1111
import { RemoteData } from '../../../core/data/remote-data';
1212
import {
13-
OpenaireQualityAssuranceEventMessageObject,
13+
SourceQualityAssuranceEventMessageObject,
1414
QualityAssuranceEventObject
1515
} from '../../../core/notifications/qa/models/quality-assurance-event.model';
1616
import {
@@ -97,9 +97,9 @@ export class QualityAssuranceEventsComponent implements OnInit, OnDestroy {
9797
*/
9898
public showMore = false;
9999
/**
100-
* The Open Aire base url for project search
100+
* The quality assurance source base url for project search
101101
*/
102-
public openAireUrl = environment.qualityAssuranceConfig.openAireUrl;
102+
public sourceUrlForProjectSearch = environment.qualityAssuranceConfig.sourceUrlForProjectSearch;
103103
/**
104104
* The FindListOptions object
105105
*/
@@ -332,15 +332,15 @@ export class QualityAssuranceEventsComponent implements OnInit, OnDestroy {
332332
* Check if the event has a valid href.
333333
* @param event
334334
*/
335-
public hasPIDHref(event: OpenaireQualityAssuranceEventMessageObject): boolean {
335+
public hasPIDHref(event: SourceQualityAssuranceEventMessageObject): boolean {
336336
return this.getPIDHref(event) !== null;
337337
}
338338

339339
/**
340340
* Get the event pid href.
341341
* @param event
342342
*/
343-
public getPIDHref(event: OpenaireQualityAssuranceEventMessageObject): string {
343+
public getPIDHref(event: SourceQualityAssuranceEventMessageObject): string {
344344
return event.pidHref;
345345
}
346346

src/app/notifications/qa/project-entry-import-modal/project-entry-import-modal.component.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ import { PaginationComponentOptions } from '../../../shared/pagination/paginatio
1313
import { SearchService } from '../../../core/shared/search/search.service';
1414
import { DSpaceObject } from '../../../core/shared/dspace-object.model';
1515
import {
16-
OpenaireQualityAssuranceEventMessageObject,
16+
SourceQualityAssuranceEventMessageObject,
1717
QualityAssuranceEventObject,
1818
} from '../../../core/notifications/qa/models/quality-assurance-event.model';
1919
import { hasValue, isNotEmpty } from '../../../shared/empty.util';
@@ -180,7 +180,7 @@ export class ProjectEntryImportModalComponent implements OnInit {
180180
public ngOnInit(): void {
181181
this.pagination = Object.assign(new PaginationComponentOptions(), { id: 'notifications-project-bound', pageSize: this.pageSize });
182182
this.projectTitle = (this.externalSourceEntry.projectTitle !== null) ? this.externalSourceEntry.projectTitle
183-
: (this.externalSourceEntry.event.message as OpenaireQualityAssuranceEventMessageObject).title;
183+
: (this.externalSourceEntry.event.message as SourceQualityAssuranceEventMessageObject).title;
184184
this.searchOptions = Object.assign(new PaginatedSearchOptions(
185185
{
186186
configuration: this.configuration,

src/app/shared/mocks/notifications.mock.ts

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1476,7 +1476,7 @@ export const qualityAssuranceEventObjectMissingPid: QualityAssuranceEventObject
14761476
value: '10.18848/1447-9494/cgp/v15i09/45934',
14771477
pidHref: 'https://doi.org/10.18848/1447-9494/cgp/v15i09/45934',
14781478
abstract: null,
1479-
openaireId: null,
1479+
sourceId: null,
14801480
acronym: null,
14811481
code: null,
14821482
funder: null,
@@ -1513,7 +1513,7 @@ export const qualityAssuranceEventObjectMissingPid2: QualityAssuranceEventObject
15131513
value: 'http://thesis2.sba.units.it/store/handle/item/12238',
15141514
pidHref:'http://thesis2.sba.units.it/store/handle/item/12238',
15151515
abstract: null,
1516-
openaireId: null,
1516+
sourceId: null,
15171517
acronym: null,
15181518
code: null,
15191519
funder: null,
@@ -1550,7 +1550,7 @@ export const qualityAssuranceEventObjectMissingPid3: QualityAssuranceEventObject
15501550
value: '10.4324/9780203408889',
15511551
pidHref: 'https://doi.org/10.4324/9780203408889',
15521552
abstract: null,
1553-
openaireId: null,
1553+
sourceId: null,
15541554
acronym: null,
15551555
code: null,
15561556
funder: null,
@@ -1587,7 +1587,7 @@ export const qualityAssuranceEventObjectMissingPid4: QualityAssuranceEventObject
15871587
value: '10.1080/13698230.2018.1430104',
15881588
pidHref: 'https://doi.org/10.1080/13698230.2018.1430104',
15891589
abstract: null,
1590-
openaireId: null,
1590+
sourceId: null,
15911591
acronym: null,
15921592
code: null,
15931593
funder: null,
@@ -1624,7 +1624,7 @@ export const qualityAssuranceEventObjectMissingPid5: QualityAssuranceEventObject
16241624
value: 'http://thesis2.sba.units.it/store/handle/item/12477',
16251625
pidHref:'http://thesis2.sba.units.it/store/handle/item/12477',
16261626
abstract: null,
1627-
openaireId: null,
1627+
sourceId: null,
16281628
acronym: null,
16291629
code: null,
16301630
funder: null,
@@ -1661,7 +1661,7 @@ export const qualityAssuranceEventObjectMissingPid6: QualityAssuranceEventObject
16611661
value: '10.1111/j.1475-4975.2004.00098.x',
16621662
pidHref: 'https://doi.org/10.1111/j.1475-4975.2004.00098.x',
16631663
abstract: null,
1664-
openaireId: null,
1664+
sourceId: null,
16651665
acronym: null,
16661666
code: null,
16671667
funder: null,
@@ -1698,7 +1698,7 @@ export const qualityAssuranceEventObjectMissingAbstract: QualityAssuranceEventOb
16981698
value: null,
16991699
pidHref: null,
17001700
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.',
1701-
openaireId: null,
1701+
sourceId: null,
17021702
acronym: null,
17031703
code: null,
17041704
funder: null,
@@ -1735,7 +1735,7 @@ export const qualityAssuranceEventObjectMissingProjectFound: QualityAssuranceEve
17351735
value: null,
17361736
pidHref: null,
17371737
abstract: null,
1738-
openaireId: null,
1738+
sourceId: null,
17391739
acronym: 'PAThs',
17401740
code: '687567',
17411741
funder: 'EC',
@@ -1772,7 +1772,7 @@ export const qualityAssuranceEventObjectMissingProjectNotFound: QualityAssurance
17721772
value: null,
17731773
pidHref: null,
17741774
abstract: null,
1775-
openaireId: null,
1775+
sourceId: null,
17761776
acronym: 'PAThs',
17771777
code: '687567B',
17781778
funder: 'EC',

src/config/default-app-config.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -435,7 +435,7 @@ export class DefaultAppConfig implements AppConfig {
435435
};
436436

437437
qualityAssuranceConfig: QualityAssuranceConfig = {
438-
openAireUrl: 'https://explore.openaire.eu/search/project?projectId=',
438+
sourceUrlForProjectSearch: 'https://explore.openaire.eu/search/project?projectId=',
439439
pageSize: 5,
440440
};
441441
}

src/config/quality-assurance.config.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,9 @@ import { Config } from './config.interface';
77
export class QualityAssuranceConfig implements Config {
88

99
/**
10-
* Url for OAIRE resources
10+
* Url for project search on quality assurance resource
1111
*/
12-
public openAireUrl: string;
12+
public sourceUrlForProjectSearch: string;
1313
/**
1414
* default count of QA sources to load
1515
*/

src/environments/environment.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -307,7 +307,7 @@ export const environment: BuildConfig = {
307307
sortDirection:'ASC',
308308
},
309309
qualityAssuranceConfig: {
310-
openAireUrl: 'https://explore.openaire.eu/search/project?projectId=',
310+
sourceUrlForProjectSearch: 'https://explore.openaire.eu/search/project?projectId=',
311311
pageSize: 5,
312312
},
313313

0 commit comments

Comments
 (0)