[Library | explore-redesign]: Bug fixes in what is executed when tabs of search all are clicked - formPlaceholderText and simpleKeywordChanged().

1. searchAll.component.ts: [Bug fix] From previous commit - Set formPlaceholderText outside if condition.
2. advancedSearchForm.component.ts: [Bug fix] In method "simpleKeywordChanged()", do not check for selectedEntity when !this.entitiesSelection (selectedEntity is changed only when exists <entities-selection>.
This commit is contained in:
Konstantina Galouni 2023-05-19 19:09:37 +03:00
parent a296f091bb
commit 412ed213fe
2 changed files with 11 additions and 6 deletions

View File

@ -303,52 +303,57 @@ export class SearchAllComponent {
public searchResults() {
this.advancedSearchLink = this.properties.searchLinkToAdvancedResults;//"/search/advanced/research-outcomes";
this.formPlaceholderText = "Search by title, author, abstract, DOI, orcid...";
if (this.reload[this.activeEntity] &&
this.fetchPublications.searchUtils.status != this.errorCodes.NONE) {
this.reload[this.activeEntity] = false;
this.linkToSearchPublications = this.properties.searchLinkToPublications;// + "?keyword=" + this.keyword;
this.formPlaceholderText = "Search by title, author, abstract, DOI, orcid...";
}
}
public searchProjects() {
this.advancedSearchLink = this.properties.searchLinkToAdvancedProjects;//"/search/advanced/projects";
this.formPlaceholderText = "Search by title, acronym, project code...";
if (this.reload[this.activeEntity] &&
this.fetchProjects.searchUtils.status != this.errorCodes.NONE ) {
this.reload[this.activeEntity] = false;
this.linkToSearchProjects = this.properties.searchLinkToProjects;// + "?keyword=" + this.keyword;
this.formPlaceholderText = "Search by title, acronym, project code...";
}
}
public searchDataProviders() {
this.advancedSearchLink = this.properties.searchLinkToAdvancedDataProviders;//"/search/advanced/dataproviders";
this.formPlaceholderText = "Search by name, description, subject...";
if ( this.reload[this.activeEntity] &&
this.fetchDataproviders.searchUtils.status != this.errorCodes.NONE) {
this.reload[this.activeEntity] = false;
this.linkToSearchDataproviders = this.properties.searchLinkToDataProviders;// + "?keyword=" + this.keyword;
this.formPlaceholderText = "Search by name, description, subject...";
}
}
public searchServices() {
this.advancedSearchLink = this.properties.searchLinkToAdvancedServices;//"/search/advanced/services";
this.formPlaceholderText = "Search by name, description, subject...";
if ( this.reload[this.activeEntity] &&
this.fetchServices.searchUtils.status != this.errorCodes.NONE) {
this.reload[this.activeEntity] = false;
this.linkToSearchDataproviders = this.properties.searchLinkToServices;// + "?keyword=" + this.keyword;
this.formPlaceholderText = "Search by name, description, subject...";
}
}
public searchOrganizations() {
this.advancedSearchLink = this.properties.searchLinkToAdvancedOrganizations;//"/search/advanced/organizations";
this.formPlaceholderText = "Search by organization name...";
if (this.reload[this.activeEntity] &&
this.fetchOrganizations.searchUtils.status != this.errorCodes.NONE) {
this.reload[this.activeEntity] = false;
this.linkToSearchOrganizations = this.properties.searchLinkToOrganizations;// + "?keyword=" + this.keyword;
this.formPlaceholderText = "Search by organization name...";
}
}
private prepareKeywordParam(keyword){

View File

@ -116,7 +116,7 @@ export class AdvancedSearchFormComponent implements OnInit, OnDestroy, OnChanges
simpleKeywordChanged() {
// this.selectedFields[0].value = $event.value;
if (this.selectedEntity == this.entityType) {
if ((this.selectedEntity == this.entityType) || !this.entitiesSelection) {
this.queryChanged();
} else {
this.router.navigate([this.selectedEntitySimpleUrl], {queryParams: {q: this.selectedFields[0].value, op: "and"}});