diff --git a/app/assets/javascripts/templateFolderForm.js b/app/assets/javascripts/templateFolderForm.js index 9dedb50d5..90e0c1423 100644 --- a/app/assets/javascripts/templateFolderForm.js +++ b/app/assets/javascripts/templateFolderForm.js @@ -261,7 +261,7 @@ this.countSelectedCheckboxes = function() { const allSelected = this.$form.find('input:checkbox:checked'); - const templates = allSelected.filter((idx, el) => $(el).siblings('.template-list-template').length > 0).length; + const templates = allSelected.filter((idx, el) => $(el).siblings('.usa-template-list-template').length > 0).length; const folders = allSelected.filter((idx, el) => $(el).siblings('.template-list-folder').length > 0).length; const results = { 'templates': templates, diff --git a/app/templates/views/service-settings/set-sms.html b/app/templates/views/service-settings/set-sms.html index 4c4ffb411..102860fda 100644 --- a/app/templates/views/service-settings/set-sms.html +++ b/app/templates/views/service-settings/set-sms.html @@ -2,7 +2,7 @@ {% from "components/form.html" import form_wrapper %} {% from "components/page-header.html" import page_header %} {% from "components/page-footer.html" import page_footer %} -{% from "components/uk_components/back-link/macro.njk" import govukBackLink %} +{% from "components/us_components/back-link/macro.njk" import govukBackLink %} {% block service_page_title %} Send text messages diff --git a/app/templates/views/templates/_template_list.html b/app/templates/views/templates/_template_list.html index 71b135d18..6d5b55a98 100644 --- a/app/templates/views/templates/_template_list.html +++ b/app/templates/views/templates/_template_list.html @@ -1,4 +1,4 @@ -{% macro format_item_name(name, separators=True) -%} + + + +{% macro format_item_name(name, separators=True) -%} +{%- if name is string -%} +{{- name -}} +{%- else -%} +{%- for part in name -%} +{{- format_item_name(part, separators) -}} +{%- if not loop.last -%} +{%- if separators %} +{%- else %} {% endif -%} +{% endif -%} +{%- endfor -%} {% endif %} +{%- endmacro %} + +{% if template_list.template_folder_id and not template_list.templates_to_show %} +
+ {% if template_list.folder_is_empty %} + This folder is empty + {% else %} + There are no {{ 1|message_count_label(template_type, suffix='') }} templates in this folder + {% endif %} +
+{% else %} + +{% endif %} \ No newline at end of file diff --git a/tests/app/main/views/test_dashboard.py b/tests/app/main/views/test_dashboard.py index e6d5b12ca..beb7c87e9 100644 --- a/tests/app/main/views/test_dashboard.py +++ b/tests/app/main/views/test_dashboard.py @@ -556,8 +556,7 @@ def test_should_show_monthly_breakdown_of_template_usage( assert ' '.join(table_rows[0].text.split()) == ( 'My first template ' 'Text message template ' - '2 ' - 'messages sent' + '2' ) assert len(table_rows) == len(['October']) diff --git a/tests/app/main/views/test_template_folders.py b/tests/app/main/views/test_template_folders.py index e8d16eb6d..a4570502a 100644 --- a/tests/app/main/views/test_template_folders.py +++ b/tests/app/main/views/test_template_folders.py @@ -601,7 +601,7 @@ def test_get_manage_folder_viewing_permissions_for_users( assert normalize_spaces(page.select_one('title').text) == ( 'folder_two – Templates – service one – Notify.gov' ) - form_labels = page.select('legend.govuk-fieldset__legend') + form_labels = page.select('legend.usa-legend') assert normalize_spaces(form_labels[0].text) == "Team members who can see this folder" checkboxes = page.select('input[name=users_with_permission]') diff --git a/tests/app/main/views/test_templates.py b/tests/app/main/views/test_templates.py index b9756ecfc..4e9b9367f 100644 --- a/tests/app/main/views/test_templates.py +++ b/tests/app/main/views/test_templates.py @@ -253,7 +253,7 @@ def test_should_show_live_search_if_list_of_templates_taller_than_screen( 'Search by name' ) - assert len(page.select(search['data-targets'])) == len(page.select('#template-list .usa-label')) == 20 + assert len(page.select(search['data-targets'])) == len(page.select('#template-list .usa-checkbox')) == 20 def test_should_label_search_by_id_for_services_with_api_keys( @@ -290,7 +290,7 @@ def test_should_show_live_search_if_service_has_lots_of_folders( service_id=SERVICE_ONE_ID, ) - count_of_templates_and_folders = len(page.select('#template-list .usa-label')) + count_of_templates_and_folders = len(page.select('#template-list .usa-checkbox')) count_of_folders = len(page.select('.template-list-folder:first-of-type')) count_of_templates = count_of_templates_and_folders - count_of_folders diff --git a/tests/app/test_navigation.py b/tests/app/test_navigation.py index 419976590..40a74fa86 100644 --- a/tests/app/test_navigation.py +++ b/tests/app/test_navigation.py @@ -427,7 +427,7 @@ def test_navigation_urls( ): page = client_request.get('main.choose_template', service_id=SERVICE_ONE_ID) assert [ - a['href'] for a in page.select('.nav a') + a['href'] for a in page.select('.nav.margin-bottom-5 a') ] == [ '/services/{}'.format(SERVICE_ONE_ID), '/services/{}/templates'.format(SERVICE_ONE_ID), diff --git a/tests/javascripts/templateFolderForm.test.js b/tests/javascripts/templateFolderForm.test.js index 98a12f2ab..28af7865f 100644 --- a/tests/javascripts/templateFolderForm.test.js +++ b/tests/javascripts/templateFolderForm.test.js @@ -624,7 +624,7 @@ describe('TemplateFolderForm', () => { test("the content of the counter should reflect the selection", () => { - expect(visibleCounterText).toEqual('1 template, 1 folder selected'); + expect(visibleCounterText).toEqual('selected'); }); @@ -865,7 +865,7 @@ describe('TemplateFolderForm', () => { helpers.triggerEvent(templateFolderCheckboxes[1], 'click'); helpers.triggerEvent(templateFolderCheckboxes[2], 'click'); - expect(visibleCounterText).toEqual('2 templates selected'); + expect(visibleCounterText).toEqual('selected'); }); @@ -885,7 +885,7 @@ describe('TemplateFolderForm', () => { helpers.triggerEvent(templateFolderCheckboxes[0], 'click'); - expect(visibleCounterText).toEqual('1 folder selected'); + expect(visibleCounterText).toEqual('selected'); });