This repository was archived by the owner on Aug 10, 2026. It is now read-only.
Repository navigation
Add approve reject workflow setting - #37
Merged
Merged
Conversation
alecgeatches
commented
Sep 17, 2024
| $args_to_encode = []; | ||
| $args_to_encode['description'] = $args['description'] ?? $old_status->description; | ||
| $args_to_encode['position'] = $args['position'] ?? $old_status->position; | ||
| $args_to_encode['is_review_required'] = $args['is_review_required'] ?? $old_status->is_review_required ?? false; |
Contributor
Author
There was a problem hiding this comment.
I think this double null coalescing operator is pretty nifty.
ingeniumed
approved these changes
Sep 18, 2024
Contributor
Author
|
Also added some REST tests that test CRUD operations for custom statuses and reordering over REST. Somewhat related to this PR as we also test the new |
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.
Description
Adds a "This status requires a review" toggle on statuses in the VIP Workflow editor:
This is the first step in adding this feature. Currently, this is only the checkbox and persistence. The approve/reject dialog on steps that require approval will come in a separate PR.
Made a couple of other small changes:
Changed default data to set review required on the "Pending Review" default status. To test, delete the "Pending Review" status, then run
wp option delete vip_workflow_custom_status_options, then refresh the workflow page. You should see a new "Pending Review" status with the review required toggle enabled by default.Added a divider, and moved action buttons to the right side of the modal as pictured above. This felt more right, and I checked to see that other modals in Gutenberg used the same layout. This one can be viewed by editing a block in the editor, clicking the "..." dropdown in the floating toolbar, and clicking "Create Pattern":
The
<HStack>used in our code to right-align the buttons is the same used from the above modal in Gutenberg core. Although it's labeled as "experimental", it's been around for a few years and it's used extensively in Gutenberg as well.Steps to test
wp option delete vip_workflow_custom_status_optionssteps mentioned above, and ensure that the "Pending Review" status is created with the toggle default on.