Issue description
On detail/edit pages (Upstreams, Routes, Services, etc.), clicking Cancel silently discards all unsaved form changes with no warning. Users can lose edits without realizing it.
Root cause
The Cancel button calls setReadOnly(true) directly with no unsaved changes check:
<Button variant="outline" onClick={() => setReadOnly(true)}>
{t('form.btn.cancel')}
</Button>
Expected behavior
A confirmation dialog should appear when the user has unsaved changes, consistent with the plugin editor drawer which was fixed in #3333 .
How to Reproduce
- Go to Upstreams → open any upstream → click Edit
- Make changes to any field
- Click Cancel
- All changes are silently discarded, no confirmation dialog
Screenshots
No response
Environment
apisix-dashboard: master
Additional context
Affected pages
- Upstreams (
upstreams/detail.$id.tsx)
- Routes (
routes/detail.$id.tsx)
Issue description
On detail/edit pages (Upstreams, Routes, Services, etc.), clicking Cancel silently discards all unsaved form changes with no warning. Users can lose edits without realizing it.
Root cause
The Cancel button calls
setReadOnly(true)directly with no unsaved changes check:Expected behavior
A confirmation dialog should appear when the user has unsaved changes, consistent with the plugin editor drawer which was fixed in #3333 .
How to Reproduce
Screenshots
No response
Environment
apisix-dashboard: master
Additional context
Affected pages
upstreams/detail.$id.tsx)routes/detail.$id.tsx)