diff --git a/searchPages/searchUtils/advancedSearchForm.component.html b/searchPages/searchUtils/advancedSearchForm.component.html index 8ef7c5a1..1a2e27ef 100644 --- a/searchPages/searchUtils/advancedSearchForm.component.html +++ b/searchPages/searchUtils/advancedSearchForm.component.html @@ -25,7 +25,7 @@
-
includes
diff --git a/searchPages/searchUtils/searchSorting.component.ts b/searchPages/searchUtils/searchSorting.component.ts index 042ec10f..f70ac1cf 100644 --- a/searchPages/searchUtils/searchSorting.component.ts +++ b/searchPages/searchUtils/searchSorting.component.ts @@ -1,45 +1,55 @@ import {Component, Input, Output, EventEmitter} from '@angular/core'; +import {Option} from "../../sharedComponents/input/input.component"; @Component({ - selector: 'search-sorting', - template: ` -
-
- -
-
- ` + selector: 'search-sorting', + template: ` +
+
+
+ ` }) export class SearchSortingComponent { - @Input() isDisabled: boolean = false; - @Input() sortBy: string = ''; - @Input() entityType: string = ''; - @Output() sortByChange = new EventEmitter(); - public optionsA = [ - {value: '', label: 'Relevance'}, - {value: 'resultdateofacceptance,descending', label: 'Date (most recent)'}, - {value: 'resultdateofacceptance,ascending', label: 'Date (least recent)'}, - ]; - public optionsB = [ - {value: '', label: 'Title'}, - {value: 'creationdate,descending', label: 'Creation Date (most recent)'}, - {value: 'creationdate,ascending', label: 'Creation Date (least recent)'}, - ]; - - - constructor () {} - - ngOnInit() {} - - - sortByChanged() { - this.sortByChange.emit(this.sortBy); + @Input() isDisabled: boolean = false; + @Input() sortBy: string = ''; + @Input() entityType: string = ''; + @Output() sortByChange = new EventEmitter(); + public options: Option[]; + private generalOptions = [ + {value: '', label: 'Relevance'}, + {value: 'resultdateofacceptance,descending', label: 'Date (most recent)'}, + {value: 'resultdateofacceptance,ascending', label: 'Date (least recent)'}, + ]; + private communityOptions = [ + {value: '', label: 'Title'}, + {value: 'creationdate,descending', label: 'Creation Date (most recent)'}, + {value: 'creationdate,ascending', label: 'Creation Date (least recent)'}, + ]; + private stakeholderOptions = [ + {value: '', label: 'Name'}, + {value: 'creationdate,descending', label: 'Creation Date (most recent)'}, + {value: 'creationdate,ascending', label: 'Creation Date (least recent)'}, + ]; + + constructor() { + } + + ngOnInit() { + if (this.entityType === 'community') { + this.options = this.communityOptions; + } else if (this.entityType === 'stakeholder') { + this.options = this.stakeholderOptions; + } else { + this.options = this.generalOptions; } + } + + + sortByChanged() { + this.sortByChange.emit(this.sortBy); + } } diff --git a/sharedComponents/input/input.component.ts b/sharedComponents/input/input.component.ts index b2eec667..27646fdc 100644 --- a/sharedComponents/input/input.component.ts +++ b/sharedComponents/input/input.component.ts @@ -57,7 +57,7 @@ declare var UIkit;
+ [attr.uk-tooltip]="(tooltip && !focused && type !== 'chips' && type !== 'textarea')?('title: ' + getLabel(formControl.value) + '; delay: 500; pos: bottom-left'):null"> @@ -194,13 +194,13 @@ export class InputComponent implements OnInit, OnDestroy, AfterViewInit, OnChang @Input() value: any | any[]; @Output() valueChange = new EventEmitter(); @Input() hint: string; + @Input() tooltip: boolean = false; /** Text */ @ViewChild('input') input: ElementRef; /** Textarea options */ @ViewChild('textArea') textArea: ElementRef; @Input('rows') rows: number = 3; /** Select | Autocomplete | chips available options */ - @Input() tooltip: boolean = false; @Input() selectArrow: string = 'arrow_drop_down'; @Input() selectedIndex: number = 0; @Input() selectable: boolean = false; @@ -263,6 +263,7 @@ export class InputComponent implements OnInit, OnDestroy, AfterViewInit, OnChang this.icon = this.selectArrow; } this.selectable = true; + this.tooltip = true; } }