You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@superset.apache.org by "mikebridge (via GitHub)" <gi...@apache.org> on 2026/09/14 18:28:33 UTC
[PR] refactor(core): let DeleteModal callers supply the confirm button label and style [superset]
mikebridge opened a new pull request, #44257:
URL: https://github.com/apache/superset/pull/44257
### SUMMARY
From @kamilgabryjelski's review of #41550: `DeleteModal` hardcodes `t('Archive')` inside the **published** `@superset-ui/core` package — soft-delete vocabulary in a generic component, and public API is hard to retract. This is his suggested shape (SC-115605, option A): callers supply the confirm button's `primaryButtonName` / `primaryButtonStyle` (typed to match `Modal`'s own props), passed through `ConfirmStatusChange`.
`recoverable` stays as the convenience default — it hides the "type DELETE to confirm" step and defaults the button to **Archive** / `primary` — so **every existing call site keeps today's behaviour byte-for-byte**: the new props are optional and resolve with `??` over the `recoverable` default. Audited: 20 `DeleteModal` and 16 `ConfirmStatusChange` call sites, none of which pass these prop names today, so there is no collision and no semver break; no `UPDATING.md` entry.
**Precedence, documented in `types.ts`:** explicit `primaryButtonName` / `primaryButtonStyle` win over the `recoverable` default for the label and style **only**; the typed-confirmation gate is governed by `recoverable` alone. (The ticket also asked to reconsider the `recoverable` / `requireConfirmationText` overlap — that prop no longer exists on master; `recoverable` is the sole gate, so this precedence note is the only overlap left to document. The two booleans are deliberately *not* collapsed into an enum — that would touch all 36 call sites' semantics.)
The nine archive call sites may pass the label explicitly in a follow-up; not required here.
### BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF
No visual change for any existing caller (defaults are identical).
### TESTING INSTRUCTIONS
```bash
cd superset-frontend
npm run test -- packages/superset-ui-core/src/components/DeleteModal
npm run test -- packages/superset-ui-core/src/components/ConfirmStatusChange
```
New tests: default labels preserved for both `recoverable` values (Delete / Archive); a custom label on a permanent delete keeps the typed gate (button disabled until `DELETE` is typed, then confirms); explicit label + `danger` style on a `recoverable` modal win over the defaults and add no gate; `ConfirmStatusChange` forwards both props into the opened modal. All pre-existing tests unchanged; 23 green across the two suites.
### ADDITIONAL INFORMATION
- [x] Has associated issue: SC-115605 (follow-up to #41550 / SC-111760)
- [ ] Required feature flags:
- [ ] Changes UI
- [ ] Includes DB Migration (follow approval process in [SIP-59](https://github.com/apache/superset/issues/13351))
- [ ] Migration is atomic, supports rollback & is backwards-compatible
- [ ] Confirm DB migration upgrade and downgrade tested
- [ ] Runtime estimates and downtime expectations provided
- [x] Introduces new feature or API — two optional props on a published component; purely additive
- [ ] Removes existing feature or API
This PR was developed with AI assistance (Claude Code, with a Codex worker producing the initial diff under a fixed brief; every line was reviewed and independently verified); a human (@mikebridge) reviews before merge.
--
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: notifications-unsubscribe@superset.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org
Re: [PR] refactor(core): let DeleteModal callers supply the confirm button label and style [superset]
Posted by "codecov[bot] (via GitHub)" <gi...@apache.org>.
codecov[bot] commented on PR #44257:
URL: https://github.com/apache/superset/pull/44257#issuecomment-5668919963
## [Codecov](https://app.codecov.io/gh/apache/superset/pull/44257?dropdown=coverage&src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) Report
:white_check_mark: All modified and coverable lines are covered by tests.
:white_check_mark: Project coverage is 80.16%. Comparing base ([`eeafd65`](https://app.codecov.io/gh/apache/superset/commit/eeafd65b746c8cff1c424906d385fe911175661b?dropdown=coverage&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)) to head ([`c21b823`](https://app.codecov.io/gh/apache/superset/commit/c21b823f6cef13b006a29bc290eafc0c8c5cc07c?dropdown=coverage&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)).
<details><summary>Additional details and impacted files</summary>
```diff
@@ Coverage Diff @@
## master #44257 +/- ##
==========================================
- Coverage 80.18% 80.16% -0.03%
==========================================
Files 2925 2925
Lines 172692 172692
Branches 40090 40090
==========================================
- Hits 138467 138432 -35
- Misses 31627 31655 +28
- Partials 2598 2605 +7
```
| [Flag](https://app.codecov.io/gh/apache/superset/pull/44257/flags?src=pr&el=flags&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | Coverage Δ | |
|---|---|---|
| [javascript](https://app.codecov.io/gh/apache/superset/pull/44257/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `75.66% <100.00%> (-0.01%)` | :arrow_down: |
| [sqlite](https://app.codecov.io/gh/apache/superset/pull/44257/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `?` | |
Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#carryforward-flags-in-the-pull-request-comment) to find out more.
</details>
[:umbrella: View full report in Codecov by Harness](https://app.codecov.io/gh/apache/superset/pull/44257?dropdown=coverage&src=pr&el=continue&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache).
:loudspeaker: Have feedback on the report? [Share it here](https://about.codecov.io/codecov-pr-comment-feedback/?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache).
<details><summary> :rocket: New features to boost your workflow: </summary>
- :snowflake: [Test Analytics](https://docs.codecov.com/docs/test-analytics): Detect flaky tests, report on failures, and find test suite problems.
- :package: [JS Bundle Analysis](https://docs.codecov.com/docs/javascript-bundle-analysis): Save yourself from yourself by tracking and limiting bundle sizes in JS merges.
</details>
--
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: notifications-unsubscribe@superset.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org
Re: [PR] refactor(core): let DeleteModal callers supply the confirm button label and style [superset]
Posted by "bito-code-review[bot] (via GitHub)" <gi...@apache.org>.
bito-code-review[bot] commented on PR #44257:
URL: https://github.com/apache/superset/pull/44257#issuecomment-5668737058
AI Code Review is in progress (usually takes 3 to 15 minutes unless it's a very large PR).
--
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: notifications-unsubscribe@superset.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org
Re: [PR] refactor(core): let DeleteModal callers supply the confirm button label and style [superset]
Posted by "richardfogaca (via GitHub)" <gi...@apache.org>.
richardfogaca merged PR #44257:
URL: https://github.com/apache/superset/pull/44257
--
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: notifications-unsubscribe@superset.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org