In Drupal 7 we provided a table that displayed a list of scheduled nodes to display as a tab on the content page and the user profile. Let's convert this into a view.

CommentFileSizeAuthor
#7 scheduled-content.png48.99 KBpfrenssen
#5 content-overview.png50.68 KBpfrenssen

Comments

joekers’s picture

Assigned: Unassigned » joekers

I'll give this one a go!

  • pfrenssen committed 63f6996 on 2423449
    Issue #2423449: Create first draft of the Scheduled Content view.
    
pfrenssen’s picture

I've started on this. I've created a first rough draft of the view and exported it.

Next steps:

  1. Check if the view is present when the module is freshly installed.
  2. Start refining the view so it is more similar to the D7 version.
  3. Provide a variant that is filtered by uid for the user page.
  4. Remove the original custom coded lists.
  5. Update the path of the view so it is displayed as a tab on the content overview.

  • pfrenssen committed 92858de on 2423449
    Issue #2423449: We are using Views for the scheduled nodes overview.
    
pfrenssen’s picture

StatusFileSize
new50.68 KB

I've been working on this today to implement this like it was in Drupal 7, but I changed my mind. I'm now thinking that we should simply clone the existing Content view, since we will gain a lot more functionality than we had (bulk operations! search! filters!) and it will be more consistent with the existing functionality which is a big plus for administrators.

@Jonathan1055, what do you think of this idea? It will look and work like the standard node overview as in the screenshot, but it will have the "Updated" column replaced with two columns "Publish on" and "Unpublish on":

Drupal 8 Content overview

  • pfrenssen committed 37f9acc on 2423449
    Issue #2423449: Base the Scheduled Content view on the Content view from...
pfrenssen’s picture

StatusFileSize
new48.99 KB

@Jonathan1055, I've implemented the view, is this acceptable for you?

Scheduled content view

jonathan1055’s picture

I think that's an excellent idea and it looks good. Definitely worth having the additional functionality of search, filter and to allow VBO. Couple of questions:

1) I presume, having a brief look at the commit, that the code is all stored in the scheduler file. So it is not like the D7 way of making a new tab using form_alter to clone an existing tab. So that means that if this Core form gets modified, then we should also keep the Scheduler page in line with it. I'm fine with that, but just wanted to check my understanding.

2) Does the admin have the abilty to customise/modify this view or columns displayed? In D7 views you can modify views provided by modules. I don't know if this works the same? Fine if not, again just asking the quesion.

Overall, great work and this is definitely the direction to go.

Jonathan

pfrenssen’s picture

  1. Yes we should keep an eye out for that, we should ensure that our view is always consistent with the one from core. It is duplicated, so it will not automatically inherit any changes that are made to the core view.
  2. Yes this is possible, this view is fully configurable, developers or site builders edit it, clone it or even disable it. Not only for this view, but for all the core views as well. This is a major selling point of Drupal 8 :)
pfrenssen’s picture

What still needs to be done here:

  1. Provide a variation of the view to show in a user profile at user/{user}/scheduler.
  2. Decide whether we keep the list of scheduled nodes at admin/config/content/scheduler/list, since this is a duplicate of the one at admin/content/scheduler. My feeling is that we should remove it to reduce possible confusion.
  3. Remove the original listing from SchedulerController::listScheduled().
  4. Update the routes in scheduler.routing.yml. I think we should keep the path of the view to be admin/content/scheduled instead of admin/content/scheduler since this better conveys what is shown on the page: a list of "Scheduled content", rather than a list of "Content managed by the Scheduler module". After all an editor might not even be aware that a module named Scheduler exists on the site.
pfrenssen’s picture

Assigned: joekers » pfrenssen

Going to rebase on top of the latest 8.x-1.x. This will make all commits reappear below this comment in random order.

  • pfrenssen committed dcdeca0 on 2423449
    Issue #2423449: Create first draft of the Scheduled Content view.
    
  • pfrenssen committed 3f4cf04 on 2423449
    Issue #2423449: We are using Views for the scheduled nodes overview.
    
  • pfrenssen committed a0fda45 on 2423449
    Issue #2423449: Base the Scheduled Content view on the Content view from...

  • pfrenssen committed 382b793 on 2423449
    Issue #2423449: Remove the access check for the custom list of scheduled...
  • pfrenssen committed 8ff02da on 2423449
    Issue #2423449: Remove the original list of scheduled nodes. It is...
pfrenssen’s picture

Did some work on this:

  1. Removed SchedulerListAccess. Now that the custom list of scheduled nodes is gone we do not need to check access to it any more.
  2. Removed the original listing from SchedulerController::listScheduled().
  3. Removed the original routes from scheduler.routing.yml and scheduler.links.task.yml.

What still needs to be done:

  1. Since the original access check was removed, we should test that users can only access their own scheduled content list unless they have the "view scheduled content" permission.
  2. Provide a variation of the view to show in a user profile at user/{user}/scheduler.

  • pfrenssen committed cf7abd7 on
    Issue #2423449: Add a scheduled content tab on the user profile.
    

  • pfrenssen committed 382b793 on 8.x-1.x
    Issue #2423449: Remove the access check for the custom list of scheduled...
  • pfrenssen committed 3f4cf04 on 8.x-1.x
    Issue #2423449: We are using Views for the scheduled nodes overview.
    
  • pfrenssen committed 8ff02da on 8.x-1.x
    Issue #2423449: Remove the original list of scheduled nodes. It is...
  • pfrenssen committed a0fda45 on 8.x-1.x
    Issue #2423449: Base the Scheduled Content view on the Content view from...
  • pfrenssen committed cf7abd7 on 8.x-1.x
    Issue #2423449: Add a scheduled content tab on the user profile.
    
  • pfrenssen committed dcdeca0 on 8.x-1.x
    Issue #2423449: Create first draft of the Scheduled Content view.
    
pfrenssen’s picture

Assigned: pfrenssen » Unassigned
Status: Active » Fixed

Created a followup task to test access to the scheduled node overviews: #2592293: Test access to scheduled node views. This is now done and merged into 8.x-1.x.

Status: Fixed » Closed (fixed)

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