[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:
Konstantina Galouni 2023-07-24 16:25:20 +03:00
parent 914e2a22bb
commit 901855daa9
4 changed files with 8 additions and 4 deletions

View File

@ -89,7 +89,7 @@ export class SearchAllComponent {
@Input() name; @Input() name;
@Input() customFilter: SearchCustomFilter = null; @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() formPlaceholderText = "Search for "+OpenaireEntities.RESULTS+", "+OpenaireEntities.PROJECTS+", "+OpenaireEntities.DATASOURCES+" & "+OpenaireEntities.ORGANIZATIONS+" in OpenAIRE";
@Input() searchForm: SearchForm = {class: 'search-form', dark: true} @Input() searchForm: SearchForm = {class: 'search-form', dark: true}
@Input() breadcrumbs: Breadcrumb[] = []; @Input() breadcrumbs: Breadcrumb[] = [];

View File

@ -169,7 +169,7 @@
<entities-selection [simpleView]="true" [currentEntity]="entityType" <entities-selection [simpleView]="true" [currentEntity]="entityType"
(selectionChange)="simpleEntityChanged($event)" (disableSelectEmitter)="disableSelectChange($event)" (selectionChange)="simpleEntityChanged($event)" (disableSelectEmitter)="disableSelectChange($event)"
[onChangeNavigate]="true" [customFilter]="customFilter" class="uk-width-2-5"></entities-selection> [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> [(value)]="selectedFields[0].value" tooltip="true"></div>
<!-- <a *ngIf="isMobile" href="#mobile-filters" filters-toggle (click)="filtersClicked.emit(true)" uk-toggle>--> <!-- <a *ngIf="isMobile" href="#mobile-filters" filters-toggle (click)="filtersClicked.emit(true)" uk-toggle>-->
<!-- <icon name="filters"></icon>--> <!-- <icon name="filters"></icon>-->

View File

@ -144,7 +144,7 @@
<ng-content select="[extra-s]"></ng-content> <ng-content select="[extra-s]"></ng-content>
</ng-container> </ng-container>
</ul> </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)" [searchInputClass]="'flat background small-vertical'" (searchEmitter)="goTo(canvas)"
class="uk-width-1-1 uk-padding-small uk-margin-medium-top"></div> class="uk-width-1-1 uk-padding-small uk-margin-medium-top"></div>
</div> </div>
@ -173,7 +173,7 @@
<ng-container *ngIf="!activeHeader.menuPosition || activeHeader.menuPosition === 'center'"> <ng-container *ngIf="!activeHeader.menuPosition || activeHeader.menuPosition === 'center'">
<ng-container *ngTemplateOutlet="mainMenu"></ng-container> <ng-container *ngTemplateOutlet="mainMenu"></ng-container>
</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()" [searchInputClass]="'flat background small-vertical'" (searchEmitter)="goTo()"
class="uk-width-large@l uk-width-medium uk-width-xlarge@xl"></div> class="uk-width-large@l uk-width-medium uk-width-xlarge@xl"></div>
</div> </div>

View File

@ -70,6 +70,7 @@ export class NavigationBarComponent implements OnInit, OnDestroy, OnChanges {
showEntity = {}; showEntity = {};
showPage = {}; showPage = {};
public searchMode: boolean = false; public searchMode: boolean = false;
public portalName: string = "";
public additionalMenuItems: MenuItem[] = []; public additionalMenuItems: MenuItem[] = [];
public featuredMenuItems: 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.config.getCommunityInformation(this.properties, this.communityId).subscribe(data => {
this.subs.push(this.config.portalAsObservable.subscribe(data => { this.subs.push(this.config.portalAsObservable.subscribe(data => {
if (data) { if (data) {
if(data.name) {
this.portalName = data.name;
}
this.showEntity = {}; this.showEntity = {};
this.showPage = {}; this.showPage = {};
if (data['entities']) { if (data['entities']) {