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

(828) Additional workflow iterations #9841

Merged
merged 6 commits into from
Jan 24, 2025

Conversation

pezholio
Copy link
Contributor

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.

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
@pezholio pezholio force-pushed the content-modelling/828-additional-workflow-iterations branch from 8e745b0 to 9dc0a8e Compare January 24, 2025 10:14
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.
@pezholio pezholio force-pushed the content-modelling/828-additional-workflow-iterations branch from 9dc0a8e to 19e3d4b Compare January 24, 2025 10:17
@pezholio pezholio requested a review from Harriethw January 24, 2025 10:53
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
Copy link
Contributor

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?

Copy link
Contributor Author

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.

Copy link
Contributor Author

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.

Copy link
Contributor

@Harriethw Harriethw left a 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!

@pezholio pezholio merged commit 4b12497 into main Jan 24, 2025
19 checks passed
@pezholio pezholio deleted the content-modelling/828-additional-workflow-iterations branch January 24, 2025 12:20
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