MelikHajlawi opened a new issue, #40405: URL: https://github.com/apache/superset/issues/40405
### Bug description ### Bug description When the Duplicate Dataset modal opens, the primary "Duplicate" button is active even though the dataset name field is empty. The `disableSave` state is initialized to `false`, but the name field is initialized to `''`. The `useEffect` that runs when the modal opens resets the name to `''` but does not reset `disableSave` to `true`. This allows the user to immediately click "Duplicate" without entering a name, sending a request with an empty dataset name. ### Steps to reproduce 1. Navigate to Settings > Datasets (or any list view that has a Duplicate action) 2. Open the "..." action menu for any dataset 3. Click "Duplicate" 4. Observe that the "Duplicate" button in the modal footer is immediately clickable ### Expected behavior The "Duplicate" button should be disabled when the name field is empty, and only enabled once the user has typed at least one character. ### Files `superset-frontend/src/features/datasets/DuplicateDatasetModal.tsx` Line 37: `useState<boolean>(false)` should be `useState<boolean>(true)` The `useEffect` at line 55 should also call `setDisableSave(true)`. ### Screenshots/recordings _No response_ ### Superset version master / latest-dev ### Python version 3.9 ### Node version 16 ### Browser Chrome ### Additional context _No response_ ### Checklist - [x] I have searched Superset docs and Slack and didn't find a solution to my problem. - [x] I have searched the GitHub issue tracker and didn't find a similar bug report. - [x] I have checked Superset's logs for errors and if I found a relevant Python stacktrace, I included it here as text in the "additional context" section. -- 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] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
