-
Notifications
You must be signed in to change notification settings - Fork 194
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
(699) Allow Content Block schedule to be edited #9699
(699) Allow Content Block schedule to be edited #9699
Conversation
2d87531
to
ef4340b
Compare
These methods are no longer shared, so it doesn’t make sense to have them in a module
This will allow the schedule to be edited
This will allow users to publish any previously scheduled editions immediately
This will allow us to use this behaviour in another controller in the next commit
This adds a new controller to edit a schedule, acting directly on the document. This fetches the document and acts on the latest edition. I’ve also updated some of the feature tests to use a tag to enable/disable Sidekiq, so we can share the features more easily.
If an editor has a scheduled edition awaiting publication and goes through the whole edit flow to create a new edition, we need to ensure that any scheduled editions are superseded.
ef4340b
to
46e10b9
Compare
@@ -28,6 +30,7 @@ def publish_with_rollback(content_block_edition) | |||
}, | |||
) | |||
ContentBlockManager::SchedulePublishingWorker.dequeue(content_block_edition) if content_block_edition.scheduled? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ContentBlockManager::SchedulePublishingWorker.dequeue(content_block_edition) if content_block_edition.scheduled?
do you think this line could be part of the dequeuing concern? or is the dequeuing concern already doing this?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
or could it have it's own named function to show what it's doing like dequeue_current_edition_if_previously_scheduled
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good plan! Have done 👍
This seems like a nicely logical place for this behaviour, and DRYs things up a bit more.
This adds an "Edit" button to a previously scheduled content block, allowing the schedule to be changed prior to the scheduled publication happening.
It also adds the ability to supersede previously scheduled editions when a new edition is published or scheduled before any previously scheduled edition(s) have been published.
Screenshot
Trello cards: https://trello.com/c/nYOtTtr2/699-update-view-page https://trello.com/c/BPc2NY8s/755-dequeue-scheduled-editions-when-publishing-a-new-edition