[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
This commit is contained in:
argiro.kokogiannaki 2021-03-29 14:01:24 +00:00
parent 7a000c3183
commit fc2ab4046f
1 changed files with 19 additions and 5 deletions

View File

@ -14,13 +14,17 @@ import {properties} from "../../../environments/environment";
<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">
<h3>
Bad karma: we can't find that page!
<span *ngIf="page !='-1'">Bad karma: we can't find that page!</span>
<div *ngIf="page =='-1'" class="uk-text-center uk-margin-large-top">
<svg _ngcontent-my-app-c8="" fill="black" height="24px" viewBox="0 0 24 24" width="24px" xmlns="http://www.w3.org/2000/svg"><path _ngcontent-my-app-c8="" d="M0 0h24v24H0z" fill="none"></path><path _ngcontent-my-app-c8="" d="M18 8h-1V6c0-2.76-2.24-5-5-5S7 3.24 7 6v2H6c-1.1 0-2 .9-2 2v10c0 1.1.9 2 2 2h12c1.1 0 2-.9 2-2V10c0-1.1-.9-2-2-2zm-6 9c-1.1 0-2-.9-2-2s.9-2 2-2 2 .9 2 2-.9 2-2 2zm3.1-9H8.9V6c0-1.71 1.39-3.1 3.1-3.1 1.71 0 3.1 1.39 3.1 3.1v2z"></path></svg>
Private Data</div>
</h3>
<h6 *ngIf="page_type" class="uk-margin-remove">
Not valid or missing {{page_type_name}} id.
<a *ngIf="page_type" routerLinkActive="router-link-active" [routerLink]="searchPage">Search </a>another {{page_type_name}}?
</h6>
<br>
<div *ngIf="page !='-1'">
<p>
You asked for {{page}}, but despite our computers looking very hard, we could not find it. What happened ?
</p>
@ -29,6 +33,7 @@ import {properties} from "../../../environments/environment";
<li>or somehow we removed that page, or gave it another name</li>
<li>or, quite unlikely for sure, maybe you typed it yourself and there was a little mistake ?</li>
</ul>
</div>
</div>
</div>
</div>
@ -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") {