-
Notifications
You must be signed in to change notification settings - Fork 2
juho/enhancement/548-move-hardcoded-heroes-to-directus-CMS-and-implement-endpoints #578
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?
Conversation
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.
a7e8761 to
b7a59a9
Compare
|
Setting this back to draft. The /defense-gallery page and the hero category pages are still fetching their data directly from code instead of the CMS. I originally thought of it as a separate task, but since the API is already working and I'm familiar with the configuration and endpoints, it makes more sense to handle it within this same PR rather than opening a new issue just to patch it afterwards. |
translate stray finnish note # Conflicts: # frontend-next-migration/src/entities/Hero/model/initializeHeroGroups.ts
… API - Initialize hero data from Directus before attempting to fetch from static data. - Implement fallback mechanism for hero retrieval, ensuring a seamless experience. - Enhance navigation logic for previous and next heroes using Directus data. - Update SingleHeroPage component to handle new hero data structure and fetching logic.
…ation - Moved the groupHeroesByGroup function from heroApi.ts to a separate module for better modularity. - This change enhances readability and maintainability of the heroApi.ts file.
b7a59a9 to
5143494
Compare
|
Status update: Hero data fetching has been migrated to a CMS-first model using Directus, with fallbacks to existing static data. This update also adds fetching to DefenseGalleryPage and SingleDefensePage with error handling to keep the UI stable if CMS data is missing or unavailable. Directus is not yet populated with hero data, so this PR is not ready to be merged. Next step is to populate hero content in Directus before merge. |




📄 Pull Request Overview
Closes #548
🔧 Changes Made
src/entities/Hero/model/heroApi.tswith normalized local filteringuseGetHeroBySlugQuery) and SSR (fetchHeroBySlug)translations.languages_code{ src, width, height })statsO2M relation, sorted byorder✅ Checklist Before Submission
console.log()or other debugging statements are left.📝 Additional Information
How to verify
directus raw check:
https://strapi.altzone.fi/items/heroes?filter[slug][_eq]=researcher&limit=1&fields=slug,id,stats.*Screenshots: [Include any screenshots or videos if the changes affect the UI]
Dependencies: [Mention any new dependencies or breaking changes]
Known Issues: [List any known issues or limitations]
Dependencies
Known Issues / Notes
languages_codein CMS deviates fromfi|en|ru, localization selection will fall back to the first translation.width/height = 1if Directus lacks metadata (UI can still render; consider enriching later).