feat(platform): hide subscription banners for non-admin users#3145
feat(platform): hide subscription banners for non-admin users#3145ffirg wants to merge 2 commits intoansible:develfrom
Conversation
JIRA: AAPRFE-2823 https://issues.redhat.com/browse/AAPRFE-2823 Non-admin users cannot act on subscription compliance issues, so displaying the banner to them causes confusion and unnecessary support burden. This change hides all subscription-related banners (compliance, grace period, expiry warnings) for non-superuser accounts. - Add is_superuser check to subscriptionBanner useMemo - Add 3 new test cases covering admin/non-admin scenarios - All existing tests continue to pass (default mock is superuser) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
|
/run-playwright |
marshmalien
left a comment
There was a problem hiding this comment.
Pulled down locally and it looked good. Before we merge, since this is our upstream repo, could we remove all references to internal jira tickets:
- PR title and description
- Code comments in
PlatformApp.tsx - Test names/comments in
PlatformApp.test.tsx
Remove AAPRFE-2823 references from comments and test names per reviewer feedback - upstream repo should not contain internal tracker links. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
CI Failure AnalysisThe Vitest (framework) failure is unrelated to this PR's changes. It's a pre-existing flaky test in the This is an async cleanup issue where React tries to update state after the test environment is torn down. This PR only modifies files in Vitest (platform) passed all tests including the 3 new tests for this feature. Could you please re-run the failed check? These types of race conditions often pass on retry. Re: SonarQube failure — this is expected for fork PRs (no access to repo secrets). Happy to discuss alternatives if needed. |
|
Closing in favor of #3148 (pushed directly to repo to enable SonarQube checks) |
Summary
Hide the "out of compliance" banner for non-admin users.
Non-admin users cannot act on subscription compliance issues, so displaying the banner to them:
This change hides all subscription-related banners (compliance, grace period, expiry warnings) for non-superuser accounts.
Risk Analysis - REQUIRED
Justification:
usePlatformActiveUserhook (already in use elsewhere)Changes Made
platform/main/PlatformApp.tsx: Addis_superusercheck tosubscriptionBanneruseMemoplatform/main/PlatformApp.test.tsx: Add 3 new test cases covering admin/non-admin scenariosImplementation Details
Uses existing pattern from
SubscriptionDetails.tsx:Test Plan
Manual Testing Steps
Screenshots
N/A - Banner visibility change only
🤖 Generated with Claude Code