2021-05-17 17:32:06 +02:00
|
|
|
import {Component, Inject, Input, Optional} from '@angular/core';
|
2018-04-11 16:06:36 +02:00
|
|
|
import {Location} from '@angular/common';
|
|
|
|
import {ActivatedRoute} from '@angular/router';
|
|
|
|
import {Title, Meta} from '@angular/platform-browser';
|
2019-11-07 10:51:09 +01:00
|
|
|
import {SEOService} from "../sharedComponents/SEO/SEO.service";
|
2020-09-24 13:18:24 +02:00
|
|
|
import {properties} from "../../../environments/environment";
|
2021-07-14 13:19:57 +02:00
|
|
|
import {RESPONSE} from '../utils/tokens';
|
|
|
|
import {Response} from 'express';
|
[Monitor Dashboard & Library | new-theme]: Renaming entity types using OpenaireEntities.
Files updated: develop.component.ts, methodology.component.ts, claimEntitiesSelection.component.ts, directLinking.component.ts, linkingGeneric.component.html, linkingGeneric.component.ts, approved.component.ts, searchDataprovidersToDeposit.component.ts, errorPage.component.ts, dataProvider.component.html, dataProvider.component.ts, dataProvider.service.ts, relatedDatasourcesTab.component.ts, project.component.ts, myOrcidLinks.component.ts, searchMyOrcidResults.component.html, searchMyOrcidResults.component.ts, searchAll.component.html, searchAll.component.ts, advancedSearchForm.component.html, advancedSearchForm.component.ts, searchDataProviders.component.ts, searchResearchResults.service.ts, numbers.component.ts, other-portals.component.html, other-portals.component.ts, fetchDataproviders.class.ts, fetchResearchResults.class.ts, searchFields.ts, result-preview.component.ts
2022-05-09 12:13:44 +02:00
|
|
|
import {OpenaireEntities} from "../utils/properties/searchFields";
|
2023-03-09 09:54:03 +01:00
|
|
|
import {EnvProperties} from "../utils/properties/env-properties";
|
2017-12-19 13:53:46 +01:00
|
|
|
|
|
|
|
@Component({
|
|
|
|
selector: 'error',
|
|
|
|
template: `
|
2022-07-02 13:43:18 +02:00
|
|
|
<div class="uk-section">
|
|
|
|
<div class="uk-margin-small-top uk-grid">
|
|
|
|
<div class="tm-main uk-width-1-1@s uk-width-1-1@m uk-width-1-1@l uk-row-first">
|
2017-12-19 13:53:46 +01:00
|
|
|
<div class="uk-container">
|
2020-10-13 21:04:50 +02:00
|
|
|
<h3>
|
2021-03-29 16:01:24 +02:00
|
|
|
<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>
|
2020-10-13 21:04:50 +02:00
|
|
|
</h3>
|
|
|
|
<h6 *ngIf="page_type" class="uk-margin-remove">
|
2019-10-31 12:39:23 +01:00
|
|
|
Not valid or missing {{page_type_name}} id.
|
2023-03-09 09:54:03 +01:00
|
|
|
<a *ngIf="page_type && properties.adminToolsPortalType !== 'eosc'" routerLinkActive="router-link-active" [routerLink]="searchPage" [queryParams]="searchPagePrams">Search </a>another {{page_type_name}}?
|
|
|
|
<a *ngIf="page_type && properties.adminToolsPortalType == 'eosc'" [href]="searchPage" target="_blank" class="custom-external">Search </a>another {{page_type_name}} in OpenAIRE?
|
2020-10-13 21:04:50 +02:00
|
|
|
</h6>
|
2017-12-19 13:53:46 +01:00
|
|
|
<br>
|
2021-03-29 16:01:24 +02:00
|
|
|
<div *ngIf="page !='-1'">
|
2017-12-19 13:53:46 +01:00
|
|
|
<p>
|
|
|
|
You asked for {{page}}, but despite our computers looking very hard, we could not find it. What happened ?
|
|
|
|
</p>
|
|
|
|
<ul>
|
|
|
|
<li>the link you clicked to arrive here has a typo in it</li>
|
|
|
|
<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>
|
2021-03-29 16:01:24 +02:00
|
|
|
</div>
|
2017-12-19 13:53:46 +01:00
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
`
|
|
|
|
})
|
|
|
|
|
|
|
|
export class ErrorPageComponent {
|
2021-05-17 17:32:06 +02:00
|
|
|
@Input() public page: string;
|
2019-10-31 12:39:23 +01:00
|
|
|
public page_type: string;
|
|
|
|
public searchPage: string;
|
2022-05-11 11:55:14 +02:00
|
|
|
public searchPagePrams: {};
|
2023-03-09 09:54:03 +01:00
|
|
|
public searchPagePramsString: string = "";
|
2019-10-31 12:39:23 +01:00
|
|
|
public page_type_name: string;
|
2023-03-09 09:54:03 +01:00
|
|
|
public properties: EnvProperties = properties;
|
2017-12-19 13:53:46 +01:00
|
|
|
|
2018-04-11 16:06:36 +02:00
|
|
|
constructor (private _location: Location, private _meta: Meta,
|
2019-10-22 12:06:44 +02:00
|
|
|
private _title: Title, private route: ActivatedRoute,
|
2021-07-14 13:19:57 +02:00
|
|
|
@Optional() @Inject(RESPONSE) private response: Response,
|
2021-04-01 14:43:49 +02:00
|
|
|
private seoService: SEOService) {}
|
|
|
|
|
2017-12-19 13:53:46 +01:00
|
|
|
ngOnInit() {
|
2020-11-18 17:06:27 +01:00
|
|
|
this.seoService.createLinkForCanonicalURL(properties.domain + properties.baseLink + "/error");
|
|
|
|
this.route.queryParams.subscribe(data => {
|
2021-05-17 17:32:06 +02:00
|
|
|
this.page = this.page?this.page:data['page'];
|
2020-11-18 17:06:27 +01:00
|
|
|
if (!this.page) {
|
|
|
|
this.page = this._location.path(true);
|
|
|
|
}
|
2021-04-01 14:43:49 +02:00
|
|
|
if(this.page != "-1") {
|
|
|
|
let title = "OpenAIRE | Error page";
|
2021-03-29 16:01:24 +02:00
|
|
|
this._meta.updateTag({content:title},"property='og:title'");
|
|
|
|
this._title.setTitle(title);
|
2022-06-27 11:00:30 +02:00
|
|
|
if(this.response) {
|
|
|
|
this.response.statusCode = 404;
|
|
|
|
this.response.statusMessage = '404 - Page not found';
|
|
|
|
}
|
2021-04-01 14:43:49 +02:00
|
|
|
} else{
|
|
|
|
let title = "OpenAIRE | Private data";
|
2021-03-29 16:01:24 +02:00
|
|
|
this._meta.updateTag({content:title},"property='og:title'");
|
|
|
|
this._title.setTitle(title);
|
2022-06-27 11:00:30 +02:00
|
|
|
if(this.response) {
|
|
|
|
this.response.statusCode = 403;
|
|
|
|
this.response.statusMessage = '403 - Private data';
|
|
|
|
}
|
2021-03-29 16:01:24 +02:00
|
|
|
}
|
2020-11-18 17:06:27 +01:00
|
|
|
this.page_type = data['page_type'];
|
|
|
|
if(this.page_type) {
|
|
|
|
if (this.page_type == "publication") {
|
2022-05-11 11:55:14 +02:00
|
|
|
this.searchPage = properties.searchLinkToResults;
|
|
|
|
this.searchPagePrams = {type: 'publications'}
|
2023-03-09 09:54:03 +01:00
|
|
|
this.searchPagePramsString = "&type=publications";
|
[Monitor Dashboard & Library | new-theme]: Renaming entity types using OpenaireEntities.
Files updated: develop.component.ts, methodology.component.ts, claimEntitiesSelection.component.ts, directLinking.component.ts, linkingGeneric.component.html, linkingGeneric.component.ts, approved.component.ts, searchDataprovidersToDeposit.component.ts, errorPage.component.ts, dataProvider.component.html, dataProvider.component.ts, dataProvider.service.ts, relatedDatasourcesTab.component.ts, project.component.ts, myOrcidLinks.component.ts, searchMyOrcidResults.component.html, searchMyOrcidResults.component.ts, searchAll.component.html, searchAll.component.ts, advancedSearchForm.component.html, advancedSearchForm.component.ts, searchDataProviders.component.ts, searchResearchResults.service.ts, numbers.component.ts, other-portals.component.html, other-portals.component.ts, fetchDataproviders.class.ts, fetchResearchResults.class.ts, searchFields.ts, result-preview.component.ts
2022-05-09 12:13:44 +02:00
|
|
|
this.page_type_name = OpenaireEntities.PUBLICATION.toLowerCase();
|
2020-11-18 17:06:27 +01:00
|
|
|
} else if (this.page_type == "software") {
|
2022-05-11 11:55:14 +02:00
|
|
|
this.searchPage = properties.searchLinkToResults;
|
|
|
|
this.searchPagePrams = {type: 'software'}
|
2023-03-09 09:54:03 +01:00
|
|
|
this.searchPagePramsString = "&type=software";
|
[Monitor Dashboard & Library | new-theme]: Renaming entity types using OpenaireEntities.
Files updated: develop.component.ts, methodology.component.ts, claimEntitiesSelection.component.ts, directLinking.component.ts, linkingGeneric.component.html, linkingGeneric.component.ts, approved.component.ts, searchDataprovidersToDeposit.component.ts, errorPage.component.ts, dataProvider.component.html, dataProvider.component.ts, dataProvider.service.ts, relatedDatasourcesTab.component.ts, project.component.ts, myOrcidLinks.component.ts, searchMyOrcidResults.component.html, searchMyOrcidResults.component.ts, searchAll.component.html, searchAll.component.ts, advancedSearchForm.component.html, advancedSearchForm.component.ts, searchDataProviders.component.ts, searchResearchResults.service.ts, numbers.component.ts, other-portals.component.html, other-portals.component.ts, fetchDataproviders.class.ts, fetchResearchResults.class.ts, searchFields.ts, result-preview.component.ts
2022-05-09 12:13:44 +02:00
|
|
|
this.page_type_name = OpenaireEntities.SOFTWARE_SINGULAR.toLowerCase();
|
2020-11-18 17:06:27 +01:00
|
|
|
} else if (this.page_type == "dataset") {
|
2022-05-11 11:55:14 +02:00
|
|
|
this.searchPagePrams = {type: 'datasets'}
|
2023-03-09 09:54:03 +01:00
|
|
|
this.searchPagePramsString = "&type=datasets";
|
2022-05-11 11:55:14 +02:00
|
|
|
this.searchPage = properties.searchLinkToResults;
|
[Monitor Dashboard & Library | new-theme]: Renaming entity types using OpenaireEntities.
Files updated: develop.component.ts, methodology.component.ts, claimEntitiesSelection.component.ts, directLinking.component.ts, linkingGeneric.component.html, linkingGeneric.component.ts, approved.component.ts, searchDataprovidersToDeposit.component.ts, errorPage.component.ts, dataProvider.component.html, dataProvider.component.ts, dataProvider.service.ts, relatedDatasourcesTab.component.ts, project.component.ts, myOrcidLinks.component.ts, searchMyOrcidResults.component.html, searchMyOrcidResults.component.ts, searchAll.component.html, searchAll.component.ts, advancedSearchForm.component.html, advancedSearchForm.component.ts, searchDataProviders.component.ts, searchResearchResults.service.ts, numbers.component.ts, other-portals.component.html, other-portals.component.ts, fetchDataproviders.class.ts, fetchResearchResults.class.ts, searchFields.ts, result-preview.component.ts
2022-05-09 12:13:44 +02:00
|
|
|
this.page_type_name = OpenaireEntities.DATASET.toLowerCase();
|
2020-11-18 17:06:27 +01:00
|
|
|
} else if (this.page_type == "orp") {
|
2022-05-11 11:55:14 +02:00
|
|
|
this.searchPagePrams = {type: 'orps'}
|
2023-03-09 09:54:03 +01:00
|
|
|
this.searchPagePramsString = "&type=orps";
|
2022-05-11 11:55:14 +02:00
|
|
|
this.searchPage = properties.searchLinkToResults;
|
[Monitor Dashboard & Library | new-theme]: Renaming entity types using OpenaireEntities.
Files updated: develop.component.ts, methodology.component.ts, claimEntitiesSelection.component.ts, directLinking.component.ts, linkingGeneric.component.html, linkingGeneric.component.ts, approved.component.ts, searchDataprovidersToDeposit.component.ts, errorPage.component.ts, dataProvider.component.html, dataProvider.component.ts, dataProvider.service.ts, relatedDatasourcesTab.component.ts, project.component.ts, myOrcidLinks.component.ts, searchMyOrcidResults.component.html, searchMyOrcidResults.component.ts, searchAll.component.html, searchAll.component.ts, advancedSearchForm.component.html, advancedSearchForm.component.ts, searchDataProviders.component.ts, searchResearchResults.service.ts, numbers.component.ts, other-portals.component.html, other-portals.component.ts, fetchDataproviders.class.ts, fetchResearchResults.class.ts, searchFields.ts, result-preview.component.ts
2022-05-09 12:13:44 +02:00
|
|
|
this.page_type_name = OpenaireEntities.OTHER_SINGULAR.toLowerCase();
|
2020-11-18 17:06:27 +01:00
|
|
|
} else if (this.page_type == "organization") {
|
|
|
|
this.searchPage = properties.searchLinkToOrganizations;
|
[Monitor Dashboard & Library | new-theme]: Renaming entity types using OpenaireEntities.
Files updated: develop.component.ts, methodology.component.ts, claimEntitiesSelection.component.ts, directLinking.component.ts, linkingGeneric.component.html, linkingGeneric.component.ts, approved.component.ts, searchDataprovidersToDeposit.component.ts, errorPage.component.ts, dataProvider.component.html, dataProvider.component.ts, dataProvider.service.ts, relatedDatasourcesTab.component.ts, project.component.ts, myOrcidLinks.component.ts, searchMyOrcidResults.component.html, searchMyOrcidResults.component.ts, searchAll.component.html, searchAll.component.ts, advancedSearchForm.component.html, advancedSearchForm.component.ts, searchDataProviders.component.ts, searchResearchResults.service.ts, numbers.component.ts, other-portals.component.html, other-portals.component.ts, fetchDataproviders.class.ts, fetchResearchResults.class.ts, searchFields.ts, result-preview.component.ts
2022-05-09 12:13:44 +02:00
|
|
|
this.page_type_name = OpenaireEntities.ORGANIZATION.toLowerCase();
|
2020-11-18 17:06:27 +01:00
|
|
|
} else if (this.page_type == "project") {
|
|
|
|
this.searchPage = properties.searchLinkToProjects;
|
[Monitor Dashboard & Library | new-theme]: Renaming entity types using OpenaireEntities.
Files updated: develop.component.ts, methodology.component.ts, claimEntitiesSelection.component.ts, directLinking.component.ts, linkingGeneric.component.html, linkingGeneric.component.ts, approved.component.ts, searchDataprovidersToDeposit.component.ts, errorPage.component.ts, dataProvider.component.html, dataProvider.component.ts, dataProvider.service.ts, relatedDatasourcesTab.component.ts, project.component.ts, myOrcidLinks.component.ts, searchMyOrcidResults.component.html, searchMyOrcidResults.component.ts, searchAll.component.html, searchAll.component.ts, advancedSearchForm.component.html, advancedSearchForm.component.ts, searchDataProviders.component.ts, searchResearchResults.service.ts, numbers.component.ts, other-portals.component.html, other-portals.component.ts, fetchDataproviders.class.ts, fetchResearchResults.class.ts, searchFields.ts, result-preview.component.ts
2022-05-09 12:13:44 +02:00
|
|
|
this.page_type_name = OpenaireEntities.PROJECT.toLowerCase();
|
2020-11-18 17:06:27 +01:00
|
|
|
} else if (this.page_type == "dataprovider") {
|
|
|
|
this.searchPage = properties.searchLinkToDataProviders;
|
[Monitor Dashboard & Library | new-theme]: Renaming entity types using OpenaireEntities.
Files updated: develop.component.ts, methodology.component.ts, claimEntitiesSelection.component.ts, directLinking.component.ts, linkingGeneric.component.html, linkingGeneric.component.ts, approved.component.ts, searchDataprovidersToDeposit.component.ts, errorPage.component.ts, dataProvider.component.html, dataProvider.component.ts, dataProvider.service.ts, relatedDatasourcesTab.component.ts, project.component.ts, myOrcidLinks.component.ts, searchMyOrcidResults.component.html, searchMyOrcidResults.component.ts, searchAll.component.html, searchAll.component.ts, advancedSearchForm.component.html, advancedSearchForm.component.ts, searchDataProviders.component.ts, searchResearchResults.service.ts, numbers.component.ts, other-portals.component.html, other-portals.component.ts, fetchDataproviders.class.ts, fetchResearchResults.class.ts, searchFields.ts, result-preview.component.ts
2022-05-09 12:13:44 +02:00
|
|
|
this.page_type_name = OpenaireEntities.DATASOURCE.toLowerCase();
|
2022-05-13 14:57:31 +02:00
|
|
|
} else if (this.page_type == "service") {
|
|
|
|
this.searchPage = properties.searchLinkToServices;
|
|
|
|
this.page_type_name = OpenaireEntities.SERVICE.toLowerCase();
|
[Monitor Dashboard & Library | new-theme]: Renaming entity types using OpenaireEntities.
Files updated: develop.component.ts, methodology.component.ts, claimEntitiesSelection.component.ts, directLinking.component.ts, linkingGeneric.component.html, linkingGeneric.component.ts, approved.component.ts, searchDataprovidersToDeposit.component.ts, errorPage.component.ts, dataProvider.component.html, dataProvider.component.ts, dataProvider.service.ts, relatedDatasourcesTab.component.ts, project.component.ts, myOrcidLinks.component.ts, searchMyOrcidResults.component.html, searchMyOrcidResults.component.ts, searchAll.component.html, searchAll.component.ts, advancedSearchForm.component.html, advancedSearchForm.component.ts, searchDataProviders.component.ts, searchResearchResults.service.ts, numbers.component.ts, other-portals.component.html, other-portals.component.ts, fetchDataproviders.class.ts, fetchResearchResults.class.ts, searchFields.ts, result-preview.component.ts
2022-05-09 12:13:44 +02:00
|
|
|
} else {
|
|
|
|
this.searchPage = properties.searchLinkToResults;
|
|
|
|
this.page_type_name = OpenaireEntities.RESULT.toLowerCase();
|
2020-11-18 17:06:27 +01:00
|
|
|
}
|
2023-03-09 09:54:03 +01:00
|
|
|
|
|
|
|
|
|
|
|
if(properties.adminToolsPortalType == 'eosc') {
|
|
|
|
this.searchPage = "https://explore.openaire.eu"+this.searchPage+this.searchPagePramsString;
|
|
|
|
}
|
2020-11-18 17:06:27 +01:00
|
|
|
}
|
|
|
|
});
|
2017-12-19 13:53:46 +01:00
|
|
|
}
|
|
|
|
}
|