diff --git a/claims/directLinking/directLinking.component.ts b/claims/directLinking/directLinking.component.ts
index 8ffbd085..667229ad 100644
--- a/claims/directLinking/directLinking.component.ts
+++ b/claims/directLinking/directLinking.component.ts
@@ -7,6 +7,7 @@ import {SearchResearchResultsService} from '../../services/searchResearchResults
import {LinkingGenericComponent} from "../linking/linkingGeneric.component";
import {ClaimResultSearchFormComponent} from "../claim-utils/claimResultSearchForm.component";
import {Subscriber} from "rxjs";
+import {properties} from "../../../../environments/environment";
@Component({
@@ -45,10 +46,7 @@ export class DirectLinkingComponent {
});
}
ngOnInit() {
- this.subscriptions.push(this.route.data
- .subscribe((data: { envSpecific: EnvProperties }) => {
- this.properties = data.envSpecific;
- }));
+ this.properties = properties;
this.subscriptions.push(this.route.queryParams.subscribe(params => {
this.id = params['id'];
diff --git a/claims/linking/linkingGeneric.component.ts b/claims/linking/linkingGeneric.component.ts
index fc8b5d8f..1dea9e4e 100644
--- a/claims/linking/linkingGeneric.component.ts
+++ b/claims/linking/linkingGeneric.component.ts
@@ -10,6 +10,7 @@ import {HelperFunctions} from "../../utils/HelperFunctions.class";
import {HelperService} from "../../utils/helper/helper.service";
import {PiwikService} from "../../utils/piwik/piwik.service";
import {Subscriber} from "rxjs";
+import {properties} from "../../../../environments/environment";
declare var UIkit:any;
@@ -57,10 +58,9 @@ export class LinkingGenericComponent {
this.showOptions.basketShowLinksTo = true;
this.showOptions.show = this.showOptions.linkTo;
}
- this.subscriptions.push(this.route.data
- .subscribe((data: { envSpecific: EnvProperties }) => {
- this.properties = data.envSpecific;
- this.url = this.properties.domain + this.properties.baseLink+this._router.url;
+
+ this.properties = properties;
+ this.url = this.properties.domain + this.properties.baseLink+this._router.url;
var description = "Linking is a functionality provided by OpenAIRE, in order to link research results with a project, a research community or other research results.";
this.updateTitle(this.pageTitle);
@@ -77,7 +77,7 @@ export class LinkingGenericComponent {
this.pageContents = contents;
})
- }));
+
if( typeof localStorage !== 'undefined') {
this.localStoragePrefix +=(this.communityId?this.communityId+"_":"");
if(localStorage.getItem(this.localStoragePrefix + "results")){
diff --git a/connect/approvedByCommunity/approved.component.ts b/connect/approvedByCommunity/approved.component.ts
index 470978ab..d293dcca 100644
--- a/connect/approvedByCommunity/approved.component.ts
+++ b/connect/approvedByCommunity/approved.component.ts
@@ -4,6 +4,7 @@ import { EnvProperties} from '../../utils/properties/env-properties';
import {ConnectHelper} from '../connectHelper';
import {SearchCommunityDataprovidersService} from '../contentProviders/searchDataproviders.service';
+import {properties} from "../../../../environments/environment";
@Component({
selector: 'approved-by-community',
@@ -24,30 +25,27 @@ export class ApprovedByCommunityComponent {
constructor (private route: ActivatedRoute, private _searchDataprovidersService: SearchCommunityDataprovidersService) {}
public ngOnInit() {
- this.route.data
- .subscribe((data: { envSpecific: EnvProperties }) => {
- this.properties = data.envSpecific;
+ this.properties =properties;
+ this.route.queryParams.subscribe(
+ communityId => {
+ this.communityId = ConnectHelper.getCommunityFromDomain(this.properties.domain);
+ if(!this.communityId) {
+ this.communityId = communityId['communityId'];
+ }
- this.route.queryParams.subscribe(
- communityId => {
- this.communityId = ConnectHelper.getCommunityFromDomain(this.properties.domain);
- if(!this.communityId) {
- this.communityId = communityId['communityId'];
- }
-
- if(this.communityId && this.communityId != "openaire") {
- this._searchDataprovidersService.searchDataproviders(this.properties, this.communityId).subscribe (
- contentproviders => {
- this.communityContentProviders = contentproviders;
- this.approved = this.checkApproval();
- },
- error => {
- this.handleError("Error getting content providers for community with id: "+this.communityId, error);
- }
- );
+ if(this.communityId && this.communityId != "openaire") {
+ this._searchDataprovidersService.searchDataproviders(this.properties, this.communityId).subscribe (
+ contentproviders => {
+ this.communityContentProviders = contentproviders;
+ this.approved = this.checkApproval();
+ },
+ error => {
+ this.handleError("Error getting content providers for community with id: "+this.communityId, error);
}
- });
- });
+ );
+ }
+ });
+
}
diff --git a/deposit/searchDataprovidersToDeposit.component.ts b/deposit/searchDataprovidersToDeposit.component.ts
index bdd71273..e8bb0d2c 100644
--- a/deposit/searchDataprovidersToDeposit.component.ts
+++ b/deposit/searchDataprovidersToDeposit.component.ts
@@ -11,6 +11,7 @@ import {EnvProperties} from '../utils/properties/env-properties';
import {ZenodoInformationClass} from "./utils/zenodoInformation.class";
import {RouterHelper} from "../utils/routerHelper.class";
import {Breadcrumb} from "../utils/breadcrumbs/breadcrumbs.component";
+import {properties} from "../../../environments/environment";
@Component({
selector: 'deposit-search-dataproviders',
@@ -106,9 +107,8 @@ export class SearchDataprovidersToDepositComponent {
public ngOnInit() {
- this.route.data
- .subscribe((data: { envSpecific: EnvProperties }) => {
- this.properties = data.envSpecific;
+
+ this.properties = properties;
this.depositLearnHowPage = this.properties.depositLearnHowPage;
this.baseUrl = this.properties.depositSearchPage;
this.pagingLimit = this.properties.pagingLimit;
@@ -116,7 +116,7 @@ export class SearchDataprovidersToDepositComponent {
name: "Deposit",
route: this.depositLearnHowPage
}, {name: "Browse repositories", route: null});
- });
+
this.sub = this.route.queryParams.subscribe(params => {
this.parameters = Object.assign({}, params);
this.keyword = params["fv0"]?params["fv0"]:'';
diff --git a/deposit/searchResultsInDeposit.component.ts b/deposit/searchResultsInDeposit.component.ts
index 74dc7b30..cfe75527 100644
--- a/deposit/searchResultsInDeposit.component.ts
+++ b/deposit/searchResultsInDeposit.component.ts
@@ -7,6 +7,7 @@ import {ZenodoInformationClass} from "./utils/zenodoInformation.class";
import {ActivatedRoute} from "@angular/router";
import {ResultPreview} from "../utils/result-preview/result-preview";
import {Subscriber} from "rxjs";
+import {properties} from "../../../environments/environment";
@Component({
selector: 'deposit-result',
@@ -58,9 +59,7 @@ export class SearchResultsInDepositComponent {
this.urlParam = "datasourceId";
}
- this.sub = this.route.data
- .subscribe((data: { envSpecific: EnvProperties }) => {
- this.properties = data.envSpecific;
+ this.properties = properties;
if (!this.zenodoInformation) {
this.zenodoInformation = new ZenodoInformationClass();
@@ -71,7 +70,7 @@ export class SearchResultsInDepositComponent {
if (!this.zenodoInformation.name) {
this.zenodoInformation.name = "Zenodo";
}
- });
+
}
public quote(params: string):string {
diff --git a/error/errorPage.component.ts b/error/errorPage.component.ts
index fe312959..5cedac67 100644
--- a/error/errorPage.component.ts
+++ b/error/errorPage.component.ts
@@ -60,43 +60,39 @@ export class ErrorPageComponent {
this.response.statusCode = 404;
this.response.statusMessage = '404 - Page not found';
}
- //this.route.data
- //.subscribe((data: { envSpecific: EnvProperties }) => {
- //let properties = data.envSpecific;
- this.seoService.createLinkForCanonicalURL(properties.domain + properties.baseLink + "/error");
+ 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);
- }
+ this.route.queryParams.subscribe(data => {
+ this.page = data['page'];
+ if (!this.page) {
+ this.page = this._location.path(true);
+ }
- this.page_type = data['page_type'];
- if(this.page_type) {
- if (this.page_type == "publication") {
- this.searchPage = properties.searchLinkToPublications;
- this.page_type_name = "publication";
- } else if (this.page_type == "software") {
- this.searchPage = properties.searchLinkToSoftware;
- this.page_type_name = "software";
- } else if (this.page_type == "dataset") {
- this.searchPage = properties.searchLinkToDatasets;
- this.page_type_name = "dataset";
- } else if (this.page_type == "orp") {
- this.searchPage = properties.searchLinkToOrps;
- this.page_type_name = "research product";
- } else if (this.page_type == "organization") {
- this.searchPage = properties.searchLinkToOrganizations;
- this.page_type_name = "organization";
- } else if (this.page_type == "project") {
- this.searchPage = properties.searchLinkToProjects;
- this.page_type_name = "project";
- } else if (this.page_type == "dataprovider") {
- this.searchPage = properties.searchLinkToDataProviders;
- this.page_type_name = "content provider";
- }
- }
- });
- //});
+ this.page_type = data['page_type'];
+ if(this.page_type) {
+ if (this.page_type == "publication") {
+ this.searchPage = properties.searchLinkToPublications;
+ this.page_type_name = "publication";
+ } else if (this.page_type == "software") {
+ this.searchPage = properties.searchLinkToSoftware;
+ this.page_type_name = "software";
+ } else if (this.page_type == "dataset") {
+ this.searchPage = properties.searchLinkToDatasets;
+ this.page_type_name = "dataset";
+ } else if (this.page_type == "orp") {
+ this.searchPage = properties.searchLinkToOrps;
+ this.page_type_name = "research product";
+ } else if (this.page_type == "organization") {
+ this.searchPage = properties.searchLinkToOrganizations;
+ this.page_type_name = "organization";
+ } else if (this.page_type == "project") {
+ this.searchPage = properties.searchLinkToProjects;
+ this.page_type_name = "project";
+ } else if (this.page_type == "dataprovider") {
+ this.searchPage = properties.searchLinkToDataProviders;
+ this.page_type_name = "content provider";
+ }
+ }
+ });
}
}
diff --git a/landingPages/dataProvider/statisticsTab.component.ts b/landingPages/dataProvider/statisticsTab.component.ts
index e8512a26..cc358d6f 100644
--- a/landingPages/dataProvider/statisticsTab.component.ts
+++ b/landingPages/dataProvider/statisticsTab.component.ts
@@ -5,6 +5,7 @@ import {ErrorCodes} from '../../utils/properties/errorCodes';
import {EnvProperties} from '../../utils/properties/env-properties';
import {StringUtils} from "../../utils/string-utils.class";
import {Subscriber} from "rxjs";
+import {properties} from "../../../../environments/environment";
@Component({
selector: 'statisticsTab',
@@ -72,9 +73,8 @@ export class StatisticsTabComponent {
constructor (private route: ActivatedRoute) {}
ngOnInit() {
- this.sub = this.route.data
- .subscribe((data: { envSpecific: EnvProperties }) => {
- this.properties = data.envSpecific;
+
+ this.properties = properties;
if (this.properties.useNewStatistisTool) {
this.docsTimelineUrl = this.properties.statisticsFrameNewAPIURL +
@@ -94,7 +94,7 @@ export class StatisticsTabComponent {
this.dataProjectsUrl = this.properties.statisticsFrameAPIURL + 'chart.php?com=query&persistent=false&data={"query":"dtsrcProjData","dtsrcName":"' + this.datasourceId + '", "table": "result", "fields": [{"fld": "number", "agg": "count", "type": "bar", "yaxis":1, "c":false}], "xaxis":{"name": "result_classifications-type", "agg": "avg"}, "group": "", "color": "", "type": "chart", "size":30, "sort": "xaxis", "xStyle":{"r": "-", "s": "-", "l": "-", "ft": "-", "wt": "-"}, "yaxisheaders": [""], "fieldsheaders": ["Research Data"], "in": [], "filters": [{"name": "result_datasources-datasource-name", "values": [""], "to": "-1"}], "having": [], "incfilters": [], "inchaving": [], "title": "", "subtitle": "", "xaxistitle": ""}&w=90%&h=90%';
this.pubsProjectsUrl = this.properties.statisticsFrameAPIURL + 'chart.php?com=query&persistent=false&data={"query":"dtsrcProjPubs","dtsrcName":"' + this.datasourceId + '", "table": "result", "fields": [{"fld": "number", "agg": "count", "type": "bar", "yaxis":1, "c":false}], "xaxis":{"name": "result_classifications-type", "agg": "avg"}, "group": "", "color": "", "type": "chart", "size":30, "sort": "xaxis", "xStyle":{"r": "-", "s": "-", "l": "-", "ft": "-", "wt": "-"}, "yaxisheaders": [""], "fieldsheaders": ["Publications"], "in": [], "filters": [{"name": "result_datasources-datasource-name", "values": [""], "to": "-1"}], "having": [], "incfilters": [], "inchaving": [], "title": "", "subtitle": "", "xaxistitle": ""}&w=90%&h=90%';
}
- });
+
}
ngOnDestroy() {
diff --git a/landingPages/htmlProjectReport/htmlProjectReport.component.ts b/landingPages/htmlProjectReport/htmlProjectReport.component.ts
index c2e3f3e4..664c1dde 100644
--- a/landingPages/htmlProjectReport/htmlProjectReport.component.ts
+++ b/landingPages/htmlProjectReport/htmlProjectReport.component.ts
@@ -10,6 +10,7 @@ import {PiwikService} from '../../utils/piwik/piwik.service';
import {SEOService} from '../../sharedComponents/SEO/SEO.service';
import {HelperService} from "../../utils/helper/helper.service";
import {Subscriber} from "rxjs";
+import {properties} from "../../../../environments/environment";
declare var UIkit: any;
@@ -84,15 +85,14 @@ export class HtmlProjectReportComponent {
}
ngOnInit() {
- this.subscriptions.push(this.route.data
- .subscribe((data: { envSpecific: EnvProperties }) => {
- this.properties = data.envSpecific;
+
+ this.properties = properties;
//this.getDivContents();
this.getPageContents();
this.updateUrl(this.properties.domain + this.properties.baseLink + this._router.url);
this.seoService.createLinkForCanonicalURL(this.properties.domain + this.properties.baseLink + this._router.url);
- }));
+
this.subscriptions.push(this.route.queryParams.subscribe(params => {
this.projectId = params['projectId'];
diff --git a/landingPages/organization/deletedByInference/deletedByInference.component.ts b/landingPages/organization/deletedByInference/deletedByInference.component.ts
index fd5f1b73..38fc971b 100644
--- a/landingPages/organization/deletedByInference/deletedByInference.component.ts
+++ b/landingPages/organization/deletedByInference/deletedByInference.component.ts
@@ -11,6 +11,7 @@ import {OrganizationsDeletedByInferenceService} from './deletedByInference.se
import {ResultPreview} from "../../../utils/result-preview/result-preview";
import {AlertModal} from "../../../utils/modal/alert";
import {Subscriber} from "rxjs";
+import {properties} from "../../../../../environments/environment";
@Component({
selector: 'organizationsDeletedByInference',
@@ -57,11 +58,9 @@ export class OrganizationsDeletedByInferenceComponent {
}
ngOnInit() {
- this.subscriptions.push(this.route.data
- .subscribe((data: { envSpecific: EnvProperties }) => {
- this.properties = data.envSpecific;
- }));
+ this.properties = properties;
+
this.subscriptions.push(this.route.queryParams.subscribe(data => {
this.errorCodes = new ErrorCodes();
this.status = this.errorCodes.LOADING;
diff --git a/landingPages/organization/organization.component.ts b/landingPages/organization/organization.component.ts
index f9714445..8cc3ec2a 100644
--- a/landingPages/organization/organization.component.ts
+++ b/landingPages/organization/organization.component.ts
@@ -23,6 +23,7 @@ import {FetchResearchResults} from "../../utils/fetchEntitiesClasses/fetchResear
import {FetchDataproviders} from "../../utils/fetchEntitiesClasses/fetchDataproviders.class";
import {IndexInfoService} from "../../utils/indexInfo.service";
import {Subscriber} from "rxjs";
+import {properties} from "../../../../environments/environment";
@Component({
selector: 'organization',
@@ -125,9 +126,8 @@ export class OrganizationComponent {
}
ngOnInit() {
- this.subscriptions.push(this.route.data
- .subscribe((data: { envSpecific: EnvProperties }) => {
- this.properties = data.envSpecific;
+
+ this.properties = properties;
if (typeof document !== 'undefined') {
this.subscriptions.push(this.indexInfoService.getLastIndexDate(this.properties).subscribe(lastIndexUpdate => {
if (lastIndexUpdate) {
@@ -138,7 +138,7 @@ export class OrganizationComponent {
//this.getDivContents();
this.getPageContents();
this.updateUrl(this.properties.domain + this.properties.baseLink + this._router.url);
- }));
+
this.subscriptions.push(this.route.queryParams.subscribe(params => {
this.organizationInfo = null;
this.updateTitle("Organization");
diff --git a/landingPages/project/project.component.ts b/landingPages/project/project.component.ts
index 8623e90f..50b2e286 100644
--- a/landingPages/project/project.component.ts
+++ b/landingPages/project/project.component.ts
@@ -26,6 +26,7 @@ import {ResultPreview} from "../../utils/result-preview/result-preview";
import {SearchResult} from "../../utils/entities/searchResult";
import {IndexInfoService} from "../../utils/indexInfo.service";
import {Subscriber} from "rxjs";
+import {properties} from "../../../../environments/environment";
@Component({
selector: 'project',
@@ -138,9 +139,8 @@ export class ProjectComponent {
private indexInfoService: IndexInfoService) {}
ngOnInit() {
- this.subscriptions.push(this.route.data
- .subscribe((data: { envSpecific: EnvProperties }) => {
- this.properties = data.envSpecific;
+
+ this.properties = properties;
if (typeof document !== 'undefined') {
this.subscriptions.push(this.indexInfoService.getLastIndexDate(this.properties).subscribe(lastIndexUpdate => {
if (lastIndexUpdate) {
@@ -152,7 +152,7 @@ export class ProjectComponent {
this.getPageContents();
this.updateUrl(this.properties.domain + this.properties.baseLink + this._router.url);
- }));
+
this.subscriptions.push(this.route.queryParams.subscribe(params => {
this.metricsClicked = false;
this.statsClicked = false;
diff --git a/landingPages/result/deletedByInference/deletedByInference.component.ts b/landingPages/result/deletedByInference/deletedByInference.component.ts
index 581292db..1981153b 100644
--- a/landingPages/result/deletedByInference/deletedByInference.component.ts
+++ b/landingPages/result/deletedByInference/deletedByInference.component.ts
@@ -11,6 +11,7 @@ import {DeletedByInferenceService} from './deletedByInference.service';
import {ResultPreview} from "../../../utils/result-preview/result-preview";
import {AlertModal} from "../../../utils/modal/alert";
import {Subscriber} from "rxjs";
+import {properties} from "../../../../../environments/environment";
@Component({
selector: 'deletedByInference',
@@ -54,16 +55,14 @@ export class DeletedByInferenceComponent {
constructor(private element: ElementRef,
private _deletedByInferenceService: DeletedByInferenceService,
- private route: ActivatedRoute,
- private _router: Router) {
+ private route: ActivatedRoute) {
}
ngOnInit() {
- this.subscriptions.push(this.route.data
- .subscribe((data: { envSpecific: EnvProperties }) => {
- this.properties = data.envSpecific;
+
+ this.properties = properties;
- }));
+
this.subscriptions.push(this.route.queryParams.subscribe(data => {
this.errorCodes = new ErrorCodes();
this.status = this.errorCodes.LOADING;
diff --git a/login/user.component.ts b/login/user.component.ts
index 0b38317f..bd972602 100644
--- a/login/user.component.ts
+++ b/login/user.component.ts
@@ -41,12 +41,10 @@ export class UserComponent {
}
ngOnInit() {
- this.subscriptions.push(this.route.data
- .subscribe((data: { envSpecific: EnvProperties }) => {
- this.properties = data.envSpecific;
- this.loginUrl = this.properties.loginUrl;
- }));
+ this.properties = properties;
+ this.loginUrl = this.properties.loginUrl;
+
if (typeof document !== 'undefined') {
this.server = false;
this.subscriptions.push(this.userManagementsService.getUserInfo().subscribe(user => {
diff --git a/searchPages/find/searchAll.component.html b/searchPages/find/searchAll.component.html
index 4dbd81c6..ca67d2b3 100644
--- a/searchPages/find/searchAll.component.html
+++ b/searchPages/find/searchAll.component.html
@@ -74,19 +74,19 @@