Skip to content
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

Merged
merged 3 commits into from
Apr 5, 2024

Conversation

ibolton336
Copy link
Member

@ibolton336 ibolton336 commented Mar 29, 2024

Working towards resolving:
#1283

Resolves https://issues.redhat.com/browse/MTA-2224

Copy link
Collaborator

@rszwajko rszwajko left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  1. filtering by tag color didn't work for me
  2. color column has incorrect header and content (see below)
    image
  3. delete action looks active - compare with previous:
    image

Signed-off-by: Ian Bolton <ibolton@redhat.com>
client/src/app/pages/controls/tags/tags.tsx Outdated Show resolved Hide resolved
client/src/app/pages/controls/tags/tags.tsx Outdated Show resolved Hide resolved
client/src/app/pages/controls/tags/tags.tsx Outdated Show resolved Hide resolved
client/src/app/pages/controls/tags/tags.tsx Outdated Show resolved Hide resolved
<Button
type="button"
id="create-tag-category"
aria-label="Create tag category"
Copy link
Collaborator

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

Copy link
Member

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

client/src/app/pages/controls/tags/tags.tsx Show resolved Hide resolved
client/src/app/pages/controls/tags/tags.tsx Outdated Show resolved Hide resolved
Signed-off-by: Ian Bolton <ibolton@redhat.com>
Copy link
Member

@sjd78 sjd78 left a 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.

client/src/app/pages/controls/tags/tags.tsx Outdated Show resolved Hide resolved
const tagNames = item?.tags
?.map((tag) => tag.name)
.concat(tagCategoryNames)
.join("");
Copy link
Member

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.

Copy link
Member Author

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(
Copy link
Member

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)

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

client/src/app/pages/controls/tags/tags.tsx Outdated Show resolved Hide resolved
client/src/app/pages/controls/tags/tags.tsx Outdated Show resolved Hide resolved
client/src/app/pages/controls/tags/tags.tsx Show resolved Hide resolved
{tagCategory.rank}
</Td>
<Td width={10} {...getTdProps({ columnKey: "color" })}>
<Color hex={categoryColor} />
Copy link
Member

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.

Copy link
Member

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

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Member

@sjd78 sjd78 left a 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))
Copy link
Member

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 });

Copy link
Collaborator

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!

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Collaborator

@rszwajko rszwajko left a 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!

@ibolton336 ibolton336 merged commit dd6c10a into konveyor:main Apr 5, 2024
7 checks passed
@ibolton336 ibolton336 added the cherry-pick/release-0.3 This PR should be cherry-picked to release-0.3 branch. label Apr 15, 2024
ibolton336 added a commit to ibolton336/tackle2-ui that referenced this pull request Apr 15, 2024
…#1806)

Working towards resolving:
konveyor#1283

---------

Signed-off-by: Ian Bolton <ibolton@redhat.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cherry-pick/release-0.3 This PR should be cherry-picked to release-0.3 branch.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants