Skip to content
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

Merged
merged 8 commits into from
Dec 5, 2024

Conversation

pezholio
Copy link
Contributor

@pezholio pezholio commented Dec 4, 2024

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

image

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

@pezholio pezholio marked this pull request as draft December 4, 2024 13:32
@pezholio pezholio force-pushed the content-modelling/699-allow-schedule-to-be-edited branch 6 times, most recently from 2d87531 to ef4340b Compare December 5, 2024 10:55
@pezholio pezholio changed the title (699) Allow schedule to be edited (699) Allow Content Block schedule to be edited Dec 5, 2024
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.
@pezholio pezholio force-pushed the content-modelling/699-allow-schedule-to-be-edited branch from ef4340b to 46e10b9 Compare December 5, 2024 11:43
@pezholio pezholio requested a review from Harriethw December 5, 2024 11:50
@pezholio pezholio marked this pull request as ready for review December 5, 2024 11:50
@@ -28,6 +30,7 @@ def publish_with_rollback(content_block_edition)
},
)
ContentBlockManager::SchedulePublishingWorker.dequeue(content_block_edition) if content_block_edition.scheduled?
Copy link
Contributor

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?

Copy link
Contributor

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

Copy link
Contributor Author

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.
@pezholio pezholio requested a review from Harriethw December 5, 2024 13:43
@pezholio pezholio merged commit 59c1835 into main Dec 5, 2024
19 checks passed
@pezholio pezholio deleted the content-modelling/699-allow-schedule-to-be-edited branch December 5, 2024 18:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants