Skip to content

[fix] Remove unreachable error-modal scaffolding from YAML-only policy pages#448

Open
WasThatRudy wants to merge 1 commit into
Kuadrant:mainfrom
WasThatRudy:fix/remove-dead-modal-scaffolding
Open

[fix] Remove unreachable error-modal scaffolding from YAML-only policy pages#448
WasThatRudy wants to merge 1 commit into
Kuadrant:mainfrom
WasThatRudy:fix/remove-dead-modal-scaffolding

Conversation

@WasThatRudy

@WasThatRudy WasThatRudy commented May 12, 2026

Copy link
Copy Markdown

Summary

  • Remove unreachable <Modal> blocks from the 5 YAML-only policy create pages (Auth, RateLimit, TokenRateLimit, OIDC, Plan)
  • Remove the useState declarations for isErrorModalOpen / errorModalMsg (the latter had no setter destructured, the former was never set to true, so the modal could never render)
  • Remove the now-unused @patternfly/react-core imports the dead block was keeping alive (Button, ButtonVariant, Modal, ModalVariant, ModalBody, ModalFooter)

131 lines deleted, 0 added. No behaviour change — these pages currently render only <ResourceYAMLEditor>, which has its own save/error handling.

These pages are slated to be rewritten with real Form + YAML views under #378 (the LFX mentorship epic). This cleanup just removes scaffolding that has no render path today.

Refs #445.

Test plan

  • yarn lint clean
  • Visually confirm /k8s/ns/:ns/<policy>/~new still renders the YAML editor for AuthPolicy, RateLimitPolicy, TokenRateLimitPolicy, OIDCPolicy, PlanPolicy — leaving for reviewer / will follow up once I have a console environment up

Summary by CodeRabbit

  • Refactor
    • Simplified the create pages for AuthPolicy, PlanPolicy, RateLimitPolicy, and TokenRateLimitPolicy.
    • Removed the extra error pop-up handling from these screens, leaving a cleaner create flow focused on the YAML editor and page title.

@coderabbitai

coderabbitai Bot commented May 12, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: e18aaf0f-7167-459a-8aef-1784459a9e76

📥 Commits

Reviewing files that changed from the base of the PR and between 2bc81f3 and fa19559.

📒 Files selected for processing (4)
  • src/components/KuadrantAuthPolicyCreatePage.tsx
  • src/components/KuadrantPlanPolicyCreatePage.tsx
  • src/components/KuadrantRateLimitPolicyCreatePage.tsx
  • src/components/KuadrantTokenRateLimitPolicyCreatePage.tsx
💤 Files with no reviewable changes (4)
  • src/components/KuadrantAuthPolicyCreatePage.tsx
  • src/components/KuadrantTokenRateLimitPolicyCreatePage.tsx
  • src/components/KuadrantRateLimitPolicyCreatePage.tsx
  • src/components/KuadrantPlanPolicyCreatePage.tsx

📝 Walkthrough

Walkthrough

Four policy creation page components (AuthPolicy, PlanPolicy, RateLimitPolicy, TokenRateLimitPolicy) have PatternFly-based error modal state, imports, and JSX removed. Each component now renders only a Helmet page title and a ResourceYAMLEditor.

Changes

Error Modal UI Removal

Layer / File(s) Summary
AuthPolicy create page cleanup
src/components/KuadrantAuthPolicyCreatePage.tsx
Removed PatternFly Modal/Button imports and the error modal JSX block; page now renders only Helmet title and ResourceYAMLEditor.
PlanPolicy create page cleanup
src/components/KuadrantPlanPolicyCreatePage.tsx
Removed PatternFly modal imports, isErrorModalOpen/errorModalMsg state, and the error modal JSX block.
RateLimitPolicy create page cleanup
src/components/KuadrantRateLimitPolicyCreatePage.tsx
Removed PatternFly Button/Modal imports, error modal state, and the rendered error Modal JSX including footer action.
TokenRateLimitPolicy create page cleanup
src/components/KuadrantTokenRateLimitPolicyCreatePage.tsx
Removed PatternFly imports, error modal state hooks, and the rendered error Modal JSX including close handler and OK button.

Estimated code review effort: 1 (Trivial) | ~5 minutes

Possibly related issues

Suggested reviewers: eguzki

Poem

Hop, hop, away with modals grey,
No more errors block the way,
YAML editors now stand tall,
Simpler pages, one and all,
A rabbit cheers this tidy sway! 🐇✨

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately summarises the main change: removing dead error-modal scaffolding from YAML-only policy create pages.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@R-Lawton

Copy link
Copy Markdown
Contributor

LGTM you just need to rebase before it can merge

…y pages

The 5 YAML-only policy create pages (Auth, RateLimit, TokenRateLimit, OIDC,
Plan) each declared an error-modal block that could never render:
setIsErrorModalOpen was never called with true, and errorModalMsg had no
setter destructured. Remove the dead block plus the @patternfly/react-core
imports it kept alive (Button, ButtonVariant, Modal, ModalVariant,
ModalBody, ModalFooter).

No behaviour change - these pages currently render only ResourceYAMLEditor,
which has its own internal save/error handling.

Refs Kuadrant#445

Signed-off-by: WasThatRudy <rudraksharss@gmail.com>
@WasThatRudy WasThatRudy force-pushed the fix/remove-dead-modal-scaffolding branch from 2bc81f3 to fa19559 Compare July 1, 2026 04:58
@WasThatRudy

Copy link
Copy Markdown
Author

LGTM you just need to rebase before it can merge

I have rebased the PR :)

@R-Lawton

R-Lawton commented Jul 3, 2026

Copy link
Copy Markdown
Contributor

lgtm you just have one test failing

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants