openaustralia/planningalerts

View on GitHub
app/views/_tailwind/authorities/under_the_hood.html.erb

Summary

Maintainability
Test Coverage
<% content_for :page_title, "Under the hood for #{@authority.full_name}" %>

<%= render Tailwind::Heading.new(tag: :h1) do %>
  Under the hood
  <span class="block mt-1 text-xl font-bold font-display">for <%= @authority.full_name %></span>
<% end %>

<p class="mt-12 text-xl text-navy">
  More of the gory details of how information gets into PlanningAlerts. This is
  here so you can see and learn how it's done but also so you are able to
  fix things and see in detail what isn't working.
</p>

<p class="mt-12 text-xl text-navy">
  <span class="font-bold">The steps to getting data into Planning Alerts</span>
  <%# TODO: Extract a numbered list like this into a component %>
  <ol class="pt-4 pl-8 text-xl list-decimal list-outside text-navy">
    <li class="pl-4">
      Applications are published on the
      <%= @authority.full_name %>
      website in a human readable, non-structured form.
    </li>
    <li class="pl-4">
      The latest scraper code on Github is loaded by our scraping
      platform <%= pa_link_to "morph.io", "https://morph.io" %>.
    </li>
    <li class="pl-4">
      The
      <%= pa_link_to "scraper #{@authority.morph_name}", morph_url(@authority) %>
      on our scraping platform
      <%= pa_link_to "morph.io", "https://morph.io" %>
      collects the information daily and converts it into a machine-readable
      format.
    </li>
    <li class="pl-4">
      If the scraper errors anyone who is
      <%= pa_link_to "watching the scraper", morph_watchers_url(@authority) %>
      on morph.io gets informed via a daily email alert.
    </li>
    <li class="pl-4">
      The machine readable data is
      <%= pa_link_to "validated, imported and geocoded", { anchor: "import" } %>
      by PlanningAlerts daily. If there are any validation errors on an
      application, the application is skipped and the error is logged.
      See below for the most recent logs.
    </li>
    <li class="pl-4">
      The information is published on PlanningAlerts, made available via the
      <%= pa_link_to "API", api_howto_path %>, and people are informed of new
      applications via email alerts.
    </li>
  </ol>
</p>

<section id="import" class="py-12 mt-12">
  <%= render Tailwind::Heading.new(tag: :h2).with_content("Most recent import logs") %>
  <%# TODO Is making the panel scrollable the right thing to do here? %>
  <pre class="py-8 mt-12 overflow-x-scroll font-mono text-xl bg-light-grey text-navy"><%= @authority.last_scraper_run_log %></pre>
</section>

<section class="py-12">
  <%= render Tailwind::Heading.new(tag: :h2).with_content("What you can do next") %>
  <p class="mt-8 text-xl text-navy">
    If something isn't right with the scraper or the data coming in then you could do one or several of the following:
    <ul class="pl-8 mt-4 text-xl list-disc text-navy">
      <li>
        <%= pa_link_to "Report or view scraper issues", github_issues_url %>
      </li>
      <li>
        <%= pa_link_to "Fork the scraper on Github", github_url(@authority) %>
        and try to fix it
      </li>
      <li>
        If it's an issue with the council website, then contact
        <%= @authority.full_name %>
      </li>
      <li>
        Contact us for help
      </li>
    </ul>
  </p>
  <p class="mt-8 text-xl text-navy">
    If everything is working fine right now but you want to help if something goes wrong:
    <ul class="pl-8 mt-4 text-xl list-disc text-navy">
      <li>
        <%= pa_link_to "Watch the scraper", morph_url(@authority) %>
        on morph.io, so you will get an email if it errors. Press the "Watch" button in the top right while you're logged in to morph.io.
      </li>
      <li>
        <%= pa_link_to "View any scraper issues", github_issues_url %>.
        Help fix them or comment on them if they are out of date
      </li>
    </ul>
  </p>
</section>