diff --git a/searchPages/find/searchAll.component.html b/searchPages/find/searchAll.component.html index e492d5da..e0a8d9a9 100644 --- a/searchPages/find/searchAll.component.html +++ b/searchPages/find/searchAll.component.html @@ -18,7 +18,7 @@ [isDisabled]="disableForms" [simpleView]="true" [formPlaceholderText]="formPlaceholderText" - [selectedFields]="selectedFields" [showAdvancedSearchLink]="true" + [selectedFields]="selectedFields" [showSwitchSearchLink]="true" [fieldIdsMap]="fieldIdsMap" [fieldIds]="fieldIds" [entitiesSelection]="true" [customFilter]="customFilter" > @@ -77,20 +77,20 @@ - - - diff --git a/searchPages/searchDataProviders.component.ts b/searchPages/searchDataProviders.component.ts index 02bcf836..e5f6fb31 100644 --- a/searchPages/searchDataProviders.component.ts +++ b/searchPages/searchDataProviders.component.ts @@ -35,13 +35,13 @@ import {properties} from "../../../environments/environment"; [includeOnlyResultsAndFilter]="includeOnlyResultsAndFilter" [piwikSiteId]=piwikSiteId [hasPrefix]="hasPrefix" [searchFormClass]="type!='deposit'?'datasourcesSearchForm':''" - [entitiesSelection]="type=='all'" [showAdvancedSearchLink]="showAdvancedSearchLink" + [entitiesSelection]="type=='all'" [showSwitchSearchLink]="showSwitchSearchLink" [filters]="filters" [simpleView]="simpleView" formPlaceholderText="Search by name, description, subject..." [showResultCount]="(type=='all' || type == 'deposit')" [showLastIndex]="type!='deposit'" [tableViewLink]="tableViewLink" - [sort]="false"> - + [sort]="false" [showBreadcrumb]="showBreadcrumb"> + @@ -83,8 +83,8 @@ export class SearchDataProvidersComponent { @Input() openaireLink: string; @Input() includeOnlyResultsAndFilter: boolean = false; @Output() searchPageUpdates = new EventEmitter(); - @Input() showAdvancedSearchLink:boolean; - + @Input() showSwitchSearchLink:boolean; + @Input() showBreadcrumb: boolean = false; subs: any[] = []; constructor (private route: ActivatedRoute, private _searchDataProvidersService: SearchDataprovidersService ) { @@ -96,8 +96,8 @@ export class SearchDataProvidersComponent { ngOnInit() { this.refineFields = DatasourcesHelperClass.getrefineFields(this.type); this.pageTitle = DatasourcesHelperClass.getTitle(this.type); - if(this.showAdvancedSearchLink == null){ - this.showAdvancedSearchLink = (this.type == "all"); + if(this.showSwitchSearchLink == null){ + this.showSwitchSearchLink = (this.type == "all"); } // this.route.data // .subscribe((data: { envSpecific: EnvProperties }) => { diff --git a/searchPages/searchOrganizations.component.ts b/searchPages/searchOrganizations.component.ts index 7b523b71..a7b90023 100644 --- a/searchPages/searchOrganizations.component.ts +++ b/searchPages/searchOrganizations.component.ts @@ -34,7 +34,9 @@ import {properties} from "../../../environments/environment"; [includeOnlyResultsAndFilter]="includeOnlyResultsAndFilter" [sort]="false" [filters]="filters" - [simpleView]="simpleView" formPlaceholderText="Search by organization name..." [showAdvancedSearchLink]="showAdvancedSearchLink" + [simpleView]="simpleView" formPlaceholderText="Search by organization name..." + [showSwitchSearchLink]="showSwitchSearchLink" + [showBreadcrumb]="showBreadcrumb" > ` @@ -71,8 +73,8 @@ export class SearchOrganizationsComponent { @Input() openaireLink: string; @Input() includeOnlyResultsAndFilter: boolean = false; @Output() searchPageUpdates = new EventEmitter(); - @Input() showAdvancedSearchLink:boolean = true; - + @Input() showSwitchSearchLink:boolean = true; + @Input() showBreadcrumb: boolean = false; public resourcesQuery = "(oaftype exact organization)"; subs: any[] = []; diff --git a/searchPages/searchProjects.component.ts b/searchPages/searchProjects.component.ts index 49c2a442..857f9258 100644 --- a/searchPages/searchProjects.component.ts +++ b/searchPages/searchProjects.component.ts @@ -34,8 +34,9 @@ import {properties} from "../../../environments/environment"; [includeOnlyResultsAndFilter]="includeOnlyResultsAndFilter" [filters]="filters" [rangeFilters]="rangeFilters" [rangeFields]="rangeFields" - [simpleView]="simpleView" formPlaceholderText="Search by title, acronym, project code..." [showAdvancedSearchLink]="showAdvancedSearchLink" - [sort]="false" + [simpleView]="simpleView" formPlaceholderText="Search by title, acronym, project code..." + [showSwitchSearchLink]="showSwitchSearchLink" + [sort]="false" [showBreadcrumb]="showBreadcrumb" > @@ -77,8 +78,8 @@ export class SearchProjectsComponent { @Input() openaireLink: string; @Input() includeOnlyResultsAndFilter: boolean = false; @Output() searchPageUpdates = new EventEmitter(); - @Input() showAdvancedSearchLink:boolean = true; - + @Input() showSwitchSearchLink:boolean = true; + @Input() showBreadcrumb: boolean = false; subs: any[] = []; constructor (private route: ActivatedRoute, private _searchProjectsService: SearchProjectsService ) { diff --git a/searchPages/searchResearchResults.component.ts b/searchPages/searchResearchResults.component.ts index a5449f10..763b30e7 100644 --- a/searchPages/searchResearchResults.component.ts +++ b/searchPages/searchResearchResults.component.ts @@ -35,7 +35,7 @@ import {properties} from "../../../environments/environment"; [rangeFilters]="rangeFilters" [rangeFields]="rangeFields" [simpleView]="simpleView" formPlaceholderText="Search by title, author, abstract, DOI, orcid..." [includeOnlyResultsAndFilter]="includeOnlyResultsAndFilter" [showBreadcrumb]="showBreadcrumb" - [showAdvancedSearchLink]="showAdvancedSearchLink" + [showSwitchSearchLink]="showSwitchSearchLink" > @@ -86,7 +86,7 @@ export class SearchResearchResultsComponent { @Input() includeOnlyResultsAndFilter: boolean = false; @Input() showBreadcrumb: boolean = false; @Output() searchPageUpdates = new EventEmitter(); - @Input() showAdvancedSearchLink: boolean = true; + @Input() showSwitchSearchLink: boolean = true; subs: any[] = []; constructor(private route: ActivatedRoute, private _searchResearchResultsService: SearchResearchResultsService) { diff --git a/searchPages/searchUtils/advancedSearchForm.component.html b/searchPages/searchUtils/advancedSearchForm.component.html index 78c574e3..56988c0a 100644 --- a/searchPages/searchUtils/advancedSearchForm.component.html +++ b/searchPages/searchUtils/advancedSearchForm.component.html @@ -1,14 +1,15 @@
- Quick search -
+

Advanced search in -

+
Search -
+
Advanced search diff --git a/searchPages/searchUtils/advancedSearchForm.component.ts b/searchPages/searchUtils/advancedSearchForm.component.ts index a544190d..b466c9e7 100644 --- a/searchPages/searchUtils/advancedSearchForm.component.ts +++ b/searchPages/searchUtils/advancedSearchForm.component.ts @@ -40,7 +40,7 @@ export class AdvancedSearchFormComponent { selectedEntitySimpleUrl; selectedEntityAdvancedUrl; @Input() entitiesSelection:boolean; - @Input() showAdvancedSearchLink:boolean = true; + @Input() showSwitchSearchLink:boolean = true; constructor (private route: ActivatedRoute, private router: Router) { } diff --git a/searchPages/searchUtils/entitiesSelection.component.ts b/searchPages/searchUtils/entitiesSelection.component.ts index 53901eff..8479b242 100644 --- a/searchPages/searchUtils/entitiesSelection.component.ts +++ b/searchPages/searchUtils/entitiesSelection.component.ts @@ -118,15 +118,17 @@ export class EntitiesSelectionComponent { 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.showResearchOutcomes = showPage[this.simpleView?this.properties.searchLinkToResults:this.properties.searchLinkToAdvancedResults] && (showEntity["publication"] || showEntity["dataset"] || showEntity["software"] || showEntity["orp"]); + this.showPublications = showPage[this.simpleView?this.properties.searchLinkToResults:this.properties.searchLinkToAdvancedResults] && showEntity["publication"]; + this.showDatasets = showPage[this.simpleView?this.properties.searchLinkToResults:this.properties.searchLinkToAdvancedResults] && showEntity["dataset"]; + this.showSoftware = showPage[this.simpleView?this.properties.searchLinkToResults:this.properties.searchLinkToAdvancedResults] && showEntity["software"]; + this.showOther = showPage[this.simpleView?this.properties.searchLinkToResults:this.properties.searchLinkToAdvancedResults] && showEntity["orp"]; + this.showProjects = showPage[this.simpleView?this.properties.searchLinkToProjects:this.properties.searchLinkToAdvancedProjects] && showEntity["project"]; + this.showOrganizations = showPage[this.simpleView?this.properties.searchLinkToOrganizations:this.properties.searchLinkToAdvancedOrganizations] && showEntity["organization"]; + this.showDataProviders = showPage[this.simpleView?this.properties.searchLinkToDataProviders:this.properties.searchLinkToAdvancedDataProviders] && showEntity["datasource"]; + if (this.customFilter && this.customFilter.queryFieldName == "communityId" || this.properties.adminToolsCommunity === "connect") { + //for community pages: no organization in simple search, only results in advanced + this.showAll = false; this.showOrganizations = false; if (!this.simpleView) { this.showProjects = false; diff --git a/searchPages/searchUtils/newSearchPage.component.html b/searchPages/searchUtils/newSearchPage.component.html index 686288b6..456df9e2 100644 --- a/searchPages/searchUtils/newSearchPage.component.html +++ b/searchPages/searchUtils/newSearchPage.component.html @@ -165,19 +165,19 @@ 'communityId'?' uk-margin-large-bottom ':'uk-margin-large-top')+ (entityType === 'community' ||entityType === 'stakeholder'?' uk-position-relative':'')" id="searchForm">
@@ -246,7 +246,7 @@
Do you want to see results only for {{customFilter.valueName}}? Click diff --git a/searchPages/searchUtils/newSearchPage.component.ts b/searchPages/searchUtils/newSearchPage.component.ts index b619ccda..89d91a21 100644 --- a/searchPages/searchUtils/newSearchPage.component.ts +++ b/searchPages/searchUtils/newSearchPage.component.ts @@ -106,7 +106,7 @@ export class NewSearchPageComponent { url = null; metaDescription = ""; @Input() entitiesSelection:boolean = true; - @Input() showAdvancedSearchLink:boolean = true; + @Input() showSwitchSearchLink:boolean = true; // on 1st load, do not show filters until results query returns. public hideFilters: boolean = true; @@ -577,7 +577,7 @@ export class NewSearchPageComponent { public removeFilter(value: Value, filter: Filter, forceRemove:boolean = false) { this.currentValueToRemove = value; this.currentFilterToRemove = filter; - if(!forceRemove && this.customFilter && this.customFilter.queryFieldName ==filter.filterId && this.customFilter.valueId == value.id ){ + if(!forceRemove && this.customFilter && this.customFilter.queryFieldName ==filter.filterId && this.customFilter.valueId == value.id && this.customFilter.promptToAddFilter ){ this.openRemoveCustomFilterModal(); return; } diff --git a/searchPages/searchUtils/searchUtils.class.ts b/searchPages/searchUtils/searchUtils.class.ts index 0f77783f..fe329973 100644 --- a/searchPages/searchUtils/searchUtils.class.ts +++ b/searchPages/searchUtils/searchUtils.class.ts @@ -17,6 +17,7 @@ export class SearchCustomFilter{ valueName:string; // Greece isHiddenFilter:boolean; selected:boolean; + promptToAddFilter:boolean; constructor( fieldName:string, queryFieldName:string, valueId:string, valueName:string ){ this.isHiddenFilter = true; this.fieldName = fieldName; @@ -24,6 +25,7 @@ export class SearchCustomFilter{ this.valueId = valueId; this.valueName = valueName; this.selected = null; + this.promptToAddFilter = false; } // public setFilter(filter:SearchCustomFilter){ // if(!filter){