[Library|Trunk]

- Error interceptor add check for registry url
- landing canonical: keep  the canonical id (to be used in services like usage counts) and put the 1st pid for the canonical url



git-svn-id: https://svn.driver.research-infrastructures.eu/driver/dnet40/modules/uoa-services-library/trunk/ng-openaire-library/src/app@60422 d315682c-612b-4755-9ff5-7f18f6832af3
This commit is contained in:
argiro.kokogiannaki 2021-02-15 13:19:33 +00:00
parent 061452d127
commit ed5f31cb7b
4 changed files with 6 additions and 7 deletions

View File

@ -12,7 +12,7 @@ import {Subscriber} from "rxjs";
<div class="uk-grid uk-margin-small-top" >
<div class="tm-main uk-width-1-1@s uk-width-1-1@m uk-width-1-1@l uk-row-first ">
<div class="uk-container">
<div class="uk-container uk-container-large">
<div class="uk-article-title custom-article-title">
My links
</div>

View File

@ -18,7 +18,7 @@ export class ErrorInterceptorService implements HttpInterceptor {
intercept(req: HttpRequest<any>, next: HttpHandler): Observable<HttpEvent<any>> {
return next.handle(req).pipe(catchError(err => {
if ((err.status === 0 && this.isService(req, properties.registryUrl)) ||
if ((err.status === 0 && properties.registryUrl && this.isService(req, properties.registryUrl)) ||
(err.status === 401 && !this.isService(req, ErrorInterceptorService.UNAUTHORIZED_WHITELIST))) {
this.logOut();
} else if(err.status === 403) {

View File

@ -356,7 +356,9 @@ export class ResultLandingComponent {
if (this.type == "result") { // no type was specified - update URL based this.resultLandingInfo.resultType
this.updateUrlWithType();
}
this.seoService.createLinkForCanonicalURL(this.properties.domain+ properties.baseLink + this.linkToLandingPage + this.resultLandingInfo.relcanId);
let pid:Identifier = Identifier.getResultPIDFromIdentifiers(this.resultLandingInfo.identifiers);
this.seoService.createLinkForCanonicalURL(this.properties.domain+ properties.baseLink + ( pid ? (this.linkToLandingPage.split("?")[0] + "?pid=" + pid.id):
(this.linkToLandingPage + this.resultLandingInfo.relcanId)));
if ((this.type == "publication") && (this.properties.environment == "beta" || this.properties.environment == "development") && (typeof document !== 'undefined')) {
this.getOpenCitations();
}

View File

@ -269,10 +269,7 @@ export class ResultLandingService {
if(data[4] != null) {
this.resultLandingInfo.identifiers = this.parsingFunctions.parseIdentifiers(data[4]);
}
let pid:Identifier = Identifier.getResultPIDFromIdentifiers(this.resultLandingInfo.identifiers);
if(pid){
this.resultLandingInfo.relcanId = encodeURIComponent(pid.id);
}
// res['result']['metadata']['oaf:entity']['oaf:result']['journal']
if(data[5] != null) {
this.resultLandingInfo.journal = {"journal": "", "issn": "", "lissn": "", "eissn": "", "issue": "", "volume": "", "start_page": "", "end_page": ""}