From dbbb832bff746f73c0bbcc416ee09bdbcd77b9e4 Mon Sep 17 00:00:00 2001 From: argirok Date: Mon, 1 Aug 2022 17:32:25 +0300 Subject: [PATCH 1/8] Connect Admin Customization: create button that updates layout timestamp and create new css files --- .../sharedComponents/admin-tabs/admin-tabs.component.ts | 3 ++- services/layout.service.ts | 8 +++++--- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/dashboard/sharedComponents/admin-tabs/admin-tabs.component.ts b/dashboard/sharedComponents/admin-tabs/admin-tabs.component.ts index a5f3d12d..5fdcd555 100644 --- a/dashboard/sharedComponents/admin-tabs/admin-tabs.component.ts +++ b/dashboard/sharedComponents/admin-tabs/admin-tabs.component.ts @@ -14,6 +14,7 @@ import { properties } from 'src/environments/environment';
  • Entities
  • Menu
  • Classes
  • +
  • Customization
  • ` }) @@ -25,7 +26,7 @@ export class AdminTabsComponent implements OnInit { @Input() public user: User; @Input() - public tab: "portal" | "page" | "entity" | "menu" | "class" = 'page'; + public tab: "portal" | "page" | "entity" | "menu" | "class" | "customization"= 'page'; private subscriptions: any[] = []; constructor(private route: ActivatedRoute, private userManagementService: UserManagementService) { diff --git a/services/layout.service.ts b/services/layout.service.ts index 4d00aa10..7282a872 100644 --- a/services/layout.service.ts +++ b/services/layout.service.ts @@ -24,9 +24,9 @@ export class LayoutService { return this.http.post(connectPortalUrl + "/build-css/" + (layout?"preview/":"") + pid + (suffix?("/"+ suffix):""), layout ); } - saveLayout(properties: EnvProperties, pid: string, layout: Layout): Observable { + saveLayout(properties: EnvProperties, pid: string, layout: Layout, portalType = null): Observable { LayoutService.removeNulls(layout); - return this.http.post(properties.adminToolsAPIURL + '/' + properties.adminToolsPortalType + '/' + return this.http.post(properties.adminToolsAPIURL + '/' + (portalType?portalType: properties.adminToolsPortalType) + '/' + pid + '/layout', layout, CustomOptions.getAuthOptionsWithBody()); } @@ -34,7 +34,9 @@ export class LayoutService { return this.http.get(properties.adminToolsAPIURL+"/" + properties.adminToolsPortalType + '/' + pid + '/layout'); } - + getLayouts(properties: EnvProperties): Observable { + return this.http.get(properties.adminToolsAPIURL+'/community/layouts'); + } mockLayout(): any { return this.http.get('./assets/customizationOptions.json') ; From 0092f060c1bc762d53e80698429c94bb4e696d88 Mon Sep 17 00:00:00 2001 From: "k.triantafyllou" Date: Tue, 2 Aug 2022 11:02:45 +0300 Subject: [PATCH 2/8] Remove section default from linking. --- claims/linking/linkingGeneric.component.html | 2 +- claims/linking/selected/metadataPreview.component.html | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/claims/linking/linkingGeneric.component.html b/claims/linking/linkingGeneric.component.html index 824a8462..b931e4b3 100644 --- a/claims/linking/linkingGeneric.component.html +++ b/claims/linking/linkingGeneric.component.html @@ -33,7 +33,7 @@
    -
    +
    diff --git a/claims/linking/selected/metadataPreview.component.html b/claims/linking/selected/metadataPreview.component.html index 2451dcf7..f5b5221f 100644 --- a/claims/linking/selected/metadataPreview.component.html +++ b/claims/linking/selected/metadataPreview.component.html @@ -1,6 +1,6 @@
    -
    +
    From a0aa836797f27fa5c0547bf426f9bb0beaaae0fa Mon Sep 17 00:00:00 2001 From: "k.triantafyllou" Date: Tue, 2 Aug 2022 11:21:19 +0300 Subject: [PATCH 3/8] Revert "Remove section default from linking." This reverts commit 0092f060c1bc762d53e80698429c94bb4e696d88. --- claims/linking/linkingGeneric.component.html | 2 +- claims/linking/selected/metadataPreview.component.html | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/claims/linking/linkingGeneric.component.html b/claims/linking/linkingGeneric.component.html index b931e4b3..824a8462 100644 --- a/claims/linking/linkingGeneric.component.html +++ b/claims/linking/linkingGeneric.component.html @@ -33,7 +33,7 @@
    -
    +
    diff --git a/claims/linking/selected/metadataPreview.component.html b/claims/linking/selected/metadataPreview.component.html index f5b5221f..2451dcf7 100644 --- a/claims/linking/selected/metadataPreview.component.html +++ b/claims/linking/selected/metadataPreview.component.html @@ -1,6 +1,6 @@
    -
    +
    From 05ca7c7eea11967ec5b54c5bd0776dbb8aa4637e Mon Sep 17 00:00:00 2001 From: Alex Martzios Date: Tue, 2 Aug 2022 12:43:39 +0300 Subject: [PATCH 4/8] change the way we get the impact factors for search results --- .../searchUtils/newSearchPage.component.html | 4 +- .../searchUtils/searchResult.component.ts | 58 ------------------- services/searchResearchResults.service.ts | 27 ++++++++- utils/entities/searchResult.ts | 1 + .../result-preview.component.html | 28 ++++----- .../result-preview.component.less | 10 ++++ .../result-preview.component.ts | 3 +- utils/result-preview/result-preview.ts | 4 +- utils/tabs/contents/search-tab.component.ts | 3 +- 9 files changed, 58 insertions(+), 80 deletions(-) create mode 100644 utils/result-preview/result-preview.component.less diff --git a/searchPages/searchUtils/newSearchPage.component.html b/searchPages/searchUtils/newSearchPage.component.html index 2219e88b..c330844b 100644 --- a/searchPages/searchUtils/newSearchPage.component.html +++ b/searchPages/searchUtils/newSearchPage.component.html @@ -300,9 +300,7 @@ [results]="results" [status]=searchUtils.status [type]="entityType" - [showLoading]="true" [properties]=properties [showImpactFactors]="(customFilter && - customFilter.queryFieldName == 'communityId' && (customFilter.valueId == - 'elixir-gr' || customFilter.valueId == 'inspired-ris'))"> + [showLoading]="true" [properties]=properties> result.DOIs).join(",")); - // console.log(dois); - if(dois.length > 0 && this.showImpactFactors && (this.properties.impactFactorsAPIURL && this.properties.impactFactorsAPIURL.length > 0) ) { - let url = this.properties.impactFactorsAPIURL + dois; - this.sub = this.http.get((this.properties.useCache?(this.properties.cacheUrl+(encodeURIComponent(url))):url)).subscribe((data_received:any[]) => { - let impact =[]; - data_received.forEach(function (result) { - if(result.doi && result.doi.length > 0 && result.pop_class!=null && result.inf_class!=null) - impact[result.doi]=result; - }); - this.previewResults.forEach(function (result) { - if(result.identifiers && result.identifiers.get("doi")) { - result.identifiers.get("doi").forEach(function (doi) { - if (impact[doi]) { - result.DOI = doi; - } - - }) - } - }); - for (let i = 0; i < this.previewResults.length; i++) { - if (this.previewResults[i].DOI) { - this.previewResults[i].pop_inf = new Array(); - this.previewResults[i].pop_inf.push(impact[this.previewResults[i].DOI].pop_class, impact[this.previewResults[i].DOI].inf_class); - if(this.previewResults[i].pop_inf[0]=="A"){ - // this.previewResults[i].pop_inf.push("High"); - this.previewResults[i].pop_inf.push("Exceptional"); - }else if(this.previewResults[i].pop_inf[0]=="B"){ - // this.previewResults[i].pop_inf.push("Average"); - this.previewResults[i].pop_inf.push("Substantial"); - }else{ - // this.previewResults[i].pop_inf.push("low"); - this.previewResults[i].pop_inf.push("Average"); - } - if(this.previewResults[i].pop_inf[1]=="A"){ - // this.previewResults[i].pop_inf.push("Strong"); - this.previewResults[i].pop_inf.push("Exceptional"); - }else if(this.previewResults[i].pop_inf[1]=="B"){ - // this.previewResults[i].pop_inf.push("Average"); - this.previewResults[i].pop_inf.push("Substantial"); - }else{ - // this.previewResults[i].pop_inf.push("Weak"); - this.previewResults[i].pop_inf.push("Average"); - } - } - } - - }, error1 => { - console.error("Failed to get Impact factors for elixir-gr") - }); - // console.log(researchResults[1]); - - } - /////////////////////// ATHENA CODE /////////////////////// } ngOnChanges(changes: SimpleChanges): void { diff --git a/services/searchResearchResults.service.ts b/services/searchResearchResults.service.ts index cf1647c2..6e69e315 100644 --- a/services/searchResearchResults.service.ts +++ b/services/searchResearchResults.service.ts @@ -199,6 +199,32 @@ export class SearchResearchResultsService { instance = Array.isArray(resData['children']['instance']) ? resData['children']['instance'][i] : resData['children']['instance']; this.parsingFunctions.parseTypes(result.types, types, instance); } + // Measure + result.measure = new Array(); + if (resData['measure'] && Array.isArray(resData['measure'])) { + for (let i = 0; i < resData['measure'].length; i++) { + if (resData['measure'][i].id == 'influence') { + result.measure[1] = resData['measure'][i].class; + if (resData['measure'][i].class == 'A') { + result.measure[3] = 'Exceptional'; + } else if (resData['measure'][i].class == 'B') { + result.measure[3] = 'Substantial'; + } else { + result.measure[3] = 'Average'; + } + } + if (resData['measure'][i].id == 'popularity') { + result.measure[0] = resData['measure'][i].class; + if (resData['measure'][i].class == 'A') { + result.measure[2] = 'Exceptional'; + } else if (resData['measure'][i].class == 'B') { + result.measure[2] = 'Substantial'; + } else { + result.measure[2] = 'Average'; + } + } + } + } /////////////////////////// Athena Code /////////////////////////// if (resData['pid']) { if (!Array.isArray(resData['pid'])) { @@ -370,7 +396,6 @@ export class SearchResearchResultsService { } results.push(result); } - return results; } diff --git a/utils/entities/searchResult.ts b/utils/entities/searchResult.ts index d88b6731..490a5c9f 100644 --- a/utils/entities/searchResult.ts +++ b/utils/entities/searchResult.ts @@ -6,6 +6,7 @@ export class SearchResult { relcanId: string; DOIs: string[]=[]; identifiers: Map; + measure: Array; //publications & datasets & orp & software & projects & dataproviders: description: string; diff --git a/utils/result-preview/result-preview.component.html b/utils/result-preview/result-preview.component.html index 81087974..b683ad2e 100644 --- a/utils/result-preview/result-preview.component.html +++ b/utils/result-preview/result-preview.component.html @@ -309,29 +309,29 @@
    -
    0 && isResultType) || result.orcidCreationDates?.length > 0))" class="uk-text-small" [ngClass]="{'uk-card-footer': isCard}"> - + - + - {{" " + result.pop_inf[2] + " popularity" }} + {{" " + result.measure[2] + " popularity" }}
    - + - {{" " + result.pop_inf[2] + " popularity" }} + {{" " + result.measure[2] + " popularity" }} - {{" " + (result.pop_inf[0] == 'A' ? 'In top 0.01%' : '') + (result.pop_inf[0] == 'B' ? 'In top 1%' : '') + (result.pop_inf[0] == 'C' ? 'In bottom 99%' : '')}} + {{" " + (result.measure[0] == 'A' ? 'In top 0.01%' : '') + (result.measure[0] == 'B' ? 'In top 1%' : '') + (result.measure[0] == 'C' ? 'In bottom 99%' : '')}}
    Popularity: Citation-based measure reflecting the current impact.
    - + - {{" " + result.pop_inf[3] + " influence" }} + {{" " + result.measure[3] + " influence" }}
    - + - {{result.pop_inf[3] + " influence" }} + {{result.measure[3] + " influence" }} - {{" " + (result.pop_inf[1] == 'A' ? 'In top 0.01%' : '') + (result.pop_inf[1] == 'B' ? 'In top 1%' : '') + (result.pop_inf[1] == 'C' ? 'In bottom 99%' : '')}} + {{" " + (result.measure[1] == 'A' ? 'In top 0.01%' : '') + (result.measure[1] == 'B' ? 'In top 1%' : '') + (result.measure[1] == 'C' ? 'In bottom 99%' : '')}}
    Influence: Citation-based measure reflecting the total impact.
    diff --git a/utils/result-preview/result-preview.component.less b/utils/result-preview/result-preview.component.less new file mode 100644 index 00000000..93da8f46 --- /dev/null +++ b/utils/result-preview/result-preview.component.less @@ -0,0 +1,10 @@ +// Impact Factors +.popularity-A svg .a, .influence-A svg .a { + fill:#d51717; +} +.popularity-B svg .a, .influence-B svg .a { + fill: #e1920a; +} +.popularity-C svg .a, .influence-C svg .a { + fill: #444; +} \ No newline at end of file diff --git a/utils/result-preview/result-preview.component.ts b/utils/result-preview/result-preview.component.ts index a5663358..121c4bd7 100644 --- a/utils/result-preview/result-preview.component.ts +++ b/utils/result-preview/result-preview.component.ts @@ -10,7 +10,8 @@ import {OpenaireEntities} from "../properties/searchFields"; @Component({ selector: 'result-preview', - templateUrl: 'result-preview.component.html' + templateUrl: 'result-preview.component.html', + styleUrls: ['result-preview.component.less'] }) export class ResultPreviewComponent implements OnInit, OnChanges { @Input() result: ResultPreview; diff --git a/utils/result-preview/result-preview.ts b/utils/result-preview/result-preview.ts index 73211623..e2c79a92 100644 --- a/utils/result-preview/result-preview.ts +++ b/utils/result-preview/result-preview.ts @@ -81,7 +81,8 @@ export class ResultPreview { //Impact factor DOI:string; - pop_inf; + measure: Array; + //publications & datasets & orp & software & organizations: projects: Project[]; @@ -194,6 +195,7 @@ export class ResultPreview { // } resultPreview.identifiers = result.identifiers; resultPreview.enermapsId = result.enermapsId; + resultPreview.measure = result.measure; return resultPreview; } diff --git a/utils/tabs/contents/search-tab.component.ts b/utils/tabs/contents/search-tab.component.ts index 96e02b31..daa12d88 100644 --- a/utils/tabs/contents/search-tab.component.ts +++ b/utils/tabs/contents/search-tab.component.ts @@ -39,7 +39,7 @@ import {StringUtils} from "../../string-utils.class"; + [type]="resultType" [showEnermaps]="showEnermaps"> @@ -59,7 +59,6 @@ export class SearchTabComponent { @Input() public searchNumber: number = 5; @Input() public searchLinkToAdvancedPage: string; @Input() properties: EnvProperties; - @Input() showImpactFactors; @Input() customTitle; @Input() showEnermaps: boolean; @Input() currentPage: number = null; From 23c0ea997cec534b30df8d60b7e0d84d162f90df Mon Sep 17 00:00:00 2001 From: Alex Martzios Date: Tue, 2 Aug 2022 14:55:33 +0300 Subject: [PATCH 5/8] resultLanding - hide marketplace links in explore (visible only for eosc explore) --- landingPages/result/resultLanding.component.html | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/landingPages/result/resultLanding.component.html b/landingPages/result/resultLanding.component.html index e3276bef..a84498a3 100644 --- a/landingPages/result/resultLanding.component.html +++ b/landingPages/result/resultLanding.component.html @@ -445,7 +445,7 @@
    - -
    1 && properties.adminToolsPortalType == 'eosc' && (!viewAll || viewAll=='egiNotebook')"> Date: Tue, 2 Aug 2022 15:42:32 +0300 Subject: [PATCH 6/8] fix widths for advanced search for - when selecting publication date and specific date range --- .../advancedSearchForm.component.html | 2 +- .../searchUtils/dateFilter.component.ts | 61 +++++++++---------- 2 files changed, 31 insertions(+), 32 deletions(-) diff --git a/searchPages/searchUtils/advancedSearchForm.component.html b/searchPages/searchUtils/advancedSearchForm.component.html index 7aaf282f..dd27b089 100644 --- a/searchPages/searchUtils/advancedSearchForm.component.html +++ b/searchPages/searchUtils/advancedSearchForm.component.html @@ -18,7 +18,7 @@
    - +
    diff --git a/searchPages/searchUtils/dateFilter.component.ts b/searchPages/searchUtils/dateFilter.component.ts index 7c595ba9..7dec2a2c 100644 --- a/searchPages/searchUtils/dateFilter.component.ts +++ b/searchPages/searchUtils/dateFilter.component.ts @@ -7,37 +7,36 @@ import { MatDatepickerInputEvent } from "@angular/material/datepicker"; @Component({ selector: 'date-filter', template: ` -
    - - {{dateValue.typesTitle[i]}} - -
    -
    -
    - - {{dateValue.typesTitle[i]}} - -
    -
    - - - - - -
    -
    - - - - - -
    - -
    -
    -
    +
    + + {{dateValue.typesTitle[i]}} + +
    +
    +
    + + {{dateValue.typesTitle[i]}} + +
    +
    + + + + + +
    +
    + + + + + +
    +
    +
    +
    ` }) From c8d27f6b57db56ab4d14f2e5fc273838ab3f4cc9 Mon Sep 17 00:00:00 2001 From: Alex Martzios Date: Tue, 2 Aug 2022 16:49:09 +0300 Subject: [PATCH 7/8] update tooltip for research products in search --- searchPages/searchUtils/entitiesSelection.component.ts | 2 +- sharedComponents/input/input.component.ts | 7 ++++++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/searchPages/searchUtils/entitiesSelection.component.ts b/searchPages/searchUtils/entitiesSelection.component.ts index 6c021616..a6646cb5 100644 --- a/searchPages/searchUtils/entitiesSelection.component.ts +++ b/searchPages/searchUtils/entitiesSelection.component.ts @@ -78,7 +78,7 @@ export class EntitiesSelectionComponent { } if(showPage[this.simpleView ? this.properties.searchLinkToResults : this.properties.searchLinkToAdvancedResults] && (showEntity["publication"] || showEntity["dataset"] || showEntity["software"] || showEntity["orp"])) { - this.entities.push({label: OpenaireEntities.RESULTS, value: 'result', tooltip: OpenaireEntities.PUBLICATIONS+', '+OpenaireEntities.DATASETS+', '+OpenaireEntities.SOFTWARE+', '+OpenaireEntities.OTHER}); + this.entities.push({label: OpenaireEntities.RESULTS, value: 'result', tooltip: OpenaireEntities.RESULTS+' ('+OpenaireEntities.PUBLICATIONS+', '+OpenaireEntities.DATASETS+', '+OpenaireEntities.SOFTWARE+', '+OpenaireEntities.OTHER+')'}); } if(showPage[this.simpleView ? this.properties.searchLinkToProjects : this.properties.searchLinkToAdvancedProjects] && showEntity["project"]) { this.entities.push({label: OpenaireEntities.PROJECTS, value: 'project'}); diff --git a/sharedComponents/input/input.component.ts b/sharedComponents/input/input.component.ts index b9df9bb2..35560870 100644 --- a/sharedComponents/input/input.component.ts +++ b/sharedComponents/input/input.component.ts @@ -59,7 +59,7 @@ declare var UIkit;
    + [attr.uk-tooltip]="(tooltip && formControl.value && !focused && type !== 'chips' && type !== 'textarea')?('title: ' + getTooltip(formControl.value) + '; delay: 500; pos: bottom-left'):null"> @@ -497,6 +497,11 @@ export class InputComponent implements OnInit, OnDestroy, AfterViewInit, OnChang let option = this.optionsArray.find(option => HelperFunctions.equals(option.value, value)); return (option) ? option.label : (value); } + + getTooltip(value: any): string { + let option = this.optionsArray.find(option => HelperFunctions.equals(option.value, value)); + return (option) ? (option.tooltip ? option.tooltip : option.label) : (value); + } focus(value: boolean, event = null) { if (this.focused) { From 7ca1d52f260a070a6aad5a8c695d5435b4d5aa52 Mon Sep 17 00:00:00 2001 From: Alex Martzios Date: Tue, 2 Aug 2022 16:53:05 +0300 Subject: [PATCH 8/8] lowercase research product entites in search --- searchPages/searchUtils/entitiesSelection.component.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/searchPages/searchUtils/entitiesSelection.component.ts b/searchPages/searchUtils/entitiesSelection.component.ts index a6646cb5..8b3759d2 100644 --- a/searchPages/searchUtils/entitiesSelection.component.ts +++ b/searchPages/searchUtils/entitiesSelection.component.ts @@ -78,7 +78,7 @@ export class EntitiesSelectionComponent { } if(showPage[this.simpleView ? this.properties.searchLinkToResults : this.properties.searchLinkToAdvancedResults] && (showEntity["publication"] || showEntity["dataset"] || showEntity["software"] || showEntity["orp"])) { - this.entities.push({label: OpenaireEntities.RESULTS, value: 'result', tooltip: OpenaireEntities.RESULTS+' ('+OpenaireEntities.PUBLICATIONS+', '+OpenaireEntities.DATASETS+', '+OpenaireEntities.SOFTWARE+', '+OpenaireEntities.OTHER+')'}); + this.entities.push({label: OpenaireEntities.RESULTS, value: 'result', tooltip: OpenaireEntities.RESULTS+' ('+OpenaireEntities.PUBLICATIONS.toLowerCase()+', '+OpenaireEntities.DATASETS.toLowerCase()+', '+OpenaireEntities.SOFTWARE.toLowerCase()+', '+OpenaireEntities.OTHER.toLowerCase()+')'}); } if(showPage[this.simpleView ? this.properties.searchLinkToProjects : this.properties.searchLinkToAdvancedProjects] && showEntity["project"]) { this.entities.push({label: OpenaireEntities.PROJECTS, value: 'project'});
    Searching Fields Terms