Problem/Motivation
We have a lot of "sitewide alert" contents, and by default, the sorting is "most recent at the end", which is not convenient. And there is no "last modified" column, so we can't change the sorting order.
Proposed resolution
Add a "last modified" column, and allow sorting by ascending or descending order on this column.
Maybe using by default a view instead of a custom list builder would be more convenient, allowing users to fully customize the listing.
Provide an admin View so that "last modified" column or other columns can be added and sorting can be configured by the users.
| Comment | File | Size | Author |
|---|---|---|---|
| #4 | before-3.1.x-listbuilder.png | 97.12 KB | batigolix |
| #4 | after-3561256-views-reverted.png | 96.97 KB | batigolix |
Issue fork sitewide_alert-3561256
Show commands
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
Comments
Comment #3
batigolixComment #4
batigolixAgree with this idea.
I'll work on a view that provides the same functionality as the custom list builder.
Comment #5
batigolixComment #7
batigolixThis adds a view that provides the same functionality as the custom list builder. It also removes the list builder.
Comment #8
smustgrave commentedThis broke a number of tests appears, also doesn't have coverage for the change itself.
Comment #9
batigolixI fixed the issue that caused the tests to fail.
My proposed change converts the custom list builder to a view with the same functionality (and it also removes the list builder).
So I actually did not create a Last Modified column as initially proposed in this issue. This column can be added now that the list is a view.
I added a test for the list (view) mainly focusing on the custom views fields.
Comment #10
batigolixComment #11
batigolixComment #12
smustgrave commentedPinged the main Mainer but some feedback
This will need to target 3.1.x
Annotations should be replaced with attributes
Don’t think we need text claiming AI generated but good to announce it here
I’m not 100% we should delete the view builder. Pretty sure node for example if views isn’t installed falls back to a view builder.
Comment #13
smustgrave commentedPushed up some changes I mentioned in #12
Comment #14
smustgrave commented@batigolix thoughts?
Comment #15
batigolixI think this indeed the best approach. It allows users to customize the list (as requested in this issue) if they have Views enabled. I will edit the issue description so that it reflects the latest changes.
I rephrased the documentation a bit so that it is clear that the view is optional.
I tested this manually: without views /admin/content/sitewide_alert shows the custom list. After enabling views, /admin/content/sitewide_alert shows a view. I can also add a column "Changed"
This can be reviewed by others.
Comment #16
batigolixComment #17
smustgrave commentedAll feedback for this one has been addressed.
Comment #21
smustgrave commentedGoofed and merged to 3.0.x vs 3.1.x, reverted that and pushing to 3.1.x will merge once green.
Comment #23
claudiu.cristeaThis adds a view in config storage with no UUID
Comment #24
claudiu.cristeaSteps:
Updated the project to 3.1.0.
Ran
drush updb -yExported the config. I can see views.view.sitewide_alert_admin.yml has been created but lacks uuid
When I install the site from config, I'm getting:
Comment #25
claudiu.cristeaI've tried to add a fix but it seems the function in only in 3.1.0 but not in 3.1.x. WeirdEDIT: It was an outdated branchComment #29
claudiu.cristeaOpened https://git.drupalcode.org/project/sitewide_alert/-/merge_requests/103 which fixes the issue. I cannot set to "Needs review" could you check and do a new release? Thank you