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

MNTOR-1809 - Add chart into dashboard top banner #3232

Merged
merged 28 commits into from
Jul 26, 2023
Merged

Conversation

codemist
Copy link
Collaborator

@codemist codemist commented Jul 19, 2023

References:

Jira: MNTOR-1809

Description

This adds the chart UI in the dashboard top banner. It also switches between two states:

This view before scanning:
image

This view after scanning:
image

Modal:
image

Checklist (Definition of Done)

  • Localization strings (if needed) have been added.
  • Commits in this PR are minimal and have descriptive commit messages.
  • I've added or updated the relevant sections in readme and/or code comments
  • I've added a unit test to test for potential regressions of this bug.
  • Product Owner accepted the User Story (demo of functionality completed) or waived the privilege.
  • All acceptance criteria are met.
  • Jira ticket has been updated (if needed) to match changes made during the development process.
  • Jira ticket has been updated (if needed) with suggestions for QA when this PR is deployed to stage.

@@ -234,11 +234,22 @@ $text-body-lg: 400 clamp(16px, 1.5svw, 18px) / 1.5 var(--font-inter), sans-serif
$text-body-md: 400 clamp(14px, 1.3svw, 16px) / 1.5 var(--font-inter), sans-serif;
$text-body-sm: 400 clamp(12px, 1.14svw, 14px) / 1.5 var(--font-inter),
sans-serif;
$text-body-xs: 400 clamp(10px, 0.975svw, 12px) / 1.5 var(--font-inter),
sans-serif;
$text-body-xs: 400 12px / 1.5 var(--font-inter), sans-serif;
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I removed the clamp on this variable, since the font's already so small it was illegible at 10px.

locales-pending/premium.ftl Outdated Show resolved Hide resolved
locales-pending/premium.ftl Show resolved Hide resolved
@pdehaan
Copy link
Collaborator

pdehaan commented Jul 20, 2023

Ah, and a general comment since I've been meaning to file this for a while…
Re: donut chart, we probably need a better variety of colors. Having 5 shades of very similar dark purples isn't easy to distinguish in a chart and for a long time I wasn't able to tell that the first two colors were different until I squinted and zoomed in on the chart.

@rhelmer rhelmer self-requested a review July 21, 2023 20:46
@rhelmer
Copy link
Collaborator

rhelmer commented Jul 22, 2023

Ah, and a general comment since I've been meaning to file this for a while… Re: donut chart, we probably need a better variety of colors. Having 5 shades of very similar dark purples isn't easy to distinguish in a chart and for a long time I wasn't able to tell that the first two colors were different until I squinted and zoomed in on the chart.

I agree it's a bit hard to distinguish, if we change it we should be mindful of color insensitive vision (aka "color blindness"), there's an MDN article and explanation about how to use the Accessibility devtools: https://developer.mozilla.org/en-US/docs/Web/Accessibility/Understanding_Colors_and_Luminance

I took a quick look using the accessibility tools and the current chart was legible overall so I wouldn't want to make us worse for some folks while trying to make it better :)

@codemist codemist marked this pull request as ready for review July 25, 2023 14:58
@codemist codemist requested a review from flodolo as a code owner July 25, 2023 14:58
modal-active-number-of-exposures-title = About your number of active exposures
# Variables:
# $limit (number) - Number of email addresses included in the plan
modal-active-number-of-exposures-part-one = This chart includes the total number of times we found each type of data exposed across all data broker profiles and all data breaches for up to { $limit } email addresses that you are currently monitoring.
Copy link
Collaborator

Choose a reason for hiding this comment

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

Please make this a plural string (see issue here)

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Fixed in d7844bd.

@codemist codemist merged commit 0951490 into main Jul 26, 2023
@codemist codemist deleted the mntor-1809-scan-banner branch July 26, 2023 16:29
@@ -59,6 +59,7 @@ financial-investments = Financial investments
financial-transactions = Financial transactions
fitness-levels = Fitness levels
flights-taken = Flights taken
full-names = Full name
Copy link
Collaborator

Choose a reason for hiding this comment

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

@codemist

I missed this one in review (not sure if it was there when I reviewed, but that's not relevant).

All categories in this file are plurals. Also, why is this category being added in this PR? Just a coincidence?

Copy link
Collaborator

Choose a reason for hiding this comment

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

@flodolo Me thinks it's related to this: #3244 (comment)
We have a bunch of these breach categories in the new dashboard UI now, so rather than add duplicate strings for localizers to localize, we reused the existing translated strings in locales/*/data-classes.ftl (although yes, that does slightly blur the fact that 99.999% of the values in that file are HIBP specific except this one).

git grep -n "full-names" | cat

locales/en/data-classes.ftl:62:full-names = Full name
src/app/(proper_react)/redesign/(authenticated)/user/dashboard/Dashboard.stories.tsx:158:    { "full-names": 98 },
src/app/functions/server/dashboard.ts:40:  fullNames: "full-names",

And yes, good callout that now there is some vague pluralizing where the ID is plural and the value is singular.
Not sure which way to fix that one, or if you think we should remove "full-names" entirely and move it into one of the files in /locales-pending/*.ftl. Plural would be more consistent with the rest of the values in data-classes.ftl, but I'm not clear on if that'd make the dashboard UI less clear, so I defer to UX/content/@codemist.

Copy link
Collaborator

Choose a reason for hiding this comment

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

Reusing strings is a bad idea, especially if we mix them from different sources. Some locales, for example, are translating categories lowercase.

Copy link
Collaborator

Choose a reason for hiding this comment

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

It's less than ideal in terms of localizability, but one way to minimize the impact would be to capitalize the first letter of the category (using a locale-sensitive library) when used in a different context.

@codemist codemist mentioned this pull request Aug 1, 2023
8 tasks
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.

5 participants