Skip to content

batches: SSBC EM3 "create" layout, default namespace selection

Administrator requested to merge kr/create-relayout into main

Created by: courier-new

This PR is a two-for-one because I started fixing the layout of the "Create" page and realized it was easier if the namespace default selection was already done. 😛

So, the default namespace selected when you land on the "Create" page is as follows:

  • if you came from the "Create" button on /organizations/my-org/batch-changes, my-org will be preselected (assuming you're a member of that org)
  • if you came from the "Create" button on /users/courier-new/batch-changes, courier-new will be preselected (assuming that's you)
  • if you came from the global "Create" button, or for some reason you don't have permission to create a batch change under the namespace you came from, your user namespace will be preselected

(In a small follow-up PR, we're actually going to hide the "Create" button from user batch change pages for users other than yourself)

One change is that all three "Create" pages now redirect to the same URL: /batch-changes/create. The reason being that:

  1. the SSBC EM3 designs don't feature the user/org page wrapper stuff that's usually in the header for any other user/org pages
  2. the pages are functionally equivalent; you can change to an org namespace even if you came from your personal user batch changes page, or vice versa
  3. it's really hard to "opt out" of those user/org area page layout header things from the user/org area components since the actual page content is so deeply nested, so having them just redirect to the main batch changes one sidesteps the need to deal with that since the batch changes area has very little nesting

The origin source and default namespace selection are conveyed through a URL parameter instead, so coming from /users/courier-new/batch-changes would take me to /batch-changes/create?namespace=courier-new, for example.

In turn, this allows us to break out of the Page layout for our create page and take over with a full-width two column layout where the editor and workspaces previews take center stage, which begins bringing the "Create" page layout closer to the EM3 designs. 🙌

Screen Shot 2021-10-27 at 8 16 11 PM

There's two other TODOs in here, one of which for getting the link URL to go to a namespace, which isn't part of the settings cascade yet, and the other of which is for dynamically computing the editor height based on the remaining vertical window space. These will both also be follow-up PRs.

Merge request reports

Loading