From c996e2100ae30307f93aaabc6246a88a4aaf248e Mon Sep 17 00:00:00 2001 From: AshGDS <8880610+AshGDS@users.noreply.github.com> Date: Fri, 24 Jan 2025 11:46:36 +0000 Subject: [PATCH] Fix component guide previews The result section data was invalid and therefore crashing. None of the component previews were rendering with their CSS. --- app/views/components/_result_card.html.erb | 2 + app/views/components/_result_item.html.erb | 2 + .../components/_result_sections.html.erb | 2 + app/views/components/docs/result_sections.yml | 38 +++++++++---------- 4 files changed, 25 insertions(+), 19 deletions(-) diff --git a/app/views/components/_result_card.html.erb b/app/views/components/_result_card.html.erb index e31a24a493c..b26c3764204 100644 --- a/app/views/components/_result_card.html.erb +++ b/app/views/components/_result_card.html.erb @@ -1,4 +1,6 @@ <% + add_app_component_stylesheet("result-card") + title ||= nil description ||= nil url ||= nil diff --git a/app/views/components/_result_item.html.erb b/app/views/components/_result_item.html.erb index 12d1b90f546..3513fa4f9e9 100644 --- a/app/views/components/_result_item.html.erb +++ b/app/views/components/_result_item.html.erb @@ -1,4 +1,6 @@ <% + add_app_component_stylesheet("result-item") + title ||= nil url ||= nil description ||= nil diff --git a/app/views/components/_result_sections.html.erb b/app/views/components/_result_sections.html.erb index 74b75ee7027..fbcb259ad79 100644 --- a/app/views/components/_result_sections.html.erb +++ b/app/views/components/_result_sections.html.erb @@ -1,4 +1,6 @@ <% + add_app_component_stylesheet("result-sections") + highlighted ||= true group_index ||= 1 result_index ||= 1 diff --git a/app/views/components/docs/result_sections.yml b/app/views/components/docs/result_sections.yml index 09718fce601..17dfc75e54f 100644 --- a/app/views/components/docs/result_sections.yml +++ b/app/views/components/docs/result_sections.yml @@ -6,29 +6,29 @@ uses_component_wrapper_helper: true examples: default: data: - title: Business tax - results: + topics: + business_tax: - title: "Register for Corporation Tax" url: "/corporation-tax" description: "You need to register for corporation tax within 3 months of starting to do business, if you haven’t done so already." with-multiple-items: data: - title: Business tax - results: - - title: "Register for Corporation Tax" - url: "/corporation-tax" - description: "You need to register for corporation tax within 3 months of starting to do business, if you haven’t done so already." - - title: "Register for VAT" - url: "/vat-registration" - description: "You need to register your business for VAT if your VAT taxable turnover is more than £85,000." + topics: + business_tax: + - title: "Register for Corporation Tax" + url: "/corporation-tax" + description: "You need to register for corporation tax within 3 months of starting to do business, if you haven’t done so already." + - title: "Register for VAT" + url: "/vat-registration" + description: "You need to register your business for VAT if your VAT taxable turnover is more than £85,000." with-multiple-highlighted-items: data: - title: Business tax - highlighted: true - results: - - title: "Register for Corporation Tax" - url: "/corporation-tax" - description: "You need to register for corporation tax within 3 months of starting to do business, if you haven’t done so already." - - title: "Register for VAT" - url: "/vat-registration" - description: "You need to register your business for VAT if your VAT taxable turnover is more than £85,000." + topics: + business_tax: + - title: "Register for Corporation Tax" + url: "/corporation-tax" + description: "You need to register for corporation tax within 3 months of starting to do business, if you haven’t done so already." + - title: "Register for VAT" + url: "/vat-registration" + description: "You need to register your business for VAT if your VAT taxable turnover is more than £85,000." + highlighted: true