diff --git a/landingPages/dataProvider/dataProvider.component.html b/landingPages/dataProvider/dataProvider.component.html
index 3b236931..ffb06c1d 100644
--- a/landingPages/dataProvider/dataProvider.component.html
+++ b/landingPages/dataProvider/dataProvider.component.html
@@ -483,7 +483,7 @@
Powered by OpenAIRE Open Research Graph
-
+
. Last update of records in OpenAIRE: {{indexUpdateDate | date: 'MMM dd, yyyy'}}
diff --git a/landingPages/dataProvider/dataProvider.component.ts b/landingPages/dataProvider/dataProvider.component.ts
index 4f8f755d..15f6b5cd 100644
--- a/landingPages/dataProvider/dataProvider.component.ts
+++ b/landingPages/dataProvider/dataProvider.component.ts
@@ -154,13 +154,15 @@ export class DataProviderComponent {
this.route.data
.subscribe((data: { envSpecific: EnvProperties }) => {
this.properties = data.envSpecific;
- this.indexInfoService.getLastIndexDate(this.properties).subscribe(lastIndexUpdate => {
- if(lastIndexUpdate) {
- this.indexUpdateDate = new Date(lastIndexUpdate);
- } else if(this.properties.lastIndexUpdate) {
- this.indexUpdateDate = new Date(this.properties.lastIndexUpdate);
- }
- });
+ if (typeof document !== 'undefined') {
+ this.indexInfoService.getLastIndexDate(this.properties).subscribe(lastIndexUpdate => {
+ if (lastIndexUpdate) {
+ this.indexUpdateDate = new Date(lastIndexUpdate);
+ } else if (this.properties.lastIndexUpdate) {
+ this.indexUpdateDate = new Date(this.properties.lastIndexUpdate);
+ }
+ });
+ }
//this.getDivContents();
this.getPageContents();
this.updateUrl(data.envSpecific.baseLink + this._router.url);
@@ -252,7 +254,9 @@ export class DataProviderComponent {
} else {
this.aggregationStatusIsInitialized = true;
}
- this.initTabs();
+ if (typeof document !== 'undefined') {
+ this.initTabs();
+ }
this.showTabs = true;
this.updateTitle(this.dataProviderInfo.title.name);
this.updateDescription("Content provider, " + this.dataProviderInfo.title.name);
diff --git a/landingPages/landing-utils/metrics/metrics.component.ts b/landingPages/landing-utils/metrics/metrics.component.ts
index 4d20ddbc..921e8123 100644
--- a/landingPages/landing-utils/metrics/metrics.component.ts
+++ b/landingPages/landing-utils/metrics/metrics.component.ts
@@ -45,14 +45,16 @@ import {animate, state, style, transition, trigger} from "@angular/animations";
class="charts uk-visible-toggle" tabindex="-1" uk-slider>
-
- 0 && viewsFrameUrl"
- [width]="element.offsetWidth" [height]="200"
+
+ 0 && viewsFrameUrl"
+ [height]="200"
[url]=viewsFrameUrl>
-
- 0 && downloadsFrameUrl"
- [width]="element.offsetWidth" [height]="200"
+
+ 0 && downloadsFrameUrl"
+ [height]="200"
[url]=downloadsFrameUrl>
@@ -164,7 +166,9 @@ export class MetricsComponent {
public errorCodes: ErrorCodes;
private sub: Subscription;
private timeouts: any[] = [];
-
+
+ public metricsClicked: boolean = false;
+
public status: number;
public state: number = -1;
@@ -173,12 +177,16 @@ export class MetricsComponent {
ngOnInit() {
this.errorCodes = new ErrorCodes();
- this.status = this.errorCodes.LOADING;
- this.getMetrics();
+ if (typeof document !== 'undefined') {
+ this.status = this.errorCodes.LOADING;
+ this.getMetrics();
+ }
}
ngOnDestroy() {
- this.sub.unsubscribe();
+ if(this.sub) {
+ this.sub.unsubscribe();
+ }
}
public get total(): number {
@@ -225,6 +233,8 @@ export class MetricsComponent {
public toggle(event) {
+ this.metricsClicked = true;
+
event.stopPropagation();
if(this.state !== -1) {
this.timeouts.forEach(timeout => {
diff --git a/landingPages/organization/organization.component.html b/landingPages/organization/organization.component.html
index 43b9b510..d77498b3 100644
--- a/landingPages/organization/organization.component.html
+++ b/landingPages/organization/organization.component.html
@@ -253,7 +253,7 @@
Powered by OpenAIRE Open Research Graph
-
+
. Last update of records in OpenAIRE: {{indexUpdateDate | date: 'MMM dd, yyyy'}}
diff --git a/landingPages/organization/organization.component.ts b/landingPages/organization/organization.component.ts
index e4e5b1b7..99103bdb 100644
--- a/landingPages/organization/organization.component.ts
+++ b/landingPages/organization/organization.component.ts
@@ -21,6 +21,7 @@ import {HelperService} from "../../utils/helper/helper.service";
import {Location} from "@angular/common";
import {FetchResearchResults} from "../../utils/fetchEntitiesClasses/fetchResearchResults.class";
import {FetchDataproviders} from "../../utils/fetchEntitiesClasses/fetchDataproviders.class";
+import {IndexInfoService} from "../../utils/indexInfo.service";
@Component({
selector: 'organization',
@@ -124,7 +125,8 @@ export class OrganizationComponent {
private _router: Router,
private helper: HelperService,
private seoService: SEOService,
- private _location: Location) {
+ private _location: Location,
+ private indexInfoService: IndexInfoService) {
this.fetchProjects = new FetchProjects(this._searchProjectsService);
this.fetchDataproviders = new FetchDataproviders(this._searchDataprovidersService);
this.fetchPublications = new FetchResearchResults(this._searchResearchResultsService);
@@ -137,8 +139,14 @@ export class OrganizationComponent {
this.route.data
.subscribe((data: { envSpecific: EnvProperties }) => {
this.properties = data.envSpecific;
- if (this.properties.lastIndexUpdate) {
- this.indexUpdateDate = new Date(this.properties.lastIndexUpdate);
+ if (typeof document !== 'undefined') {
+ this.indexInfoService.getLastIndexDate(this.properties).subscribe(lastIndexUpdate => {
+ if (lastIndexUpdate) {
+ this.indexUpdateDate = new Date(lastIndexUpdate);
+ } else if (this.properties.lastIndexUpdate) {
+ this.indexUpdateDate = new Date(this.properties.lastIndexUpdate);
+ }
+ });
}
//this.getDivContents();
this.getPageContents();
@@ -330,8 +338,12 @@ export class OrganizationComponent {
this.piwiksub = this._piwikService.trackView(this.properties, this.organizationInfo.title.name, this.piwikSiteId).subscribe();
}
var refineFields: string [] = ["funder"];
- this.getTotalResearchResults();
- this.getTotalDataproviders();
+
+ if (typeof document !== 'undefined') {
+ this.getTotalResearchResults();
+ this.getTotalDataproviders();
+ }
+
this.fetchProjects.getResultsForOrganizations(this.organizationId, "", 1, this.searchNumber, refineFields, this.properties);
this.showLoading = false;
}
diff --git a/landingPages/project/project.component.html b/landingPages/project/project.component.html
index 075f6caa..bf9f6b34 100644
--- a/landingPages/project/project.component.html
+++ b/landingPages/project/project.component.html
@@ -689,7 +689,7 @@
Powered by OpenAIRE Open Research Graph
-
+
. Last update of records in OpenAIRE: {{indexUpdateDate | date: 'MMM dd, yyyy'}}
diff --git a/landingPages/project/project.component.ts b/landingPages/project/project.component.ts
index 194e75dd..61d2d8b9 100644
--- a/landingPages/project/project.component.ts
+++ b/landingPages/project/project.component.ts
@@ -152,13 +152,15 @@ export class ProjectComponent {
this.route.data
.subscribe((data: { envSpecific: EnvProperties }) => {
this.properties = data.envSpecific;
- this.indexInfoService.getLastIndexDate(this.properties).subscribe(lastIndexUpdate => {
- if(lastIndexUpdate) {
- this.indexUpdateDate = new Date(lastIndexUpdate);
- } else if(this.properties.lastIndexUpdate) {
- this.indexUpdateDate = new Date(this.properties.lastIndexUpdate);
- }
- });
+ if (typeof document !== 'undefined') {
+ this.indexInfoService.getLastIndexDate(this.properties).subscribe(lastIndexUpdate => {
+ if (lastIndexUpdate) {
+ this.indexUpdateDate = new Date(lastIndexUpdate);
+ } else if (this.properties.lastIndexUpdate) {
+ this.indexUpdateDate = new Date(this.properties.lastIndexUpdate);
+ }
+ });
+ }
//this.getDivContents();
this.getPageContents();
this.updateUrl(data.envSpecific.baseLink + this._router.url);
@@ -251,12 +253,15 @@ export class ProjectComponent {
}
actionsAfterLoadId() {
- this.getProjectInfo(this.projectId);
+ //this.getProjectInfo(this.projectId);
//this.searchPublications();
- this.fetchPublications.getNumForEntity("publication", "project", this.projectId, this.properties);
- this.fetchDatasets.getNumForEntity("dataset", "project", this.projectId, this.properties);
- this.fetchSoftware.getNumForEntity("software", "project", this.projectId, this.properties);
- this.fetchOrps.getNumForEntity("other", "project", this.projectId, this.properties);
+
+ if (typeof document !== 'undefined') {
+ this.fetchPublications.getNumForEntity("publication", "project", this.projectId, this.properties);
+ this.fetchDatasets.getNumForEntity("dataset", "project", this.projectId, this.properties);
+ this.fetchSoftware.getNumForEntity("software", "project", this.projectId, this.properties);
+ this.fetchOrps.getNumForEntity("other", "project", this.projectId, this.properties);
+ }
}
ngOnDestroy() {
diff --git a/landingPages/project/project.service.ts b/landingPages/project/project.service.ts
index 9fe5124b..49fce96f 100644
--- a/landingPages/project/project.service.ts
+++ b/landingPages/project/project.service.ts
@@ -179,22 +179,25 @@ export class ProjectService {
let id: string = "";
if(!Array.isArray(data[2])) {
- if(data[2].hasOwnProperty("legalshortname")) {
+ if(data[2].hasOwnProperty("to") && data[2]['to'].class == "hasParticipant") {
+
+ if (data[2].hasOwnProperty("legalshortname")) {
acronym = data[2].legalshortname;
}
- if(data[2].hasOwnProperty("legalname")) {
+ if (data[2].hasOwnProperty("legalname")) {
name = data[2].legalname;
}
- if(!acronym && !name){
+ if (!acronym && !name) {
// acronym is displayed with link and name only in tooltip
acronym = "[no title available]";
}
- if(data[2].hasOwnProperty("to")) {
- id = data[2]['to'].content;
+ if (data[2].hasOwnProperty("to")) {
+ id = data[2]['to'].content;
}
this.projectInfo.organizations.push({"acronym": acronym, "name": name, "id": id});
+ }
} else {
for(let i=0; i
Powered by OpenAIRE Open Research Graph
-
+
. Last update of records in OpenAIRE: {{indexUpdateDate | date: 'MMM dd, yyyy'}}
diff --git a/landingPages/result/resultLanding.component.ts b/landingPages/result/resultLanding.component.ts
index 76c8947f..54b4a312 100644
--- a/landingPages/result/resultLanding.component.ts
+++ b/landingPages/result/resultLanding.component.ts
@@ -116,13 +116,15 @@ export class ResultLandingComponent {
this.route.data
.subscribe((data: { envSpecific: EnvProperties }) => {
this.properties = data.envSpecific;
- this.indexInfoService.getLastIndexDate(this.properties).subscribe(lastIndexUpdate => {
- if (lastIndexUpdate) {
- this.indexUpdateDate = new Date(lastIndexUpdate);
- } else if (this.properties.lastIndexUpdate) {
- this.indexUpdateDate = new Date(this.properties.lastIndexUpdate);
- }
- });
+ if (typeof document !== 'undefined') {
+ this.indexInfoService.getLastIndexDate(this.properties).subscribe(lastIndexUpdate => {
+ if (lastIndexUpdate) {
+ this.indexUpdateDate = new Date(lastIndexUpdate);
+ } else if (this.properties.lastIndexUpdate) {
+ this.indexUpdateDate = new Date(this.properties.lastIndexUpdate);
+ }
+ });
+ }
//this.getDivContents();
this.getPageContents();
this.updateUrl(data.envSpecific.baseLink + this._router.url);
@@ -248,15 +250,19 @@ export class ResultLandingComponent {
this.showLoading = true;
this.resultLandingInfo = null;
-
- this._resultLaningService.getProvenanceActionVocabulary(this.properties).subscribe(
- provenanceActionVocabulary => {
- this.getResultLandingInfo(provenanceActionVocabulary);
- }, err => {
- this.getResultLandingInfo(null);
- this.handleError("Error getting provenance action vocabulary for " + this.type + " with id: " + this.id, err);
- }
- );
+
+ if (typeof document !== 'undefined') {
+ this._resultLaningService.getProvenanceActionVocabulary(this.properties).subscribe(
+ provenanceActionVocabulary => {
+ this.getResultLandingInfo(provenanceActionVocabulary);
+ }, err => {
+ this.getResultLandingInfo(null);
+ this.handleError("Error getting provenance action vocabulary for " + this.type + " with id: " + this.id, err);
+ }
+ );
+ } else {
+ this.getResultLandingInfo(null);
+ }
}
@@ -325,13 +331,15 @@ export class ResultLandingComponent {
});
}
this.bioentitiesNum = bioentitiesNum;
- if (this.resultLandingInfo.identifiers != undefined && this.resultLandingInfo.identifiers.has('doi')) {
- this.doi = this.resultLandingInfo.identifiers.get('doi')[0];
- this.metricsService.hasAltMetrics(this.properties.altMetricsAPIURL, this.doi).subscribe(hasAltMetrics => {
- this.hasAltMetrics = hasAltMetrics;
- }, error => {
- this.hasAltMetrics = false;
- });
+ if(typeof document !== 'undefined') {
+ if (this.resultLandingInfo.identifiers != undefined && this.resultLandingInfo.identifiers.has('doi')) {
+ this.doi = this.resultLandingInfo.identifiers.get('doi')[0];
+ this.metricsService.hasAltMetrics(this.properties.altMetricsAPIURL, this.doi).subscribe(hasAltMetrics => {
+ this.hasAltMetrics = hasAltMetrics;
+ }, error => {
+ this.hasAltMetrics = false;
+ });
+ }
}
this.showLoading = false;
this.setActiveTab();
diff --git a/searchPages/searchDataProviders.component.ts b/searchPages/searchDataProviders.component.ts
index 599c3be6..ede5fcad 100644
--- a/searchPages/searchDataProviders.component.ts
+++ b/searchPages/searchDataProviders.component.ts
@@ -40,6 +40,7 @@ import {DatasourcesHelperClass} from "./searchUtils/datasourcesHelper.class";
[sort]="false">
+
`
})
@@ -129,6 +130,7 @@ export class SearchDataProvidersComponent {
// console.log(this.refineFields)
this.searchPage.prepareSearchPage(this.fieldIds, this.selectedFields, this.refineFields, [], this.fieldIdsMap,this.customFilter,params, "dataprovider");
this.getResults(this.searchPage.getSearchAPIQueryForAdvancedSearhFields(), this.searchUtils.page, this.searchUtils.size, refine, this.searchPage.getSearchAPIQueryForRefineFields(params, firstLoad));
+ firstLoad = false;
});
}
ngOnDestroy() {
@@ -167,7 +169,8 @@ export class SearchDataProvidersComponent {
this.results = data[1];
//console.log(this.results);
if (refine) {
- this.filters = this.searchPage.prepareFiltersToShow((this.type=="all" || this.type == "deposit")?data[2]:this.filters, this.searchUtils.totalResults);
+ this.filters =
+ this.searchPage.prepareFiltersToShow((this.type=="all" || this.type == "deposit")?data[2]:this.filters, this.searchUtils.totalResults);
}else{
this.searchPage.buildPageURLParameters(this.filters, [], false);
}
diff --git a/searchPages/searchOrganizations.component.ts b/searchPages/searchOrganizations.component.ts
index 7d3bf698..f42cf56b 100644
--- a/searchPages/searchOrganizations.component.ts
+++ b/searchPages/searchOrganizations.component.ts
@@ -121,7 +121,7 @@ public resourcesQuery = "(oaftype exact organization)";
this.searchPage.prepareSearchPage(this.fieldIds, this.selectedFields, this.refineFields, [], this.fieldIdsMap,this.customFilter,params, "organization");
this.getResults(this.searchPage.getSearchAPIQueryForAdvancedSearhFields(), this.searchUtils.page, this.searchUtils.size, refine, this.searchPage.getSearchAPIQueryForRefineFields(params, firstLoad));
-
+ firstLoad = false;
});
}
ngOnDestroy() {
diff --git a/sharedComponents/navigationBar.component.ts b/sharedComponents/navigationBar.component.ts
index 6d7dbd7f..548e0696 100644
--- a/sharedComponents/navigationBar.component.ts
+++ b/sharedComponents/navigationBar.component.ts
@@ -50,13 +50,16 @@ export class NavigationBarComponent {
ngOnInit() {
this.activeRouteEnabled = false;
- this.sub = this.route.queryParams.subscribe(params => {
+ //this.sub = this.route.queryParams.subscribe(params => {
+ //console.log("params: ",params);
this.initialize();
- });
+ //});
}
ngOnDestroy() {
- this.sub.unsubscribe();
+ if(this.sub) {
+ this.sub.unsubscribe();
+ }
}
initialize() {
diff --git a/utils/iframe.component.ts b/utils/iframe.component.ts
index 568cc7ec..460d11dc 100644
--- a/utils/iframe.component.ts
+++ b/utils/iframe.component.ts
@@ -27,7 +27,11 @@ export class IFrameComponent {
this.style = {
"width.px": this.width,
"height.px": this.height
- }
+ };
+ } else if(this.height) {
+ this.style = {
+ "height.px": this.height
+ };
}
}
}
diff --git a/utils/tabs/contents/search-tab.component.ts b/utils/tabs/contents/search-tab.component.ts
index 5669114b..a2c29205 100644
--- a/utils/tabs/contents/search-tab.component.ts
+++ b/utils/tabs/contents/search-tab.component.ts
@@ -58,7 +58,11 @@ export class SearchTabComponent {
} else if (entityType == "other") {
return (full ? ("other research product" + (plural ? "s" : "")) : "other");
} else if (entityType == "result") {
- return (full ? ("research outcome" + (plural ? "s" : "")) : "result");
+ return ((full ? "research outcome" : "result") + (plural ? "s" : ""));
+ } else if (entityType == "project") {
+ return "project" + (plural ? "s" : "");
+ } else if (entityType == "dataprovider") {
+ return ((full ? "content provider" : "dataprovider") + (plural ? "s" : ""));
}
}
}