vanshaj2023 opened a new pull request, #3355: URL: https://github.com/apache/apisix-dashboard/pull/3355
**Why submit this pull request?** - [x] Bugfix - [ ] New feature provided - [ ] Improve performance - [ ] Backport patches **What changes will this PR take into?** When editing a Route or Upstream and clicking Cancel, all unsaved form changes were silently discarded with no warning. This PR adds a confirmation dialog (same pattern as #3333) that appears only when the form has unsaved changes. - Added `handleCancel` in `routes/detail.$id.tsx` and `upstreams/detail.$id.tsx` that checks `form.formState.isDirty` before closing - If dirty → shows "Unsaved Changes" confirmation modal with Discard/Cancel options - If clean → closes silently without modal - Added `info.unsaved.*` i18n keys across all 5 locales (en, zh, de, es, tr) Note: `form.formState.isDirty` is reliable here because `form.reset(fetchedData)` is called after data loads, correctly setting `defaultValues`. This is different from #3333 where direct value comparison was needed. **Related issues** fix #3344 **Checklist:** - [x] Did you explain what problem does this PR solve? Or what new features have been added? - [ ] Have you added corresponding test cases? - [ ] Have you modified the corresponding document? - [x] Is this PR backward compatible? If it is not backward compatible, please discuss on the mailing list first -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
