-
Notifications
You must be signed in to change notification settings - Fork 43
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
👻 Refactor tags table to remove deprecated legacy table dep #1806
Conversation
ce9b406
to
4e27ffb
Compare
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.
1c9cbda
to
601cb3b
Compare
Signed-off-by: Ian Bolton <[email protected]>
601cb3b
to
65c93c9
Compare
<Button | ||
type="button" | ||
id="create-tag-category" | ||
aria-label="Create tag category" |
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.
the label is not translated
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.
To be snarky and pedantic -- it's not externalized
Signed-off-by: Ian Bolton <[email protected]>
06e40ed
to
fc8fb99
Compare
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 don't think any of my comments are blockers, but I'm gonna have another look shortly.
const tagNames = item?.tags | ||
?.map((tag) => tag.name) | ||
.concat(tagCategoryNames) | ||
.join(""); |
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.
Oddly this bit always annoyed me. Probably should be .join("^")
or some name invalid character so the oddball false positive matches won't happen. "RedItchy" will match "ditch" but "Red^Itchy" will not.
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.
}, | ||
{ | ||
title: item.tags ? item.tags.length : 0, | ||
selectOptions: dedupeFunction( |
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.
The name filter list should contain what? Tag Category names AND all Tag Names? That's a bit confusing. Maybe have the Name filter look like the Tag filter on the application table? Maybe that is work for another PR?
Maybe something like this:
Column name: Tag Category
Filter 1: Tag Category (select list)
Filter 2: Tag (select list like Tags on Applications)
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.
{tagCategory.rank} | ||
</Td> | ||
<Td width={10} {...getTdProps({ columnKey: "color" })}> | ||
<Color hex={categoryColor} /> |
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.
Something odd with this component such that it doesn't line up with the other text in the row.
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.
but also not a regression -- so that can be a followup PR as well
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.
One more sorting change and good to go from me.
<Td>{cell.title}</Td> | ||
))} | ||
{(tagCategory.tags || []) | ||
.sort((a, b) => a.name.localeCompare(b.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.
Another place to use localeNumericCompare()
FWIW, localeNumbericCompare()
could be changed a bit to have the locale be defaulted to "i18n.language" and ignore that part here...(could also be another PR)
/**
* Uses native string localCompare method with numeric option enabled.
*
* @param locale to be used by string compareFn
*/
export const localeNumericCompare = (
a: string,
b: string,
locale: string = i18n.language
): number => a.localeCompare(b, locale, { numeric: true });
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 vote for a small nice PR!
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.
Looks OK to me!
…#1806) Working towards resolving: konveyor#1283 --------- Signed-off-by: Ian Bolton <[email protected]>
Working towards resolving:
#1283
Resolves https://issues.redhat.com/browse/MTA-2224