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

2200 - Adding tooltip to Total messages header for explanation #2273

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 10 additions & 10 deletions app/assets/sass/uswds/_data-visualization.scss
Original file line number Diff line number Diff line change
Expand Up @@ -60,16 +60,16 @@ $failed: color('gray-cool-20');
}
}

.usa-tooltip {
line-height: 1;
.usa-tooltip__body {
width: units(mobile);
font-size: size("body", 2);
height: auto;
white-space: wrap;
line-height: units(1);
}
}
// .usa-tooltip {
Copy link
Contributor

Choose a reason for hiding this comment

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

Please remove the comment if we don't need it anymore

Choose a reason for hiding this comment

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

hi! i saw that my review is requested for this, and i'm wondering where i might find a screen capture of it. thank you! tho i do appreciate the clarity of .usa-tooltip being added

// line-height: 1;
// .usa-tooltip__body {
// width: units(mobile);
// font-size: size("body", 2);
// height: auto;
// white-space: wrap;
// line-height: units(1);
// }
// }

.progress-bar {
width: 300px;
Expand Down
18 changes: 18 additions & 0 deletions app/assets/sass/uswds/_uswds-theme-custom-styles.scss
Original file line number Diff line number Diff line change
Expand Up @@ -552,6 +552,24 @@ td.table-empty-message {
max-width: 100%;
}

.usa-tooltip {
&__information {
background: color('ink');
margin-top: 4px;
color: white;
border-radius: 50%;
height: units(3);
width: units(3);
border: 1px solid color('ink');
}
.usa-tooltip__body {
min-width: units('card-lg');
max-width: units('mobile');
white-space: normal;
word-wrap: break-word;
}
}

// Tabs

.tabs {
Expand Down
13 changes: 12 additions & 1 deletion app/templates/views/dashboard/dashboard.html
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,18 @@ <h2 class="font-body-2xl line-height-sans-2 margin-top-0">{{ current_service.nam
{{ ajax_block(partials, updates_url, 'inbox') }}

<div id="totalMessageChartContainer" data-sms-sent="{{ sms_sent }}" data-sms-allowance-remaining="{{ sms_allowance_remaining }}">
<h2 id="chartTitle">Total messages</h2>
<div class="grid-row flex-align-center">
<h2 id="chartTitle" class="margin-right-1">Total messages</h2>
<button
type="button"
class="usa-tooltip usa-tooltip__information margin-right-0"
data-position="top"
title="Total messages track the sum of messages for the service: pending, failed, or delivered"
>
<span class="usa-sr-only">More information</span>
i
</button>
</div>
<svg id="totalMessageChart"></svg>
<div id="message"></div>
</div>
Expand Down
Loading