Problem/Motivation
The scheduler module adds a tab to the main /admin/content page, so it appears alongside "Content", "Files", and "Media". But scheduler is only concerned with scheduling nodes, so shouldn't it be set up as a task (sub-tab) of content instead of alongside it?
Proposed resolution
Remaining tasks
User interface changes
The "Scheduled" tab will be removed, and a "Scheduled Content" sub-task link will appear beneath the 'Content' tab. This will also mean that an 'Overview' link will be shown, to get back from 'Scheduled Content' to the main content page.
| Comment | File | Size | Author |
|---|---|---|---|
| #20 | Screen Shot 2021-04-01 at 10.11.28 AM.png | 10.94 KB | bkosborne |
Issue fork scheduler-3167193
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 #2
bkosborneAdding this related issue as it may conflict
Comment #3
bkosborneComment #4
bkosborneHere's a screenshot that shows what I think it should be:
Comment #5
bkosborneI think the challenge here is that it requires the "All Content" local task to exist as well. Drupal does not provide this by default. And while Scheduler could provide it, what if there's already some other module doing it?
Comment #6
jonathan1055 commentedHi bkosborne,
Yes I think you are right, as Scheduler and has only ever supported node content the link should probably be as a sub-task alongside Content as in your screenshot, and not a separate tab at the top. I'll see what can be done, it may be quite straightforward. If we ever do support Media and other entities I am sure we can sort out the action/task when the time comes.
Do you have experience in how to manage a change in UI? Are there guidelines on what can be done and what should not be changed within a major release?
Comment #7
bkosborneI haven't had to deal with that much in modules I maintain. I think that it just needs to be featured prominently at the top of the release notes so it's not missed. Functionality isn't changing here, just the location of something in the admin UI.
Comment #8
jonathan1055 commentedHere's a patch which seems to do it. I first created the new 'Scheduled' task, but that required an 'Overview' tasks to be defined, otherwise it was not displayed when you clicked the main 'Content' link. The I found that when core module Content Moderation module is also enabled, as this has an 'Overview' tasks we got two Overviews. The trick I've used is to repeat the
content_moderation.content:key in scheduler.links.task.yml, the same value as is used in content_moderation.links.task.yml. So now we do not get a duplicate if that module is enabled. I'm not sure this best practice though. But is works.Without Content Moderation module
With Content Moderation module
If you can, please test the patch and let me know what you find. You will have to clear your cache as the routing is not refreshed without that. Also there is a minor change to the Scheduled view to make it not a menu tab, but a normal view. If you do not reload the view you'll still get the original tab. You can either edit the view and in 'Page settings' Menu: change it from 'tab' to 'normal'. Or you can use Config Manager and Config Update modules to refresh the view from source code.
Comment #9
jonathan1055 commentedHi @bkosborne,
I have just tried out the new d.o. issue forks. See the links at the top of this issue.
Comment #10
jonathan1055 commentedI did not intend to change the title. Either it was an accidental paste, or that happened automatically when I created the fork (which would be strange, and annoying)
Comment #12
bkosborneLet's see if we can postpone this on the core issue so we don't need to hack in the handling of the "Overview" task link provided by Content Moderation.
Comment #13
jonathan1055 commentedSetting back to 'needs review' to address the points by @bkosborne.
(a) We need an update hook
(b) to work out if that route definition is required or whether we can use the route
view.scheduler_scheduled_content.overviewthat Views provides.Comment #14
jonathan1055 commentedYou are right @bkosborne, we do not need our own
scheduler.scheduled_content, we can simple useview.scheduler_scheduled_content.overviewwhich is supplied by Views modules.Comment #15
jonathan1055 commentedHi @bkosborne,
Thanks for the review and comments. I've responded on the gitlab MR thread, and it's neat that it is all echoed back to this issue.
Please could you test the final patch, which you get get via the "plain diff" link at the top of this issue, whcih is https://git.drupalcode.org/project/scheduler/-/merge_requests/1.diff then mark this RTBC if OK. Then I will get it committed.
Comment #18
jonathan1055 commentedMaybe it needs another commit to enable the preview from #3206654: Create live preview via TugboatQA
Comment #19
bkosborneApologies for the delay - I'll review this today
Comment #20
bkosborneOkay. Looks good. One minor issue is that I prefer NOT having the view have a menu link defined at all. Because one is defined, the admin toolbar module adds a link under content to scheduled:
But that's mostly a personal preference and not a big deal.
Comment #21
jonathan1055 commentedThanks for the review, good to hear it is all working.
Regarding the link, I will leave that in for now. When this is committed it will change again with #2096585: Support for non-node entities, e.g. Media, Commerce Products, Custom 3rd-party entities so we'll see how it works and take a decision then.
Comment #24
jonathan1055 commentedMerged the MR. Thanks @bkosborne and @cobblestone.consulting