- Pagination arrow color fixed according to page

- Data type showed in suggestions corrected according to user-friendly values
This commit is contained in:
Porras-Bernardez 2024-09-03 12:53:02 +02:00
parent 7953b3c09c
commit 826c5b8c4e
5 changed files with 46 additions and 7 deletions

View file

@ -74,12 +74,31 @@ export default class SearchViewComponent extends Vue {
if (typeof this.searchTerm === "string") {
return this.searchTerm;
} else if (this.searchTerm instanceof Suggestion) {
return this.searchTerm.value + " (" + this.searchTerm.type + ")";
return this.searchTerm.value + " (" + this.getTypeAlias(this.searchTerm.type) + ")";
// return this.searchTerm.value + " (" + this.searchTerm.type + ")";
} else {
return "";
}
}
/**
* The alias for the search term type will be set depending on the name of the type.
* This will allow to display the customised terms instead of the values currently used in the OpenSearch index.
* TODO: This should be corrected directly in the index
*/
getTypeAlias(type: string): string {
switch (type) {
case "author":
return "creator";
case "subjects":
return "keyword";
case "doctype":
return "data type";
default:
return type;
}
}
// Method to check if a search term is present
hasSearchTerm(): boolean {
if (typeof this.searchTerm === "string" && this.searchTerm !== "") {