Repository navigation
Fixes #36885: hide the domain edit on a tag of a disabled classification - #36886
Conversation
TagPage forces EditAll and EditOwners off for a disabled or deleted tag, but EditDomains, added in #33471 and read by the generic domain widget, passed through, so admins still saw Add Domain.
✅ PR checks passedThe linked issue has a description and all required Shipping project fields set. Thanks! |
🔄 Playwright impact map auto-refreshedThis PR touched specs or UI source that changed the source→spec routing map. I regenerated What is this file? It is the auto-generated half of Playwright's PR planner. It routes "if source X changes, run specs Y" by walking spec imports and cross-referencing What if I want to regenerate locally instead? Run this before pushing your next change to skip the bot commit: python3 .github/scripts/generate_playwright_impact_map.py
git add .github/playwright/impact-map.generated.json
git commit --amend --no-edit # or a separate commit |
|
| Count | Rule |
|---|---|
| 3 | react-hooks/exhaustive-deps |
All findings
| Location | Rule | Message | |
|---|---|---|---|
| 🟡 | src/pages/TagPage/TagPage.tsx:351:9 |
react-hooks/exhaustive-deps |
The 'activeTabHandler' function makes the dependencies of useCallback Hook (at line 517) change on every render. To fix this, wrap the definition of 'activeTabH |
| 🟡 | src/pages/TagPage/TagPage.tsx:746:6 |
react-hooks/exhaustive-deps |
React Hook useMemo has a missing dependency: 'fetchFeedCount'. Either include it or remove the dependency array. |
| 🟡 | src/pages/TagPage/TagPage.tsx:826:6 |
react-hooks/exhaustive-deps |
React Hook useMemo has a missing dependency: 't'. Either include it or remove the dependency array. |
Fix locally (fast - only checks files changed in this branch):
make ui-checkstyle-changed…Tags.spec Gate the prioritized EditDomains value instead of OR-ing it with EditAll, so a field-level deny still wins on an enabled tag. The spec's not.toBeVisible check passed vacuously while the lazy domain widget had not mounted; wait for the widget first.
ui-checkstyle bans getPrioritizedEditPermission in components; the hook already exposes the same prioritized value as a named flag.
🚦 Removed from the merge queue —
|
Code Review ✅ Approved 1 closed / 1 findings🔴 High risk · Changing TagPage's EditDomains gate alters permission decisions; disabled tags may lose domain-edit controls, preventing users from making needed domain updates. Hides the Add Domain control on tags of disabled classifications by gating ✅ 1 closed✅ Bug: EditDomains OR with EditAll overrides explicit domain deny on enabled tags
VerificationRules No rules evaluated Functional validation Not enabledAuto-approval Not enabledFor more verification details, comment OptionsDisplay: compact → Showing compact verification results. Comment with these commands to change the behavior for this request:
Was this helpful? React with 👍 / 👎 | Powered by Gitar — free for open source |
|



Describe your changes:
Fixes #36885
When a Classification is disabled, its tags should open read-only. On the Tag detail page the owner control was hidden, but the Add Domain button still showed for users who hold
EditDomains, admins included.Why: #33471 added the
EditDomainsoperation and switched the generic domain widget (DomainWidget→useGenericDomainLabel) fromcanEditAlltocanEditDomains(EditAll || EditDomains).TagPagehands itsGenericProvidera set of permissions that forcesEditAllandEditOwnersoff when the tag is disabled or deleted, but it didn't coverEditDomains, so the raw permission still reached the widget.What:
TagPagenow gatesEditDomainswithisEditable && canEditDomains, the prioritized flaguseEntityPermissionsalready returns. A disabled or deleted tag denies the domain edit. An enabled tag keeps its own permission, including an explicitEditDomains: falseunderEditAll: true(deny wins). This matchesClassificationDetails, which usesisEditable && flags.canEditDomains.Tags.spec.tsnow waits for the lazy domain widget before assertingadd-domainis not visible.Why the spec passed until now: the bug has existed since #33471 (Oct 16), and Tags.spec runs in most merge-queue runs, where it kept passing. The widgets on the Tag page are
React.lazy.waitForAllLoadersToDisappeardoesn't wait for their skeleton, andexpect(...).not.toBeVisible()passes as soon as the element is absent. So whenever the domain widget hadn't mounted yet atTags.spec.ts:193, the check passed without testing anything. It's a timing race, not a regression. The same code both passed and failed on Nov 2: #36858's own merge group failed, while #36695's group, built on top of #36858's commit (298565b4), passed. With the new wait, the spec now checks the real behaviour on every run.Type of change:
High-level design:
N/A — small change.
Tests:
Use cases covered
EditAll,EditOwnersandEditDomainsgets no owner or domain edit control.EditAll: true, EditDomains: falsekeeps the domain edit denied (field-level deny wins).Unit tests
src/pages/TagPage/TagPage.test.tsx. New casesdenies owner and domain edits on a disabled tag even with EditDomainsandkeeps an explicit EditDomains deny on an enabled tag with EditAllcheck the permissionsTagPagepasses toGenericProvider.{"EditAll": false, "EditDomains": true, "EditOwners": false}). With it, all 12TagPagetests pass.Backend integration tests
Ingestion integration tests
Playwright (UI) tests
playwright/e2e/Pages/Tags.spec.ts. Before the existingnot.toBeVisiblechecks (Tags.spec.ts:193), it now waits for the domain widget (KnowledgePanel.Domain) to render, so they can't pass vacuously. I haven't run it locally; the merge queue runs it.Manual testing performed
Diagnosed from the merge-queue logs on #36858 (runs 41524642539 and 41574791631). The
add-domainbutton resolved visible on the disabled tag's page in every attempt.UI screen recording:
Not applicable — permission-gating bug fix with no new UI. The behaviour is covered by the unit test above and the existing Playwright spec.
Checklist:
I have read the CONTRIBUTING document.
My PR title is
Fixes <issue-number>: <short explanation>My PR is linked to a GitHub issue via
Fixes #<issue-number>above.I have commented on my code, particularly in hard-to-understand areas.
I have added tests (unit / integration / Playwright as applicable) and listed them above.
Self-review: I reviewed the final diff against
REVIEW.mdand fixed every 🔴 finding, or answered it on the line below. Two-line gate plus one test; no findings.Decision check: no durable decision. This applies the existing disabled-aware gating to the operation Fixes 33420: authorize the target domain when an asset is reassigned #33471 added.
I have added a test that covers the exact scenario we are fixing.