This repository was archived by the owner on Jan 19, 2026. It is now read-only.
Add publish flag for rollback command#59
Open
shchypylov wants to merge 3 commits into
Open
Conversation
Comment on lines
+9
to
+32
| /** | ||
| * @method isStoryPublishedWithoutChanges | ||
| * @param {Object} story | ||
| * @return {Boolean} | ||
| */ | ||
| const isStoryPublishedWithoutChanges = story => { | ||
| return story.published && !story.unpublished_changes | ||
| } | ||
|
|
||
| /** | ||
| * @method isStoryWithUnpublishedChanges | ||
| * @param {Object} story | ||
| * @return {Boolean} | ||
| */ | ||
| const isStoryWithUnpublishedChanges = story => { | ||
| return story.published && story.unpublished_changes | ||
| } | ||
| /** | ||
| * @typedef {'all'|'published'|'published-with-changes'} PublishOptions | ||
| * | ||
| * @typedef {Object} RunRollbackOptions | ||
| * @property {PublishOptions} publish | ||
| * / | ||
|
|
Member
There was a problem hiding this comment.
These functions already exist in the run.js file, how about extracting them from there to a constants file and using them in both places?
Author
There was a problem hiding this comment.
Done, moved them to utils.js file and reused them in run.js and rollback.js files.
Member
ademarCardoso
left a comment
There was a problem hiding this comment.
Thanks for the contribution 💪🏼
Please take a look in my comments 😄
Author
|
@ademarCardoso, hey, sorry for the delay! I have updated the code base, please, take a look. |
Author
|
@ademarCardoso, hi there! Did you have a chance to check the changes I made? |
Author
|
@ademarCardoso, ping 🙃 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Pull request type
Jira Link: N/A
How to test this PR
You need to rollback a migration and observe that content after is being published (previously, rollback content was in "Draft" state).
What is the new behavior?
publishflag forrollback-migrationwas addedOther information
Based on this issue