% content_for :title, "Component audit" %> <%= render 'govuk_publishing_components/components/title', title: "Components audit", margin_top: 0; %> <% if ENV["MAIN_COMPONENT_GUIDE"] %>
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. a print stylesheet 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.
Warn <%= warning[:component] %> - <%= warning[:message] %>
<% 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 our dependency on.
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 %> <%= render "govuk_publishing_components/components/accordion", { items: application_items } %> <% else %>No applications found.
<% end %>Component | Stylesheet | Print stylesheet | JS | Test | JS test |
---|---|---|---|---|---|
<%= component[:name] %> | <% if component[:stylesheet] %> Yes <% end %> | <% if component[:print_stylesheet] %> Yes <% end %> | <% if component[:javascript] %> Yes <% end %> | <% if component[:tests] %> Yes <% end %> | <% if component[:js_tests] %> Yes <% end %> |
Sorry, no applications found.
<% end %> <% end %> <% component_items = [ { heading: { text: "Component files", }, summary: { text: "Lists what files each component has", }, content: { html: component_files }, }, { heading: { text: "Components containing other components", }, summary: { text: "Shows which components contain other components", }, content: { html: components_within_components }, }, { heading: { text: "Components by application", }, summary: { text: "Shows which applications use each component", }, content: { html: components_by_application }, }, ] %> <%= render "govuk_publishing_components/components/accordion", { items: component_items } %> <% else %>No components found.
<% end %>Component auditing is only available when the component guide is running locally as a standalone app.
<% end %>