refactor: replace genre with tags in frontend TypeScript
- Add fetchTagValues() function in bookshelf.ts - Update custom-section-builder field id from "genre" to "tags" - Genre code preserved as comments for easy restoration if needed - collection-rules.ts already supports both genre and tags Updates the frontend TypeScript to use tags instead of genre for filtering. Genre code is preserved in comments for future use if the genre field is populated. Relates to IMPLEMENTATION_TAGS_FILTER.md Phase 4
This commit is contained in:
@@ -294,11 +294,16 @@ Alpine.data("bookshelf", () => ({
|
|||||||
await this.fetchFieldValues("author", input.value, "author-datalist");
|
await this.fetchFieldValues("author", input.value, "author-datalist");
|
||||||
},
|
},
|
||||||
|
|
||||||
// Fetch genre values for autocomplete
|
// Fetch tag values for autocomplete
|
||||||
async fetchGenreValues(input: HTMLInputElement): Promise<void> {
|
async fetchTagValues(input: HTMLInputElement): Promise<void> {
|
||||||
await this.fetchFieldValues("genre", input.value, "genre-datalist");
|
await this.fetchFieldValues("tags", input.value, "tags-datalist");
|
||||||
},
|
},
|
||||||
|
|
||||||
|
// // Fetch genre values for autocomplete
|
||||||
|
// async fetchGenreValues(input: HTMLInputElement): Promise<void> {
|
||||||
|
// await this.fetchFieldValues("genre", input.value, "genre-datalist");
|
||||||
|
// },
|
||||||
|
|
||||||
// Fetch series values for autocomplete
|
// Fetch series values for autocomplete
|
||||||
async fetchSeriesValues(input: HTMLInputElement): Promise<void> {
|
async fetchSeriesValues(input: HTMLInputElement): Promise<void> {
|
||||||
await this.fetchFieldValues("series", input.value, "series-datalist");
|
await this.fetchFieldValues("series", input.value, "series-datalist");
|
||||||
|
|||||||
@@ -45,9 +45,32 @@ const FILTER_FIELDS: FilterField[] = [
|
|||||||
],
|
],
|
||||||
valueType: "text",
|
valueType: "text",
|
||||||
},
|
},
|
||||||
|
// {
|
||||||
|
// id: "genre",
|
||||||
|
// label: "Genre",
|
||||||
|
// operators: [
|
||||||
|
// { id: "equals", label: "Equals", requiresValue: true },
|
||||||
|
// { id: "not_equals", label: "Not Equals", requiresValue: true },
|
||||||
|
// { id: "in", label: "In", requiresValue: true },
|
||||||
|
// { id: "not_in", label: "Not In", requiresValue: true },
|
||||||
|
// ],
|
||||||
|
// valueType: "select",
|
||||||
|
// options: [
|
||||||
|
// "Fiction",
|
||||||
|
// "Non-Fiction",
|
||||||
|
// "Sci-Fi",
|
||||||
|
// "Fantasy",
|
||||||
|
// "Mystery",
|
||||||
|
// "Romance",
|
||||||
|
// "Thriller",
|
||||||
|
// "Biography",
|
||||||
|
// "History",
|
||||||
|
// "Self-Help",
|
||||||
|
// ],
|
||||||
|
// },
|
||||||
{
|
{
|
||||||
id: "genre",
|
id: "tags",
|
||||||
label: "Genre",
|
label: "Tags",
|
||||||
operators: [
|
operators: [
|
||||||
{ id: "equals", label: "Equals", requiresValue: true },
|
{ id: "equals", label: "Equals", requiresValue: true },
|
||||||
{ id: "not_equals", label: "Not Equals", requiresValue: true },
|
{ id: "not_equals", label: "Not Equals", requiresValue: true },
|
||||||
|
|||||||
Reference in New Issue
Block a user