-
Notifications
You must be signed in to change notification settings - Fork 193
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
(828) Additional workflow iterations #9841
(828) Additional workflow iterations #9841
Conversation
This will allow us to identify what flow a user is on when moving through the create/edit flow.
This allows us to specify the order of steps and get their next and previous steps
8e745b0
to
9dc0a8e
Compare
This saves us from having to set it each time in our controller methods. It relies on the actions being in order, and returns the previous step for each action, unless the edition is brand new.
This was misleading, and the only difference was the `back_path`, so the two can be combined. Both `review_update_url` and `review_update` were identical URLs too, so we can remove these as well
Rather than having to manually specify where we need to redirect, we get the next action in the `SHOW_ACTIONS` constant and redirect to that step.
9dc0a8e
to
19e3d4b
Compare
module WorkflowHelper | ||
def back_path(content_block_edition, current_step) | ||
if current_step == "review" && content_block_edition.document.is_new_block? | ||
content_block_manager.content_block_manager_content_block_documents_path |
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.
now I'm questing why we take users back to the documents page when reviewing a new block - it seems weird, when my browser button just takes me back to the editing form. Is it because we can't actually provide a link back to the form including the data they may have changed?
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.
Yeah, I thought that was weird too. I guess we could throw them back to the edit state for that block. We'd just need to be careful that we don't show them the rest of the edit flow. I think it's doable though. Lemme have a look.
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.
Hmmm. I think I'll merge as is. I'll make a card to pick it up at a later date.
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.
lots of improvements here!
Trello card: https://trello.com/c/eqAcYy1U/828-add-internal-and-external-change-notes-when-editing-blocks
This simplifies the workflow code further, having one source of truth for the workflow steps, adding some useful helpers to get the next/previous steps, and removing some confusing code.