Commit graph

97 commits

Author SHA1 Message Date
486bf9cbad feat(typeahead): update structure and enhance Typeahead integration and logging:
- Bloodhound Initialization:
  - Changed the suggestion object structure to a flattened format for Typeahead compatibility.
  - Removed nested `display` structure in favor of direct `displayLabel` and `displayDescription` fields.
  - Simplified the construction of suggestion objects by directly setting flattened fields.

- Typeahead Initialization:
  - Enhanced logging in the JavaScript initialization script for better debugging.
  - Updated the `display` function in Typeahead to use flattened fields (`displayLabel` and `displayDescription`) instead of nested `display` objects.
  - Improved error handling and logging for cases where suggestions are not arrays or are empty.

- Selection Handling:
  - Added detailed logging for selected suggestions in both Rust and JavaScript.
  - Ensured the input field is updated with the selected suggestion's label.

- Code Cleanup:
  - Removed redundant nested object creation for `display` fields in Bloodhound initialization.
  - Streamlined the JavaScript initialization script for better readability and maintainability.
  - Consolidated logging statements for consistent debugging output.
2025-04-14 17:42:04 +03:00
102f69fd29 fix(debug): remove buggy typeahead debug check 2025-04-11 16:16:16 +03:00
f646b92d3a feat(typeahead): enhance TypeaheadInput component for improved functionality
- Improved Bloodhound initialization:
  - Added nested display structure for suggestions (label and description).
  - Included a response filter to handle empty responses gracefully.
  - Added rate-limiting and wildcard support for remote queries.
- Enhanced Typeahead initialization:
  - Added custom templates for rendering suggestions with nested display fields.
  - Included debug logs for better traceability of Typeahead and Bloodhound instances.
  - Improved error handling for deserialization of suggestions.
- Added support for opening the dropdown on receiving suggestions.
- Updated input event handler to include additional debug checks for Typeahead instance.
- Ensured proper cleanup and memory management for closures and global handlers.
- Added custom CSS styles for `.typeahead` input and suggestion dropdown to enhance UI/UX.
2025-04-11 15:34:19 +03:00
07405db017 feat(typeahead): Enhance Bloodhound and Typeahead initialization logic
- Improved Bloodhound initialization by adding explicit global storage for the instance.
- Enhanced `initialize_bloodhound` to include proper rate limiting, wildcard configuration, and tokenizer setup.
- Refactored `initialize_typeahead` to include a more robust dataset configuration with templates for rendering suggestions.
- Fixed DOM element access in the `on:input` handler to ensure proper interaction with the input element.
- Simplified the `remote_fn` logic in `initialize_bloodhound` for fetching and syncing suggestions.
- Added error handling and logging for better debugging during Typeahead initialization.
- Ensured closures are properly registered in the global scope to handle Typeahead events.
- Updated the JavaScript initialization script to use bracket notation for safer handler invocation.
- Removed the additional inclusion of `corejs-typeahead` script from the `<head>` section.
2025-04-08 17:55:46 +03:00
5ca277ee80 feat(typeahead): Improve typeahead initialization and event handling 2025-04-08 02:30:58 +03:00
d6661c2ac9 feat(typeahead): use typeahead for name input field 2025-04-04 18:47:12 +03:00
4de14bb48b feat(input): update name input field to search for wiki suggestions without search wiki button 2025-04-02 22:07:24 +03:00
303b713d59 fix(properties): fetch prop values alongside prop ids and labels 2025-04-01 14:43:36 +03:00
8c7946091f fix(labels): display correct labels in dropdown and when properties are added 2025-03-31 23:50:35 +03:00
9d21d9999f fix(labels): add set_is_fetching_labels signal to fetch_item_properties label to fix error 2025-03-31 18:07:36 +03:00
40bb35d6a8 feat(labels): add state to track when labels are being fetched(in progress) 2025-03-31 17:36:46 +03:00
ef7245b716 fix(labels): add property cache and refactor fetch_item_properties function to use it 2025-03-27 15:31:58 +03:00
5c3070bfc0 fix(labels): update set_property_labels signal in fetch_item_properties function to avoid repetitive label fetches 2025-03-26 14:48:58 +03:00
ebb1afd1af fix(properties): show property labels in custom property autocomplete dropdown 2025-03-25 15:51:49 +03:00
3126d90f5a fix(auto search): retrace my steps to resolve ownership errors 2025-03-18 23:47:47 +03:00
85dce655e4 feat(auto-search): remove search button and have autosearch while typing 2025-03-17 22:41:23 +03:00
5a14111db7 fix(properties): correct property saving and fetching 2025-02-26 02:18:32 +03:00
7e288b3a82 fix(url): fix url routing 2025-02-25 19:59:52 +03:00
a47d6b2e3a fix(db): fix property and item deletion 2025-02-25 16:47:58 +03:00
c9b24faad7 fix(404 error): enhance the logging in the item loading process to diagnose the 404 error 2025-02-24 17:42:07 +03:00
de14061b9a fix(item saving): fix Item Saving Error (400 Bad Request) 2025-02-24 10:27:40 +03:00
fd39e3b967 feat(url): update api calls in items_list.rs 2025-02-22 02:27:34 +03:00
585a4a6eb7 fix(debug): add logging to solve db saving issues 2025-02-21 15:11:11 +03:00
e90a6be010 feat (items_list.rs): simplify deserialization and remove unnecessary conversions 2025-02-20 16:26:43 +03:00
63aaa57fa1 refactor(imports): remove unused imports 2025-02-20 15:57:02 +03:00
a35d4d557d feat(ssr): added get_current_url function for SSR support 2025-02-20 15:38:43 +03:00
af1e6d949f feat(item_list): remove JSON deserialization of custom properties in items loader 2025-02-19 22:11:13 +03:00
5815c9fe10 feat(item_list): make DbItem struct public. 2025-02-18 23:44:45 +03:00
9beb997125 feat(item_list): update save_item_to_db function to take current_url as an argument.
Changes:

* Replaced `let current_url = get_current_url();` with `let current_url = Rc::new(get_current_url());` to share the current URL between closures.
* Wrapped `add_property` and `update_item` functions in Arc to share them between closures.
* Updated `save_item_to_db` function to take `current_url` as an argument and use it to construct the ItemToSend struct.
* Updated `fetch_property_labels` function to use the `property_ids` vector instead of a single property ID.
* Updated `fetch_item_properties` function to use the `wikidata_id` parameter instead of a hardcoded value.
* Updated `WikidataResponse` struct to use a `Vec<WikidataSuggestion>` instead of a single `WikidataSuggestion`.
2025-02-18 20:01:45 +03:00
63f11f6a2d feat(db): move function to lead items from db outside the items list component. 2025-02-17 20:19:54 +03:00
fddec7f728 feat(url): edit items list component to include current URL in database query 2025-02-13 23:06:26 +03:00
e72ed778a2 feat(item): remove reviews from item struct. 2025-02-12 15:56:11 +03:00
443c7a7e0c build(files): remove unused item_form.rs and wikidata_lookup.rs files 2025-02-06 22:19:42 +03:00
4bfd47d8c4 feat(item_list): normalize property labels to display the right labels on the item list 2025-02-04 14:29:11 +03:00
94ed4c46b9 feat(item_list): succesfully fetch property labels using SPARQL 2025-02-03 19:48:50 +03:00
25b3128181 feat(item_list): use sparql to fetch properties 2025-02-03 14:58:56 +03:00
23cd674e31 feat(item_list): implement querying using GRAPHQL 2025-02-01 05:28:36 +03:00
af921088f9 feat(wikidata): enhance property value parsing and improve time handling
- Refactor `fetch_item_properties` to handle nested JSON types efficiently
- Introduce `parse_property_value` for structured processing of various value types
  - Handle time values with varying precision (year, month, day)
  - Parse and format dates from RFC 3339 format
  - Support fetching and displaying labels for Wikidata entity references
- Replace raw JSON object handling with cleaner structured parsing
- Update property label fetching and signal updates for better UI data synchronization
2025-01-30 14:59:55 +03:00
a40e9c98c4 feat(Item_list): auto-add property on dropdown selection
-No need for an "Add Property" button
2025-01-29 19:42:53 +03:00
2d072f3303 feat(item_list): move delete buttons next to item name 2025-01-29 16:07:10 +03:00
792b4daf04 feat(item_list): put item names into the header 2025-01-29 15:51:11 +03:00
e0c49ffa86 build(merge): merge branch 'db' into main 2025-01-29 15:30:35 +03:00
1318319ad1 fix(properties): reflect added properties in real time in the ui 2025-01-28 23:45:27 +03:00
ac8eb8118d fix(item_list):initialize with one empty item if the database is empty 2025-01-28 20:44:52 +03:00
68b458df5e feat(db): enable user to delete items and properties from the database. 2025-01-28 14:36:17 +03:00
afa3bd3ece feat(Item_list): update ItemsList component to include delete button for property input fields 2025-01-28 02:43:07 +03:00
c38f19d76c feat(labels): persist property labels on refresh. 2025-01-27 16:48:28 +03:00
3fa56abc83 feat(db): persist custom properties from db 2025-01-27 16:34:25 +03:00
e0e5fc49c2 feat(db): load items from database on startup.
-successfully loading names and description
2025-01-24 15:10:25 +03:00
c1207f613d feat(db): add selected properties state and update save_item_to_db function to include selected properties 2025-01-24 02:23:24 +03:00