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

👻 Adds colors to drawer tags & removes boilerplate #1481

Merged
merged 5 commits into from
Oct 31, 2023

Conversation

ibolton336
Copy link
Member

Follow up to: #1470

  • Added a reusable component for drawer labels.
  • Adds random colors to the tags just for differentiation between the tags when viewing in the drawer.

@ibolton336 ibolton336 force-pushed the cleanup-associated-apps-archetypes branch from 24f218a to e0c71ec Compare October 16, 2023 19:11
@codecov
Copy link

codecov bot commented Oct 16, 2023

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (8b0c97d) 40.16% compared to head (bd51226) 40.16%.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #1481   +/-   ##
=======================================
  Coverage   40.16%   40.16%           
=======================================
  Files         144      144           
  Lines        4551     4551           
  Branches     1096     1096           
=======================================
  Hits         1828     1828           
  Misses       2626     2626           
  Partials       97       97           
Flag Coverage Δ
client 40.16% <ø> (ø)
server ∅ <ø> (∅)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

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 like the structure of the change. Only a few comments.

Comment on lines 11 to 18
const getRandomColor = () => {
const letters = "0123456789ABCDEF";
let color = "#";
for (let i = 0; i < 6; i++) {
color += letters[Math.floor(Math.random() * 16)];
}
return color;
};
Copy link
Member

Choose a reason for hiding this comment

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

There is an alternative that looks like it can generate some better colors (like keeping super dark and super light colors out): https://gist.github.com/bendc/76c48ce53299e6078a76

@ibolton336 ibolton336 force-pushed the cleanup-associated-apps-archetypes branch from e0c71ec to 69cca76 Compare October 30, 2023 18:36
Signed-off-by: ibolton336 <ibolton@redhat.com>
Signed-off-by: ibolton336 <ibolton@redhat.com>
@ibolton336 ibolton336 force-pushed the cleanup-associated-apps-archetypes branch from 69cca76 to dcf3056 Compare October 30, 2023 18:38
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.

Looks great, just one last change and one nit-pick

}): JSX.Element {
const { t } = useTranslation();

if (items?.length === 0) {
Copy link
Member

Choose a reason for hiding this comment

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

If items is undefined, this will reduce to undefined === 0 which is false.

Try if (items?.length ?? 0 === 0) { to force a 0 if items is undefined.

Signed-off-by: ibolton336 <ibolton@redhat.com>
Signed-off-by: Ian Bolton <ibolton@redhat.com>
Signed-off-by: Ian Bolton <ibolton@redhat.com>
@sjd78 sjd78 merged commit eb632fe into konveyor:main Oct 31, 2023
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants