-
Notifications
You must be signed in to change notification settings - Fork 30
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
Add publish flag for rollback command #59
base: master
Are you sure you want to change the base?
Add publish flag for rollback command #59
Conversation
src/tasks/migrations/rollback.js
Outdated
/** | ||
* @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 | ||
* / | ||
|
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.
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?
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.
Done, moved them to utils.js
file and reused them in run.js
and rollback.js
files.
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.
Thanks for the contribution 💪🏼
Please take a look in my comments 😄
@ademarCardoso, hey, sorry for the delay! I have updated the code base, please, take a look. |
@ademarCardoso, hi there! Did you have a chance to check the changes I made? |
@ademarCardoso, ping 🙃 |
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?
publish
flag forrollback-migration
was addedOther information
Based on this issue