From e0d2d740677ae08e7ae35d35d68a7b40bfe905d4 Mon Sep 17 00:00:00 2001 From: Jonathan Bobel Date: Thu, 8 Jun 2023 13:12:00 -0400 Subject: [PATCH] Update dashboard and template flow (#514) * Updated header and footer * Moved files around and updated gulpfile to correct the build process when it goes to production * Updated fonts * Adjusted grid templating * Adding images to assets * Updated account pages, dashboard, and pages in message sending flow * Updated the styling for the landing pages in the account section once logged in --- app/assets/javascripts/fileUpload.js | 5 +- app/assets/javascripts/main.js | 2 +- app/assets/javascripts/templateFolderForm.js | 12 +-- .../uswds/_uswds-theme-custom-styles.scss | 73 ++++++++++++++++++- .../stylesheets/components/file-upload.scss | 16 +--- app/main/forms.py | 3 +- app/navigation.py | 4 +- app/templates/components/banner.html | 6 +- app/templates/components/big-number.html | 2 +- app/templates/components/folder-path.html | 2 +- app/templates/components/list-entry.html | 2 +- app/templates/components/page-footer.html | 8 +- app/templates/components/pill.html | 4 +- app/templates/components/show-more.html | 2 +- app/templates/components/table.html | 2 +- app/templates/components/textbox.html | 14 ++-- .../uk_components/back-link/template.njk | 2 +- .../uk_components/button/template.njk | 2 +- .../uk_components/error-message/template.njk | 2 +- .../uk_components/fieldset/template.njk | 2 +- .../uk_components/header/template.njk | 4 +- .../uk_components/hint/template.njk | 4 +- .../uk_components/input/template.njk | 4 +- .../uk_components/label/template.njk | 2 +- app/templates/main_nav.html | 34 ++++----- app/templates/org_template.html | 2 +- app/templates/partials/jobs/status.html | 4 +- .../templates/content-count-message.html | 2 +- .../templates/guidance-character-count.html | 8 +- .../partials/templates/guidance-links.html | 4 +- .../templates/guidance-optional-content.html | 8 +- .../templates/guidance-personalisation.html | 2 +- app/templates/service_navigation.html | 6 +- app/templates/views/choose-account.html | 2 +- app/templates/views/dashboard/_totals.html | 8 +- app/templates/views/dashboard/_usage.html | 6 +- app/templates/views/dashboard/dashboard.html | 8 +- app/templates/views/edit-sms-template.html | 13 +++- app/templates/views/features.html | 2 +- app/templates/views/manage-users.html | 4 +- app/templates/views/notifications.html | 45 ++++++------ .../views/platform-admin/_base_template.html | 6 +- app/templates/views/send.html | 6 +- app/templates/views/service-settings.html | 6 +- app/templates/views/signedout.html | 35 +++++---- app/templates/views/signin.html | 4 +- app/templates/views/templates/_template.html | 19 ++--- .../views/templates/_template_list.html | 4 +- app/templates/views/templates/choose.html | 11 ++- app/templates/views/templates/template.html | 32 +++----- app/templates/views/two-factor-sms.html | 2 +- app/templates/views/usage.html | 9 ++- app/templates/withnav_template.html | 16 ++-- app/templates/withoutnav_template.html | 2 +- gulpfile.js | 1 + tests/app/main/test_permissions.py | 4 +- .../views/accounts/test_choose_accounts.py | 2 +- .../test_organisation_invites.py | 2 +- .../views/organisations/test_organisations.py | 20 ++--- .../test_email_branding_requests.py | 11 +-- .../service_settings/test_service_settings.py | 28 +++---- tests/app/main/views/test_add_service.py | 6 +- tests/app/main/views/test_api_integration.py | 12 +-- .../app/main/views/test_code_not_received.py | 4 +- tests/app/main/views/test_dashboard.py | 4 +- tests/app/main/views/test_email_branding.py | 4 +- tests/app/main/views/test_feedback.py | 10 +-- tests/app/main/views/test_find_services.py | 2 +- tests/app/main/views/test_find_users.py | 2 +- tests/app/main/views/test_index.py | 9 +-- tests/app/main/views/test_manage_users.py | 8 +- tests/app/main/views/test_notifications.py | 2 +- tests/app/main/views/test_platform_admin.py | 4 +- tests/app/main/views/test_providers.py | 8 +- tests/app/main/views/test_register.py | 6 +- tests/app/main/views/test_send.py | 28 +++---- tests/app/main/views/test_sign_in.py | 2 +- tests/app/main/views/test_templates.py | 28 +++---- tests/app/main/views/test_tour.py | 16 ++-- tests/app/main/views/test_two_factor.py | 2 +- tests/app/main/views/test_user_profile.py | 6 +- tests/app/main/views/test_verify.py | 4 +- tests/app/test_navigation.py | 21 +++--- tests/javascripts/errorBanner.test.js | 4 +- .../stick-to-window-when-scrolling.test.js | 2 +- tests/javascripts/support/helpers/html.js | 4 +- tests/javascripts/templateFolderForm.test.js | 8 +- 87 files changed, 409 insertions(+), 354 deletions(-) diff --git a/app/assets/javascripts/fileUpload.js b/app/assets/javascripts/fileUpload.js index fe20c1a79..d12e554ed 100644 --- a/app/assets/javascripts/fileUpload.js +++ b/app/assets/javascripts/fileUpload.js @@ -6,7 +6,7 @@ this.submit = () => this.$form.trigger('submit'); this.showCancelButton = () => $('.file-upload-button', this.$form).replaceWith(` - Cancel upload + Cancel upload `); this.start = function(component) { @@ -15,7 +15,8 @@ // The label gets styled like a button and is used to hide the native file upload control. This is so that // users see a button that looks like the others on the site. - this.$form.find('label.file-upload-button').addClass('govuk-button govuk-!-margin-right-1'); +// + this.$form.find('label.file-upload-button').addClass('usa-button'); // Clear the form if the user navigates back to the page $(window).on("pageshow", () => this.$form[0].reset()); diff --git a/app/assets/javascripts/main.js b/app/assets/javascripts/main.js index fb7869922..dadda8596 100644 --- a/app/assets/javascripts/main.js +++ b/app/assets/javascripts/main.js @@ -17,7 +17,7 @@ showHideContent.init(); $(() => GOVUK.modules.start()); -$(() => $('.error-message, .govuk-error-message').eq(0).parent('label').next('input').trigger('focus')); +$(() => $('.error-message, .usa-error-message').eq(0).parent('label').next('input').trigger('focus')); $(() => $('.banner-dangerous').eq(0).trigger('focus')); diff --git a/app/assets/javascripts/templateFolderForm.js b/app/assets/javascripts/templateFolderForm.js index 943d136d0..dfef5a144 100644 --- a/app/assets/javascripts/templateFolderForm.js +++ b/app/assets/javascripts/templateFolderForm.js @@ -82,7 +82,7 @@ this.render(); } - this.$form.on('click', 'button.govuk-button--secondary', (event) => this.actionButtonClicked(event)); + this.$form.on('click', 'button.usa-button', (event) => this.actionButtonClicked(event)); this.$form.on('change', 'input[type=checkbox]', () => this.templateFolderCheckboxChanged()); }; @@ -149,7 +149,7 @@ this.makeButton = (text, opts) => { let $btn = $('') .html(text) - .addClass('govuk-link govuk-link--no-visited-state js-cancel') + .addClass('usa-link font-body-sm margin-left-1 js-cancel') // isn't set if cancelSelector is undefined .data('target', opts.cancelSelector || undefined) .attr('tabindex', '0') @@ -299,10 +299,10 @@ this.nothingSelectedButtons = $(`
- - +