From 7f1862dbab9f3a01114191846ffa93ea82ca7027 Mon Sep 17 00:00:00 2001 From: "argiro.kokogiannaki" Date: Mon, 27 Apr 2020 08:14:05 +0000 Subject: [PATCH] [Library|Trunk] Search: -Entities Selection: add check if route is enabled -Delay in result types checkboxes to 2 s -Use breadcrumb component -add connect background -remove space between names in showAuthors component -Filters: -message about top 100 always visible -rename to view all -change css for search input -show 100 if results > 95 -view less under the 2nd list -Search bar: -select contains all avaliable entities not only search results - Landing pages: -correct issue with pmid in landing -correct issue with date in cite this -Hide Addthis: value in properties git-svn-id: https://svn.driver.research-infrastructures.eu/driver/dnet40/modules/uoa-services-library/trunk/ng-openaire-library/src/app@58552 d315682c-612b-4755-9ff5-7f18f6832af3 --- connect/connectHelper.ts | 2 +- deposit/depositFirstPage.component.ts | 39 +++++-- .../citeThis/citeThis.component.ts | 2 +- .../landing-utils/parsingFunctions.class.ts | 4 +- .../result/resultLanding.component.html | 2 +- .../entitiesSelection.component.ts | 24 ++-- .../searchUtils/newSearchPage.component.html | 8 +- .../searchUtils/newSearchPage.component.ts | 9 +- .../searchUtils/newSearchPage.module.ts | 3 +- .../searchUtils/quick-selections.component.ts | 2 +- .../searchUtils/searchFilter.component.html | 26 +++-- .../searchUtils/searchFilter.component.ts | 2 +- .../searchPageTableView.component.html | 14 ++- .../searchPageTableView.component.ts | 6 + .../searchUtils/searchPageTableView.module.ts | 3 +- sharedComponents/navigationBar.component.html | 6 +- .../searchBar/searchBar.component.html | 4 +- .../searchBar/searchBar.component.ts | 108 ++++++++---------- utils/authors/showAuthors.component.ts | 5 +- utils/breadcrumbs/breadcrumbs.component.ts | 5 +- utils/properties/env-properties.ts | 1 + .../result-preview.component.html | 4 +- 22 files changed, 159 insertions(+), 120 deletions(-) diff --git a/connect/connectHelper.ts b/connect/connectHelper.ts index fa5bba4b..13a93133 100644 --- a/connect/connectHelper.ts +++ b/connect/connectHelper.ts @@ -3,7 +3,7 @@ import {HttpParams} from '@angular/common/http'; export class ConnectHelper { public static getCommunityFromDomain(domain: string): string{ - // domain = "beta.egi.openaire.eu"; //for testing + domain = "beta.ee.openaire.eu"; //for testing if (domain.indexOf('openaire.eu') === -1) { return null; } diff --git a/deposit/depositFirstPage.component.ts b/deposit/depositFirstPage.component.ts index 45032ef5..e32f58c8 100644 --- a/deposit/depositFirstPage.component.ts +++ b/deposit/depositFirstPage.component.ts @@ -69,18 +69,28 @@ import {Meta, Title} from "@angular/platform-browser";
-

+ +

+
- - + + + +
+ + +
@@ -100,9 +110,20 @@ import {Meta, Title} from "@angular/platform-browser";
- Browse all + --> + + Use related zenodo communities + + + Deposit in Zenodo
diff --git a/landingPages/landing-utils/citeThis/citeThis.component.ts b/landingPages/landing-utils/citeThis/citeThis.component.ts index 1fbc0a8e..99c008b8 100644 --- a/landingPages/landing-utils/citeThis/citeThis.component.ts +++ b/landingPages/landing-utils/citeThis/citeThis.component.ts @@ -84,7 +84,7 @@ export class CiteThisComponent { } if(this.result.dateofacceptance != undefined){ citationData.issued = {}; - var date:string = (this.result.dateofacceptance)+""; // transform to string in case it is an integer + var date:string = (this.result.dateofacceptance.getFullYear())+""; // transform to string in case it is an integer var dateArray:string[] = (date && (date).indexOf('-') !== -1)?[date.split('-')[0]]:[date]; if(dateArray.length < 3){ // dateArray.push[1]; diff --git a/landingPages/landing-utils/parsingFunctions.class.ts b/landingPages/landing-utils/parsingFunctions.class.ts index a696e8c0..2fcaede7 100644 --- a/landingPages/landing-utils/parsingFunctions.class.ts +++ b/landingPages/landing-utils/parsingFunctions.class.ts @@ -454,7 +454,7 @@ export class ParsingFunctions { let identifiers = new Map(); if (pid.hasOwnProperty("classname") && pid['classname'] != "") { - if (pid.classname == "doi" || pid.classname == "pmc" || pid.classname == "handle" || pid == "pmid") { + if (pid.classname == "doi" || pid.classname == "pmc" || pid.classname == "handle" || pid.classname == "pmid") { if (!identifiers.has(pid.classname)) { identifiers.set(pid.classname, new Array()); } @@ -463,7 +463,7 @@ export class ParsingFunctions { } } else { for (let i = 0; i < pid.length; i++) { - if (pid[i].classname == "doi" || pid[i].classname == "pmc" || pid[i].classname == "handle" || pid == "pmid") { + if (pid[i].classname == "doi" || pid[i].classname == "pmc" || pid[i].classname == "handle" || pid[i].classname == "pmid") { if (!identifiers.has(pid[i].classname)) { identifiers.set(pid[i].classname, new Array()); } diff --git a/landingPages/result/resultLanding.component.html b/landingPages/result/resultLanding.component.html index 9cbf19b5..6540acfb 100644 --- a/landingPages/result/resultLanding.component.html +++ b/landingPages/result/resultLanding.component.html @@ -498,7 +498,7 @@ -
+
Share - Bookmark
diff --git a/searchPages/searchUtils/entitiesSelection.component.ts b/searchPages/searchUtils/entitiesSelection.component.ts index d5cc7e1f..6084720d 100644 --- a/searchPages/searchUtils/entitiesSelection.component.ts +++ b/searchPages/searchUtils/entitiesSelection.component.ts @@ -101,19 +101,23 @@ export class EntitiesSelectionComponent { if (this.properties) { // console.log(this.customFilter) this.config.getCommunityInformation(this.properties, (this.customFilter && this.customFilter.queryFieldName == "communityId") ? this.customFilter.valueId : this.properties.adminToolsCommunity).subscribe(data => { - var showEntity = {}; - for (var i = 0; i < data['entities'].length; i++) { + let showEntity = {}; + let showPage = {}; + for (let i = 0; i < data['entities'].length; i++) { showEntity["" + data['entities'][i]["pid"] + ""] = data['entities'][i]["isEnabled"]; } - this.showResearchOutcomes = showEntity["publication"] || showEntity["dataset"] || showEntity["software"] || showEntity["orp"]; - this.showPublications = showEntity["publication"]; - this.showDatasets = showEntity["dataset"]; - this.showSoftware = showEntity["software"]; - this.showOther = showEntity["orp"]; - this.showProjects = showEntity["project"]; - this.showOrganizations = showEntity["organization"]; - this.showDataProviders = showEntity["datasource"]; + for (let i = 0; i < data['pages'].length; i++) { + showPage["" + data['pages'][i]["route"] + ""] = data['pages'][i]["isEnabled"]; + } + this.showResearchOutcomes = showPage[this.properties.searchLinkToResults] && (showEntity["publication"] || showEntity["dataset"] || showEntity["software"] || showEntity["orp"]); + this.showPublications = showPage[this.properties.searchLinkToResults] && showEntity["publication"]; + this.showDatasets = showPage[this.properties.searchLinkToResults] && showEntity["dataset"]; + this.showSoftware = showPage[this.properties.searchLinkToResults] && showEntity["software"]; + this.showOther = showPage[this.properties.searchLinkToResults] && showEntity["orp"]; + this.showProjects = showPage[this.properties.searchLinkToProjects] && showEntity["project"]; + this.showOrganizations = showPage[this.properties.searchLinkToOrganizations] && showEntity["organization"]; + this.showDataProviders = showPage[this.properties.searchLinkToDataProviders] && showEntity["datasource"]; if (this.customFilter && this.customFilter.queryFieldName == "communityId") { this.showOrganizations = false; diff --git a/searchPages/searchUtils/newSearchPage.component.html b/searchPages/searchUtils/newSearchPage.component.html index b7b8c5b6..3816a02a 100644 --- a/searchPages/searchUtils/newSearchPage.component.html +++ b/searchPages/searchUtils/newSearchPage.component.html @@ -107,11 +107,10 @@ -
+
- -
Home > Search
+
@@ -359,7 +358,8 @@
-
diff --git a/searchPages/searchUtils/newSearchPage.component.ts b/searchPages/searchUtils/newSearchPage.component.ts index 5d27b47a..353ac901 100644 --- a/searchPages/searchUtils/newSearchPage.component.ts +++ b/searchPages/searchUtils/newSearchPage.component.ts @@ -18,6 +18,7 @@ import {SearchFields} from "../../utils/properties/searchFields"; import {RefineResultsUtils} from "../../services/servicesUtils/refineResults.class"; import {RangeFilter} from "../../utils/rangeFilter/rangeFilterHelperClasses.class"; import {ZenodoInformationClass} from "../../deposit/utils/zenodoInformation.class"; +import {Breadcrumb} from "../../utils/breadcrumbs/breadcrumbs.component"; declare var UIkit: any; @@ -92,7 +93,7 @@ export class NewSearchPageComponent { public divContents = null; public routerHelper: RouterHelper = new RouterHelper(); public errorCodes: ErrorCodes = new ErrorCodes(); - + breadcrumbs:Breadcrumb[] = []; url = null; @Input() entitiesSelection:boolean = true; @@ -133,6 +134,12 @@ export class NewSearchPageComponent { this.searchUtils.baseUrl = "/" + this.searchUtils.baseUrl; this.seoService.createLinkForCanonicalURL(this.properties.baseLink + this.router.url, false); + this.breadcrumbs.push({name: 'home', route: '/'}); + if(this.simpleView) { + this.breadcrumbs.push( {name: "Search", route: this.simpleSearchLink}); + }else if(!this.simpleView && this.advancedSearchLink) { + this.breadcrumbs.push({name: "Advanced Search", route: this.advancedSearchLink}); + } } diff --git a/searchPages/searchUtils/newSearchPage.module.ts b/searchPages/searchUtils/newSearchPage.module.ts index f8ae7522..3cb71c46 100644 --- a/searchPages/searchUtils/newSearchPage.module.ts +++ b/searchPages/searchUtils/newSearchPage.module.ts @@ -25,6 +25,7 @@ import {SearchResultsModule} from "./searchResults.module"; import {SearchResultsInDepositModule} from "../../deposit/searchResultsInDeposit.module"; import {AdvancedSearchFormModule} from "./advancedSearchForm.module"; import {QuickSelectionsModule} from "./quick-selections.module"; +import {BreadcrumbsModule} from "../../utils/breadcrumbs/breadcrumbs.module"; @NgModule({ imports: [ @@ -33,7 +34,7 @@ import {QuickSelectionsModule} from "./quick-selections.module"; SearchPagingModule, SearchResultsPerPageModule, SearchSortingModule, SearchDownloadModule, ModalModule, SearchFilterModule, RangeFilterModule, PiwikServiceModule, HelperModule, Schema2jsonldModule, SEOServiceModule, SearchResultsModule, - SearchResultsInDepositModule, AdvancedSearchFormModule, QuickSelectionsModule + SearchResultsInDepositModule, AdvancedSearchFormModule, QuickSelectionsModule, BreadcrumbsModule ], declarations: [ NewSearchPageComponent diff --git a/searchPages/searchUtils/quick-selections.component.ts b/searchPages/searchUtils/quick-selections.component.ts index 6738636c..948ed522 100644 --- a/searchPages/searchUtils/quick-selections.component.ts +++ b/searchPages/searchUtils/quick-selections.component.ts @@ -123,7 +123,7 @@ export class QuickSelectionsComponent implements OnChanges { }); } this.resultTypesObs = this.clicks.pipe( - debounceTime(1000) + debounceTime(2000) ).subscribe(e =>{this.actuallyChanged()} ); } diff --git a/searchPages/searchUtils/searchFilter.component.html b/searchPages/searchUtils/searchFilter.component.html index 4e0ccea8..f358e8b5 100644 --- a/searchPages/searchUtils/searchFilter.component.html +++ b/searchPages/searchUtils/searchFilter.component.html @@ -56,19 +56,24 @@ - + View more - - View less + + View all +