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.

Issue fork scheduler-3167193

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

bkosborne created an issue. See original summary.

bkosborne’s picture

Adding this related issue as it may conflict

bkosborne’s picture

Title: Move "Scheduled" menu tab so it goes under Content instead of alongside it » Move "Scheduled" menu tab so it's a task under "Content"
Issue summary: View changes
bkosborne’s picture

StatusFileSize
new30.04 KB

Here's a screenshot that shows what I think it should be:

bkosborne’s picture

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

jonathan1055’s picture

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

bkosborne’s picture

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

jonathan1055’s picture

Version: 8.x-1.3 » 8.x-1.x-dev
Issue summary: View changes
Status: Active » Needs review
Related issues: -#2981703: Add support for media entities
StatusFileSize
new1.88 KB
new64.02 KB
new51.98 KB

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

without content moderation

With Content Moderation module

with content moderation

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.

jonathan1055’s picture

Title: Move "Scheduled" menu tab so it's a task under "Content" » 3167193-scheduled-sub-task

Hi @bkosborne,
I have just tried out the new d.o. issue forks. See the links at the top of this issue.

jonathan1055’s picture

Title: 3167193-scheduled-sub-task » Move "Scheduled" menu tab so it's a task under "Content"

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

bkosborne’s picture

Title: Move "Scheduled" menu tab so it's a task under "Content" » [PP-1] Move "Scheduled" menu tab so it's a task under "Content"
Status: Needs review » Postponed
Related issues: +#3199682: Create a default task menu link for content overview so contrib doesn't have to

Let'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.

jonathan1055’s picture

Title: [PP-1] Move "Scheduled" menu tab so it's a task under "Content" » Move "Scheduled" menu tab so it's a task under "Content"
Status: Postponed » Needs review

Setting 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.overview that Views provides.

jonathan1055’s picture

You are right @bkosborne, we do not need our own scheduler.scheduled_content, we can simple use view.scheduler_scheduled_content.overview which is supplied by Views modules.

jonathan1055’s picture

Hi @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.

jonathan1055’s picture

Maybe it needs another commit to enable the preview from #3206654: Create live preview via TugboatQA

bkosborne’s picture

Apologies for the delay - I'll review this today

bkosborne’s picture

Status: Needs review » Reviewed & tested by the community
StatusFileSize
new10.94 KB

Okay. 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:

The admin toolbar menu with "content" item focused, showing the "Scheduled" sub-item

But that's mostly a personal preference and not a big deal.

jonathan1055’s picture

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

  • jonathan1055 committed 9db9c27 on 8.x-1.x
    Issue #3167193 by jonathan1055, bkosborne, cobblestone.consulting: Move...

jonathan1055’s picture

Status: Reviewed & tested by the community » Fixed

Merged the MR. Thanks @bkosborne and @cobblestone.consulting

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.