[Library | develop]: In search bars, set in placeholder the portal name according to the configuration name.
1. home.component & navigationBar.component: Get portalName by config.portalAsObservable>name and set placeholder to "Search "+portalName. 2. searchAll.component.ts: Set default value of "formPlaceholderText" to "Search". 3. advancedSearchForm.component.html: Set placeholder of input (when there is also the <entities-selection>) to [placeholder]="formPlaceholderText".
This commit is contained in:
parent
914e2a22bb
commit
901855daa9
|
@ -89,7 +89,7 @@ export class SearchAllComponent {
|
|||
@Input() name;
|
||||
@Input() customFilter: SearchCustomFilter = null;
|
||||
|
||||
@Input() formPlaceholderText = "Search in Explore"
|
||||
@Input() formPlaceholderText = "Search"
|
||||
// @Input() formPlaceholderText = "Search for "+OpenaireEntities.RESULTS+", "+OpenaireEntities.PROJECTS+", "+OpenaireEntities.DATASOURCES+" & "+OpenaireEntities.ORGANIZATIONS+" in OpenAIRE";
|
||||
@Input() searchForm: SearchForm = {class: 'search-form', dark: true}
|
||||
@Input() breadcrumbs: Breadcrumb[] = [];
|
||||
|
|
|
@ -169,7 +169,7 @@
|
|||
<entities-selection [simpleView]="true" [currentEntity]="entityType"
|
||||
(selectionChange)="simpleEntityChanged($event)" (disableSelectEmitter)="disableSelectChange($event)"
|
||||
[onChangeNavigate]="true" [customFilter]="customFilter" class="uk-width-2-5"></entities-selection>
|
||||
<div class="uk-width-expand" input placeholder="Search in Explore" [searchable]="true" [hint]="formPlaceholderText"
|
||||
<div class="uk-width-expand" input [placeholder]="formPlaceholderText" [searchable]="true" [hint]="formPlaceholderText"
|
||||
[(value)]="selectedFields[0].value" tooltip="true"></div>
|
||||
<!-- <a *ngIf="isMobile" href="#mobile-filters" filters-toggle (click)="filtersClicked.emit(true)" uk-toggle>-->
|
||||
<!-- <icon name="filters"></icon>-->
|
||||
|
|
|
@ -144,7 +144,7 @@
|
|||
<ng-content select="[extra-s]"></ng-content>
|
||||
</ng-container>
|
||||
</ul>
|
||||
<div *ngIf="hasSearchBar" search-input [(value)]="keyword" placeholder="Search"
|
||||
<div *ngIf="hasSearchBar" search-input [(value)]="keyword" [placeholder]="'Search'+(portalName ? (' in '+portalName) : '')"
|
||||
[searchInputClass]="'flat background small-vertical'" (searchEmitter)="goTo(canvas)"
|
||||
class="uk-width-1-1 uk-padding-small uk-margin-medium-top"></div>
|
||||
</div>
|
||||
|
@ -173,7 +173,7 @@
|
|||
<ng-container *ngIf="!activeHeader.menuPosition || activeHeader.menuPosition === 'center'">
|
||||
<ng-container *ngTemplateOutlet="mainMenu"></ng-container>
|
||||
</ng-container>
|
||||
<div *ngIf="searchMode" #search_input search-input [(value)]="keyword" placeholder="Search"
|
||||
<div *ngIf="searchMode" #search_input search-input [(value)]="keyword" [placeholder]="'Search'+(portalName ? (' in '+portalName) : '')"
|
||||
[searchInputClass]="'flat background small-vertical'" (searchEmitter)="goTo()"
|
||||
class="uk-width-large@l uk-width-medium uk-width-xlarge@xl"></div>
|
||||
</div>
|
||||
|
|
|
@ -70,6 +70,7 @@ export class NavigationBarComponent implements OnInit, OnDestroy, OnChanges {
|
|||
showEntity = {};
|
||||
showPage = {};
|
||||
public searchMode: boolean = false;
|
||||
public portalName: string = "";
|
||||
|
||||
public additionalMenuItems: MenuItem[] = [];
|
||||
public featuredMenuItems: MenuItem[] = [];
|
||||
|
@ -136,6 +137,9 @@ export class NavigationBarComponent implements OnInit, OnDestroy, OnChanges {
|
|||
//this.config.getCommunityInformation(this.properties, this.communityId).subscribe(data => {
|
||||
this.subs.push(this.config.portalAsObservable.subscribe(data => {
|
||||
if (data) {
|
||||
if(data.name) {
|
||||
this.portalName = data.name;
|
||||
}
|
||||
this.showEntity = {};
|
||||
this.showPage = {};
|
||||
if (data['entities']) {
|
||||
|
|
Loading…
Reference in New Issue