onurtashan opened a new pull request, #40193:
URL: https://github.com/apache/superset/pull/40193
## Summary
Fixes a bug where `certified_by` and `certification_details` are cleared
when a certified dashboard's layout is edited and saved.
## Root Cause
`saveDashboardRequest` unconditionally sent `certified_by: ''` and
`certification_details: ''` in the PUT body when these fields are `undefined`
in the Redux `dashboardInfo` state — which commonly happens during layout
editing. The backend treats empty strings as valid updates and overwrites the
DB fields.
## Fix
Use conditional spread to only include certification fields in the payload
when they are explicitly set — preserving backend values when not provided:
```typescript
// Before
certified_by: certified_by || '',
certification_details:
certified_by && certification_details ? certification_details : '',
// After
...(certified_by !== undefined && { certified_by }),
...(certification_details !== undefined && { certification_details }),
```
## Testing
- [ ] Certify a dashboard → edit layout → save → certification preserved ✅
- [ ] Certify a dashboard → edit info → clear certified_by → save →
certification cleared ✅
- [ ] Uncertified dashboard → edit layout → save → still uncertified ✅
Closes #40192
--
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]