From fc2ab4046f9fff0a8a28084434d02753ec44084f Mon Sep 17 00:00:00 2001 From: "argiro.kokogiannaki" Date: Mon, 29 Mar 2021 14:01:24 +0000 Subject: [PATCH] [Library|Trunk] errorPage: page=-1 parameter for private data message git-svn-id: https://svn.driver.research-infrastructures.eu/driver/dnet40/modules/uoa-services-library/trunk/ng-openaire-library/src/app@60744 d315682c-612b-4755-9ff5-7f18f6832af3 --- error/errorPage.component.ts | 24 +++++++++++++++++++----- 1 file changed, 19 insertions(+), 5 deletions(-) diff --git a/error/errorPage.component.ts b/error/errorPage.component.ts index 5cedac67..a9ccea44 100644 --- a/error/errorPage.component.ts +++ b/error/errorPage.component.ts @@ -14,13 +14,17 @@ import {properties} from "../../../environments/environment";

- Bad karma: we can't find that page! + Bad karma: we can't find that page! +
+ + Private Data

Not valid or missing {{page_type_name}} id. Search another {{page_type_name}}?

+

You asked for {{page}}, but despite our computers looking very hard, we could not find it. What happened ?

@@ -29,6 +33,7 @@ import {properties} from "../../../environments/environment";
  • or somehow we removed that page, or gave it another name
  • or, quite unlikely for sure, maybe you typed it yourself and there was a little mistake ?
  • +
    @@ -56,18 +61,27 @@ export class ErrorPageComponent { //this.page = location.href; } ngOnInit() { - if(this.response) { - this.response.statusCode = 404; - this.response.statusMessage = '404 - Page not found'; - } + this.seoService.createLinkForCanonicalURL(properties.domain + properties.baseLink + "/error"); this.route.queryParams.subscribe(data => { this.page = data['page']; + if (!this.page) { this.page = this._location.path(true); } + if(this.response && this.page!="-1") { + this.response.statusCode = 404; + this.response.statusMessage = '404 - Page not found'; + var title = "OpenAIRE | Error page"; + this._meta.updateTag({content:title},"property='og:title'"); + this._title.setTitle(title); + }else{ + var title = "OpenAIRE | Private data"; + this._meta.updateTag({content:title},"property='og:title'"); + this._title.setTitle(title); + } this.page_type = data['page_type']; if(this.page_type) { if (this.page_type == "publication") {