-
Notifications
You must be signed in to change notification settings - Fork 16
Make SideModal submit button copy consistent #2048
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
Conversation
|
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
|
Ha, @benjaminleonard was way ahead of us on the form type concept:
|
|
I'm on the fence too, but I think |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I like the change — it fixes the inconsistency and reduces choices we have to make at dev time.
It's a small thing, but since we're giving all the edit forms the same button label, I want to make sure we considered all possibilities. The plausible options I can think of are:
| Label | Comment |
|---|---|
| Save changes | Fine, though something about "changes" bothers me. "Save" makes me think of saving progress for later rather than submitting my update permanently |
| Save | Kinda short, plus same problem as "save" above |
| Update | A little better than "save", I think, but similar |
| Update [resource] | I might like this the best, but it's also the most annoying. We could do it by making the edit form take a resource name prop and have it plug it into both the title with Edit ${resource} and the button label with `Update ${resource} |
|
I'm on board with the |
| submitError: ApiError | null | ||
| loading?: boolean | ||
| title: string | ||
| title?: string |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I’d add a doc comment here explaining that you only need this when you want to override the default create or edit title. Same with submitLabel I think.
test/e2e/silo-access.e2e.ts
Outdated
| await page.click('role=menuitem[name="Change role"]') | ||
|
|
||
| await expectVisible(page, ['role=heading[name*="Change user role"]']) | ||
| await expectVisible(page, ['role=heading[name*="Edit role"]']) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
“Change user role” is a little more descriptive? I could go either way. If it shows up for editing a group role too it’s misleading.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, I agree that Change is probably more accurate than Edit, as they aren't editing the role, per se. Change permissions?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
On the actions modal we say Change role, so I think that makes sense. Should we determine whether it's a user or group and pass in the appropriate term? Change user role / Change group role
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Permissions isn’t a term in the API, so I prefer to avoid it. Really what they’re doing in this case is updating the policy on the resource, and the UI is sort of deliberately obscuring that (uncharacteristically) because it is so much more natural to think about operating on the user.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hold the phone. There was a TODO in the project-access and silo-access files noting that we should // TODO: show user name in header or SOMEWHERE … this seems like as good a time as any to update that in the modal's title.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yea, it’s a bit weird but it’s still an improvement. See what it looks like with a 63 character name.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
what about break-words instead of break-all?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I tried that, plus wrapping a container in display: inline-block and individual words in both break-words and break-all, but neither worked as desired 100% of the time. I think users will run into more situations with something like Name ofPerson or hyphenated-group-name as opposed to unhyphenatedLongGroupName, so break-words is probably the best solution for now.

oxidecomputer/console@784e8aa...7c96844 * [7c968443](oxidecomputer/console@7c968443) oxidecomputer/console#2083 * [b844a42c](oxidecomputer/console@b844a42c) oxidecomputer/console#2078 * [47835ee3](oxidecomputer/console@47835ee3) oxidecomputer/console#2086 * [c4ddebc2](oxidecomputer/console@c4ddebc2) oxidecomputer/console#2082 * [530a0997](oxidecomputer/console@530a0997) upload-artifact@v4 requires unique filenames for each run in matrix * [b996c34c](oxidecomputer/console@b996c34c) bump actions/upload-artifact to v4 * [bc51f530](oxidecomputer/console@bc51f530) bump API to latest main * [743da3b0](oxidecomputer/console@743da3b0) oxidecomputer/console#2080 * [7596d633](oxidecomputer/console@7596d633) oxidecomputer/console#2073 * [65531bff](oxidecomputer/console@65531bff) oxidecomputer/console#2074 * [4d226cd3](oxidecomputer/console@4d226cd3) oxidecomputer/console#1891 * [7490104a](oxidecomputer/console@7490104a) update readme with cool new preview URL * [a2218994](oxidecomputer/console@a2218994) oxidecomputer/console#2066 * [641ebe85](oxidecomputer/console@641ebe85) oxidecomputer/console#2061 * [1bb8dd3a](oxidecomputer/console@1bb8dd3a) oxidecomputer/console#2055 * [41dd9f06](oxidecomputer/console@41dd9f06) oxidecomputer/console#2059 * [04692802](oxidecomputer/console@04692802) oxidecomputer/console#2048 * [8c30305e](oxidecomputer/console@8c30305e) oxidecomputer/console#2050 * [53709d2a](oxidecomputer/console@53709d2a) oxidecomputer/console#2046 * [84caede7](oxidecomputer/console@84caede7) oxidecomputer/console#2026 * [bca9f42a](oxidecomputer/console@bca9f42a) oxidecomputer/console#2045 * [09e5f713](oxidecomputer/console@09e5f713) oxidecomputer/console#2043 * [d780e5d8](oxidecomputer/console@d780e5d8) fix casing on floating IP attach/detach toasts
oxidecomputer/console@784e8aa...7c96844 * [7c968443](oxidecomputer/console@7c968443) oxidecomputer/console#2083 * [b844a42c](oxidecomputer/console@b844a42c) oxidecomputer/console#2078 * [47835ee3](oxidecomputer/console@47835ee3) oxidecomputer/console#2086 * [c4ddebc2](oxidecomputer/console@c4ddebc2) oxidecomputer/console#2082 * [530a0997](oxidecomputer/console@530a0997) upload-artifact@v4 requires unique filenames for each run in matrix * [b996c34c](oxidecomputer/console@b996c34c) bump actions/upload-artifact to v4 * [bc51f530](oxidecomputer/console@bc51f530) bump API to latest main * [743da3b0](oxidecomputer/console@743da3b0) oxidecomputer/console#2080 * [7596d633](oxidecomputer/console@7596d633) oxidecomputer/console#2073 * [65531bff](oxidecomputer/console@65531bff) oxidecomputer/console#2074 * [4d226cd3](oxidecomputer/console@4d226cd3) oxidecomputer/console#1891 * [7490104a](oxidecomputer/console@7490104a) update readme with cool new preview URL * [a2218994](oxidecomputer/console@a2218994) oxidecomputer/console#2066 * [641ebe85](oxidecomputer/console@641ebe85) oxidecomputer/console#2061 * [1bb8dd3a](oxidecomputer/console@1bb8dd3a) oxidecomputer/console#2055 * [41dd9f06](oxidecomputer/console@41dd9f06) oxidecomputer/console#2059 * [04692802](oxidecomputer/console@04692802) oxidecomputer/console#2048 * [8c30305e](oxidecomputer/console@8c30305e) oxidecomputer/console#2050 * [53709d2a](oxidecomputer/console@53709d2a) oxidecomputer/console#2046 * [84caede7](oxidecomputer/console@84caede7) oxidecomputer/console#2026 * [bca9f42a](oxidecomputer/console@bca9f42a) oxidecomputer/console#2045 * [09e5f713](oxidecomputer/console@09e5f713) oxidecomputer/console#2043 * [d780e5d8](oxidecomputer/console@d780e5d8) fix casing on floating IP attach/detach toasts



Fixes #984
We had a few different strings we were using for the various edit forms. This PR aligns them, by adding a new
formType('create' | 'edit') prop. For edit forms, we have a default button label of "Save changes" (which we were already using in a few places).This PR also removes an
idprop, which we can generate dynamically, allowing us to clean the props up a little.I'm ambivalent on whether
formTypeshould be a required prop, as we're only using it to set the default label oneditforms. We could make it optional and clean up the variouscreateform callsites.