Skip to content

Varkopat/enhancement/629 status gating for heroes - #681

Open
Varkopat wants to merge 7 commits into
devfrom
Varkopat/enhancement/629-status-gating-for-heroes
Open

Varkopat/enhancement/629 status gating for heroes#681
Varkopat wants to merge 7 commits into
devfrom
Varkopat/enhancement/629-status-gating-for-heroes

Conversation

@Varkopat

Copy link
Copy Markdown

📄 Pull Request Overview

Closes #629

🔧 Changes Made

  1. Feature Implementation & Data Fetching
  • Hero Component Upgrades: Integrated locale-based data fetching and introduced loading states to enhance UI responsiveness and user experience.
  • API Query Filtering & Status Gating: Added status-based filtering and gating for Hero API queries and responses to ensure only authorized/valid items are returned.
  1. Testing & Code Quality
  • Added comprehensive unit/integration test coverage for status gating across Hero API queries and response structures.
  • Refactored Hero API data layer to cleanly separate status validation logic from query execution.
  1. Added heroes.status as a Select/Dropdown field in Directus. The field uses a “Status” UI similar to the provided screenshot in the issue.

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: Added new tests or updated existing ones for the changes made.
  • Documentation: Documentation has been updated (if applicable).

📝 Additional Information

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

  • Screenshots: [Include any screenshots or videos if the changes affect the UI]

The defense gallery now shows only heroes which status is defined as "published" in Directus:

Defense gallery

Status field in Directus:

Status field

@codecov-alt

codecov-alt Bot commented Sep 11, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 18.18182% with 18 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
...ation/src/widgets/SectionHeroesBlocks/ui/index.tsx 0.00% 12 Missing ⚠️
...-next-migration/src/entities/Hero/model/heroApi.ts 44.44% 5 Missing ⚠️
...on/src/entities/Hero/model/buildHeroQueryParams.ts 0.00% 1 Missing ⚠️
Files with missing lines Coverage Δ
...on/src/entities/Hero/model/buildHeroQueryParams.ts 0.00% <0.00%> (ø)
...-next-migration/src/entities/Hero/model/heroApi.ts 66.25% <44.44%> (+66.25%) ⬆️
...ation/src/widgets/SectionHeroesBlocks/ui/index.tsx 0.00% <0.00%> (ø)

... and 5 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@Varkopat Varkopat linked an issue Sep 11, 2026 that may be closed by this pull request
@patinen

patinen commented Sep 12, 2026

Copy link
Copy Markdown
Contributor

Great work! I went through the changes and everything looks to be working as expected within the issue's scope.

I did notice an existing edge case with the static hero fallback. If Directus returns no published heroes, the view falls back to the static hero data hence bypasses the status gating. This isn't really part of the original scope, so I'll create a separate follow-up issue for it rather than blocking this one.

Looks good to me, well done!

@patinen

patinen commented Sep 12, 2026

Copy link
Copy Markdown
Contributor

One minor thing: I noticed altLogoold.png is also changed in this PR. I assume it probably got carried over from an earlier merge, but just wanted to check whether that change is intentional.

This isn’t a blocker for me, since it doesn’t seem to affect the implementation here. Still, for future PRs it’s worth keeping an eye on unrelated file changes so the diff stays focused on the issue being worked on.

@Varkopat

Copy link
Copy Markdown
Author

Great work! I went through the changes and everything looks to be working as expected within the issue's scope.

I did notice an existing edge case with the static hero fallback. If Directus returns no published heroes, the view falls back to the static hero data hence bypasses the status gating. This isn't really part of the original scope, so I'll create a separate follow-up issue for it rather than blocking this one.

Looks good to me, well done!

Thank you! Just one question about the follow-up issue: Is it already possible to start working on it or is there a possibility of merge conflicts? I'm interested in continuing to work with Directus related issues.

@Varkopat

Copy link
Copy Markdown
Author

One minor thing: I noticed altLogoold.png is also changed in this PR. I assume it probably got carried over from an earlier merge, but just wanted to check whether that change is intentional.

This isn’t a blocker for me, since it doesn’t seem to affect the implementation here. Still, for future PRs it’s worth keeping an eye on unrelated file changes so the diff stays focused on the issue being worked on.

Yes, altLogoold.png got carried over from an earlier merge. It somehow has done so for a while when I create a new branch. I need to work on it to see what causes that. Tips are appreciated.

I will keep an eye on unrelated file changes in future issues 👍

@patinen

patinen commented Sep 12, 2026

Copy link
Copy Markdown
Contributor

Great work! I went through the changes and everything looks to be working as expected within the issue's scope.
I did notice an existing edge case with the static hero fallback. If Directus returns no published heroes, the view falls back to the static hero data hence bypasses the status gating. This isn't really part of the original scope, so I'll create a separate follow-up issue for it rather than blocking this one.
Looks good to me, well done!

Thank you! Just one question about the follow-up issue: Is it already possible to start working on it or is there a possibility of merge conflicts? I'm interested in continuing to work with Directus related issues.

You can start working on it already. #682

Most of the changes would be in different files although there will probably be some overlap in heroApi.ts, since the follow-up needs to distinguish an actual Directus failure from a successful empty response, but most of those changes should be in different parts of the code.

I'd recommend branching the follow-up from this branch rather than directly from dev. That should avoid most of the potential conflicts, and if this branch gets merged first, the follow-up branch can be easily rebased onto dev.

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.

Status gating for heroes

2 participants