Skip to content

Directus Data Reorganization for Team Page#620

Merged
Rutjake merged 5 commits intodevfrom
juho/enhancement/586-directus-data-reorganization-for-team-page
Apr 2, 2026
Merged

Directus Data Reorganization for Team Page#620
Rutjake merged 5 commits intodevfrom
juho/enhancement/586-directus-data-reorganization-for-team-page

Conversation

@patinen
Copy link
Copy Markdown
Contributor

@patinen patinen commented Jan 29, 2026

📄 Pull Request Overview

Closes #586

🔧 Changes Made

  1. Migrated API calls to V2 collections (members_v2, teams_v2, departments_v2)
  2. Refactored to roles-based structure: Members now have roles[] array containing team/department info instead of direct fields
  3. Fixed translation field names (name instead of team/department) and updated TypeScript types
  4. Refactored organizeMembers to reduce complexity and fix linter errors

Checklist Before Submission

  • Functionality: I have tested my code, and it works as expected.
  • JSDoc: I have added or updated JSDoc comments for all relevant code.
  • Debugging: No console.log() or other debugging statements are left.
  • Clean Code: Removed commented-out or unnecessary code.
  • Tests: May need updates for new structure
  • Documentation: Updated

📝 Additional Information

Provide any additional context or information that reviewers may need to know:

  • Members can now have multiple roles and appear in multiple teams/departments
  • Breaking change: Member interface now uses roles[] instead of direct team/department fields

Copy link
Copy Markdown
Member

@Skoivumaki Skoivumaki left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A simple "credits" page is starting to get quite complex. I find using JS native let variable odd in a TS Next enviroment, but from what I found. Using it in loops and similar, is acceptable or even preferred over constants. (Unless the entire logic was originally built around them const, which probably wouldnt be as readable...)
Anyway, good work as always👍

@patinen
Copy link
Copy Markdown
Contributor Author

patinen commented Jan 30, 2026

Just to clarify, this PR is about the API migration to membersPagev2 in Directus, a refactor to a roles-based structure to avoid duplicated members and make the model easier to work with.

About the lets: const is still the default (especially in UI-related TSX), but in the API/mappers and translation helpers some values are resolved step by step (find -> fallback -> create), so let reads clearer than forcing everything into const chains.

@Rutjake
Copy link
Copy Markdown
Contributor

Rutjake commented Feb 2, 2026

The Directus implementation is now very clear and much easier to maintain. The code works well and looks solid!
After discussing with the author, we’ve decided to move this PR to Draft until the UX team finishes the new designs. Great work!

@Rutjake Rutjake marked this pull request as draft February 2, 2026 17:26
patinen and others added 2 commits April 2, 2026 13:47
Not sure why I had this changed in the first place, must've been from some previous fiddling with the news' image size issues
@patinen
Copy link
Copy Markdown
Contributor Author

patinen commented Apr 2, 2026

Update: added "order" field (integer) to Directus' TeamsV2 collection and implemented a sorting feature to mappers.ts so that the teams are displayed in correct order on the teams page.

Ready to merge.

@patinen patinen marked this pull request as ready for review April 2, 2026 11:08
Copy link
Copy Markdown
Contributor

@Rutjake Rutjake left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Impressive work!

@Rutjake Rutjake merged commit 05f227a into dev Apr 2, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants