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: [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