From e57f1b02ed0baac901631be505a10991a5f9cddd Mon Sep 17 00:00:00 2001 From: "k.triantafyllou" Date: Mon, 12 Feb 2024 14:47:02 +0200 Subject: [PATCH 1/2] [develop]: Split style of deposit and funders to new css files and use rootClass to appy style in html --- explore/angular.json | 2 + explore/src/app/app.component.ts | 42 ++++++++++++++++---- explore/src/app/app.module.ts | 9 +++-- explore/src/app/deposit/deposit.component.ts | 15 +++++-- explore/src/app/funders/funders.component.ts | 2 + explore/src/app/openaireLibrary | 2 +- explore/src/assets/deposit.less | 3 ++ explore/src/assets/explore-custom.less | 6 +-- explore/src/assets/funders.less | 3 ++ 9 files changed, 63 insertions(+), 21 deletions(-) create mode 100644 explore/src/assets/deposit.less create mode 100644 explore/src/assets/funders.less diff --git a/explore/angular.json b/explore/angular.json index 6f089df1..da263358 100644 --- a/explore/angular.json +++ b/explore/angular.json @@ -52,6 +52,8 @@ ], "styles": [ "src/styles.less", + {"input": "src/assets/deposit.less", "inject": false }, + {"input": "src/assets/funders.less", "inject": false }, "src/assets/common-assets/library-css/material.scss" ], "scripts": [ diff --git a/explore/src/app/app.component.ts b/explore/src/app/app.component.ts index a17526e3..ff1ddfd6 100644 --- a/explore/src/app/app.component.ts +++ b/explore/src/app/app.component.ts @@ -1,4 +1,4 @@ -import {ChangeDetectorRef, Component, ElementRef, ViewChild} from '@angular/core'; +import {AfterViewInit, ChangeDetectorRef, Component, ElementRef, ViewChild} from '@angular/core'; import {ActivatedRoute, Router} from '@angular/router'; import {EnvProperties} from './openaireLibrary/utils/properties/env-properties'; import {MenuItem} from './openaireLibrary/sharedComponents/menu'; @@ -23,20 +23,21 @@ import {QuickContactService} from './openaireLibrary/sharedComponents/quick-cont import {LayoutService} from './openaireLibrary/dashboard/sharedComponents/sidebar/layout.service'; @Component({ - //changeDetection: ChangeDetectionStrategy.Default, - //encapsulation: ViewEncapsulation.Emulated, selector: 'app-root', template: ` - +
+ +
-
+
+
@@ -57,7 +58,9 @@ import {LayoutService} from './openaireLibrary/dashboard/sharedComponents/sideba ` }) -export class AppComponent { +export class AppComponent implements AfterViewInit { + loading: boolean = false; + rootClass: string; isClient: boolean = false; userMenuItems: MenuItem[] = []; menuItems: MenuItem [] = []; @@ -124,7 +127,7 @@ export class AppComponent { } })); } - + ngOnDestroy() { this.subscriptions.forEach(subscription => { if (subscription instanceof Subscriber) { @@ -141,6 +144,31 @@ export class AppComponent { ngAfterViewInit() { if (typeof window !== "undefined") { this.createObservers(); + this.subscriptions.push(this.layoutService.rootClass.subscribe(rootClass => { + this.loading = true; + this.cdr.detectChanges(); + if (rootClass && this.isClient) { + let link = document.getElementById('theme'); + let append = false; + if (!link) { + link = document.createElement('link'); + link.rel = 'stylesheet'; + link.id = 'theme'; + append = true; + } + link.href = rootClass + '.css'; + link.onerror = (error) => console.log(error); + if (append) { + document.head.appendChild(link); + } + } + this.rootClass = rootClass; + this.cdr.detectChanges(); + setTimeout(() => { + this.loading = false; + this.cdr.detectChanges(); + }, 500) + })); } } diff --git a/explore/src/app/app.module.ts b/explore/src/app/app.module.ts index 1704868f..6d95092c 100755 --- a/explore/src/app/app.module.ts +++ b/explore/src/app/app.module.ts @@ -19,6 +19,7 @@ import {DEFAULT_TIMEOUT, TimeoutInterceptor} from "./openaireLibrary/timeout-int import {ErrorInterceptorService} from "./openaireLibrary/error-interceptor.service"; import {QuickContactModule} from './openaireLibrary/sharedComponents/quick-contact/quick-contact.module'; import {AlertModalModule} from './openaireLibrary/utils/modal/alertModal.module'; +import {LoadingModule} from "./openaireLibrary/utils/loading/loading.module"; @NgModule({ imports: [ @@ -30,10 +31,10 @@ import {AlertModalModule} from './openaireLibrary/utils/modal/alertModal.module' CookieLawModule, BrowserModule, AppRoutingModule, - BrowserAnimationsModule, PageURLResolverModule, - Schema2jsonldModule, - QuickContactModule, - AlertModalModule + BrowserAnimationsModule, PageURLResolverModule, + Schema2jsonldModule, + QuickContactModule, + AlertModalModule, LoadingModule ], declarations: [AppComponent, OpenaireErrorPageComponent], exports: [AppComponent], diff --git a/explore/src/app/deposit/deposit.component.ts b/explore/src/app/deposit/deposit.component.ts index 2d4ff8bb..c2a9c156 100644 --- a/explore/src/app/deposit/deposit.component.ts +++ b/explore/src/app/deposit/deposit.component.ts @@ -1,4 +1,5 @@ -import {Component} from '@angular/core'; +import {Component, OnDestroy, OnInit} from '@angular/core'; +import {LayoutService} from "../openaireLibrary/dashboard/sharedComponents/sidebar/layout.service"; @Component({ selector: 'openaire-deposit', @@ -7,11 +8,17 @@ import {Component} from '@angular/core'; ` }) -export class OpenaireDepositComponent { +export class OpenaireDepositComponent implements OnInit, OnDestroy { - constructor() { + constructor(private layoutService: LayoutService) { } - public ngOnInit() {} + public ngOnInit() { + this.layoutService.setRootClass('deposit'); + } + + ngOnDestroy() { + this.layoutService.setRootClass(null); + } } diff --git a/explore/src/app/funders/funders.component.ts b/explore/src/app/funders/funders.component.ts index f1de1989..29a587cd 100644 --- a/explore/src/app/funders/funders.component.ts +++ b/explore/src/app/funders/funders.component.ts @@ -91,6 +91,7 @@ export class FundersComponent implements OnInit { } ngOnInit() { + this.layoutService.setRootClass('funders'); this.title.setTitle('OpenAIRE - Explore | Funders'); this.properties = properties; this.subscriptions.push( this.piwikService.trackView(this.properties, this.pageTitle).subscribe()); @@ -126,6 +127,7 @@ export class FundersComponent implements OnInit { subscription.unsubscribe(); } }); + this.layoutService.setRootClass(null); } private updateDescription(description: string) { diff --git a/explore/src/app/openaireLibrary b/explore/src/app/openaireLibrary index a7294685..1cfe22f4 160000 --- a/explore/src/app/openaireLibrary +++ b/explore/src/app/openaireLibrary @@ -1 +1 @@ -Subproject commit a7294685fb4ad530d1d1fbca75edd5bb0f691eff +Subproject commit 1cfe22f406d3a74ce0cf73a50ec19824331a6447 diff --git a/explore/src/assets/deposit.less b/explore/src/assets/deposit.less new file mode 100644 index 00000000..d35446c2 --- /dev/null +++ b/explore/src/assets/deposit.less @@ -0,0 +1,3 @@ +.deposit { + @import (multiple) "~src/assets/openaire-theme/less/_import"; +} diff --git a/explore/src/assets/explore-custom.less b/explore/src/assets/explore-custom.less index 071f252d..b6b227bb 100644 --- a/explore/src/assets/explore-custom.less +++ b/explore/src/assets/explore-custom.less @@ -32,10 +32,6 @@ /* Landing */ @landing-portal-color: @explore-color; -.deposit, .funders { - @import (multiple) "~src/assets/openaire-theme/less/_import"; -} - .monitor-dashboard-link { color: @monitor-color; } @@ -51,4 +47,4 @@ text-decoration: none; color: @secondary-color; } -} \ No newline at end of file +} diff --git a/explore/src/assets/funders.less b/explore/src/assets/funders.less new file mode 100644 index 00000000..82accc6e --- /dev/null +++ b/explore/src/assets/funders.less @@ -0,0 +1,3 @@ +.funders { + @import (multiple) "~src/assets/openaire-theme/less/_import"; +} From 8cdc423f02928303d34fbf3e56bba4fe18bc11bc Mon Sep 17 00:00:00 2001 From: "konstantina.galouni" Date: Mon, 12 Feb 2024 14:47:47 +0200 Subject: [PATCH 2/2] [develop | DONE | CHANGED]: CHANGELOG.md: Added changelogs for [production-release-february-2024]. --- explore/CHANGELOG.md | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/explore/CHANGELOG.md b/explore/CHANGELOG.md index b6e172b9..1c129674 100644 --- a/explore/CHANGELOG.md +++ b/explore/CHANGELOG.md @@ -14,6 +14,19 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0. - *Fixed (for any bug fixes)* - *Security (in case of vulnerabilities)* +## [production-release-february-2024] - 2024/02/12 +### Changed +* Remove "open access" as preselected filter +* Rounded numbers in search tabs +* Home page: Performance improvements on images loading +* Home page, Search page, Funders page: Performance improvements on services requests + +### Fixed +* Filtering out in funding levels according to selected funder when querying 100 values +* Filters in claims & in organization landing > projects tab were always loading +* Research products landing page: Added providers in versions +* SEO fixes in landing pages + ## [production-release-january-2024] - 2024/02/01 ### Changed * Updated FoS search filter - do not display code