-
Notifications
You must be signed in to change notification settings - Fork 16
Set up normalizeName string utility function #2549
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
Merged
Merged
Conversation
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
|
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
david-crespo
approved these changes
Nov 13, 2024
Collaborator
david-crespo
left a comment
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.
Good idea! I'd rename the function — "syntax" is not the right word for these constraints. A maximally literal option would be constrainNameChars. A more abstract option is normalizeName.
david-crespo
added a commit
to oxidecomputer/omicron
that referenced
this pull request
Nov 14, 2024
oxidecomputer/console@9ef82ba...48fc079 * [48fc079a](oxidecomputer/console@48fc079a) oxidecomputer/console#2542 * [f3d38103](oxidecomputer/console@f3d38103) oxidecomputer/console#2545 * [eba6626d](oxidecomputer/console@eba6626d) bump API for moved system timeseries endpoints * [6052fdbf](oxidecomputer/console@6052fdbf) oxidecomputer/console#2549 * [b886e4b8](oxidecomputer/console@b886e4b8) oxidecomputer/console#2550 * [7303d9d7](oxidecomputer/console@7303d9d7) oxidecomputer/console#2551 * [e239a8e2](oxidecomputer/console@e239a8e2) oxidecomputer/console#2540 * [31520a2e](oxidecomputer/console@31520a2e) move Breadcrumbs component definition into TopBar.tsx * [ad02edec](oxidecomputer/console@ad02edec) minor: extract UserMenu component for readability
david-crespo
added a commit
to oxidecomputer/omicron
that referenced
this pull request
Nov 14, 2024
oxidecomputer/console@9ef82ba...48fc079 * [48fc079a](oxidecomputer/console@48fc079a) oxidecomputer/console#2542 * [f3d38103](oxidecomputer/console@f3d38103) oxidecomputer/console#2545 * [eba6626d](oxidecomputer/console@eba6626d) bump API for moved system timeseries endpoints * [6052fdbf](oxidecomputer/console@6052fdbf) oxidecomputer/console#2549 * [b886e4b8](oxidecomputer/console@b886e4b8) oxidecomputer/console#2550 * [7303d9d7](oxidecomputer/console@7303d9d7) oxidecomputer/console#2551 * [e239a8e2](oxidecomputer/console@e239a8e2) oxidecomputer/console#2540 * [31520a2e](oxidecomputer/console@31520a2e) move Breadcrumbs component definition into TopBar.tsx * [ad02edec](oxidecomputer/console@ad02edec) minor: extract UserMenu component for readability Co-authored-by: iliana etaoin <iliana@oxide.computer>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
We are already restricting some of the characters that users can add to the Name field. While working on #2546 I figured that it might be helpful to have this string manipulation available in an external function, so we can restrict what's typed in to the Combobox field. Because we'll want to give users the option of typing a number in as the initial character ("I'm trying to filter for Images with
2024in them"), thenameSyntaxfunction has an optional second prop. Left off, the default action is to only permit a letter in the zeroth position. Iftrueis passed in toallowNonLetterStart, the user can enter either a number or a dash. Non-allowed characters are dropped.