msyavuz opened a new pull request, #43255:
URL: https://github.com/apache/superset/pull/43255
### SUMMARY
Certifying a metric in Edit dataset → Metrics saves the certification
details but drops **Certified by**, so nobody can see who certified the metric.
`Fieldset` rebuilds the whole record on every field edit — `onChange({
...item, [fieldKey]: val })` — where `item` is the value captured when that
render was on screen. `TextControl` commits through a `FAST_DEBOUNCE` (250 ms)
debounce, so when two adjacent fields are filled in one visit to the expanded
row, the second field's callback was built before the first field's value had
been applied. It rebuilds the metric from that older snapshot and the first
field is gone. Certification is the visible case because it is the only pair of
adjacent text fields users fill back to back; the saved `extra` came out as
`{"certification":{"details":"Metric cert details"}}`.
Reading the item off a ref merges each edit into the latest committed record
instead of a snapshot. `Fieldset` is shared, so the dataset column fieldsets
get the same fix.
### BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF
Before / after, from the new test's `buildExtraJsonObject` output for the
same keystrokes:
```
- {"certification":{"details":"Metric cert details"}}
+ {"certification":{"certified_by":"Metric Certifier","details":"Metric cert
details"}}
```
### TESTING INSTRUCTIONS
1. Data → Datasets → Edit a dataset → Metrics tab → expand a metric.
2. Type into **Certified by**, then into **Certification details**, then
Save.
3. Reopen the dataset and expand the same metric — both fields are still
there.
Automated: `npm run test -- DatasourceEditorMetricCertification`. The new
test drives the real editor and fails on master.
### ADDITIONAL INFORMATION
- [ ] Has associated issue: No — reported through Preset support.
- [ ] Required feature flags: None.
- [x] Changes UI: Only in that edits stop being dropped; no visual change.
- [ ] Includes DB Migration: No.
- [ ] Introduces new feature or API: No.
- [ ] Removes existing feature or API: No.
--
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]