From c2e023381f09cb1b0c68445dacb4f88ac7c2b12a Mon Sep 17 00:00:00 2001 From: davidtrussler Date: Wed, 27 Sep 2023 16:46:02 +0100 Subject: [PATCH] Make content and style changes --- ...collection-group-document-search-search-title-slug.scss | 7 +++++-- .../search_options.html.erb | 3 +-- .../search_title_slug.html.erb | 4 ++-- features/document-collections.feature | 6 +++--- ...ent_collection_group_document_search_controller_test.rb | 2 +- 5 files changed, 12 insertions(+), 10 deletions(-) diff --git a/app/assets/stylesheets/admin/views/_document-collection-group-document-search-search-title-slug.scss b/app/assets/stylesheets/admin/views/_document-collection-group-document-search-search-title-slug.scss index eeb943ea39c..c4d6f708f1a 100644 --- a/app/assets/stylesheets/admin/views/_document-collection-group-document-search-search-title-slug.scss +++ b/app/assets/stylesheets/admin/views/_document-collection-group-document-search-search-title-slug.scss @@ -1,6 +1,10 @@ .app-view-document-collection-document-search-results__table { + .govuk-table__cell:nth-child(2) { + white-space: nowrap; + } + .govuk-table__cell, - .govuk-table__cell > * { + .govuk-table__cell * { vertical-align: middle; } @@ -9,7 +13,6 @@ .govuk-button--secondary { margin-left: govuk-spacing(3); - vertical-align: middle; } } } diff --git a/app/views/admin/document_collection_group_document_search/search_options.html.erb b/app/views/admin/document_collection_group_document_search/search_options.html.erb index 38ddbf76c14..f28c6a9e499 100644 --- a/app/views/admin/document_collection_group_document_search/search_options.html.erb +++ b/app/views/admin/document_collection_group_document_search/search_options.html.erb @@ -16,8 +16,7 @@ }, { value: "title-or-slug", - text: "Search via title or slug", - hint_text: "This only applies to documents made in Whitehall publisher", + text: "Search via title", }, ] %> diff --git a/app/views/admin/document_collection_group_document_search/search_title_slug.html.erb b/app/views/admin/document_collection_group_document_search/search_title_slug.html.erb index 5b6c44d27d2..fdacddede67 100644 --- a/app/views/admin/document_collection_group_document_search/search_title_slug.html.erb +++ b/app/views/admin/document_collection_group_document_search/search_title_slug.html.erb @@ -14,7 +14,7 @@ <%= render "govuk_publishing_components/components/search", { name: "query", value: params[:query], - label_text: "Search by title or slug", + label_text: "Search by title", label_size: "l", } %> <% end %> @@ -27,7 +27,7 @@
<% if @results.empty? %> -

No documents found

+

No results found. Search again using the <%= link_to "full URL", "#", class: "govuk-link govuk-link--no-visited-state" %>.

<% else %>
<%= render "govuk_publishing_components/components/table", diff --git a/features/document-collections.feature b/features/document-collections.feature index d78c3ac97aa..3b8710a35d9 100644 --- a/features/document-collections.feature +++ b/features/document-collections.feature @@ -68,12 +68,12 @@ Feature: Grouping documents into a collection Then I can see that the heading has been updated to "Interesting new heading" @design-system-only - Scenario: Adding a document to a group via slug + Scenario: Adding a document to a group via title Given a document collection "Collection" exists And the document collection "Collection" has a group with the heading "Group" And a published document "Document 1" exists - When I select to add a new document to the collection group through "Search via title or slug" - And I search by "title or slug" for "Document 1" + When I select to add a new document to the collection group through "Search via title" + And I search by "title" for "Document 1" And I add "Document 1" to the document collection Then I should see "Document 1" in the list for the collection group "Group" diff --git a/test/functional/admin/document_collection_group_document_search_controller_test.rb b/test/functional/admin/document_collection_group_document_search_controller_test.rb index e1d31709bf2..16619fdd63e 100644 --- a/test/functional/admin/document_collection_group_document_search_controller_test.rb +++ b/test/functional/admin/document_collection_group_document_search_controller_test.rb @@ -69,7 +69,7 @@ class Admin::DocumentCollectionGroupDocumentSearchControllerTest < ActionControl @request_params[:query] = "Something " get :search_title_slug, params: @request_params assert_template "document_collection_group_document_search/search_title_slug" - assert_select ".govuk-body", text: /No documents found/ + assert_select ".govuk-body", text: /No results found. Search again using the full URL./ end view_test "GET #search_title_slug with an empty query string shows an alert flash" do