mikebridge opened a new pull request, #43469:
URL: https://github.com/apache/superset/pull/43469
### SUMMARY
With `SOFT_DELETE` enabled, the Charts **card view**'s delete confirmation
still showed the permanent-delete dialog — "Please confirm" / "Are you sure you
want to delete [name]?", destructive styling, and the type-DELETE friction —
while the **list view** shows the archive dialog for the identical, recoverable
action. The same click archived the chart either way; only the card's dialog
misstated what was about to happen.
The card's `ConfirmStatusChange` now mirrors the list view's idiom
(`ChartList`): under the flag it passes `recoverable` (the underlying
`DeleteModal` then drops the type-DELETE input and renders a primary-styled
**Archive** button on its own), titles the dialog "Archive [name]?", sources
the body from the shared `archiveConfirmDescription()` helper, and labels the
kebab entry via `deleteActionLabel()`. With the flag off, rendering is
unchanged and pinned by a test.
Design notes:
- **No new translation units** — every string already exists for the list
view; `messages.pot` is untouched.
- **Nothing behind the dialog changes** — the shared `handleChartDelete`,
permission gating (`isUserEditorOrAdmin`), and toasts are untouched.
- **Deliberately out of scope** (recorded in the spec): the list view's
pre-flight lookup that lists blocking alerts/reports in the dialog. A blocked
deletion keeps surfacing its explanatory message after confirm, exactly as
today. This PR was split out of the SC-117151 work to stay at its own blast
radius.
- Because the body comes from the shared copy module, the card automatically
inherits the copy refinements in #43401 (Settings-menu location hint, one-day
pluralization) when that merges — no follow-up needed here.
This is a pre-existing inconsistency from the soft-delete rollout, not a
regression: `ChartCard` predates the flag and was never wired to it. The
Dashboards card view is unaffected (it delegates to its list page's flag-aware
dialog) and datasets have no card view.
### BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF
**Before** (flag on, card view): "Please confirm" / "Are you sure you want
to delete [name]?" with the type-DELETE input and a danger-styled Delete button
— a permanent-delete dialog for a recoverable action.
**After** (flag on, card view): "Archive [name]?" with a primary-styled
Archive button, no type-DELETE input, and the shared body copy ("This chart
will be moved to Recently Archived. You can recover it there [within N days].")
— identical to the list view's dialog for the same chart.
Flag off: byte-identical to before this change (pinned by test).
### TESTING INSTRUCTIONS
```bash
cd superset-frontend
npm run test -- src/features/charts/ChartCard.test.tsx
```
5 tests: the 3 pre-existing card tests plus the archive-dialog assertions
(title, Archive button, shared body, no type-DELETE input) and a flag-off
pinning test.
Manual: enable `SOFT_DELETE`, Charts page → card view → kebab (⋮) on any
chart → entry reads **Archive**; clicking it opens the archive dialog matching
the list view's. Disable the flag → entry reads **Delete** and the dialog is
the unchanged permanent-delete one.
### ADDITIONAL INFORMATION
- [x] Has associated issue: SC-118046 (split out of SC-117151 by its design
review)
- [x] Required feature flags: `SOFT_DELETE` (flag-off behavior unchanged)
- [x] 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
- [ ] Introduces new feature or API
- [ ] Removes existing feature or API
This PR was developed with AI assistance (Claude Code), including the
implementation and tests; 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]