batches: set up `/edit`, better namespace batch changes support
Created by: courier-new
Another piece of EM2.4. The goal of this PR was to add support for visiting the route users/courier-new/batch-changes/my-batch-change/edit
to open the SSBC editor for an existing batch change and be able to execute a new batch spec for it. Currently, re-execution is disabled except for draft batch changes.
Nothing actually points to this new route yet, so for now you can only get to it by manually typing it in. I've also flagged a couple things here with TODO
comments that will almost immediately be improved by the batch change settings form (#28829).
In order for this to work, I needed to be able to define routes within the user and org namespaces that would not render the normal user/org area header, since our SSBC editor page wants to occupy the whole screen. You can see how this works by looking at the reordered component nesting in UserArea
and OrgArea
, where I then selectively render the Page
container and User/OrgHeader
unless the route asks for fullPage: true
. I tried my best to verify that this didn't have adverse effects on the layout for other namespace pages or when the error boundary or suspense view are visible, but please double check me on that.
Enabling this full-page support meant that I could also restore the URL users/courier-new/batch-changes/create
as a way of creating a new batch change from a given namespace, as opposed to having to pass the namespace as a query parameter as I was doing before.
Here's a quick demo video of some of this in action:
https://user-images.githubusercontent.com/8942601/145515132-86edb89c-88c0-4309-aabf-f6345b72bcd9.mov
This PR depends on the mutation changes from #28825 and #28827 and is thus temporarily based on #28827.