fix: hide Endpoints tab in Workload Editor for CronJob/Job types#443
Conversation
CronJob and Job workloads don't expose network endpoints, so the Endpoints tab is now hidden in form mode. A non-blocking warning is shown in YAML mode when endpoints are present for these types. Resolves: openchoreo/openchoreo#2838 Signed-off-by: Kavith Lokuhewage <kaviththiranga@gmail.com>
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
📝 WalkthroughWalkthroughAdds an optional Changes
Sequence Diagram(s)(omitted) Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Possibly related issues
Possibly related PRs
Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 3 | ❌ 2❌ Failed checks (1 warning, 1 inconclusive)
✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
📝 Coding Plan
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. Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In
`@plugins/openchoreo/src/components/Environments/Workload/WorkloadEditor/WorkloadEditor.tsx`:
- Around line 583-591: The effect that normalizes invalid workload sub-tabs
(useEffect referencing WORKLOAD_SUB_TABS, activeTab, workloadNavItems,
setActiveTab) currently just calls setActiveTab('container') which results in a
new history entry; instead update the URL using a history replace so the bad
query param is replaced not pushed. Locate the block where
setActiveTab('container') is invoked and perform a URL update via your router's
replace API (e.g., history.replace(...) or navigate(..., { replace: true })) to
set ?tab=container, then call setActiveTab('container') (or derive activeTab
from the URL) so the back button does not return to the invalid tab entry.
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID: 9c2584ab-8a85-4bb4-a831-19b15c0305bf
📒 Files selected for processing (2)
plugins/openchoreo/src/components/Environments/Workload/WorkloadConfigPage.tsxplugins/openchoreo/src/components/Environments/Workload/WorkloadEditor/WorkloadEditor.tsx
plugins/openchoreo/src/components/Environments/Workload/WorkloadEditor/WorkloadEditor.tsx
Show resolved
Hide resolved
Both workload and component sub-tab guards now use setActiveTab(tab, true) to replace the URL instead of pushing, preventing a back-button loop when redirecting away from an invalid tab (e.g. ?tab=endpoints on a CronJob). Resolves: openchoreo/openchoreo#2838 Signed-off-by: Kavith Lokuhewage <kaviththiranga@gmail.com>
8a0dfc1
CronJob and Job workloads don't expose network endpoints, so the
Endpoints tab is now hidden in form mode. A non-blocking warning
is shown in YAML mode when endpoints are present for these types.
Resolves: openchoreo/openchoreo#2838
Summary by CodeRabbit
Bug Fixes
UX Improvements