Add approve reject workflow setting #37
Merged
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.