PromucFlow_constructor/app/client/src/components/formControls
sneha122 b7c104c66f
fix: ds discard popup issue fixes (#19114)
This PR includes following changes:
- With latest datasource autosave improvements, we do not save the
datasource immediately but save it on explicit click of save button, so
in case user has not saved any changes and tries to leave the page, we
have added a popup to inform users that they have unsaved changes and
whether they would like to save them or not.
- The issue was in case of postgres and authenticated API datasource,
this popup was getting seen even when the user has not made any changes
in the datasource configuration. This PR solves that issue.
- The unsaved changes popup needs to be shown only when user has made
any new changes in the datasource form

TL;DR
- We have used redux form's isDirty method to check if user has made any
new updates to the form or not. This isDirty compares initial value of
datasource form with current form value and if current form value is
different it shows the unsaved changes popup
- The issue occurred because in case of postgres and authenticated API
datasource, we initialise 1 default pair of host address and port
(postgres), and default pairs of headers and query parameters
(Authenticated API). These initial default changes made the form dirty
and so user used to see the popup even when they have not explicitly
made any changes.
- This PR fixes the issue by setting initial form value with these
defaults so they do not make the form dirty.

Fixes #18962 , #18998 

https://user-images.githubusercontent.com/30018882/208931098-b570e3c4-10bc-4b76-bd54-531ccf869436.mov

Co-authored-by: “sneha122” <“sneha@appsmith.com”>
Co-authored-by: Aishwarya UR <aishwarya@appsmith.com>
2022-12-30 15:53:24 +05:30
..
BaseControl.tsx fix: Added frontend validation checks for access token url and url in authenticated API datasource configuration (#17340) 2022-10-13 18:59:20 +05:30
CheckboxControl.tsx feat: Migrate design system components import to design-system repo - I (#15562) 2022-08-22 10:39:39 +05:30
DropDownControl.tsx feat: Split evaluation and linting (#17287) 2022-11-03 14:53:15 +05:30
DynamicInputTextControl.test.tsx [Fix] Fix mouse click for the autocomplete at the api pane (#5929) 2021-07-19 17:36:04 +05:30
DynamicInputTextControl.tsx feat: Refactor invite modal for handling RBAC updates (#16405) 2022-09-02 22:45:08 +05:30
DynamicTextFieldControl.tsx feat: Adds one way switching to Form Controls (#17194) 2022-10-13 21:28:46 +01:00
EntitySelectorControl.tsx fix: UQI UI alignment fixes (#15035) 2022-07-06 12:10:25 +05:30
FieldArrayControl.tsx chore: import common variables from design system (#17600) 2022-10-31 06:54:47 +05:30
FilePickerControl.tsx chore: migrate toast (#17208) 2022-10-14 01:43:44 +05:30
FixedKeyInputControl.tsx Increase width for various form controls (#13895) 2022-05-18 15:37:47 +01:00
InputNumberControl.tsx chore: import common variables from design system (#17600) 2022-10-31 06:54:47 +05:30
InputTextControl.tsx fix: Added frontend validation checks for access token url and url in authenticated API datasource configuration (#17340) 2022-10-13 18:59:20 +05:30
KeyValueArrayControl.tsx fix: ds discard popup issue fixes (#19114) 2022-12-30 15:53:24 +05:30
PaginationControl.tsx fix: UQI UI alignment fixes (#15035) 2022-07-06 12:10:25 +05:30
SortingControl.tsx feat: Migrate design system components import to design-system repo - I (#15562) 2022-08-22 10:39:39 +05:30
StyledControls.tsx feat: upgrade client npm packages. (#14858) 2022-06-30 16:59:09 +05:30
SwitchControl.tsx fix: updated settings page design (#16990) 2022-10-06 16:36:29 +05:30
utils.test.ts fix: Allowing multi form to json switching and eliminating json to form sw… (#18192) 2022-11-25 11:38:35 +00:00
utils.ts fix: removed old key_val_input, updated keyval_array, show ds info (#18626) 2022-12-13 20:09:16 +05:30
WhereClauseControl.tsx feat: Migrate design system components import to design-system repo - I (#15562) 2022-08-22 10:39:39 +05:30