diff --git a/searchPages/searchUtils/advancedSearchForm.component.html b/searchPages/searchUtils/advancedSearchForm.component.html index ecfe5042..de0313d4 100644 --- a/searchPages/searchUtils/advancedSearchForm.component.html +++ b/searchPages/searchUtils/advancedSearchForm.component.html @@ -1,179 +1,185 @@ -
- Quick search - -
- Advanced search in - - -
-
-
+
+
+ Advanced search in + {{entities.getLabel(entityType)}} + +
+ +
+
+ -
+
- - - - - - - - - - -
Field to searchTerm
- {{fieldIdsMap[id].name}} - -
- - -
+ + + + + + + + + - - - - + + + + + - - - + + + +
Field to searchTerm
+ {{fieldIdsMap[id].name}} + +
+ + +
-
- - - - - - - - - + + + + + + + + + + Yes
- + No
-
- {{op.id}} - -
- Add rule -
-
+ + {{op.id}} + +
+ Add rule +
+
-
+
+ class="uk-icon-button portal-button clickable " + (click)="addField()"> +
+
+
+
+ Please check your from date
-
-
-
- Please check your from date -
-
- Please check your to date -
-
- Please check your dates +
+ Please check your to date +
+
+ Please check your dates +
+
+
+ +
+ +
+ - -
- -
- - - -
-
-
+ + + +
+
+
+
+
- -
+
diff --git a/searchPages/searchUtils/advancedSearchForm.component.ts b/searchPages/searchUtils/advancedSearchForm.component.ts index f23c501d..88b78d7f 100644 --- a/searchPages/searchUtils/advancedSearchForm.component.ts +++ b/searchPages/searchUtils/advancedSearchForm.component.ts @@ -28,6 +28,7 @@ export class AdvancedSearchFormComponent { @Output() queryChange = new EventEmitter(); @Input() resultTypes; @Input() quickFilter: { filter: Filter, selected: boolean, filterId: string, value: string }; + public disableSelect: boolean = false; validDateFrom: boolean = true; validDateTo: boolean = true; @Input() customFilter: SearchCustomFilter; @@ -106,6 +107,10 @@ export class AdvancedSearchFormComponent { } } + disableSelectChange(value) { + this.disableSelect = value; + } + addField() { this.newFieldId = this.fieldIds[0]; var type = this.fieldIdsMap[this.newFieldId].type; diff --git a/searchPages/searchUtils/entitiesSelection.component.ts b/searchPages/searchUtils/entitiesSelection.component.ts index 04a8b966..aed53071 100644 --- a/searchPages/searchUtils/entitiesSelection.component.ts +++ b/searchPages/searchUtils/entitiesSelection.component.ts @@ -11,10 +11,14 @@ import {OpenaireEntities} from "../../utils/properties/searchFields"; @Component({ selector: 'entities-selection', template: ` - +
+ +
+
` }) export class EntitiesSelectionComponent { @@ -24,9 +28,9 @@ export class EntitiesSelectionComponent { @Input() currentEntity = "result"; @Input() simpleView: boolean = true; @Input() onChangeNavigate: boolean = true; - @Input() disableSelect: boolean = false; @Output() selectionChange = new EventEmitter(); @ViewChild('input') input: InputComponent; + @Output() disableSelectEmitter: EventEmitter = new EventEmitter(); public entities: Option[] = []; public properties: EnvProperties = properties; private subscriptions: Subscription[] = []; @@ -53,7 +57,9 @@ export class EntitiesSelectionComponent { } } if(this.onlyresults) { - this.entities.push({label: 'All ' + OpenaireEntities.RESULTS.toLowerCase(), value: 'all'}); + if(this.simpleView) { + this.entities.push({label: 'All ' + OpenaireEntities.RESULTS.toLowerCase(), value: 'all'}); + } if(showPage[this.simpleView ? this.properties.searchLinkToResults : this.properties.searchLinkToAdvancedResults] && showEntity["publication"]) { this.entities.push({label: OpenaireEntities.PUBLICATIONS, value: 'publications'}); } @@ -67,12 +73,13 @@ export class EntitiesSelectionComponent { this.entities.push({label: OpenaireEntities.OTHER, value: 'other'}); } } else { - this.entities.push({label: 'All Content', value: 'all'}); + if(this.simpleView) { + this.entities.push({label: 'All Content', value: 'all'}); + } 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'}); } - if(showPage[this.simpleView ? this.properties.searchLinkToProjects : this.properties.searchLinkToAdvancedProjects] && showEntity["project"]) { this.entities.push({label: OpenaireEntities.PROJECTS, value: 'project'}); } @@ -90,28 +97,36 @@ export class EntitiesSelectionComponent { this.entities = this.entities.filter(option => option.value !== 'project' && option.value !== 'dataprovider'); } } - this.disableSelect = this.entities.length == 1; + console.log(this.entities); + this.disableSelectEmitter.emit(this.entities.length == 1); } })); - } else if ((this.customFilter && this.customFilter.queryFieldName == "community") && this.properties.adminToolsCommunity === "monitor") { - this.disableSelect = true; - } else if (this.customFilter && (this.customFilter.queryFieldName == "relfunder" || this.customFilter.queryFieldName == "funder")) { - this.disableSelect = true; - } else if (this.customFilter && this.customFilter.queryFieldName == "relorganizationid") { - this.disableSelect = true; + } else if (((this.customFilter && this.customFilter.queryFieldName == "community") && this.properties.adminToolsCommunity === "monitor") || + (this.customFilter && (this.customFilter.queryFieldName == "relfunder" || this.customFilter.queryFieldName == "funder")) || + (this.customFilter && this.customFilter.queryFieldName == "relorganizationid")) { + this.entities.push({label: OpenaireEntities.RESULTS, value: 'result'}); + this.entities.push({label: OpenaireEntities.PROJECTS, value: 'project'}); + this.entities.push({label: OpenaireEntities.ORGANIZATIONS, value: 'organization'}); + this.entities.push({label: OpenaireEntities.DATASOURCES, value: 'dataprovider'}); + this.disableSelectEmitter.emit(true); } else { if(this.onlyresults) { - this.entities.push({label: 'All ' + OpenaireEntities.RESULTS.toLowerCase(), value: 'all'}); + if(this.simpleView) { + this.entities.push({label: 'All ' + OpenaireEntities.RESULTS.toLowerCase(), value: 'all'}); + } this.entities.push({label: OpenaireEntities.PUBLICATIONS, value: 'publications'}); this.entities.push({label: OpenaireEntities.DATASETS, value: 'datasets'}); this.entities.push({label: OpenaireEntities.SOFTWARE, value: 'software'}); this.entities.push({label: OpenaireEntities.OTHER, value: 'other'}); } else { - this.entities.push({label: 'All Content', value: 'all'}); + if(this.simpleView) { + this.entities.push({label: 'All Content', value: 'all'}); + } this.entities.push({label: OpenaireEntities.RESULTS, value: 'result'}); this.entities.push({label: OpenaireEntities.PROJECTS, value: 'project'}); this.entities.push({label: OpenaireEntities.ORGANIZATIONS, value: 'organization'}); this.entities.push({label: OpenaireEntities.DATASOURCES, value: 'dataprovider'}); + this.disableSelectEmitter.emit(false); } } this.selectedEntity = this.currentEntity; @@ -128,6 +143,10 @@ export class EntitiesSelectionComponent { } } + getLabel(value: string) { + return this.entities.find(entity => entity.value === value)?.label; + } + entityChanged() { if (!this.simpleView || this.onChangeNavigate) { this.router.navigate([this.getUrl(this.simpleView)], {queryParams: this.customFilter ? this.customFilter.getParameters() : {}}); diff --git a/searchPages/searchUtils/newSearchPage.component.html b/searchPages/searchUtils/newSearchPage.component.html index f92e8b5f..2c27b8a3 100644 --- a/searchPages/searchUtils/newSearchPage.component.html +++ b/searchPages/searchUtils/newSearchPage.component.html @@ -4,8 +4,8 @@ refineFields.indexOf(customFilter.queryFieldName) == -1) ||customFilter.isHiddenFilter)"> - - {{customFilter.valueName}} + + {{customFilter.valueName}}
@@ -13,13 +13,12 @@ - - - {{type.name}} - + + {{type.name}} + - @@ -28,13 +27,12 @@ - - - {{filter.selectedFromAndToValues}} - + + {{filter.selectedFromAndToValues}} + - @@ -44,13 +42,12 @@ - - - {{value.name}} - - - + + {{value.name}} + + @@ -119,10 +116,10 @@
-
+
- -
{{placeholderInfo.label}}
+
{{placeholderInfo.label}}
+
{{getLabel(formControl.value)}}
No value selected
-
{{getLabel(formControl.value)}}
+
{{getLabel(formControl.value)}}