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() {
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() {

View File

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

View File

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

View File

@ -514,7 +514,7 @@ export class MonitorComponent implements OnInit, OnDestroy {
}
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 {

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

View File

@ -10,13 +10,22 @@ interface Links {
searchLinkToOrp;
searchLinkToOrganization;
searchLinkToResults,
searchLinkToPublications,
searchLinkToDatasets,
searchLinkToSoftware,
searchLinkToOrps,
searchLinkToProjects,
searchLinkToDataProviders,
searchLinkToOrganizations,
searchLinkToAdvancedResults,
searchLinkToAdvancedPublications,
searchLinkToAdvancedDatasets
searchLinkToAdvancedSoftware,
searchLinkToAdvancedOrps,
searchLinkToAdvancedProjects,
searchLinkToAdvancedDataProviders,
searchLinkToAdvancedOrganizations,
errorLink
}
export class LinksResolver {
@ -31,16 +40,25 @@ export class LinksResolver {
searchLinkToOrp: properties.searchLinkToOrp,
searchLinkToOrganization: properties.searchLinkToOrganization,
searchLinkToResults: properties.searchLinkToResults,
searchLinkToPublications: properties.searchLinkToPublications,
searchLinkToDatasets: properties.searchLinkToDatasets,
searchLinkToSoftware: properties.searchLinkToSoftware,
searchLinkToOrps: properties.searchLinkToOrps,
searchLinkToDataProviders: properties.searchLinkToDataProviders,
searchLinkToProjects: properties.searchLinkToProjects,
searchLinkToOrganizations: properties.searchLinkToOrganizations,
searchLinkToAdvancedResults: properties.searchLinkToAdvancedResults,
searchLinkToAdvancedPublications: properties.searchLinkToAdvancedPublications,
searchLinkToAdvancedDatasets: properties.searchLinkToAdvancedDatasets,
searchLinkToAdvancedSoftware: properties.searchLinkToAdvancedSoftware,
searchLinkToAdvancedOrps: properties.searchLinkToAdvancedOrps,
searchLinkToAdvancedProjects: properties.searchLinkToAdvancedProjects,
searchLinkToAdvancedDataProviders: properties.searchLinkToAdvancedDataProviders,
searchLinkToAdvancedOrganizations: properties.searchLinkToAdvancedOrganizations,
errorLink: properties.errorLink
};
public static setProperties( alias: string) {
public static setProperties(alias: string) {
Object.keys(this.default).forEach(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 {ConfigurationService} from "../../../openaireLibrary/utils/configuration/configuration.service";
import {SearchForm} from "../../../openaireLibrary/searchPages/searchUtils/newSearchPage.component";
import {EnvProperties} from "../../../openaireLibrary/utils/properties/env-properties";
import {properties} from "../../../../environments/environment";
@Component({
selector: 'monitor-search-dataproviders',
template: `
<search-dataproviders *ngIf="initialized"
[customFilter]=customFilter [hasPrefix]="false" [searchForm]="searchForm"
[includeOnlyResultsAndFilter]="false" [showSwitchSearchLink]="showSwitchSearchLink" [piwikSiteId]="piwikSiteId">
</search-dataproviders>
<search-dataproviders *ngIf="initialized"
[customFilter]=customFilter [hasPrefix]="false" [searchForm]="searchForm"
[includeOnlyResultsAndFilter]="false" [showSwitchSearchLink]="showSwitchSearchLink"
[piwikSiteId]="piwikSiteId">
</search-dataproviders>
`
})
export class MonitorSearchDataprovidersComponent {
@Input() searchForm: SearchForm = {class: 'search-form', dark: false};
customFilter: SearchCustomFilter = null;
initialized: boolean = false;
showSwitchSearchLink:boolean = false;
showSwitchSearchLink: boolean = false;
piwikSiteId;
public properties: EnvProperties = properties;
constructor(private route: ActivatedRoute,
private router: Router,
private stakeholderService: StakeholderService, private configurationService: ConfigurationService) {
private stakeholderService: StakeholderService, private configurationService: ConfigurationService) {
}
subscriptions = [];
ngOnDestroy() {
this.subscriptions.forEach(subscription => {
if (subscription instanceof Subscriber) {
@ -33,7 +40,7 @@ export class MonitorSearchDataprovidersComponent {
}
});
}
ngOnInit() {
this.subscriptions.push(this.route.params.subscribe(params => {
if (params['stakeholder']) {
@ -60,6 +67,6 @@ export class MonitorSearchDataprovidersComponent {
}
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() {
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() {
this.router.navigate(['/error'], {queryParams: {'page': this.router.url}});
this.router.navigate([this.properties.errorLink], {queryParams: {'page': this.router.url}});
}
private editOpen() {

View File

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

View File

@ -107,6 +107,7 @@ export let properties: EnvProperties = {
searchLinkToAdvancedOrps: "/search/advanced/other",
searchLinkToAdvancedDataProviders: "/search/advanced/dataproviders",
searchLinkToAdvancedOrganizations: "/search/advanced/organizations",
errorLink: '/error',
lastIndexInformationLink: "https://www.openaire.eu/aggregation-and-content-provision-workflows",
showLastIndexInformationLink: true,
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,
monitorStatsFrameUrl:"https://stats.madgik.di.uoa.gr/stats-api/",
useOldStatisticsSchema: false,
disableFrameLoad: false,
disableFrameLoad: true,
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/",
searchResourcesAPIURL: "https://beta.services.openaire.eu/search/v2/api/resources",
@ -102,6 +102,7 @@ export let properties: EnvProperties = {
searchLinkToAdvancedProjects: "/search/advanced/projects",
searchLinkToAdvancedDataProviders: "/search/advanced/dataproviders",
searchLinkToAdvancedOrganizations: "/search/advanced/organizations",
errorLink: '/error',
lastIndexInformationLink: "https://beta.openaire.eu/aggregation-and-content-provision-workflows",
showLastIndexInformationLink: true,
widgetLink: "https://beta.openaire.eu/index.php?option=com_openaire&view=widget&format=raw&projectId=",