Skip to content

Fix/unsaved plugin config warning#3333

Open
vanshaj2023 wants to merge 8 commits intoapache:masterfrom
vanshaj2023:fix/unsaved-plugin-config-warning
Open

Fix/unsaved plugin config warning#3333
vanshaj2023 wants to merge 8 commits intoapache:masterfrom
vanshaj2023:fix/unsaved-plugin-config-warning

Conversation

@vanshaj2023
Copy link
Contributor

Why submit this pull request?

  • Bugfix
  • New feature provided
  • Improve performance
  • Backport patches

What changes will this PR take into?

When users edit plugin configurations in the Plugin Editor Drawer and close it without saving, all changes were silently discarded with no warning. This PR adds a confirmation dialog that appears when the user attempts to close the drawer with unsaved changes.

  • Added unsaved-changes guard in PluginEditorDrawer.tsx using direct value comparison (getValues('config') !== toConfigStr(config)) instead of isDirty, which is unreliable here because useEffect calls setValue on open — marking the form dirty before the user touches anything
  • Reused the existing modals.openConfirmModal pattern from DeleteResourceBtn.tsx
  • Guard is scoped to add/edit modes only; view mode closes silently as the form is disabled
  • Added info.unsaved.* i18n keys across all 5 locales (en, zh, de, es, tr)

Related issues

fix #3326

Checklist:

  • 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?
  • Is this PR backward compatible? If it is not backward compatible, please discuss on the mailing list first

@Baoyuantop
Copy link
Contributor

Hi @vanshaj2023, please add an E2E test for this feature to ensure it works properly. Also, could you include some screenshots of the feature in the pull request description?

@vanshaj2023
Copy link
Contributor Author

Hi @Baoyuantop
I added E2E tests.
please review these changes .

image

@Baoyuantop
Copy link
Contributor

Hi @vanshaj2023, please fix the failed CI.

@vanshaj2023
Copy link
Contributor Author

Hi @Baoyuantop ,
I fixed the issue please review it.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

fix(ux): unsaved plugin config changes are silently discarded when closing the editor drawer

2 participants