pkg/ui: Don't force tracez tags to uppercase.#83913
pkg/ui: Don't force tracez tags to uppercase.#83913craig[bot] merged 1 commit intocockroachdb:masterfrom
Conversation
benbardin
left a comment
There was a problem hiding this comment.
You're welcome @knz ! CI is passing now, can I get an LGTM? Thank you!
Reviewable status:
complete! 0 of 0 LGTMs obtained (waiting on @adityamaru and @andreimatei)
|
I'm OK with the change, but I'm not technology expert on the front-end. |
benbardin
left a comment
There was a problem hiding this comment.
Can do!
Reviewable status:
complete! 0 of 0 LGTMs obtained (waiting on @adityamaru and @andreimatei)
|
So This actually makes this kind of confusing for me to read since we are applying the giving us something like, Anyway, just a thought. Code quote: const { size, status, icon, iconPosition, text, allowLowerCase } = props;
const styles = ["badge", `badge--size-${size}`, `badge--status-${status}`];
if (!allowLowerCase) {
styles.push("badge--uppercase");
}
const classes = cx(...styles); |
|
Thanks for cutting out a duplicate! I think I would prefer that we use Thank you. |
benbardin
left a comment
There was a problem hiding this comment.
Reviewable status:
complete! 0 of 0 LGTMs obtained (waiting on @adityamaru, @andreimatei, @dhartunian, @koorosh, and @nathanstilwell)
pkg/ui/workspaces/cluster-ui/src/badge/badge.tsx line 35 at r1 (raw file):
Previously, nathanstilwell (Nathan Stilwell) wrote…
So
classnamesalready has the functionality you are creating here (the ability to add a className based on a boolean variable). So I think what you want is something like,const classes = cx("badge", `badge--size-${size}`, `badge--status-${status}`{ "badge--uppercase": !allowLowerCase, });This actually makes this kind of confusing for me to read since we are applying the
badge--uppercaseclass after negating a variable. It seems like the default for badges should be that they are uppercase and we want the ability to override that. So what if we had a prop called something likeuppercaseand defaulted it to false? Then thecxcall would look like,const classes = cx("badge", `badge--size-${size}`, `badge--status-${status}`{ "badge--uppercase": uppercase, });giving us something like,
export function Badge(props: BadgeProps) { const { size, status, icon, iconPosition, text, uppercase = true } = props; const classes = cx("badge", `badge--size-${size}`, `badge--status-${status}`{ "badge--uppercase": uppercase, });Anyway, just a thought.
Oh, neat trick! Thanks! How's this look?
|
Previously, benbardin (Ben Bardin) wrote…
I still find reviewable very confusing, but I'm not seeing a change yet. Am I missing something? |
benbardin
left a comment
There was a problem hiding this comment.
Reviewable status:
complete! 0 of 0 LGTMs obtained (waiting on @adityamaru, @andreimatei, @dhartunian, @koorosh, and @nathanstilwell)
pkg/ui/workspaces/cluster-ui/src/badge/badge.tsx line 35 at r1 (raw file):
Previously, nathanstilwell (Nathan Stilwell) wrote…
I still find reviewable very confusing, but I'm not seeing a change yet. Am I missing something?
No, I just forgot to commit locally before pushing 🤦 How about now?
|
Previously, benbardin (Ben Bardin) wrote…
Nice. |
nathanstilwell
left a comment
There was a problem hiding this comment.
Reviewed 10 of 10 files at r1, 1 of 1 files at r2, 2 of 2 files at r3, all commit messages.
Reviewable status:complete! 0 of 0 LGTMs obtained (waiting on @adityamaru, @andreimatei, @dhartunian, and @koorosh)
Also, deprecate uses of db-console/.../Badge in favor of the identical version in cluster-ui. Release note: None
|
bors r+ |
|
Build succeeded: |
Also, deprecate uses of db-console/.../Badge in favor of the identical version
in cluster-ui.
Release note: None