Skip to content

Conversation

@ekes
Copy link
Member

@ekes ekes commented May 15, 2025

Adds an alternative admin view for admin media page including a usage column.

Update hook will replace view if it's not been changed (and entity_usage is installed).

Manual tests:

  • Install fresh: /admin/content/media should have a usage count column;
  • Install on existing site: if the /admin/content/media view has not been changed it will be update; if it has been changed it should not be updated; if entity_usage is uninstalled it should not be updated.

Note about automated tests: This suffers from the same issues as #297 (comment) We should move these functionalities elsewhere at some point and work out how to make reliable tests.

@ekes ekes requested a review from finnlewis May 15, 2025 14:22
@ekes
Copy link
Member Author

ekes commented May 15, 2025

image

ekes added 2 commits May 15, 2025 16:54
The return type for TranslatableMarkup still seems not to have been
fixed in core, so mildly irritating to have to decide it here.
Copy link
Member

@markconroy markconroy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Works a treat on a new install.

@tonypaulbarker
Copy link
Contributor

This is a nice enhancement. For follow up, wondering if it would work to display a link (or the list of items) on the media entity edit pane so people could see the usage at the point of editing.

@markconroy
Copy link
Member

@tonypaulbarker Good idea. Wanna create a new issue for that and we can work on it then?

@tonypaulbarker
Copy link
Contributor

Follow up issue created at #300

@finnlewis finnlewis merged commit 15d9082 into 2.x May 20, 2025
23 of 29 checks passed
@willguv
Copy link
Member

willguv commented May 27, 2025

@ekes @tonypaulbarker I'd like to write about this in the next product newsletter (goes out first week of the month)

How do users get this please?

  • ensure entity_usage is installed (think this should be in the profile, is it?)
  • update localgov_core?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants