[Trunk | Library]:

1. result-preview.ts: In Project interface, added optional boolean field "validated" (parsed in landing pages to show validated projects by funders).
2. parsingFunctions.class.ts: In method "parseFundingByProjects()" added parsing for "validated" field.   
3. fundedBy.component.ts: ticket #6228 - Show "Validated by funder" message if "validate" field is true.
4. dataProvider.component.ts: [Bug fix] In method "getDataProviderAggregationStatus()" set "aggregationStatusIsInitialized" to true on success and on error
        (not on complete, because after error it never completes and keeps on loading).
5. orcid.component.ts: [Bug fix]
        a. In method "getToken()" set "showLoading" to false on success and on error (after error there is no complete).
        b. In method "getPersonalDetails()" move "setTimeout" from complete to error.
6. showPublisher.component.ts: [Bug fix] Add "UTC" in pipe when showing published date ({{publishDate | date: 'dd MMM yyyy' : 'UTC'}}).
7. timeout-interceptor.service.ts: Timeout only GET requests.


git-svn-id: https://svn.driver.research-infrastructures.eu/driver/dnet40/modules/uoa-services-library/trunk/ng-openaire-library/src/app@61003 d315682c-612b-4755-9ff5-7f18f6832af3
This commit is contained in:
konstantina.galouni 2021-05-13 15:48:01 +00:00
parent 6eed709019
commit 64595c7382
7 changed files with 26 additions and 19 deletions

View File

@ -271,13 +271,12 @@ export class DataProviderComponent {
this.subscriptions.push(this._dataproviderService.getDataproviderAggregationStatus(originalId, this.properties).subscribe(
data => {
this.dataProviderInfo.aggregationStatus = data;
this.aggregationStatusIsInitialized = true;
},
err => {
//console.log(err);
this.handleError("Error getting content provider aggregation status for id: " + this.datasourceId, err);
},
() => {
this.aggregationStatusIsInitialized = true;
this.handleError("Error getting content provider aggregation status for id: " + this.datasourceId, err);
}
));
}

View File

@ -47,8 +47,10 @@ import {properties} from "../../../../environments/environment";
<span class="uk-text-muted">Funding stream: </span>{{item.funding}}
</li>
</ul>
<div *ngIf="item.provenanceAction" class="uk-text-muted">
{{item.provenanceAction}}
<div *ngIf="item.provenanceAction || item.validated" class="uk-text-muted">
<span *ngIf="item.validated">Validated by funder</span>
<span *ngIf="item.provenanceAction && item.validated"> | </span>
<span *ngIf="item.provenanceAction">{{item.provenanceAction}}</span>
</div>
</div>
<span *ngIf="i < (fundedByProjects.slice(0, showNum).length - 1)">, </span>

View File

@ -21,7 +21,7 @@ export class ParsingFunctions {
let fundedByProject: Project = {
"id": "", "acronym": "", "title": "",
"funderShortname": "", "funderName": "",
"funding": "", "code": "", "provenanceAction": ""
"funding": "", "code": "", "provenanceAction": "", "validated": false
};
if (relation.title != 'unidentified') {
@ -29,7 +29,10 @@ export class ParsingFunctions {
fundedByProject['acronym'] = relation.acronym;
fundedByProject['title'] = relation.title;
fundedByProject['code'] = relation.code;
if(relation.validated && relation.validated.date) {
fundedByProject['validated'] = true;
}
if (provenanceActionVocabulary != null && relation.provenanceaction in provenanceActionVocabulary) {
fundedByProject['provenanceAction'] = provenanceActionVocabulary[relation.provenanceaction];
}

View File

@ -8,7 +8,7 @@ import {EnvProperties} from "../../utils/properties/env-properties";
|| journal['volume'] || journal['eissn'] || journal['issue'])">
<span *ngIf="publishDate" class="uk-margin-right">
<span class="uk-text-muted">Published: </span>
{{publishDate | date: 'dd MMM yyyy'}}
{{publishDate | date: 'dd MMM yyyy' : 'UTC'}}
</span>
<span *ngIf="journal && (journal['journal'] || journal['issn'] || journal['lissn']
|| journal['volume'] || journal['eissn'] || journal['issue'])">

View File

@ -105,15 +105,15 @@ export class OrcidComponent {
}
// this.message = "Thank you for connecting your ORCID iD with OpenAIRE! Please close this window and continue!";
}
this.showLoading = false;
},
error => {
this.showLoading = false;
this.gotToken = true;
console.error("Error getting token from code: "+code, error);
this.message = "An error occured while trying to connect your ORCID iD with OpenAIRE. Please try again!";
},
() => {
this.showLoading = false;
}
)
}
@ -147,17 +147,15 @@ export class OrcidComponent {
} else {
this._router.navigate([properties.searchLinkToAdvancedResults], {});
}
},
error => {
setTimeout(() => {
this.message += "<div class='uk-margin-top'>If you are not authomatically redirected, please navigate to our search pages.</div>";
}, 3000);
}));
} else {
this.getToken(this.code);
}
},
() => {
if(this.gotToken) {
setTimeout(() => {
this.message += "<div class='uk-margin-top'>If you are not authomatically redirected, please navigate to our search pages.</div>";
}, 3000);
}
}
));
}
@ -175,4 +173,4 @@ export class OrcidComponent {
private updateUrl(url: string) {
this._meta.updateTag({content: url}, "property='og:url'");
}
}
}

View File

@ -11,6 +11,10 @@ export class TimeoutInterceptor implements HttpInterceptor {
}
intercept(req: HttpRequest<any>, next: HttpHandler): Observable<HttpEvent<any>> {
if (req.method !== 'GET') {
return next.handle(req);
}
const timeoutValue = req.headers.get('timeout') || this.defaultTimeout;
const timeoutValueNumeric = Number(timeoutValue);

View File

@ -42,6 +42,7 @@ export interface Project {
funderName: string;
funding?: string;
code: string;
validated?: boolean;
budget?: string;
contribution?: string;
currency?: string;