-
Notifications
You must be signed in to change notification settings - Fork 2
Nikolas/feature/603 implement directus to gallery page #610
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: dev
Are you sure you want to change the base?
Nikolas/feature/603 implement directus to gallery page #610
Conversation
Rutjake
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good Work!
I suggest optimizing the search to prevent unnecessary backend load. By implementing a simple Debounce using e.g. useEffect and setTimeout, we ensure that the API request is only fired after the user has stopped typing for a brief moment (e.g., 500ms). This significantly reduces the number of requests sent to Directus while typing."
Something has happened to the size of the SectionGallery block:

it should remain the same as what was done to the frontend before:

|
@Rutjake I checked the current implementation and, as far as I can see, the search only performs client-side filtering on already fetched data. It doesn’t trigger additional Directus requests while typing. |
Skoivumaki
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Everything good 👍
This seems correct. However the idea is a must if Directus were to have hundreds of images and would have to be optimized by limiting query size. For now, I don't find this issue severe enough for it to require further optimization. |
📄 Pull Request Overview
Closes #603
This PR implements dynamic Gallery data fetching from Directus CMS.
🔧 Changes Made
photo_object,photo_version, andcategorydata from Directus using existing API infrastructure.translations,category.translations,preview/full.translations).title,author, anddescriptiononphoto_object.getLanguageCodeand centralized translation helpers.useGetDirectusGalleryImages, following existing project conventions for Directus relations.✅ Checklist Before Submission
console.log()or other debugging statements are left.📝 Additional Information
Provide any additional context or information that reviewers may need to know: