rusackas opened a new pull request, #40628:
URL: https://github.com/apache/superset/pull/40628

   ### SUMMARY
   
   The `EncryptedField` component in the Database connection modal handles 
engine-specific encrypted credentials (e.g. `service_account_info` for gsheets, 
`credentials_info` for bigquery/datastore).
   
   In edit mode, the backend may return the existing credential for these 
fields via `db.parameters`. The component derived its displayed value directly 
from that parameter, so the value was placed into the DOM on the first render — 
before the mount `useEffect` reset the parameter to an empty string. The reset 
relies on an effect that runs after the initial render, leaving a brief window 
where an existing value could appear in the field.
   
   This change initializes the displayed value to an empty string whenever the 
form is in edit mode, so a pre-existing credential is never rendered. Users 
must re-enter credentials to change them, which is consistent with the existing 
clear-on-mount behavior. The create / copy-paste flow continues to serialize 
and display typed values exactly as before.
   
   ### BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF
   
   N/A
   
   ### TESTING INSTRUCTIONS
   
   - `npx jest 
src/features/databases/DatabaseModal/DatabaseConnectionForm/EncryptedField.test.tsx`
   - Tests assert: edit mode never renders an existing value (for 
object/boolean/string/number inputs), and the create flow still serializes and 
displays typed values.
   - Manual: edit a gsheets/bigquery database with stored credentials — the 
Service Account field should be empty rather than pre-filled.
   
   ### ADDITIONAL INFORMATION
   
   - [ ] Has associated issue:
   - [ ] Required feature flags:
   - [x] Changes UI
   - [ ] Includes DB Migration (follow approval process in 
[SIP-59](https://github.com/apache/superset/issues/13351))
   - [ ] Introduces new feature or API
   - [ ] Removes existing feature or API
   
   🤖 Generated with [Claude Code](https://claude.com/claude-code)


-- 
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]

Reply via email to