Add property errorLink in navigation to error

This commit is contained in:
Konstantinos Triantafyllou 2022-05-11 12:57:00 +03:00
parent bbfdaea444
commit de5874e334
12 changed files with 52 additions and 16 deletions

View File

@ -228,7 +228,7 @@ export class AppComponent implements OnInit, OnDestroy {
} }
private navigateToError() { private navigateToError() {
this.router.navigate(['/error'], {queryParams: {'page': this.properties.baseLink + this.router.url}}); this.router.navigate([this.properties.errorLink], {queryParams: {'page': this.properties.baseLink + this.router.url}});
} }
public get open() { public get open() {

View File

@ -8,6 +8,7 @@ import {properties} from "../../environments/environment";
import {Router} from "@angular/router"; import {Router} from "@angular/router";
import {StakeholderUtils} from "../utils/indicator-utils"; import {StakeholderUtils} from "../utils/indicator-utils";
import {OpenaireEntities} from "../openaireLibrary/utils/properties/searchFields"; import {OpenaireEntities} from "../openaireLibrary/utils/properties/searchFields";
import {EnvProperties} from "../openaireLibrary/utils/properties/env-properties";
@Component({ @Component({
selector: 'develop', selector: 'develop',
@ -122,6 +123,7 @@ export class DevelopComponent implements OnInit, OnDestroy {
private stakeholderUtils: StakeholderUtils = new StakeholderUtils(); private stakeholderUtils: StakeholderUtils = new StakeholderUtils();
public type: string; public type: string;
public openaireEntities = OpenaireEntities; public openaireEntities = OpenaireEntities;
public properties: EnvProperties = properties;
constructor(private stakeholderService: StakeholderService, constructor(private stakeholderService: StakeholderService,
private seoService: SEOService, private seoService: SEOService,
@ -159,7 +161,7 @@ export class DevelopComponent implements OnInit, OnDestroy {
} }
private navigateToError() { private navigateToError() {
this._router.navigate(['/error'], {queryParams: {'page': this._router.url}}); this._router.navigate([this.properties.errorLink], {queryParams: {'page': this._router.url}});
} }
ngOnDestroy() { ngOnDestroy() {

View File

@ -2,6 +2,7 @@ import {NgModule} from '@angular/core';
import {RouterModule} from '@angular/router'; import {RouterModule} from '@angular/router';
import {PreviousRouteRecorder} from '../openaireLibrary/utils/piwik/previousRouteRecorder.guard'; import {PreviousRouteRecorder} from '../openaireLibrary/utils/piwik/previousRouteRecorder.guard';
import {MonitorComponent} from "./monitor.component"; import {MonitorComponent} from "./monitor.component";
import {OpenaireErrorPageComponent} from "../error/errorPage.component";
@NgModule({ @NgModule({
imports: [ imports: [
@ -40,6 +41,11 @@ import {MonitorComponent} from "./monitor.component";
activeMenuItem: "search" activeMenuItem: "search"
} }
}, },
{
path: ':stakeholder/error',
component: OpenaireErrorPageComponent,
data: {hasSidebar: false}
},
{ {
path: ':stakeholder/:topic', path: ':stakeholder/:topic',
component: MonitorComponent, component: MonitorComponent,

View File

@ -514,7 +514,7 @@ export class MonitorComponent implements OnInit, OnDestroy {
} }
private navigateToError() { private navigateToError() {
this._router.navigate(['/error'], {queryParams: {'page': this._router.url}}); this._router.navigate([this.properties.errorLink], {queryParams: {'page': this._router.url}});
} }
public quote(param: string): string { public quote(param: string): string {

@ -1 +1 @@
Subproject commit 10c70ad1daaf6dc0b9db291eca23c2bd40418a10 Subproject commit dea5b96f56d2795e69086561987670e5a055eba4

View File

@ -10,13 +10,22 @@ interface Links {
searchLinkToOrp; searchLinkToOrp;
searchLinkToOrganization; searchLinkToOrganization;
searchLinkToResults, searchLinkToResults,
searchLinkToPublications,
searchLinkToDatasets,
searchLinkToSoftware,
searchLinkToOrps,
searchLinkToProjects, searchLinkToProjects,
searchLinkToDataProviders, searchLinkToDataProviders,
searchLinkToOrganizations, searchLinkToOrganizations,
searchLinkToAdvancedResults, searchLinkToAdvancedResults,
searchLinkToAdvancedPublications,
searchLinkToAdvancedDatasets
searchLinkToAdvancedSoftware,
searchLinkToAdvancedOrps,
searchLinkToAdvancedProjects, searchLinkToAdvancedProjects,
searchLinkToAdvancedDataProviders, searchLinkToAdvancedDataProviders,
searchLinkToAdvancedOrganizations, searchLinkToAdvancedOrganizations,
errorLink
} }
export class LinksResolver { export class LinksResolver {
@ -31,16 +40,25 @@ export class LinksResolver {
searchLinkToOrp: properties.searchLinkToOrp, searchLinkToOrp: properties.searchLinkToOrp,
searchLinkToOrganization: properties.searchLinkToOrganization, searchLinkToOrganization: properties.searchLinkToOrganization,
searchLinkToResults: properties.searchLinkToResults, searchLinkToResults: properties.searchLinkToResults,
searchLinkToPublications: properties.searchLinkToPublications,
searchLinkToDatasets: properties.searchLinkToDatasets,
searchLinkToSoftware: properties.searchLinkToSoftware,
searchLinkToOrps: properties.searchLinkToOrps,
searchLinkToDataProviders: properties.searchLinkToDataProviders, searchLinkToDataProviders: properties.searchLinkToDataProviders,
searchLinkToProjects: properties.searchLinkToProjects, searchLinkToProjects: properties.searchLinkToProjects,
searchLinkToOrganizations: properties.searchLinkToOrganizations, searchLinkToOrganizations: properties.searchLinkToOrganizations,
searchLinkToAdvancedResults: properties.searchLinkToAdvancedResults, searchLinkToAdvancedResults: properties.searchLinkToAdvancedResults,
searchLinkToAdvancedPublications: properties.searchLinkToAdvancedPublications,
searchLinkToAdvancedDatasets: properties.searchLinkToAdvancedDatasets,
searchLinkToAdvancedSoftware: properties.searchLinkToAdvancedSoftware,
searchLinkToAdvancedOrps: properties.searchLinkToAdvancedOrps,
searchLinkToAdvancedProjects: properties.searchLinkToAdvancedProjects, searchLinkToAdvancedProjects: properties.searchLinkToAdvancedProjects,
searchLinkToAdvancedDataProviders: properties.searchLinkToAdvancedDataProviders, searchLinkToAdvancedDataProviders: properties.searchLinkToAdvancedDataProviders,
searchLinkToAdvancedOrganizations: properties.searchLinkToAdvancedOrganizations, searchLinkToAdvancedOrganizations: properties.searchLinkToAdvancedOrganizations,
errorLink: properties.errorLink
}; };
public static setProperties( alias: string) { public static setProperties(alias: string) {
Object.keys(this.default).forEach(field => { Object.keys(this.default).forEach(field => {
properties[field] = "/" + alias + (<string>this.default[field]); properties[field] = "/" + alias + (<string>this.default[field]);
}); });

View File

@ -5,27 +5,34 @@ import {StakeholderService} from "../../../openaireLibrary/monitor/services/stak
import {Subscriber} from "rxjs"; import {Subscriber} from "rxjs";
import {ConfigurationService} from "../../../openaireLibrary/utils/configuration/configuration.service"; import {ConfigurationService} from "../../../openaireLibrary/utils/configuration/configuration.service";
import {SearchForm} from "../../../openaireLibrary/searchPages/searchUtils/newSearchPage.component"; import {SearchForm} from "../../../openaireLibrary/searchPages/searchUtils/newSearchPage.component";
import {EnvProperties} from "../../../openaireLibrary/utils/properties/env-properties";
import {properties} from "../../../../environments/environment";
@Component({ @Component({
selector: 'monitor-search-dataproviders', selector: 'monitor-search-dataproviders',
template: ` template: `
<search-dataproviders *ngIf="initialized" <search-dataproviders *ngIf="initialized"
[customFilter]=customFilter [hasPrefix]="false" [searchForm]="searchForm" [customFilter]=customFilter [hasPrefix]="false" [searchForm]="searchForm"
[includeOnlyResultsAndFilter]="false" [showSwitchSearchLink]="showSwitchSearchLink" [piwikSiteId]="piwikSiteId"> [includeOnlyResultsAndFilter]="false" [showSwitchSearchLink]="showSwitchSearchLink"
</search-dataproviders> [piwikSiteId]="piwikSiteId">
</search-dataproviders>
` `
}) })
export class MonitorSearchDataprovidersComponent { export class MonitorSearchDataprovidersComponent {
@Input() searchForm: SearchForm = {class: 'search-form', dark: false}; @Input() searchForm: SearchForm = {class: 'search-form', dark: false};
customFilter: SearchCustomFilter = null; customFilter: SearchCustomFilter = null;
initialized: boolean = false; initialized: boolean = false;
showSwitchSearchLink:boolean = false; showSwitchSearchLink: boolean = false;
piwikSiteId; piwikSiteId;
public properties: EnvProperties = properties;
constructor(private route: ActivatedRoute, constructor(private route: ActivatedRoute,
private router: Router, private router: Router,
private stakeholderService: StakeholderService, private configurationService: ConfigurationService) { private stakeholderService: StakeholderService, private configurationService: ConfigurationService) {
} }
subscriptions = []; subscriptions = [];
ngOnDestroy() { ngOnDestroy() {
this.subscriptions.forEach(subscription => { this.subscriptions.forEach(subscription => {
if (subscription instanceof Subscriber) { if (subscription instanceof Subscriber) {
@ -33,7 +40,7 @@ export class MonitorSearchDataprovidersComponent {
} }
}); });
} }
ngOnInit() { ngOnInit() {
this.subscriptions.push(this.route.params.subscribe(params => { this.subscriptions.push(this.route.params.subscribe(params => {
if (params['stakeholder']) { if (params['stakeholder']) {
@ -60,6 +67,6 @@ export class MonitorSearchDataprovidersComponent {
} }
navigateToError() { navigateToError() {
this.router.navigate(['/error'], {queryParams: {'page': this.router.url}}); this.router.navigate([this.properties.errorLink], {queryParams: {'page': this.router.url}});
} }
} }

View File

@ -67,6 +67,6 @@ export class MonitorSearchProjectsComponent {
} }
navigateToError() { navigateToError() {
this.router.navigate(['/error'], {queryParams: {'page': this.router.url}}); this.router.navigate([this.properties.errorLink], {queryParams: {'page': this.router.url}});
} }
} }

View File

@ -432,7 +432,7 @@ export class TopicComponent implements OnInit, OnDestroy, IDeactivateComponent {
} }
private navigateToError() { private navigateToError() {
this.router.navigate(['/error'], {queryParams: {'page': this.router.url}}); this.router.navigate([this.properties.errorLink], {queryParams: {'page': this.router.url}});
} }
private editOpen() { private editOpen() {

View File

@ -106,6 +106,7 @@ export let properties: EnvProperties = {
searchLinkToAdvancedOrps: "/search/advanced/other", searchLinkToAdvancedOrps: "/search/advanced/other",
searchLinkToAdvancedDataProviders: "/search/advanced/dataproviders", searchLinkToAdvancedDataProviders: "/search/advanced/dataproviders",
searchLinkToAdvancedOrganizations: "/search/advanced/organizations", searchLinkToAdvancedOrganizations: "/search/advanced/organizations",
errorLink: '/error',
lastIndexInformationLink: "https://beta.openaire.eu/aggregation-and-content-provision-workflows", lastIndexInformationLink: "https://beta.openaire.eu/aggregation-and-content-provision-workflows",
showLastIndexInformationLink: true, showLastIndexInformationLink: true,

View File

@ -107,6 +107,7 @@ export let properties: EnvProperties = {
searchLinkToAdvancedOrps: "/search/advanced/other", searchLinkToAdvancedOrps: "/search/advanced/other",
searchLinkToAdvancedDataProviders: "/search/advanced/dataproviders", searchLinkToAdvancedDataProviders: "/search/advanced/dataproviders",
searchLinkToAdvancedOrganizations: "/search/advanced/organizations", searchLinkToAdvancedOrganizations: "/search/advanced/organizations",
errorLink: '/error',
lastIndexInformationLink: "https://www.openaire.eu/aggregation-and-content-provision-workflows", lastIndexInformationLink: "https://www.openaire.eu/aggregation-and-content-provision-workflows",
showLastIndexInformationLink: true, showLastIndexInformationLink: true,
widgetLink: "https://www.openaire.eu/index.php?option=com_openaire&view=widget&format=raw&projectId=", widgetLink: "https://www.openaire.eu/index.php?option=com_openaire&view=widget&format=raw&projectId=",

View File

@ -21,7 +21,7 @@ export let properties: EnvProperties = {
useNewStatistisTool: true, useNewStatistisTool: true,
monitorStatsFrameUrl:"https://stats.madgik.di.uoa.gr/stats-api/", monitorStatsFrameUrl:"https://stats.madgik.di.uoa.gr/stats-api/",
useOldStatisticsSchema: false, useOldStatisticsSchema: false,
disableFrameLoad: false, disableFrameLoad: true,
claimsAPIURL: "http://scoobydoo.di.uoa.gr:8080/dnet-claims-service-2.0.0-SNAPSHOT/rest/claimsService/", claimsAPIURL: "http://scoobydoo.di.uoa.gr:8080/dnet-claims-service-2.0.0-SNAPSHOT/rest/claimsService/",
searchAPIURLLAst: "https://beta.services.openaire.eu/search/v2/api/", searchAPIURLLAst: "https://beta.services.openaire.eu/search/v2/api/",
searchResourcesAPIURL: "https://beta.services.openaire.eu/search/v2/api/resources", searchResourcesAPIURL: "https://beta.services.openaire.eu/search/v2/api/resources",
@ -102,6 +102,7 @@ export let properties: EnvProperties = {
searchLinkToAdvancedProjects: "/search/advanced/projects", searchLinkToAdvancedProjects: "/search/advanced/projects",
searchLinkToAdvancedDataProviders: "/search/advanced/dataproviders", searchLinkToAdvancedDataProviders: "/search/advanced/dataproviders",
searchLinkToAdvancedOrganizations: "/search/advanced/organizations", searchLinkToAdvancedOrganizations: "/search/advanced/organizations",
errorLink: '/error',
lastIndexInformationLink: "https://beta.openaire.eu/aggregation-and-content-provision-workflows", lastIndexInformationLink: "https://beta.openaire.eu/aggregation-and-content-provision-workflows",
showLastIndexInformationLink: true, showLastIndexInformationLink: true,
widgetLink: "https://beta.openaire.eu/index.php?option=com_openaire&view=widget&format=raw&projectId=", widgetLink: "https://beta.openaire.eu/index.php?option=com_openaire&view=widget&format=raw&projectId=",