Code commenting

This commit is contained in:
Porras-Bernardez 2024-09-16 12:57:26 +02:00
commit 8e3f4fa88e
4 changed files with 161 additions and 240 deletions

View file

@ -61,16 +61,14 @@ export default class SearchViewComponent extends Vue {
// };
private open: OpenSettings = {
core: OPEN_CORE, //"rdr_data", // SOLR.core;
host: OPEN_HOST, //"tethys.at",
core: OPEN_CORE,
host: OPEN_HOST, //"https://catalog.geosphere.at",
};
private error = "";
// Computed property to get search term as string
get stringSearchTerm(): string {
// console.log("stringSearchTerm:", this.searchTerm);
get stringSearchTerm(): string {
if (typeof this.searchTerm === "string") {
return this.searchTerm;
} else if (this.searchTerm instanceof Suggestion) {
@ -109,9 +107,6 @@ export default class SearchViewComponent extends Vue {
return false;
}
}
// getKeyName(value: string) {
// return Object.entries(Suggestion).find(([key, val]) => val === value)?.[0];
// }
// Method to get enum key by enum value
getEnumKeyByEnumValue<T extends { [index: string]: string }>(myEnum: T, enumValue: string): keyof T | null {
@ -122,9 +117,6 @@ export default class SearchViewComponent extends Vue {
// Lifecycle hook: executed before the component is mounted
beforeMount(): void {
// console.log("beforeMount!");
// this.rdrAPI = new DatasetService();
// Trigger search based on provided display and type props
if (this.display != "" && this.type != undefined) {
const enumKey: "Title" | "Author" | "Subject" | "Doctype" | null = this.getEnumKeyByEnumValue(SearchType, this.type);