From 058d30f4c1cddb8c5b5e967393aee09847ef2d83 Mon Sep 17 00:00:00 2001 From: "konstantina.galouni" Date: Wed, 26 Apr 2023 11:45:54 +0300 Subject: [PATCH 01/25] [Connect Admin | develop]: community.service.ts: Renamed "advancedConstraint" to "advancedConstraints" (coming from community API). --- connect/community/community.service.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/connect/community/community.service.ts b/connect/community/community.service.ts index acc3b749..d8fe6975 100644 --- a/connect/community/community.service.ts +++ b/connect/community/community.service.ts @@ -122,8 +122,8 @@ export class CommunityService { } else { community.fos = []; } - if (resData.advancedConstraint != null) { - community.selectionCriteria = resData.advancedConstraint; + if (resData.advancedConstraints != null) { + community.selectionCriteria = resData.advancedConstraints; } else { community.selectionCriteria = new SelectionCriteria(); } From 3be6013644a90d9a49c08a71c75fb7549d8b3e69 Mon Sep 17 00:00:00 2001 From: "konstantina.galouni" Date: Wed, 26 Apr 2023 15:54:43 +0300 Subject: [PATCH 02/25] [Library | develop & Eosc Explore | develop]: index.html: Updated favicon for beta | transferData.component.ts: Added check for client side before opening Data Transfer modal. --- utils/dataTransfer/transferData.component.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/utils/dataTransfer/transferData.component.ts b/utils/dataTransfer/transferData.component.ts index e0ede1ee..699a5bd0 100644 --- a/utils/dataTransfer/transferData.component.ts +++ b/utils/dataTransfer/transferData.component.ts @@ -60,7 +60,7 @@ export class EGIDataTransferComponent { } ngAfterViewInit() { - if(this.isOpen){ + if(this.isOpen && typeof document !== 'undefined'){ this.open(); } } From bd87a47795f8f9243e0a1129d715fcb96cf9b714 Mon Sep 17 00:00:00 2001 From: "k.triantafyllou" Date: Tue, 2 May 2023 18:08:48 +0300 Subject: [PATCH 03/25] Fix bug with UIKit sticky on page-content if header is changing width. --- .../page-content/page-content.component.ts | 36 ++++++++++++++----- 1 file changed, 28 insertions(+), 8 deletions(-) diff --git a/dashboard/sharedComponents/page-content/page-content.component.ts b/dashboard/sharedComponents/page-content/page-content.component.ts index bc1b1da9..df7428e4 100644 --- a/dashboard/sharedComponents/page-content/page-content.component.ts +++ b/dashboard/sharedComponents/page-content/page-content.component.ts @@ -13,7 +13,6 @@ import { import {LayoutService, SidebarItem} from "../sidebar/layout.service"; declare var UIkit; -declare var ResizeObserver; @Component({ selector: '[page-content]', @@ -99,11 +98,9 @@ export class PageContentComponent implements OnInit, AfterViewInit, OnDestroy { ngAfterViewInit() { if (typeof document !== "undefined") { - this.observeStickyFooter(); if (this.shouldSticky && typeof document !== 'undefined') { - this.sticky.header = UIkit.sticky((this.headerSticky ? this.header.nativeElement : this.actions.nativeElement), { - offset: this.offset - }); + this.initHeader(); + this.observeStickyHeader(); this.subscriptions.push(UIkit.util.on(document, 'active', '#' + this.sticky.header.$el.id, () => { this.isStickyActive = true; this.cdr.detectChanges(); @@ -116,6 +113,7 @@ export class PageContentComponent implements OnInit, AfterViewInit, OnDestroy { if (this.sticky_footer) { let footer_offset = this.calcStickyFooterOffset(this.sticky_footer.nativeElement); this.sticky.footer = UIkit.sticky(this.sticky_footer.nativeElement, {bottom: true, offset: footer_offset}); + this.observeStickyFooter(); } } } @@ -124,12 +122,23 @@ export class PageContentComponent implements OnInit, AfterViewInit, OnDestroy { this.subscriptions.forEach(subscription => { if (typeof ResizeObserver !== "undefined" && subscription instanceof ResizeObserver) { subscription.disconnect(); - } else if (typeof ResizeObserver !== "undefined" && subscription instanceof IntersectionObserver) { + } else if (typeof IntersectionObserver !== "undefined" && subscription instanceof IntersectionObserver) { subscription.disconnect(); } }); } + initHeader() { + this.sticky.header = UIkit.sticky((this.headerSticky ? this.header.nativeElement : this.actions.nativeElement), { + offset: this.offset + }); + + } + + initFooter() { + let footer_offset = this.calcStickyFooterOffset(this.sticky_footer.nativeElement); + this.sticky.footer = UIkit.sticky(this.sticky_footer.nativeElement, {bottom: true, offset: footer_offset}); + } /** * Workaround for sticky not update bug when sidebar is toggled. @@ -200,14 +209,25 @@ export class PageContentComponent implements OnInit, AfterViewInit, OnDestroy { headerObs.observe(this.header.nativeElement); } } + + private observeStickyHeader() { + if (this.sticky.header) { + let resizeObs= new ResizeObserver(entries => { + entries.forEach(entry => { + this.initHeader(); + }) + }); + this.subscriptions.push(resizeObs); + resizeObs.observe(this.sticky.header.$el); + } + } private observeStickyFooter() { if (this.sticky_footer) { let resizeObs = new ResizeObserver(entries => { entries.forEach(entry => { setTimeout(() => { - this.sticky.footer.offset = this.calcStickyFooterOffset(entry.target); - this.cdr.detectChanges(); + this.initFooter(); }); }) }); From c321390ccbbe72515f336830c3aa54e3156379ef Mon Sep 17 00:00:00 2001 From: "k.triantafyllou" Date: Wed, 3 May 2023 16:29:59 +0300 Subject: [PATCH 04/25] Fix bug in sidebar toggle item | Page content: Add timeout on initialization of header. --- .../page-content/page-content.component.ts | 49 ++++++------------- .../sidebar/sideBar.component.ts | 4 +- 2 files changed, 19 insertions(+), 34 deletions(-) diff --git a/dashboard/sharedComponents/page-content/page-content.component.ts b/dashboard/sharedComponents/page-content/page-content.component.ts index df7428e4..54261153 100644 --- a/dashboard/sharedComponents/page-content/page-content.component.ts +++ b/dashboard/sharedComponents/page-content/page-content.component.ts @@ -98,23 +98,25 @@ export class PageContentComponent implements OnInit, AfterViewInit, OnDestroy { ngAfterViewInit() { if (typeof document !== "undefined") { - if (this.shouldSticky && typeof document !== 'undefined') { - this.initHeader(); - this.observeStickyHeader(); - this.subscriptions.push(UIkit.util.on(document, 'active', '#' + this.sticky.header.$el.id, () => { - this.isStickyActive = true; - this.cdr.detectChanges(); - })); - this.subscriptions.push(UIkit.util.on(document, 'inactive', '#' + this.sticky.header.$el.id, () => { - this.isStickyActive = false; - this.cdr.detectChanges(); - })); - } if (this.sticky_footer) { - let footer_offset = this.calcStickyFooterOffset(this.sticky_footer.nativeElement); - this.sticky.footer = UIkit.sticky(this.sticky_footer.nativeElement, {bottom: true, offset: footer_offset}); + this.initFooter(); this.observeStickyFooter(); } + if (this.shouldSticky && typeof document !== 'undefined') { + setTimeout(() => { + this.sticky.header = UIkit.sticky((this.headerSticky ? this.header.nativeElement : this.actions.nativeElement), { + offset: this.offset + }); + this.subscriptions.push(UIkit.util.on(document, 'active', '#' + this.sticky.header.$el.id, () => { + this.isStickyActive = true; + this.cdr.detectChanges(); + })); + this.subscriptions.push(UIkit.util.on(document, 'inactive', '#' + this.sticky.header.$el.id, () => { + this.isStickyActive = false; + this.cdr.detectChanges(); + })); + }); + } } } @@ -127,13 +129,6 @@ export class PageContentComponent implements OnInit, AfterViewInit, OnDestroy { } }); } - - initHeader() { - this.sticky.header = UIkit.sticky((this.headerSticky ? this.header.nativeElement : this.actions.nativeElement), { - offset: this.offset - }); - - } initFooter() { let footer_offset = this.calcStickyFooterOffset(this.sticky_footer.nativeElement); @@ -209,18 +204,6 @@ export class PageContentComponent implements OnInit, AfterViewInit, OnDestroy { headerObs.observe(this.header.nativeElement); } } - - private observeStickyHeader() { - if (this.sticky.header) { - let resizeObs= new ResizeObserver(entries => { - entries.forEach(entry => { - this.initHeader(); - }) - }); - this.subscriptions.push(resizeObs); - resizeObs.observe(this.sticky.header.$el); - } - } private observeStickyFooter() { if (this.sticky_footer) { diff --git a/dashboard/sharedComponents/sidebar/sideBar.component.ts b/dashboard/sharedComponents/sidebar/sideBar.component.ts index 2e0c8aa1..39bc1fc1 100644 --- a/dashboard/sharedComponents/sidebar/sideBar.component.ts +++ b/dashboard/sharedComponents/sidebar/sideBar.component.ts @@ -49,7 +49,9 @@ export class SideBarComponent implements OnInit, AfterViewInit, OnDestroy, OnCha } ngAfterViewInit() { - this.toggle(true); + setTimeout(() => { + this.toggle(true); + }); } ngOnChanges(changes: SimpleChanges) { From d96ee9acc80dc8b0451d4bada0dab19532ba84ae Mon Sep 17 00:00:00 2001 From: "k.triantafyllou" Date: Fri, 5 May 2023 17:05:41 +0300 Subject: [PATCH 05/25] Fix width of tabs in terminology page. --- monitor/methodology/terminology.component.less | 3 +++ monitor/methodology/terminology.component.ts | 5 +++-- 2 files changed, 6 insertions(+), 2 deletions(-) create mode 100644 monitor/methodology/terminology.component.less diff --git a/monitor/methodology/terminology.component.less b/monitor/methodology/terminology.component.less new file mode 100644 index 00000000..e6212b69 --- /dev/null +++ b/monitor/methodology/terminology.component.less @@ -0,0 +1,3 @@ +.uk-width-medium { + width: 350px; +} diff --git a/monitor/methodology/terminology.component.ts b/monitor/methodology/terminology.component.ts index ded7fbcd..2e518e29 100644 --- a/monitor/methodology/terminology.component.ts +++ b/monitor/methodology/terminology.component.ts @@ -50,7 +50,7 @@ declare var ResizeObserver;
-
+
@@ -116,7 +116,8 @@ declare var ResizeObserver;
- ` + `, + styleUrls: ['terminology.component.less'] }) export class TerminologyComponent implements OnInit, OnDestroy, AfterViewInit, AfterContentChecked { public tab: 'entities' | 'attributes' = 'entities'; From d6ec928237238cf1d0bebbf2a83e915348b8e38a Mon Sep 17 00:00:00 2001 From: "konstantina.galouni" Date: Mon, 8 May 2023 17:50:39 +0300 Subject: [PATCH 06/25] [Monitor & Library | develop]: [Bug fix] Show quick contact button when not in contacts us and not intersecting either with contact us section (home page), nor with bottom. 1. layout.service.ts: Initialize hasQuickContactSubject to false (Don't ever show it unless it should be there). 2. quick-contact.service.ts: Initialize display to false (Assume it is intersecting, until it is proved it is not). 3. app.component.ts: Updated checks for and added public bottomNotIntersecting: boolean; and public displayQuickContact: boolean; --- dashboard/sharedComponents/sidebar/layout.service.ts | 2 +- sharedComponents/quick-contact/quick-contact.service.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/dashboard/sharedComponents/sidebar/layout.service.ts b/dashboard/sharedComponents/sidebar/layout.service.ts index ed91e514..447d7a5f 100644 --- a/dashboard/sharedComponents/sidebar/layout.service.ts +++ b/dashboard/sharedComponents/sidebar/layout.service.ts @@ -59,7 +59,7 @@ export class LayoutService { /** * Add hasQuickContact: false on data of route config, if the quick-contact fixed button is not needed. */ - private hasQuickContactSubject: BehaviorSubject = new BehaviorSubject(true); + private hasQuickContactSubject: BehaviorSubject = new BehaviorSubject(false); /** * Add activeMenuItem: string on data of route config, if page should activate a specific MenuItem and route url does not match. */ diff --git a/sharedComponents/quick-contact/quick-contact.service.ts b/sharedComponents/quick-contact/quick-contact.service.ts index 0ddcdcc7..c31a742c 100644 --- a/sharedComponents/quick-contact/quick-contact.service.ts +++ b/sharedComponents/quick-contact/quick-contact.service.ts @@ -5,7 +5,7 @@ import { BehaviorSubject, Observable } from "rxjs"; providedIn: "root" }) export class QuickContactService { - private display: BehaviorSubject = new BehaviorSubject(true); + private display: BehaviorSubject = new BehaviorSubject(false); public get isDisplayed(): Observable { return this.display.asObservable(); From 49f9bec70d9c8e6dcdda9151c5fb42d62225d26b Mon Sep 17 00:00:00 2001 From: "k.triantafyllou" Date: Tue, 9 May 2023 15:38:37 +0300 Subject: [PATCH 07/25] Add year range in types of input component --- sharedComponents/input/input.component.ts | 111 +++++++++++++++++++--- 1 file changed, 97 insertions(+), 14 deletions(-) diff --git a/sharedComponents/input/input.component.ts b/sharedComponents/input/input.component.ts index 5d83e1fa..9d63eead 100644 --- a/sharedComponents/input/input.component.ts +++ b/sharedComponents/input/input.component.ts @@ -15,13 +15,12 @@ import { ViewChild, ViewChildren } from "@angular/core"; -import {AbstractControl, UntypedFormArray, UntypedFormControl, ValidatorFn} from "@angular/forms"; +import {AbstractControl, UntypedFormArray, UntypedFormControl, UntypedFormGroup, ValidatorFn} from "@angular/forms"; import {HelperFunctions} from "../../utils/HelperFunctions.class"; import {BehaviorSubject, Subscription} from "rxjs"; import {EnvProperties} from "../../utils/properties/env-properties"; import {properties} from "../../../../environments/environment"; import {ClickEvent} from "../../utils/click/click-outside-or-esc.directive"; -import {element} from "protractor"; export type InputType = 'text' @@ -31,7 +30,8 @@ export type InputType = | 'autocomplete_soft' | 'textarea' | 'select' - | 'chips'; + | 'chips' + | 'year-range'; export interface Option { icon?: string, @@ -48,6 +48,16 @@ export interface Placeholder { static?: boolean } +export interface YearRange { + from: ControlConfiguration, + to: ControlConfiguration +} + +export interface ControlConfiguration { + control: string, + placeholder: string +} + declare var UIkit; /** @@ -63,11 +73,11 @@ declare var UIkit;
-
+
+ +
+ +
+
-
+
+ +
+
@@ -157,6 +180,7 @@ declare var UIkit;
+
@@ -179,7 +203,7 @@ declare var UIkit;
- {{formControl.errors.error}} + {{errors?.error}} Please provide a valid URL (e.g. https://example.com) @@ -213,7 +237,7 @@ export class InputComponent implements OnInit, OnDestroy, AfterViewInit, OnChang @Input() tooltip: boolean = false; @Input() searchable: boolean = false; /** Text */ - @ViewChild('input') input: ElementRef; + @ViewChildren('input') input: QueryList; /** Textarea options */ @ViewChild('textArea') textArea: ElementRef; @Input('rows') rows: number = 3; @@ -236,6 +260,10 @@ export class InputComponent implements OnInit, OnDestroy, AfterViewInit, OnChang @Input() visibleChips: number = 1; @Input() separators: string[] = []; @Input() noWrap: boolean = false; + /** Year Range Configuration */ + @Input() yearRange: YearRange; + public activeIndex: 0 | 1 | null = null; + @Input() visibleRows: number = -1; @Input() extendEnter: () => void = null; @Output() focusEmitter: EventEmitter = new EventEmitter(); @@ -259,7 +287,9 @@ export class InputComponent implements OnInit, OnDestroy, AfterViewInit, OnChang @Input() set placeholder(placeholder: string | Placeholder) { - if (typeof placeholder === 'string') { + if(this.type === 'year-range') { + this.placeholderInfo = null; + } else if (typeof placeholder === 'string') { this.placeholderInfo = {label: placeholder, static: false}; } else { if (placeholder.static && (this.type === 'autocomplete' || this.hint)) { @@ -432,6 +462,22 @@ export class InputComponent implements OnInit, OnDestroy, AfterViewInit, OnChang this.unsubscribe(); } + getFormByName(name: string): UntypedFormControl { + if (this.formControl instanceof UntypedFormGroup) { + return this.formControl.get(name); + } else { + return null; + } + } + + get formAsGroup(): UntypedFormGroup { + if (this.formControl instanceof UntypedFormGroup) { + return this.formControl; + } else { + return null; + } + } + get formAsControl(): UntypedFormControl { if (this.formControl instanceof UntypedFormControl) { return this.formControl; @@ -448,6 +494,25 @@ export class InputComponent implements OnInit, OnDestroy, AfterViewInit, OnChang } } + get yearRangeActive(): boolean { + if(this.yearRange) { + return this.formAsGroup && (this.getFormByName(this.yearRange.from.control)?.value || this.getFormByName(this.yearRange.to.control)?.value); + } + return false; + } + + get errors(): any { + if(this.formAsGroup) { + return (this.formAsGroup.errors + ?this.formAsGroup.errors:(this.getFormByName(this.yearRange.from.control).errors + ?this.getFormByName(this.yearRange.from.control).errors:this.getFormByName(this.yearRange.to.control).errors)); + } else if(this.formAsControl) { + return this.formAsControl.errors; + } else { + return this.searchControl.errors; + } + } + reset() { this.secure = true; this.unsubscribe(); @@ -455,7 +520,7 @@ export class InputComponent implements OnInit, OnDestroy, AfterViewInit, OnChang if (this.type === 'logoURL') { this.secure = (!this.initValue || this.initValue.includes('https://')); } - if (this.optionsArray) { + if (this.optionsArray?.length > 0) { this.filteredOptions = this.filter(''); this.cdr.detectChanges(); } @@ -475,7 +540,7 @@ export class InputComponent implements OnInit, OnDestroy, AfterViewInit, OnChang } })); } - if (this.formControl.validator) { + if (this.formAsControl?.validator) { let validator = this.formControl.validator({} as AbstractControl); this.required = (validator && validator.required); } @@ -502,8 +567,20 @@ export class InputComponent implements OnInit, OnDestroy, AfterViewInit, OnChang } } })); + if(this.formAsGroup) { + this.subscriptions.push(this.formAsGroup.get(this.yearRange.from.control).valueChanges.subscribe(value => { + if(this.formAsGroup.get(this.yearRange.from.control).valid) { + if(this.activeIndex === 0 && value.length > 0) { + this.activeIndex = 1; + this.input.get(this.activeIndex).nativeElement.focus(); + } + } + })); + } if (this.input) { - this.input.nativeElement.disabled = this.formControl.disabled; + this.input.forEach(input => { + input.nativeElement.disabled = this.formControl.disabled; + }); } } @@ -598,14 +675,17 @@ export class InputComponent implements OnInit, OnDestroy, AfterViewInit, OnChang } focus(value: boolean, event = null) { + if(!this.activeIndex) { + this.activeIndex = 0; + } if (this.focused) { this.formControl.markAsTouched(); } this.focused = value; this.cdr.detectChanges(); if (this.focused) { - if (this.input) { - this.input.nativeElement.focus(); + if (this.input?.length > 0) { + this.input.get(this.activeIndex).nativeElement.focus(); } else if (this.textArea) { this.textArea.nativeElement.focus(); } else if (this.searchInput) { @@ -618,9 +698,12 @@ export class InputComponent implements OnInit, OnDestroy, AfterViewInit, OnChang this.open(true); } } else { + this.activeIndex = null; this.open(false); if (this.input) { - this.input.nativeElement.blur(); + this.input.forEach(input => { + input.nativeElement.blur(); + }) } else if (this.textArea) { this.textArea.nativeElement.blur(); } else if (this.searchInput) { From 6be478cacc13f3c5e6808d4d5dc358eb53be1faf Mon Sep 17 00:00:00 2001 From: "k.triantafyllou" Date: Wed, 10 May 2023 11:53:49 +0300 Subject: [PATCH 08/25] Add max-length=4 and text-center in inputs of year-range --- sharedComponents/input/input.component.ts | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/sharedComponents/input/input.component.ts b/sharedComponents/input/input.component.ts index 9d63eead..c6d7af71 100644 --- a/sharedComponents/input/input.component.ts +++ b/sharedComponents/input/input.component.ts @@ -152,15 +152,13 @@ declare var UIkit;
- +
-
- +
Date: Thu, 11 May 2023 13:04:09 +0300 Subject: [PATCH 09/25] Modal: Fix UIkit undefined in server --- utils/modal/alert.ts | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/utils/modal/alert.ts b/utils/modal/alert.ts index d43ab3f2..2c79afbb 100644 --- a/utils/modal/alert.ts +++ b/utils/modal/alert.ts @@ -185,14 +185,16 @@ export class AlertModal implements OnInit, AfterViewInit, OnDestroy { * Opens an alert window creating backdrop. */ open() { - UIkit.modal(this.element.nativeElement).show(); + if(typeof UIkit !== "undefined") { + UIkit.modal(this.element.nativeElement).show(); + } } /** * ok method closes the modal and emits modalOutput. */ ok() { - if (!this.stayOpen) { + if (!this.stayOpen && typeof UIkit !== "undefined") { UIkit.modal(this.element.nativeElement).hide(); } if (!this.choice) { @@ -209,6 +211,8 @@ export class AlertModal implements OnInit, AfterViewInit, OnDestroy { * cancel method closes the modal. */ cancel() { - UIkit.modal(this.element.nativeElement).hide(); + if(typeof UIkit !== "undefined") { + UIkit.modal(this.element.nativeElement).hide(); + } } } From 7cf23698d789f68c2e2c47644f38129babb373c6 Mon Sep 17 00:00:00 2001 From: "k.triantafyllou" Date: Mon, 15 May 2023 16:47:25 +0300 Subject: [PATCH 10/25] Rename OpenAIRE Research Graph into OpenAIRE Graph and add the new logo in powered by sections. --- monitor/how/how.component.less | 299 ------------------ monitor/how/how.component.ts | 72 ----- monitor/how/how.module.ts | 12 - .../indicators/indicator-themes.component.ts | 4 +- .../methodological-approach.component.ts | 12 +- monitor/methodology/methodology.module.ts | 8 +- monitor/methodology/terminology.component.ts | 14 +- 7 files changed, 15 insertions(+), 406 deletions(-) delete mode 100644 monitor/how/how.component.less delete mode 100644 monitor/how/how.component.ts delete mode 100644 monitor/how/how.module.ts diff --git a/monitor/how/how.component.less b/monitor/how/how.component.less deleted file mode 100644 index 04459c51..00000000 --- a/monitor/how/how.component.less +++ /dev/null @@ -1,299 +0,0 @@ -@import "~src/assets/openaire-theme/less/_import-variables"; - -@media only screen and (min-width: @breakpoint-small) { - .how .first > div:first-child { - position: relative; - } - - .how .first > div:first-child:after { - content: "we"; - font-size: 20px; - font-weight: 600; - text-align: center; - padding-bottom: 5%; - position: absolute; - background-image: url("~src/assets/common-assets/monitor-assets/green-arrows/1.svg"); - right: -21%; - top: 33%; - width: 20%; - background-size: contain; - background-repeat: no-repeat; - background-position: bottom center; - } - - .how .second > div:first-child { - position: relative; - padding: 0 10% 0 20%; - } - - .how .second > div:first-child:after { - content: "and"; - font-size: 20px; - font-weight: 600; - text-align: center; - padding-bottom: 5%; - position: absolute; - background-image: url("~src/assets/common-assets/monitor-assets/green-arrows/2.svg"); - right: -17%; - top: 33%; - width: 30%; - background-size: contain; - background-repeat: no-repeat; - background-position: bottom center; - } - - .how .third { - position: relative; - } - - .how .third > div:first-child { - padding: 0 14% 0 13%; - } - - .how .third:after { - content: "on which"; - font-size: 20px; - font-weight: 600; - padding-right: 30%; - padding-top: 5%; - padding-bottom: 5%; - position: absolute; - background-image: url("~src/assets/common-assets/monitor-assets/green-arrows/3.svg"); - bottom: -6%; - left: 13%; - transform: translateY(100%); - width: 140px; - background-size: contain; - background-repeat: no-repeat; - background-position: center; - } - - .how .fourth { - padding: 10% 3% 0 3%; - } - - .how .fourth > div:first-child { - position: relative; - padding: 0 16% 0 16%; - } - - .how .fourth> div:first-child:after { - content: "and"; - font-size: 20px; - font-weight: 600; - text-align: center; - padding-bottom: 5%; - position: absolute; - background-image: url("~src/assets/common-assets/monitor-assets/green-arrows/4.svg"); - left: -18%; - top: 36%; - width: 30%; - background-size: contain; - background-repeat: no-repeat; - background-position: bottom center; - } - - .how .fifth { - padding: 11% 2% 0 2%; - } - - .how .fifth > div:first-child { - position: relative; - } - - .how .fifth > div:first-child:after { - content: "We"; - font-size: 20px; - font-weight: 600; - text-align: center; - padding-bottom: 5%; - position: absolute; - background-image: url("~src/assets/common-assets/monitor-assets/green-arrows/5.svg"); - left: -35%; - top: 36%; - width: 30%; - background-size: contain; - background-repeat: no-repeat; - background-position: bottom center; - } - - .how .sixth { - padding: 10% 5% 0 0; - } - - .how .sixth > div:first-child { - padding: 0 15% 0 15%; - } - - .how .final { - padding: 10% 20% 0 20%; - } - - .how .final > div:first-child { - position: relative; - } - - .how .final > div:first-child:before { - content: ""; - position: absolute; - background-image: url("~src/assets/common-assets/monitor-assets/green-arrows/6.svg"); - left: -26%; - top: -20%; - height: 70%; - width: 30%; - background-size: contain; - background-repeat: no-repeat; - background-position: bottom center; - } - - .how .final > div:first-child:after { - content: "We make visualizations, graphs, reports and deliver all in a customisable tool"; - font-size: 20px; - position: absolute; - top: 30%; - width: 250px; - padding: 8% 0 5% 0; - background-size: contain; - background-repeat: no-repeat; - background-position: bottom center; - } -} - -@media only screen and (max-width: @breakpoint-xsmall-max) { - .how .first { - position: relative; - padding-bottom: 30%; - } - - .how .first:after { - content: "we"; - text-align: center; - padding: 10% 34% 10% 0; - position: absolute; - background-image: url("~src/assets/common-assets/monitor-assets/green-arrows/3.svg"); - left: 26%; - top: 79%; - background-size: contain; - background-repeat: no-repeat; - background-position: center; - } - - .how .second { - position: relative; - padding: 0 10% 30% 10%; - } - - .how .second:after { - content: "and"; - text-align: center; - padding: 10% 34% 10% 0; - position: absolute; - background-image: url("~src/assets/common-assets/monitor-assets/green-arrows/3.svg"); - left: 25%; - top: 80%; - background-size: contain; - background-repeat: no-repeat; - background-position: center; - } - - .how .third { - position: relative; - padding: 0 5% 30% 5%; - } - - .how .third:after { - content: "on which"; - font-weight: bold; - text-align: center; - padding: 10% 41% 10% 0; - position: absolute; - background-image: url("~src/assets/common-assets/monitor-assets/green-arrows/3.svg"); - left: 15%; - top: 83%; - background-size: contain; - background-repeat: no-repeat; - background-position: center; - } - - .how .fourth { - position: relative; - padding: 0 0 30% 0; - } - - .how .fourth > div:first-child { - padding: 0 10% 0 10%; - } - - .how .fourth:after { - content: "and"; - text-align: center; - padding: 10% 34% 10% 0; - position: absolute; - background-image: url("~src/assets/common-assets/monitor-assets/green-arrows/3.svg"); - left: 26%; - top: 79%; - background-size: contain; - background-repeat: no-repeat; - background-position: center; - } - - .how .fifth { - position: relative; - padding: 0 2% 30% 2%; - } - - .how .fifth:after { - content: "We"; - text-align: center; - padding: 10% 34% 10% 0; - position: absolute; - background-image: url("~src/assets/common-assets/monitor-assets/green-arrows/3.svg"); - left: 27%; - top: 76%; - background-size: contain; - background-repeat: no-repeat; - background-position: center; - } - - .how .sixth { - padding: 0 5% 30% 0; - } - - .how .sixth > div:first-child { - padding: 0 15% 0 15%; - } - - .how .final { - padding: 20% 0 20% 0; - } - - .how .final > div:first-child { - position: relative; - } - - .how .final > div:first-child:before { - content: ""; - position: absolute; - background-image: url("~src/assets/common-assets/monitor-assets/green-arrows/6.svg"); - left: 34%; - top: -70%; - height: 70%; - width: 30%; - background-size: contain; - background-repeat: no-repeat; - background-position: center; - } - - .how .final > div:first-child:after { - content: "We make visualizations, graphs, reports and deliver all in a customisable tool"; - text-align: center; - position: absolute; - left: -62%; - top: 85%; - width: 300px; - padding: 12% 0 0 54%; - background-size: contain; - background-repeat: no-repeat; - background-position: center; - } -} diff --git a/monitor/how/how.component.ts b/monitor/how/how.component.ts deleted file mode 100644 index 251d3549..00000000 --- a/monitor/how/how.component.ts +++ /dev/null @@ -1,72 +0,0 @@ -import {Component} from "@angular/core"; - -@Component({ - selector: 'how', - template: ` -
-
-
-
- -
-
- Starting from existing
research-related data sources -
-
-
-
- -
-
-
-
- -
-
- build an open, global
and trusted Research graph -
-
-
-
-
-
- -
-
- we perform Statistical
Analysis
and produce
- Open Science Indicators -
-
-
-
- -
-
- furthermore Network
Analysis
producing
- Collaboration Indicators -
-
-
-
- -
-
- Often combine with external data
- (patents, social, company) and - perform
Impact Analysis to - produce
Innovation Indicators -
-
-
-
-
- -
-
-
- `, - styleUrls: ['how.component.less'] -}) -export class HowComponent { - -} diff --git a/monitor/how/how.module.ts b/monitor/how/how.module.ts deleted file mode 100644 index 781800fe..00000000 --- a/monitor/how/how.module.ts +++ /dev/null @@ -1,12 +0,0 @@ -import {NgModule} from "@angular/core"; -import {CommonModule} from "@angular/common"; -import {HowComponent} from "./how.component"; - -@NgModule({ - imports: [CommonModule], - declarations: [HowComponent], - exports: [HowComponent] -}) -export class HowModule { - -} diff --git a/monitor/indicators/indicator-themes.component.ts b/monitor/indicators/indicator-themes.component.ts index 4f48b5e2..fcb11a8e 100644 --- a/monitor/indicators/indicator-themes.component.ts +++ b/monitor/indicators/indicator-themes.component.ts @@ -26,7 +26,7 @@ import {Subscriber} from "rxjs";
Indicator themes that we are covering in the Monitor dashboards.

- This is the current set of indicator themes we cover. We’ll keep enriching it as new requests and data are coming into the OpenAIRE Research Graph. We are at your disposal, should you have any recommendations! + This is the current set of indicator themes we cover. We’ll keep enriching it as new requests and data are coming into the OpenAIRE Graph. We are at your disposal, should you have any recommendations!

Check out the indicator pages (for funders, @@ -50,7 +50,7 @@ import {Subscriber} from "rxjs";

Indicator themes that we are covering in the Monitor dashboards.

- This is the current set of indicator themes we cover. We’ll keep enriching it as new requests and data are coming into the OpenAIRE Research Graph. We are at your disposal, should you have any recommendations! + This is the current set of indicator themes we cover. We’ll keep enriching it as new requests and data are coming into the OpenAIRE Graph. We are at your disposal, should you have any recommendations!

Check out the indicator pages (for funders, diff --git a/monitor/methodology/methodological-approach.component.ts b/monitor/methodology/methodological-approach.component.ts index e4e9bffe..5ddc49c1 100644 --- a/monitor/methodology/methodological-approach.component.ts +++ b/monitor/methodology/methodological-approach.component.ts @@ -32,7 +32,7 @@ import {Breadcrumb} from "../../utils/breadcrumbs/breadcrumbs.component";

  • Coverage and accuracy: As detailed in graph.openaire.eu - multiple data sources are ingested in the OpenAIRE research graph for coverage to the fullest extent + multiple data sources are ingested in the OpenAIRE Graph for coverage to the fullest extent possible, in order to provide meaningful indicators.
  • Clarity and replicability: We describe our construction methodology in @@ -69,7 +69,7 @@ import {Breadcrumb} from "../../utils/breadcrumbs/breadcrumbs.component";

    How? It’s about open data and collaboration.

    • - Built on the OpenAire Research Graph + Built on the OpenAire Graph Linked scholarly information from open initiatives around the world. Beyond publications.
    • @@ -84,7 +84,7 @@ import {Breadcrumb} from "../../utils/breadcrumbs/breadcrumbs.component";
  • - OpenAIRE Research Graph + OpenAIRE Graph
    @@ -105,7 +105,7 @@ import {Breadcrumb} from "../../utils/breadcrumbs/breadcrumbs.component";
  • Coverage and accuracy: As detailed in graph.openaire.eu - multiple data sources are ingested in the OpenAIRE research graph for coverage to the fullest extent + multiple data sources are ingested in the OpenAIRE Graph for coverage to the fullest extent possible, in order to provide meaningful indicators.
  • Clarity and replicability: We describe our construction methodology in @@ -131,7 +131,7 @@ import {Breadcrumb} from "../../utils/breadcrumbs/breadcrumbs.component";
  • - OpenAIRE Research Graph + OpenAIRE Graph
    Completeness, inclusion, transparency and replicability @@ -139,7 +139,7 @@ import {Breadcrumb} from "../../utils/breadcrumbs/breadcrumbs.component";

    It’s about open data and collaboration.

    • - Built on the OpenAire Research Graph + Built on the OpenAire Graph Linked scholarly information from open initiatives around the world. Beyond publications.
    • diff --git a/monitor/methodology/methodology.module.ts b/monitor/methodology/methodology.module.ts index 25a8ad77..3d07357c 100644 --- a/monitor/methodology/methodology.module.ts +++ b/monitor/methodology/methodology.module.ts @@ -5,10 +5,7 @@ import {MethodolocigalApproachComponent} from "./methodological-approach.compone import {RouterModule} from "@angular/router"; import {PreviousRouteRecorder} from "../../utils/piwik/previousRouteRecorder.guard"; import {PageContentModule} from "../../dashboard/sharedComponents/page-content/page-content.module"; -import {HowModule} from "../how/how.module"; import {IconsModule} from "../../utils/icons/icons.module"; -import {IconsService} from "../../utils/icons/icons.service"; -import {graph} from "../../utils/icons/icons"; import {BreadcrumbsModule} from "../../utils/breadcrumbs/breadcrumbs.module"; import {SliderTabsModule} from "../../sharedComponents/tabs/slider-tabs.module"; import {HelperModule} from "../../utils/helper/helper.module"; @@ -32,11 +29,8 @@ import {HelperModule} from "../../utils/helper/helper.module"; component: MethodolocigalApproachComponent, canDeactivate: [PreviousRouteRecorder] } - ]), PageContentModule, HowModule, IconsModule, BreadcrumbsModule, SliderTabsModule, HelperModule], + ]), PageContentModule, IconsModule, BreadcrumbsModule, SliderTabsModule, HelperModule], exports: [TerminologyComponent, MethodolocigalApproachComponent] }) export class MethodologyModule { - constructor(private iconsService: IconsService) { - this.iconsService.registerIcons([graph]); - } } diff --git a/monitor/methodology/terminology.component.ts b/monitor/methodology/terminology.component.ts index 2e518e29..0da0c18c 100644 --- a/monitor/methodology/terminology.component.ts +++ b/monitor/methodology/terminology.component.ts @@ -42,10 +42,9 @@ declare var ResizeObserver;
      - - More information for - OpenAIRE Research Graph - . + + Powered by OpenAIRE graph +
      @@ -87,10 +86,9 @@ declare var ResizeObserver;
      - - More information for - OpenAIRE Research Graph - . + + Powered by OpenAIRE graph +
      From 99492a2f08439c96018177b1272b78db40f1d9be Mon Sep 17 00:00:00 2001 From: "k.triantafyllou" Date: Tue, 16 May 2023 11:12:14 +0300 Subject: [PATCH 11/25] Input: Fix arrow left-right on inputs with type != chips. Fix dirty status of from and to controls for year-range type. --- sharedComponents/input/input.component.ts | 60 +++++++++++++++-------- 1 file changed, 39 insertions(+), 21 deletions(-) diff --git a/sharedComponents/input/input.component.ts b/sharedComponents/input/input.component.ts index c6d7af71..98f4b9c4 100644 --- a/sharedComponents/input/input.component.ts +++ b/sharedComponents/input/input.component.ts @@ -353,9 +353,9 @@ export class InputComponent implements OnInit, OnDestroy, AfterViewInit, OnChang @HostListener('window:keydown.arrowLeft', ['$event']) arrowLeft(event: KeyboardEvent) { - if (this.focused) { - event.preventDefault(); + if (this.type === 'chips' && this.focused) { if (this.activeElement.getValue()) { + event.preventDefault(); let index = this.chips.toArray().indexOf(this.activeElement.getValue()); if (index > 0) { this.activeElement.next(this.chips.get(index - 1)); @@ -367,9 +367,9 @@ export class InputComponent implements OnInit, OnDestroy, AfterViewInit, OnChang @HostListener('window:keydown.arrowRight', ['$event']) arrowRight(event: KeyboardEvent) { - if (this.focused) { - event.preventDefault(); + if (this.type === 'chips' && this.focused) { if (this.activeElement.getValue()) { + event.preventDefault(); let index = this.chips.toArray().indexOf(this.activeElement.getValue()); if (index < this.chips.length - 1) { this.activeElement.next(this.chips.get(index + 1)); @@ -544,20 +544,22 @@ export class InputComponent implements OnInit, OnDestroy, AfterViewInit, OnChang } this.subscriptions.push(this.formControl.valueChanges.subscribe(value => { if (this.formControl.enabled) { - value = (value === '') ? null : value; - if (this.type === 'logoURL') { - this.secure = (!value || value.includes('https://')); - } - if (this.initValue === value || (this.initValue === '' && value === null)) { - this.formControl.markAsPristine(); - } else { - this.formControl.markAsDirty(); - } - if (this.type === 'autocomplete_soft') { - this.filteredOptions = this.filter(value); - this.cdr.detectChanges(); - if (this.focused) { - this.open(true); + if(this.type !== 'year-range') { + value = (value === '') ? null : value; + if (this.type === 'logoURL') { + this.secure = (!value || value.includes('https://')); + } + if (this.initValue === value || (this.initValue === '' && value === null)) { + this.formControl.markAsPristine(); + } else { + this.formControl.markAsDirty(); + } + if (this.type === 'autocomplete_soft') { + this.filteredOptions = this.filter(value); + this.cdr.detectChanges(); + if (this.focused) { + this.open(true); + } } } if ((this.value && value && this.value !== value) || (!this.value && value) || this.value && !value) { @@ -566,14 +568,30 @@ export class InputComponent implements OnInit, OnDestroy, AfterViewInit, OnChang } })); if(this.formAsGroup) { - this.subscriptions.push(this.formAsGroup.get(this.yearRange.from.control).valueChanges.subscribe(value => { - if(this.formAsGroup.get(this.yearRange.from.control).valid) { - if(this.activeIndex === 0 && value.length > 0) { + let fromControl = this.formAsGroup.get(this.yearRange.from.control); + this.subscriptions.push(fromControl.valueChanges.subscribe(value => { + let from = this.initValue[this.yearRange.from.control]; + if (from === value || (from === '' && value === null)) { + fromControl.markAsPristine(); + } else { + fromControl.markAsDirty(); + } + if(fromControl.valid) { + if(this.activeIndex === 0 && value) { this.activeIndex = 1; this.input.get(this.activeIndex).nativeElement.focus(); } } })); + let toControl = this.formAsGroup.get(this.yearRange.to.control); + this.subscriptions.push(toControl.valueChanges.subscribe(value => { + let to = this.initValue[this.yearRange.to.control]; + if (to === value || (to === '' && value === null)) { + toControl.markAsPristine(); + } else { + toControl.markAsDirty(); + } + })); } if (this.input) { this.input.forEach(input => { From b14f76c2b06854b7f2a9e028ce4b148634bc95d0 Mon Sep 17 00:00:00 2001 From: "k.triantafyllou" Date: Wed, 24 May 2023 12:36:22 +0300 Subject: [PATCH 12/25] Entities selection: Initialize entities array to empty before add entities. --- searchPages/searchUtils/entitiesSelection.component.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/searchPages/searchUtils/entitiesSelection.component.ts b/searchPages/searchUtils/entitiesSelection.component.ts index 8b3759d2..f51dd8ad 100644 --- a/searchPages/searchUtils/entitiesSelection.component.ts +++ b/searchPages/searchUtils/entitiesSelection.component.ts @@ -56,6 +56,7 @@ export class EntitiesSelectionComponent { showPage["" + data['pages'][i]["route"] + ""] = data['pages'][i]["isEnabled"]; } } + this.entities = []; if(this.onlyresults) { if(this.simpleView) { this.entities.push({label: 'All ' + OpenaireEntities.RESULTS.toLowerCase(), value: 'all'}); From e6974dfd0f989955999f7ccffa19e2e266867723 Mon Sep 17 00:00:00 2001 From: "k.triantafyllou" Date: Wed, 24 May 2023 14:31:08 +0300 Subject: [PATCH 13/25] Disable cookie in server for connect production. --- http-interceptor.service.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/http-interceptor.service.ts b/http-interceptor.service.ts index dadd3781..dab01120 100644 --- a/http-interceptor.service.ts +++ b/http-interceptor.service.ts @@ -36,7 +36,7 @@ export class HttpInterceptorService implements HttpInterceptor { } else { if (isPlatformServer(this.platformId)) { let headers = new HttpHeaders(); - if(request.withCredentials) { + if(request.withCredentials && (properties.dashboard !== 'connect' || properties.environment !== 'production')) { headers = headers.set('Cookie', this.req.get('Cookie')); } const authReq = request.clone({ From 956d1f2c3f403a97d526879aa8c9bafe944a08d3 Mon Sep 17 00:00:00 2001 From: "k.triantafyllou" Date: Thu, 25 May 2023 10:02:05 +0300 Subject: [PATCH 14/25] Navbar: Logo add small class if logoInfo exists. --- sharedComponents/navigationBar.component.html | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sharedComponents/navigationBar.component.html b/sharedComponents/navigationBar.component.html index 611a4716..5ce946ca 100644 --- a/sharedComponents/navigationBar.component.html +++ b/sharedComponents/navigationBar.component.html @@ -317,7 +317,7 @@
      + {{metrics.infos.get(key).name}} @@ -313,4 +314,16 @@ export class MetricsComponent { let formatted = NumberUtils.roundNumber(+num); return formatted.number + formatted.size; } + + public getEoscParams() { + let params = ""; + if(this.prevPath) { + let splitted: string[] = this.prevPath.split("?"); + params = "&return_path="+StringUtils.URIEncode(splitted[0]); + if(splitted.length > 0) { + params += "&search_params="+StringUtils.URIEncode(splitted[1]); + } + } + return params; + } } diff --git a/landingPages/landing-utils/parsingFunctions.class.ts b/landingPages/landing-utils/parsingFunctions.class.ts index 23592e3f..ef502b3b 100644 --- a/landingPages/landing-utils/parsingFunctions.class.ts +++ b/landingPages/landing-utils/parsingFunctions.class.ts @@ -9,10 +9,11 @@ import {StringUtils} from "../../utils/string-utils.class"; }) export class ParsingFunctions { public eoscSubjects = [ - {label: 'EOSC::Jupyter Notebook', link: 'https://' + (properties.environment != 'production'?'beta.':'') + 'marketplace.eosc-portal.eu/services?tag=EOSC%3A%3AJupyter+Notebook', value: 'Jupyter Notebook'}, - {label: 'EOSC::RO-crate', link: 'https://' + (properties.environment != 'production'?'beta.':'') + 'marketplace.eosc-portal.eu/datasources/eosc.psnc.6f0470e3bb9203ec3a7553f3a72a7a1f?q=ROHub', value: 'RO-crate'}, - {label: 'EOSC::Galaxy Workflow', link: 'https://' + (properties.environment != 'production'?'beta.':'') + 'marketplace.eosc-portal.eu/services?tag=EOSC%3A%3AGalaxy+Workflow', value: 'Galaxy Workflow'}, - {label: 'EOSC::Twitter Data', link: 'https://' + (properties.environment != 'production'?'beta.':'') + 'marketplace.eosc-portal.eu/services?tag=EOSC%3A%3ATwitter+Data', value: 'Twitter Data'} + {label: 'EOSC::Jupyter Notebook', link: 'https://' + (properties.environment != 'production'?'beta.':'') + 'search.marketplace.eosc-portal.eu/search/service?q=*&fq=tag_list:"EOSC%5C:%5C:Jupyter%20Notebook"', value: 'Jupyter Notebook'}, + {label: 'EOSC::RO-crate', link: 'https://' + (properties.environment != 'production'?'beta.':'') + 'search.marketplace.eosc-portal.eu/search/data-source?q=*&fq=tag_list:%22eosc%5C:%5C:ro%5C-crate%22', value: 'RO-crate'}, + {label: 'EOSC::Galaxy Workflow', link: 'https://' + (properties.environment != 'production'?'beta.':'') + 'search.marketplace.eosc-portal.eu/search/service?q=*&fq=tag_list:%22eosc%5C:%5C:galaxy%20workflow%22', value: 'Galaxy Workflow'}, + {label: 'EOSC::Twitter Data', link: 'https://' + (properties.environment != 'production'?'beta.':'') + 'search.marketplace.eosc-portal.eu/search/service?q=*&fq=tag_list:%22EOSC%5C:%5C:Twitter%20Data%22', value: 'Twitter Data'}, + {label: 'EOSC::Data Cube', link: 'https://' + (properties.environment != 'production'?'beta.':'') + 'search.marketplace.eosc-portal.eu/search/service?q=*&fq=tag_list:%22EOSC%5C:%5C:Data%20Cube%22', value: 'Data Cube'} ] public notebookInSubjects: boolean = false; diff --git a/landingPages/organization/organization.component.ts b/landingPages/organization/organization.component.ts index 475f280b..75c242b4 100644 --- a/landingPages/organization/organization.component.ts +++ b/landingPages/organization/organization.component.ts @@ -170,8 +170,8 @@ export class OrganizationComponent { this.updateTitle("Organization"); this.updateDescription(""); - if(params["pv"]) { - this.prevPath = params["pv"]; + if(params["return_path"]) { + this.prevPath = params["return_path"] + (params["search_params"] ? ("?"+params["search_params"]) : ""); } if((typeof document !== 'undefined') && document.referrer) { this.referrer = document.referrer; diff --git a/landingPages/project/project.component.ts b/landingPages/project/project.component.ts index 34e7d6e9..a992f455 100644 --- a/landingPages/project/project.component.ts +++ b/landingPages/project/project.component.ts @@ -214,8 +214,8 @@ export class ProjectComponent { this.updateTitle(title); this.updateDescription(description); - if(params["pv"]) { - this.prevPath = params["pv"]; + if(params["return_path"]) { + this.prevPath = params["return_path"] + (params["search_params"] ? ("?"+params["search_params"]) : ""); } if((typeof document !== 'undefined') && document.referrer) { this.referrer = document.referrer; @@ -979,7 +979,11 @@ export class ProjectComponent { public addEoscPrevInParams(obj) { if(properties.adminToolsPortalType == "eosc" && this.prevPath) { - return this.routerHelper.addQueryParam("pv", this.prevPath, obj); + let splitted: string[] = this.prevPath.split("?"); + obj = this.routerHelper.addQueryParam("return_path", splitted[0], obj); + if(splitted.length > 0) { + obj = this.routerHelper.addQueryParam("search_params", splitted[1], obj); + } } return obj; } diff --git a/landingPages/result/resultLanding.component.ts b/landingPages/result/resultLanding.component.ts index 1ef770ad..1df4c97d 100644 --- a/landingPages/result/resultLanding.component.ts +++ b/landingPages/result/resultLanding.component.ts @@ -208,9 +208,8 @@ export class ResultLandingComponent { this.egiTransferModalOpen = true; } this.updateDescription(""); - - if(data["pv"]) { - this.prevPath = data["pv"]; + if(data["return_path"]) { + this.prevPath = data["return_path"] + (data["search_params"] ? ("?"+data["search_params"]) : ""); } if((typeof document !== 'undefined') && document.referrer) { this.referrer = document.referrer; @@ -723,7 +722,7 @@ export class ResultLandingComponent { } if(!this.identifier) { this._location.go(( pid ? (this.linkToLandingPage.split("?")[0] + "?pid=" + pid.id): - (this.linkToLandingPage + this.id)) + (this.prevPath ? ("&pv="+this.prevPath) : "")); + (this.linkToLandingPage + this.id)) + this.getEoscParams()); } // else { // this._location.go(this.linkToLandingPage.split("?")[0] + "?pid=" + this.identifier.id); @@ -924,9 +923,25 @@ export class ResultLandingComponent { this.descriptionModal.open(); } + public getEoscParams() { + let params = ""; + if(this.prevPath) { + let splitted: string[] = this.prevPath.split("?"); + params = "&return_path="+StringUtils.URIEncode(splitted[0]); + if(splitted.length > 0) { + params += "&search_params="+StringUtils.URIEncode(splitted[1]); + } + } + return params; + } + public addEoscPrevInParams(obj) { if(properties.adminToolsPortalType == "eosc" && this.prevPath) { - return this.routerHelper.addQueryParam("pv", this.prevPath, obj); + let splitted: string[] = this.prevPath.split("?"); + obj = this.routerHelper.addQueryParam("return_path", splitted[0], obj); + if(splitted.length > 0) { + obj = this.routerHelper.addQueryParam("search_params", splitted[1], obj); + } } return obj; } diff --git a/utils/result-preview/result-preview.component.ts b/utils/result-preview/result-preview.component.ts index bd9e2011..1ed5b5c7 100644 --- a/utils/result-preview/result-preview.component.ts +++ b/utils/result-preview/result-preview.component.ts @@ -180,7 +180,11 @@ export class ResultPreviewComponent implements OnInit, OnChanges { public addEoscPrevInParams(obj) { if(properties.adminToolsPortalType == "eosc" && this.prevPath) { - return this.routerHelper.addQueryParam("pv", this.prevPath, obj); + let splitted: string[] = this.prevPath.split("?"); + obj = this.routerHelper.addQueryParam("return_path", splitted[0], obj); + if(splitted.length > 0) { + obj = this.routerHelper.addQueryParam("search_params", splitted[1], obj); + } } return obj; } From 3ee89e2bcae313a1ac82cfb678c4476ec1e9905f Mon Sep 17 00:00:00 2001 From: "konstantina.galouni" Date: Fri, 26 May 2023 14:37:34 +0300 Subject: [PATCH 17/25] [Library | develop]: ISVocabularies.service.ts: [Bug fix] In methods getFos() and getSDGs(), removed check and call to cache - these files are always local | sdg.component.ts: Set customFilter and pass it as parameter to . --- utils/staticAutoComplete/ISVocabularies.service.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/utils/staticAutoComplete/ISVocabularies.service.ts b/utils/staticAutoComplete/ISVocabularies.service.ts index e635b8ec..8a1b5457 100644 --- a/utils/staticAutoComplete/ISVocabularies.service.ts +++ b/utils/staticAutoComplete/ISVocabularies.service.ts @@ -122,12 +122,12 @@ export class ISVocabulariesService { getFos(properties: EnvProperties): Observable { let url = "/assets/common-assets/vocabulary/fos.json"; - return this.http.get((properties.useLongCache) ? (properties.cacheUrl + encodeURIComponent(url)) : url) + return this.http.get(url); } getSDGs(properties: EnvProperties): Observable { let url = "/assets/common-assets/vocabulary/sdg.json"; - return this.http.get((properties.useLongCache) ? (properties.cacheUrl + encodeURIComponent(url)) : url) + return this.http.get(url); } parseSDGs(data: any): AutoCompleteValue[] { From 63cf1b09dae454cf6c07469216d866da241dc195 Mon Sep 17 00:00:00 2001 From: "k.triantafyllou" Date: Sat, 27 May 2023 22:46:07 +0300 Subject: [PATCH 18/25] Change base-background to global-backround. Add method to convert rgba to rgb in order to avoid different colors when elements stacks. --- connect/community/CustomizationOptions.ts | 206 ++++++++++++---------- 1 file changed, 113 insertions(+), 93 deletions(-) diff --git a/connect/community/CustomizationOptions.ts b/connect/community/CustomizationOptions.ts index 091178da..f1a318d6 100644 --- a/connect/community/CustomizationOptions.ts +++ b/connect/community/CustomizationOptions.ts @@ -1,86 +1,102 @@ import {properties} from "../../../../environments/environment"; export class Layout { - _id:string; - portalPid:string; - layoutOptions:CustomizationOptions; + _id: string; + portalPid: string; + layoutOptions: CustomizationOptions; date; - constructor(community, options:CustomizationOptions){ + + constructor(community, options: CustomizationOptions) { this.portalPid = community; this.layoutOptions = options; } public static getVariables(options: CustomizationOptions): {} | null { - if(options) { + if (options) { let variables = {}; - if(options.identity) { - variables['@global-primary-background'] = options.identity.mainColor; - variables['@global-secondary-background'] = options.identity.secondaryColor; + if (options.identity) { + variables['@global-primary-background'] = Layout.convertRGBAtoRGB(options.identity.mainColor); + variables['@global-secondary-background'] = Layout.convertRGBAtoRGB(options.identity.secondaryColor); } - if(options.backgrounds){ - variables['@general-search-form-background'] = options.backgrounds.form.color; - variables['@base-body-background'] = options.backgrounds.light.color; - variables['@hero-background-image'] = (options.backgrounds.form.imageFile?(this.getUrl(properties.utilsService + '/download/' +options.backgrounds.form.imageFile)): 'none') ; + if (options.backgrounds) { + variables['@general-search-form-background'] = Layout.convertRGBAtoRGB(options.backgrounds.form.color); + variables['@global-background'] = Layout.convertRGBAtoRGB(options.backgrounds.light.color); + variables['@hero-background-image'] = (options.backgrounds.form.imageFile ? (this.getUrl(properties.utilsService + '/download/' + options.backgrounds.form.imageFile)) : 'none'); variables['@hero-background-position'] = options.backgrounds.form.position; } - if(options.buttons){ + if (options.buttons) { //general variables['@button-border-width'] = options.buttons.lightBackground.borderWidth + "px"; variables['@button-border-radius'] = options.buttons.lightBackground.borderRadius + "px"; // default -> on dark background todo check again when we have sucj=h buttons - variables['@button-default-background'] = options.buttons.darkBackground.backgroundColor; - variables['@button-default-color'] = options.buttons.darkBackground.color; - variables['@button-default-border'] = options.buttons.darkBackground.borderColor; - variables['@button-default-hover-background'] = options.buttons.darkBackground.onHover.backgroundColor; - variables['@button-default-hover-color'] = options.buttons.darkBackground.onHover.color; - variables['@button-default-hover-border'] = options.buttons.darkBackground.onHover.borderColor; - variables['@button-default-active-background'] = options.buttons.darkBackground.onHover.backgroundColor; - variables['@button-default-active-color'] = options.buttons.darkBackground.onHover.color; - variables['@button-default-active-border'] = options.buttons.darkBackground.onHover.borderColor; + variables['@button-default-background'] = Layout.convertRGBAtoRGB(options.buttons.darkBackground.backgroundColor); + variables['@button-default-color'] = Layout.convertRGBAtoRGB(options.buttons.darkBackground.color); + variables['@button-default-border'] = Layout.convertRGBAtoRGB(options.buttons.darkBackground.borderColor); + variables['@button-default-hover-background'] = Layout.convertRGBAtoRGB(options.buttons.darkBackground.onHover.backgroundColor); + variables['@button-default-hover-color'] = Layout.convertRGBAtoRGB(options.buttons.darkBackground.onHover.color); + variables['@button-default-hover-border'] = Layout.convertRGBAtoRGB(options.buttons.darkBackground.onHover.borderColor); + variables['@button-default-active-background'] = Layout.convertRGBAtoRGB(options.buttons.darkBackground.onHover.backgroundColor); + variables['@button-default-active-color'] = Layout.convertRGBAtoRGB(options.buttons.darkBackground.onHover.color); + variables['@button-default-active-border'] = Layout.convertRGBAtoRGB(options.buttons.darkBackground.onHover.borderColor); // primary - variables['@button-primary-background'] = options.buttons.lightBackground.backgroundColor; - variables['@button-primary-color'] = options.buttons.lightBackground.color; - variables['@button-primary-border'] = options.buttons.lightBackground.borderColor; - variables['@button-primary-hover-background'] = options.buttons.lightBackground.onHover.backgroundColor; - variables['@button-primary-hover-color'] = options.buttons.lightBackground.onHover.color; - variables['@button-primary-hover-border'] = options.buttons.lightBackground.onHover.borderColor; - variables['@button-primary-active-background'] = options.buttons.lightBackground.onHover.backgroundColor; - variables['@button-primary-active-color'] = options.buttons.lightBackground.onHover.color; - variables['@button-primary-active-border'] = options.buttons.lightBackground.onHover.borderColor; + variables['@button-primary-background'] = Layout.convertRGBAtoRGB(options.buttons.lightBackground.backgroundColor); + variables['@button-primary-color'] = Layout.convertRGBAtoRGB(options.buttons.lightBackground.color); + variables['@button-primary-border'] = Layout.convertRGBAtoRGB(options.buttons.lightBackground.borderColor); + variables['@button-primary-hover-background'] = Layout.convertRGBAtoRGB(options.buttons.lightBackground.onHover.backgroundColor); + variables['@button-primary-hover-color'] = Layout.convertRGBAtoRGB(options.buttons.lightBackground.onHover.color); + variables['@button-primary-hover-border'] = Layout.convertRGBAtoRGB(options.buttons.lightBackground.onHover.borderColor); + variables['@button-primary-active-background'] = Layout.convertRGBAtoRGB(options.buttons.lightBackground.onHover.backgroundColor); + variables['@button-primary-active-color'] = Layout.convertRGBAtoRGB(options.buttons.lightBackground.onHover.color); + variables['@button-primary-active-border'] = Layout.convertRGBAtoRGB(options.buttons.lightBackground.onHover.borderColor); // secondary - variables['@button-secondary-background'] = options.buttons.lightBackground.color; - variables['@button-secondary-color'] = options.buttons.lightBackground.backgroundColor; - variables['@button-secondary-border'] = options.buttons.lightBackground.backgroundColor; - variables['@button-secondary-hover-background'] = options.buttons.lightBackground.backgroundColor; - variables['@button-secondary-hover-color'] = options.buttons.lightBackground.color; - variables['@button-secondary-hover-border'] = options.buttons.lightBackground.borderColor; - variables['@button-secondary-active-background'] = options.buttons.lightBackground.backgroundColor; - variables['@button-secondary-active-color'] = options.buttons.lightBackground.color; - variables['@button-secondary-active-border'] = options.buttons.lightBackground.borderColor; - + variables['@button-secondary-background'] = Layout.convertRGBAtoRGB(options.buttons.lightBackground.color); + variables['@button-secondary-color'] = Layout.convertRGBAtoRGB(options.buttons.lightBackground.backgroundColor); + variables['@button-secondary-border'] = Layout.convertRGBAtoRGB(options.buttons.lightBackground.backgroundColor); + variables['@button-secondary-hover-background'] = Layout.convertRGBAtoRGB(options.buttons.lightBackground.backgroundColor); + variables['@button-secondary-hover-color'] = Layout.convertRGBAtoRGB(options.buttons.lightBackground.color); + variables['@button-secondary-hover-border'] = Layout.convertRGBAtoRGB(options.buttons.lightBackground.borderColor); + variables['@button-secondary-active-background'] = Layout.convertRGBAtoRGB(options.buttons.lightBackground.backgroundColor); + variables['@button-secondary-active-color'] = Layout.convertRGBAtoRGB(options.buttons.lightBackground.color); + variables['@button-secondary-active-border'] = Layout.convertRGBAtoRGB(options.buttons.lightBackground.borderColor); + } return variables; } return null; } - public static getUrl(url){ + + public static getUrl(url) { return 'url("' + url + '")'; } - + + public static convertRGBAtoRGB(color: string): string { + if(color.includes('rgba')) { + const regexPattern = /rgba\((\d+),\s*(\d+),\s*(\d+),\s*([\d.]+)\)/; + const matches = color.match(regexPattern); + const [, r, g, b, a] = matches; + let R = parseInt(r)*parseFloat(a) + (1 - parseFloat(a))*255; + let G = parseInt(g)*parseFloat(a) + (1 - parseFloat(a))*255; + let B = parseInt(b)*parseFloat(a) + (1 - parseFloat(a))*255; + return 'rgb(' + R + ',' + G + ',' + B + ',' + ')'; + } else { + return color; + } + } } + export class CustomizationOptions { identity: { mainColor: string; secondaryColor: string; }; - identityIsCustom:boolean; - backgroundsIsCustom:boolean; - buttonsIsCustom:boolean; + identityIsCustom: boolean; + backgroundsIsCustom: boolean; + buttonsIsCustom: boolean; backgrounds: { dark: { - color: string; //background + color: string; //background } light: { color: string; //background @@ -89,41 +105,41 @@ export class CustomizationOptions { color: string; //background imageUrl: string; imageFile: string; - position:string; + position: string; } }; buttons: { darkBackground: ButtonsCustomization; lightBackground: ButtonsCustomization; }; - + constructor(mainColor: string = null, secondaryColor: string = null) { - this.identity= { + this.identity = { mainColor: mainColor ? mainColor : CustomizationOptions.getIdentity().mainColor, - secondaryColor : secondaryColor ? secondaryColor : CustomizationOptions.getIdentity().secondaryColor, + secondaryColor: secondaryColor ? secondaryColor : CustomizationOptions.getIdentity().secondaryColor, }; this.identityIsCustom = false; this.backgroundsIsCustom = false; this.buttonsIsCustom = false; - this.backgrounds={ - dark : { + this.backgrounds = { + dark: { color: this.identity.mainColor, }, - light : { + light: { color: "#f9f9f9" //CustomizationOptions.getRGBA(this.identity.mainColor,0.05), }, - form : { - color: CustomizationOptions.getRGBA(this.identity.mainColor,0.15), - imageUrl : null, - imageFile : null, + form: { + color: CustomizationOptions.getRGBA(this.identity.mainColor, 0.15), + imageUrl: null, + imageFile: null, position: null } }; - - + + this.buttons = { darkBackground: { - isDefault:true, + isDefault: true, backgroundColor: "#ffffff", color: "#000000", borderStyle: "solid", @@ -137,7 +153,7 @@ export class CustomizationOptions { } }, lightBackground: { - isDefault:true, + isDefault: true, backgroundColor: this.identity.mainColor, color: '#ffffff', borderStyle: "solid", @@ -150,15 +166,16 @@ export class CustomizationOptions { borderColor: this.identity.secondaryColor, } } - + }; } - public static checkForObsoleteVersion(current:CustomizationOptions, communityId:string){ - let defaultCO = new CustomizationOptions(CustomizationOptions.getIdentity(communityId).mainColor,CustomizationOptions.getIdentity(communityId).secondaryColor); + + public static checkForObsoleteVersion(current: CustomizationOptions, communityId: string) { + let defaultCO = new CustomizationOptions(CustomizationOptions.getIdentity(communityId).mainColor, CustomizationOptions.getIdentity(communityId).secondaryColor); let updated = Object.assign({}, defaultCO); - if(!current){ + if (!current) { current = Object.assign({}, defaultCO); - }else { + } else { if (current.identity && current.identity.mainColor && current.identity.secondaryColor) { updated = new CustomizationOptions(current.identity.mainColor, current.identity.secondaryColor); } @@ -195,53 +212,55 @@ export class CustomizationOptions { } } return current; - - + + } - public static getIdentity(community:string=null){ - let COLORS= { - default:{ - mainColor:'#4687E6', + + public static getIdentity(community: string = null) { + let COLORS = { + default: { + mainColor: '#4687E6', secondaryColor: '#2D72D6' }, - "covid-19":{ - mainColor:"#03ADEE", + "covid-19": { + mainColor: "#03ADEE", secondaryColor: "#F15157" } }; - if(community && COLORS[community]){ + if (community && COLORS[community]) { return COLORS[community]; } return COLORS.default; } - public static getRGBA(color, A){ - if(color.indexOf("#")!=-1){ - return 'rgba('+parseInt(color.substring(1,3),16)+','+parseInt(color.substring(3,5),16)+','+parseInt(color.substring(5,7),16)+','+A+')'; + + public static getRGBA(color, A) { + if (color.indexOf("#") != -1) { + return 'rgba(' + parseInt(color.substring(1, 3), 16) + ',' + parseInt(color.substring(3, 5), 16) + ',' + parseInt(color.substring(5, 7), 16) + ',' + A + ')'; } return color; } - - public static isForLightBackground(color:string){ + + public static isForLightBackground(color: string) { let L, r, g, b, a = 1; - if(color.length == 7 || color.length == 9) { + if (color.length == 7 || color.length == 9) { r = parseInt(color.substring(1, 3), 16); g = parseInt(color.substring(3, 5), 16); b = parseInt(color.substring(5, 7), 16); - if(color.length == 9) { - a = parseInt(color.substring(7, 9), 16); + if (color.length == 9) { + a = parseInt(color.substring(7, 9), 16); } - }else if(color.length > 9){ + } else if (color.length > 9) { let array = color.split("rgba(")[1].split(")")[0].split(","); r = parseInt(array[0]); g = parseInt(array[1]); b = parseInt(array[2]); a = +array[3]; - + } - const brightness = r* 0.299 + g * 0.587 + b * 0.114 + (1 - a) * 255; - + const brightness = r * 0.299 + g * 0.587 + b * 0.114 + (1 - a) * 255; + return (brightness < 186) - + // return !(r*0.299 + g*0.587 + b*0.114 > 186); /*for(let c of [r,g,b]){ c = c / 255.0; @@ -255,11 +274,12 @@ export class CustomizationOptions { return L > 0.179// (L + 0.05) / (0.05) > (1.0 + 0.05) / (L + 0.05); //use #000000 else use #ffffff */ } - - + + } -export class ButtonsCustomization{ - isDefault:boolean; + +export class ButtonsCustomization { + isDefault: boolean; backgroundColor: string; color: string; borderStyle: string; From bb8f196abb5054af89342284729f28a8e659076c Mon Sep 17 00:00:00 2001 From: "k.triantafyllou" Date: Sat, 27 May 2023 22:48:13 +0300 Subject: [PATCH 19/25] Disable local get calls in server because of network error and return empty element as a response. Fix bug in sdg with async calls. --- http-interceptor.service.ts | 3 ++ sdg/sdg.component.ts | 28 +++++++++---------- .../ISVocabularies.service.ts | 4 +-- 3 files changed, 19 insertions(+), 16 deletions(-) diff --git a/http-interceptor.service.ts b/http-interceptor.service.ts index bdc3d3bd..7b0a4104 100644 --- a/http-interceptor.service.ts +++ b/http-interceptor.service.ts @@ -35,6 +35,9 @@ export class HttpInterceptorService implements HttpInterceptor { return of(response); } else { if (isPlatformServer(this.platformId)) { + if(request.url.startsWith('/assets') || request.url.startsWith('assets')) { + return of(null); + } let headers = new HttpHeaders(); if(request.withCredentials && !properties.hasMachineCache) { headers = headers.set('Cookie', this.req.get('Cookie')); diff --git a/sdg/sdg.component.ts b/sdg/sdg.component.ts index ac2ba65a..3c2e6489 100644 --- a/sdg/sdg.component.ts +++ b/sdg/sdg.component.ts @@ -55,26 +55,26 @@ export class SdgComponent implements OnInit, OnDestroy { this.updateUrl(this.url); this.updateTitle(this.pageTitle); this.updateDescription(this.pageDescription); - this.vocabulariesService.getSDGs(properties).subscribe(data => { + this.subscriptions.push(this.vocabulariesService.getSDGs(properties).subscribe(data => { this.sdgs = data['sdg']; - }); + this.subscriptions.push(this.refineFieldResultsService.getRefineFieldsResultsByEntityName(['sdg'], 'result', this.properties, refineParams).subscribe(data => { + this.sdgsResearchOutcomes = data[1][0].values; + let merged =[]; + for(let i=0; i innerItem.id === this.sdgs[i].id)) + }); + } + this.displayedSdgs = merged; + this.loading = false; + })); + })); let refineParams = null; if(this.customFilter) { let refineValue = StringUtils.URIEncode(this.customFilter.queryFieldName + " exact " + StringUtils.quote((this.customFilter.valueId))); refineParams = '&fq=' + refineValue; } - this.refineFieldResultsService.getRefineFieldsResultsByEntityName(['sdg'], 'result', this.properties, refineParams).subscribe(data => { - this.sdgsResearchOutcomes = data[1][0].values; - let merged =[]; - for(let i=0; i innerItem.id === this.sdgs[i].id)) - }); - } - this.displayedSdgs = merged; - this.loading = false; - }); } public ngOnDestroy() { diff --git a/utils/staticAutoComplete/ISVocabularies.service.ts b/utils/staticAutoComplete/ISVocabularies.service.ts index 8a1b5457..82457e06 100644 --- a/utils/staticAutoComplete/ISVocabularies.service.ts +++ b/utils/staticAutoComplete/ISVocabularies.service.ts @@ -122,12 +122,12 @@ export class ISVocabulariesService { getFos(properties: EnvProperties): Observable { let url = "/assets/common-assets/vocabulary/fos.json"; - return this.http.get(url); + return this.http.get(url).pipe(map(res => (res && res['fos'])?res:{fos: []})); } getSDGs(properties: EnvProperties): Observable { let url = "/assets/common-assets/vocabulary/sdg.json"; - return this.http.get(url); + return this.http.get(url).pipe(map(res => (res && res['sdg'])?res:{sdg: []})); } parseSDGs(data: any): AutoCompleteValue[] { From 46b9543ae7f43f08cbaf69c7bc1f12c9274dc1ba Mon Sep 17 00:00:00 2001 From: Konstantina Galouni Date: Thu, 1 Jun 2023 15:28:24 +0200 Subject: [PATCH 20/25] Added LICENSE.txt file --- LICENSE.txt | 200 ++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 200 insertions(+) create mode 100644 LICENSE.txt diff --git a/LICENSE.txt b/LICENSE.txt new file mode 100644 index 00000000..0267301c --- /dev/null +++ b/LICENSE.txt @@ -0,0 +1,200 @@ + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. \ No newline at end of file From d11a409f09e11aba35b62de2f787eb64d732d4a2 Mon Sep 17 00:00:00 2001 From: "konstantina.galouni" Date: Thu, 1 Jun 2023 17:13:49 +0300 Subject: [PATCH 21/25] [Library | develop & Eosc Explore | develop]: metrics.component.ts & metrics.module.ts & metrics.service.ts: [Bug fix] Keep id, not url in parsing and build url of data source in component to use route instead of href | CHANGELOG.md: Updated format of contents & Added changes before production release v.2.0.2. | package.json: Updated version from 2.0.1 to 2.0.2. --- .../landing-utils/metrics/metrics.component.ts | 16 +++++++++------- .../landing-utils/metrics/metrics.module.ts | 3 ++- services/metrics.service.ts | 2 +- 3 files changed, 12 insertions(+), 9 deletions(-) diff --git a/landingPages/landing-utils/metrics/metrics.component.ts b/landingPages/landing-utils/metrics/metrics.component.ts index 4d7004c0..56762c46 100644 --- a/landingPages/landing-utils/metrics/metrics.component.ts +++ b/landingPages/landing-utils/metrics/metrics.component.ts @@ -9,6 +9,8 @@ import {ClickEvent} from "../../../utils/click/click-outside-or-esc.directive"; import {NumberUtils} from "../../../utils/number-utils.class"; import {OpenaireEntities} from "../../../utils/properties/searchFields"; import {StringUtils} from "../../../utils/string-utils.class"; +import {properties} from "../../../../../environments/environment"; +import {RouterHelper} from "../../../utils/routerHelper.class"; @Component({ selector: 'metrics', @@ -78,7 +80,7 @@ import {StringUtils} from "../../../utils/string-utils.class"; - + {{metrics.infos.get(key).name}} @@ -152,6 +154,7 @@ export class MetricsComponent { public status: number; public state: number = -1; public openaireEntities = OpenaireEntities; + public routerHelper:RouterHelper = new RouterHelper(); constructor(private metricsService: MetricsService, private cdr: ChangeDetectorRef) { } @@ -315,15 +318,14 @@ export class MetricsComponent { return formatted.number + formatted.size; } - public getEoscParams() { - let params = ""; - if(this.prevPath) { + public addEoscPrevInParams(obj) { + if(properties.adminToolsPortalType == "eosc" && this.prevPath) { let splitted: string[] = this.prevPath.split("?"); - params = "&return_path="+StringUtils.URIEncode(splitted[0]); + obj = this.routerHelper.addQueryParam("return_path", splitted[0], obj); if(splitted.length > 0) { - params += "&search_params="+StringUtils.URIEncode(splitted[1]); + obj = this.routerHelper.addQueryParam("search_params", splitted[1], obj); } } - return params; + return obj; } } diff --git a/landingPages/landing-utils/metrics/metrics.module.ts b/landingPages/landing-utils/metrics/metrics.module.ts index 10f5391d..fab8e9a2 100644 --- a/landingPages/landing-utils/metrics/metrics.module.ts +++ b/landingPages/landing-utils/metrics/metrics.module.ts @@ -10,10 +10,11 @@ import {MetricsService} from '../../../services/metrics.service'; import {ErrorMessagesModule} from '../../../utils/errorMessages.module'; import {IFrameModule} from "../../../utils/iframe.module"; import {IconsModule} from "../../../utils/icons/icons.module"; +import {RouterModule} from "@angular/router"; @NgModule({ imports: [ - CommonModule, FormsModule, ErrorMessagesModule, IFrameModule, IconsModule + CommonModule, FormsModule, RouterModule, ErrorMessagesModule, IFrameModule, IconsModule ], declarations: [ MetricsComponent diff --git a/services/metrics.service.ts b/services/metrics.service.ts index 2c401656..4b3adf99 100644 --- a/services/metrics.service.ts +++ b/services/metrics.service.ts @@ -58,7 +58,7 @@ export class MetricsService { info = {}; info.name = result[2]; - info.url = properties.searchLinkToDataProvider+id; + info.url = id; info.numOfDownloads = "0"; info.openaireDownloads = "0"; info.numOfViews = "0"; From 17c2b03c9e281ae1d5c4a32b812c3b1c11a9f3da Mon Sep 17 00:00:00 2001 From: "konstantina.galouni" Date: Tue, 6 Jun 2023 12:23:42 +0300 Subject: [PATCH 22/25] [Library | develop]: resultLanding.component.html: Added tooltip on links of Compatible EOSC Services. --- landingPages/result/resultLanding.component.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/landingPages/result/resultLanding.component.html b/landingPages/result/resultLanding.component.html index 2e552f33..f43629b5 100644 --- a/landingPages/result/resultLanding.component.html +++ b/landingPages/result/resultLanding.component.html @@ -466,7 +466,7 @@ eosc_logo
      - From e6d4be54540ff1b23acb88728be9e0e9dd1ebdd1 Mon Sep 17 00:00:00 2001 From: "k.triantafyllou" Date: Wed, 7 Jun 2023 17:34:53 +0300 Subject: [PATCH 23/25] Add client-management-portal in Dasbboard values of properties. --- utils/properties/env-properties.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/utils/properties/env-properties.ts b/utils/properties/env-properties.ts index baed70d1..5528da7b 100644 --- a/utils/properties/env-properties.ts +++ b/utils/properties/env-properties.ts @@ -1,5 +1,5 @@ export type Environment = "development" | "test" | "beta" | "production"; -export type Dashboard = "explore" | "connect" | "monitor" | "aggregator" | "eosc"; +export type Dashboard = "explore" | "connect" | "monitor" | "aggregator" | "eosc" | "client-management-portal"; export type PortalType = "explore" | "connect" | "community" | "monitor" | "funder" | "ri" | "project" | "organization" | "aggregator" | "eosc"; export interface EnvProperties { From e7f087c09d677bbe4df6b076d53996e5d55a6aec Mon Sep 17 00:00:00 2001 From: argirok Date: Thu, 8 Jun 2023 11:05:48 +0300 Subject: [PATCH 24/25] remove color for connect portal results --- .../searchUtils/portal-search-result.component.html | 2 +- .../searchUtils/portal-search-result.component.less | 12 ++++++------ 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/searchPages/searchUtils/portal-search-result.component.html b/searchPages/searchUtils/portal-search-result.component.html index 8a20d567..9e556f8b 100644 --- a/searchPages/searchUtils/portal-search-result.component.html +++ b/searchPages/searchUtils/portal-search-result.component.html @@ -3,7 +3,7 @@
    • + [ngClass]="result.type" [class.noColor]="properties.adminToolsPortalType == 'connect'" [class.uk-disabled]="!hasPermission(result)">
      Member
      diff --git a/searchPages/searchUtils/portal-search-result.component.less b/searchPages/searchUtils/portal-search-result.component.less index e43a61fd..a631ad17 100644 --- a/searchPages/searchUtils/portal-search-result.component.less +++ b/searchPages/searchUtils/portal-search-result.component.less @@ -11,15 +11,15 @@ @media(min-width: @breakpoint-medium) { .uk-card { - &.funder { + &.funder:not(.noColor) { .setType(@funder-color); } - &.ri { + &.ri:not(.noColor) { .setType(@ri-color); } - &.organization { + &.organization:not(.noColor) { .setType(@organization-color); } } @@ -27,15 +27,15 @@ @media(max-width: @breakpoint-small-max) { .uk-card { - &.funder { + &.funder:not(.noColor) { .setType(@funder-color, bottom); } - &.ri { + &.ri:not(.noColor) { .setType(@ri-color, bottom); } - &.organization { + &.organization:not(.noColor) { .setType(@organization-color, bottom); } } From c09db5ae42f957a11372cc7af27851c331c23751 Mon Sep 17 00:00:00 2001 From: argirok Date: Thu, 8 Jun 2023 11:23:40 +0300 Subject: [PATCH 25/25] portal-search-result: use HTML to string pipe to show the description --- searchPages/searchUtils/portal-search-result.component.html | 2 +- searchPages/searchUtils/portal-search-result.module.ts | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/searchPages/searchUtils/portal-search-result.component.html b/searchPages/searchUtils/portal-search-result.component.html index 9e556f8b..9c202293 100644 --- a/searchPages/searchUtils/portal-search-result.component.html +++ b/searchPages/searchUtils/portal-search-result.component.html @@ -49,7 +49,7 @@
    -

    +

    {{result.description | htmlToString}}

    diff --git a/searchPages/searchUtils/portal-search-result.module.ts b/searchPages/searchUtils/portal-search-result.module.ts index ce1ebcf2..96a31172 100644 --- a/searchPages/searchUtils/portal-search-result.module.ts +++ b/searchPages/searchUtils/portal-search-result.module.ts @@ -11,12 +11,13 @@ import {UrlPrefixModule} from "../../utils/pipes/url-prefix.module"; import {IconsService} from "../../utils/icons/icons.service"; import {incognito, restricted} from "../../utils/icons/icons"; import {LogoUrlPipeModule} from "../../utils/pipes/logoUrlPipe.module"; +import {HTMLToStringPipeModule} from "../../utils/pipes/HTMLToStringPipe.module"; @NgModule({ imports: [ CommonModule, FormsModule, RouterModule, ErrorMessagesModule, - AlertModalModule, ManageModule, IconsModule, UrlPrefixModule, LogoUrlPipeModule + AlertModalModule, ManageModule, IconsModule, UrlPrefixModule, LogoUrlPipeModule, HTMLToStringPipeModule ], declarations: [ PortalSearchResultComponent