% title = "Applications" title = "This application" unless ENV["MAIN_COMPONENT_GUIDE"] %> <%= render "govuk_publishing_components/components/heading", { text: title, font_size: "l", margin_bottom: 6 } %> <% if @applications.any? %> <%= render "govuk_publishing_components/components/details", { title: "How to use this information" } do %>
This page shows information about component use on GOV.UK. This information has been cross referenced with the components in the gem to produce warnings where e.g. JavaScript for a component exists but has not been included in an application.
Warnings should be investigated, although there may be a reason why the application has been configured as it is. Note that 'code' can refer to templates or ruby code.
<% end %> <% accordion_content = nil summary = nil %> <% application_items = @applications.map do |application| %> <% if @other_applications summary = 'Application not found' if application[:application_found] summary = "Warnings: 0" summary = "Warnings: #{application[:warning_count]}" if application[:warning_count] > 0 end end %> <% accordion_content = capture do %> <% if application[:application_found] %> <% github_link = 'https://github.com/alphagov/' + application[:name] + '/blob/main/' %> <% if @other_applications %> <% if application[:uses_static] %>This application uses static, which can contain assets for components used in more than one application. Warnings for missing component assets in this application that are already included in static have been suppressed.
<% end %> <% application[:warnings].each do |warning| %>Warn <%= warning[:component] %> - <%= warning[:message] %>
<% end %> <% else %>More information about this application is available by viewing the component guide from a locally running instance of govuk_publishing_components.
<% end %> <%= render "govuk_publishing_components/components/heading", { text: "Components used", font_size: "m", margin_bottom: 4, heading_level: 3, } %>This shows instances of `gem-c-` classes found in the application. If a reference is found in a stylesheet or in code a warning is created, as this could be a style override or hard coded component markup.
This shows JavaScript files that might contain jQuery, which we are trying to remove.
This application was not found. This could be because you do not have this repository checked out locally.
<% end %> <% end %> <% { heading: { text: application[:name] }, summary: { text: sanitize(summary) }, content: { html: sanitize(accordion_content) }, } %> <% end %> <% if ENV["MAIN_COMPONENT_GUIDE"] %> <%= render "govuk_publishing_components/components/accordion", { items: application_items } %> <% else %><%= sanitize(summary) %>
<%= accordion_content %> <% end %> <% else %>No applications found.
<% end %>