diff --git a/app/assets/stylesheets/components/banner.scss b/app/assets/stylesheets/components/banner.scss index cd4e4504b..91842562f 100644 --- a/app/assets/stylesheets/components/banner.scss +++ b/app/assets/stylesheets/components/banner.scss @@ -142,3 +142,47 @@ } } + +.banner-dashboard { + + $baseline-shift: -5px; + + display: block; + position: relative; + padding: $gutter-two-thirds 0; + border-top: 1px solid $border-colour; + border-bottom: 1px solid $border-colour; + margin-bottom: $gutter; + text-decoration: none; + + &:focus { + border-color: $focus-colour; + box-shadow: 0 3px 0 0 $focus-colour, 0 -3px 0 0 $focus-colour; + color: $text-colour; + } + + &-count { + @include bold-36; + padding-right: 5px; + } + + &-count-label { + @include bold-24; + text-decoration: underline; + position: relative; + top: $baseline-shift; + } + + &-meta { + @include core-19; + position: absolute; + right: 0; + bottom: $gutter-two-thirds - $baseline-shift; + text-align: right; + } + + & + .banner-dashboard { + margin-top: -$gutter; + border-top: none; + } +} diff --git a/app/assets/stylesheets/components/show-more.scss b/app/assets/stylesheets/components/show-more.scss index 8c26cdf56..56e89fb16 100644 --- a/app/assets/stylesheets/components/show-more.scss +++ b/app/assets/stylesheets/components/show-more.scss @@ -34,11 +34,6 @@ } -.show-more-empty { - @extend %show-more; - margin-top: -10px; -} - .show-more-no-border { @extend %show-more; border-top: 1px solid transparent; diff --git a/app/templates/views/dashboard/_inbox.html b/app/templates/views/dashboard/_inbox.html index 0e3f386b4..ae02d07cb 100644 --- a/app/templates/views/dashboard/_inbox.html +++ b/app/templates/views/dashboard/_inbox.html @@ -2,20 +2,18 @@
{% if inbound_sms_summary != None %} -
- {{ - big_number_with_status( - inbound_sms_summary.count, - 'text messages received', - link=url_for('.inbox', service_id=current_service.id), - show_failures=False - ) - }} -
{% endif %}
diff --git a/tests/app/main/views/test_dashboard.py b/tests/app/main/views/test_dashboard.py index 440042f8e..a75066840 100644 --- a/tests/app/main/views/test_dashboard.py +++ b/tests/app/main/views/test_dashboard.py @@ -222,11 +222,11 @@ def test_inbound_messages_shows_count_of_messages_when_there_are_messages( 'main.service_dashboard', service_id=SERVICE_ONE_ID, ) - + banner = page.select_one('a.banner-dashboard') assert normalize_spaces( - page.select('.big-number-meta-wrapper')[0].text - ) == '99 text messages received latest message just now' - assert page.select('.big-number-meta-wrapper a')[0]['href'] == url_for( + banner.text + ) == '9,999 text messages received latest message just now' + assert banner['href'] == url_for( 'main.inbox', service_id=SERVICE_ONE_ID ) @@ -248,9 +248,9 @@ def test_inbound_messages_shows_count_of_messages_when_there_are_no_messages( 'main.service_dashboard', service_id=SERVICE_ONE_ID, ) - - assert normalize_spaces(page.select('.big-number-meta-wrapper')[0].text) == '0 text messages received' - assert page.select('.big-number-meta-wrapper a')[0]['href'] == url_for( + banner = page.select_one('a.banner-dashboard') + assert normalize_spaces(banner.text) == '0 text messages received' + assert banner['href'] == url_for( 'main.inbox', service_id=SERVICE_ONE_ID ) diff --git a/tests/conftest.py b/tests/conftest.py index 4adadb726..0bd693681 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -1959,7 +1959,7 @@ def mock_get_inbound_sms_summary(mocker): service_id, ): return { - 'count': 99, + 'count': 9999, 'most_recent': datetime.utcnow().isoformat() }