mikebridge opened a new pull request, #45642:
URL: https://github.com/apache/superset/pull/45642

   **TL;DR:** when deleting a semantic layer or view is refused because other 
assets depend on it, the dialog now names those assets, including archived 
ones, so you can find and fix them. You only see names you could already see 
elsewhere; anything else is shown as a count with a hint to ask an admin.
   
   > **Depends on #45545.** This branch is stacked on it, so the diff includes 
its commits until it merges. Only the last commits belong to this PR.
   
   ### SUMMARY
   
   The delete refusal (409) already returned up to 20 dependents, but the 
dialogs showed counts only. Archived dependents were never named, even to 
admins, because visibility was computed over live rows only.
   
   - **Archived blockers are named to the people who could restore them.** 
Archived charts and dashboards are named to the users Recently Archived would 
show them to: admins see every archived item, and others see the items they 
edit. The live visibility filters are unchanged. Each dependent carries an 
`archived` flag, and the rest are counted in `inaccessible_count` as before.
   - **The dialogs list the dependents.** The layer and view delete dialogs 
show:
     - the dependents' names and types, with "archived" where it applies;
     - links to live charts and dashboards;
     - "and N more" past the 20 listed;
     - a note to ask an admin when some dependents are hidden.
   - **Copy:**
     - the refusal no longer says "Semantic source";
     - the view dialog gets the trash icon and the bold name the layer dialog 
has;
     - "Recently Archived" capitalisation is consistent in the database dialog;
     - an empty layer reads "has no semantic views".
   
   The deletion policy itself is unchanged.
   
   ### BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF
   
   Before: "Deletion is blocked by 15 dependent assets (2 archived)", with no 
names. After: the same line plus a list of the blocking charts and dashboards, 
archived ones marked, live ones linked.
   
   ### TESTING INSTRUCTIONS
   
   - `pytest tests/unit_tests/commands/semantic_layer/delete_test.py 
tests/unit_tests/semantic_layers/api_test.py`
   - `npm run test -- src/pages/DatasetList src/pages/DatabaseList`
   - Manually, with `SEMANTIC_LAYERS` and `SOFT_DELETE` on:
     1. Create a chart on a semantic view, archive it, and try to delete the 
view as an admin. The dialog names the archived chart.
     2. As a non-admin who doesn't edit that chart, the chart is counted, with 
the ask-an-admin note.
   
   ### ADDITIONAL INFORMATION
   
   - [ ] Has associated issue:
   - [x] Required feature flags: `SEMANTIC_LAYERS` (and `SOFT_DELETE` for 
archived assets)
   - [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
   
   The 409 gains one additive field per dependent (`archived`); existing fields 
keep their meaning.
   


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