create admin view to monitor flags
Techbot opened this issue · 3 comments
There are some example views with the module and a recipe book somewhere.
pair programming required.
There are basic Views visible on the /user/* pages. If the user has paragraphs and nodes flagged, these items will display, with their ID.
The 2 main things missing from the Views right now
- an indication of which node the flagged paragraphs are on
- the flag name (machine name)
Without these, a list of flagged paragraphs aren't that useful.
1 Isn't related to Flags, as such. I might have found some hints.
https://www.drupal.org/project/paragraphs_admin/issues/3406566
https://www.drupal.org/forum/support/module-development-and-code-questions/2023-04-24/way-to-query-all-nodes-that-use-a-specific-paragraph-field
2 I can't find anything online about flag names and the language is confusion - on the Create flag form it is called "label". In the data base I think it's the flag_id (not to be confused with the entity id). When we were looking at how to access the flag machine name, @Techbot opted for an SQL query 5201df2
I think using the Flag Assign User https://www.drupal.org/project/flag_assign_user contrib module and printing the links in the template overrides resolves this issue as best we can right now.
The Flag Assign User provides a form where the admin can assign or unassign a flag for a specific user.
In the flag template override file, we print some handy links to the form and the flag ID and paired with the list of Missions on the /user/ID
page, admins can manage the missions for users (and for testing)
https://github.com/Techbot/eclecticmeme/blob/main/web/themes/custom/emc/templates/contrib/flag.html.twig#L42
This all gets quickly out of control if there are multiple missions flagged, or multiple users. There is no way to see the current status of a user's flagged item (whether it is flagged or not).