Compare commits

...

2 Commits

4 changed files with 21 additions and 8 deletions

View File

@ -30,6 +30,7 @@ import {ISVocabulariesService} from "./openaireLibrary/utils/staticAutoComplete/
[onlyTop]=false [user]="user"
[communityId]="properties.adminToolsCommunity" [userMenuItems]=userMenuItems [menuItems]=menuItems></navbar>
<div *ngIf="loading">
loading... {{isClient ? "client" : "server"}}
<loading [full]="true"></loading>
</div>
<schema2jsonld *ngIf="properties" [URL]="properties.domain+properties.baseLink"

View File

@ -1,6 +1,6 @@
import {APP_ID, NgModule} from '@angular/core';
import {SharedModule} from './openaireLibrary/shared/shared.module';
import {BrowserModule} from '@angular/platform-browser';
import {BrowserModule, provideClientHydration} from '@angular/platform-browser';
import {BrowserAnimationsModule} from '@angular/platform-browser/animations';
import {CommonModule} from '@angular/common';
import {HTTP_INTERCEPTORS, HttpClientModule} from '@angular/common/http';
@ -38,6 +38,7 @@ import {LoadingModule} from "./openaireLibrary/utils/loading/loading.module";
declarations: [AppComponent],
exports: [AppComponent],
providers: [
provideClientHydration(),
{provide: APP_ID, useValue: 'explore'},
// {
// provide: HTTP_INTERCEPTORS,

View File

@ -2,10 +2,10 @@ import {
AfterViewInit,
ChangeDetectorRef,
Component,
ElementRef,
ElementRef, Inject, makeStateKey,
OnDestroy,
OnInit,
QueryList,
OnInit, PLATFORM_ID,
QueryList, TransferState,
ViewChild,
ViewChildren
} from '@angular/core';
@ -25,6 +25,7 @@ import {properties} from "../../environments/environment";
import {Numbers, NumbersComponent} from "../openaireLibrary/sharedComponents/numbers/numbers.component";
import {StringUtils} from "../openaireLibrary/utils/string-utils.class";
import {QuickContactService} from '../openaireLibrary/sharedComponents/quick-contact/quick-contact.service';
import {isPlatformServer} from "@angular/common";
@Component({
selector: 'home',
@ -109,15 +110,20 @@ export class HomeComponent implements OnInit, OnDestroy, AfterViewInit {
];
stringUtils = new StringUtils();
// disableSelect: boolean = true;
public isClient: boolean = false;
constructor(
private _router: Router,
private _piwikService: PiwikService,
private config: ConfigurationService, private _meta: Meta, private _title: Title, private seoService: SEOService,
private helper: HelperService,
private cdr: ChangeDetectorRef,
private quickContactService: QuickContactService
private quickContactService: QuickContactService,
@Inject(PLATFORM_ID) private platform: any,
private transferState: TransferState
) {
this.isClient = !isPlatformServer(this.platform);
let description = "OpenAIRE Explore: Over 100M of research deduplicated, 170K research software, 11M research data. One of the largest open scholarly records collection worldwide.";
let title = "OpenAIRE | Find and Share research";
this._title.setTitle(title);
@ -221,7 +227,12 @@ export class HomeComponent implements OnInit, OnDestroy, AfterViewInit {
this.resultTypes.values.push({name: this.openaireEntities.OTHER, id: "other", selected: false, number: 0});
}
if(this.numbersComponent) {
this.numbersComponent.init(this.numbersComponent.showDatasets, this.numbersComponent.showSoftware, this.numbersComponent.showPublications, this.numbersComponent.showDatasets, this.numbersComponent.showSoftware, this.numbersComponent.showOrp, this.numbersComponent.showProjects, this.numbersComponent.showDataProviders, this.numbersComponent.showOrganizations);
let stateKey = makeStateKey<Numbers>("numbers");
// if(this.isClient && this.transferState.hasKey(stateKey)) {
// this.numbers = this.transferState.get(stateKey, null);
// } else {
this.numbersComponent.init(this.numbersComponent.showDatasets, this.numbersComponent.showSoftware, this.numbersComponent.showPublications, this.numbersComponent.showDatasets, this.numbersComponent.showSoftware, this.numbersComponent.showOrp, this.numbersComponent.showProjects, this.numbersComponent.showDataProviders, this.numbersComponent.showOrganizations);
// }
}
}
},

@ -1 +1 @@
Subproject commit 8d6c45abe39953e70764bca0fb0e5446055d6325
Subproject commit 0aacac2de9b8779babb5ba5a2a11d3368aee463f