diff --git a/app/controllers/api_keys_controller.rb b/app/controllers/api_keys_controller.rb index a67cd3136..c2214c374 100644 --- a/app/controllers/api_keys_controller.rb +++ b/app/controllers/api_keys_controller.rb @@ -16,25 +16,16 @@ def index sig { void } def create user = T.must(current_user) - redirect_url = if Flipper.enabled?(:trial_api_keys, current_user) - api_keys_url - else - api_howto_url - end # For the time being limit users to only creating one API key if user.api_keys.empty? - if Flipper.enabled?(:trial_api_keys, current_user) - # Create a trial key which automatically expires and has a low daily limit - # TODO: Extract this - user.api_keys.create!(daily_limit: ApiKey.default_daily_limit_trial, expires_at: ApiKey.default_trial_duration_days.days.from_now) - else - user.api_keys.create! - end - redirect_to redirect_url, notice: t(".success") + # Create a trial key which automatically expires and has a low daily limit + # TODO: Extract this + user.api_keys.create!(daily_limit: ApiKey.default_daily_limit_trial, expires_at: ApiKey.default_trial_duration_days.days.from_now) + redirect_to api_keys_url, notice: t(".success") else # This is a terrible way of showing an error but it's not likely to happen so I'm not going to worry about that - redirect_to redirect_url, notice: t(".already_have_key") + redirect_to api_keys_url, notice: t(".already_have_key") end end diff --git a/app/controllers/documentation_controller.rb b/app/controllers/documentation_controller.rb index b62d88bed..73f277c3c 100644 --- a/app/controllers/documentation_controller.rb +++ b/app/controllers/documentation_controller.rb @@ -12,18 +12,10 @@ def about; end def faq; end sig { void } - def api_howto - # If feature flag is enabled show a new landing page instead - # with a link to an extracted "API Developer Documentation" page - return unless Flipper.enabled?(:trial_api_keys, current_user) - - render "api_landing" - end + def api_howto; end sig { void } - def api_developer - raise ActiveRecord::RecordNotFound unless Flipper.enabled?(:trial_api_keys, current_user) - end + def api_developer; end # rubocop:disable Naming/AccessorMethodName sig { void } diff --git a/app/views/application/_footer.html.erb b/app/views/application/_footer.html.erb index 5ed2aebee..1fce98628 100644 --- a/app/views/application/_footer.html.erb +++ b/app/views/application/_footer.html.erb @@ -16,11 +16,7 @@ <%# Repeat the main nav in the footer %>
  • <%= link_to "Home", root_path, class: "text-white underline hover:opacity-80 focus:outline-none focus:text-navy focus:bg-sun-yellow" %>
  • <%= link_to "Search", address_applications_path, class: "text-white underline hover:opacity-80 focus:outline-none focus:text-navy focus:bg-sun-yellow" %>
  • - <% if Flipper.enabled?(:trial_api_keys, current_user) %> -
  • <%= link_to "API", api_howto_path, class: "text-white underline hover:opacity-80 focus:outline-none focus:text-navy focus:bg-sun-yellow" %>
  • - <% else %> -
  • <%= link_to "Get the Data (API)", api_howto_path, class: "text-white underline hover:opacity-80 focus:outline-none focus:text-navy focus:bg-sun-yellow" %>
  • - <% end %> +
  • <%= link_to "API", api_howto_path, class: "text-white underline hover:opacity-80 focus:outline-none focus:text-navy focus:bg-sun-yellow" %>
  • <%= link_to "Help", faq_path, class: "text-white underline hover:opacity-80 focus:outline-none focus:text-navy focus:bg-sun-yellow" %>
  • diff --git a/app/views/application/_menu_mobile.html.erb b/app/views/application/_menu_mobile.html.erb index 777970953..b4e4a233f 100644 --- a/app/views/application/_menu_mobile.html.erb +++ b/app/views/application/_menu_mobile.html.erb @@ -18,11 +18,7 @@
  • <%= link_to "Search", address_applications_path, class: class_names("decoration-fuchsia", "decoration-4", "focus:outline-none", "focus:bg-sun-yellow", "underline" => current_page?(address_applications_path)) %>
  • <%= link_to api_howto_path, class: class_names("decoration-fuchsia", "decoration-4", "focus:outline-none", "focus:bg-sun-yellow", "underline" => current_page?(api_howto_path)) do %> - <% if Flipper.enabled?(:trial_api_keys, current_user) %> - Planning Alerts API - <% else %> - Get the Data - <% end %> + Planning Alerts API <% end %>
  • <%= link_to "Help", faq_path, class: class_names("decoration-fuchsia", "decoration-4", "focus:outline-none", "focus:bg-sun-yellow", "underline" => current_page?(faq_path)) %>
  • diff --git a/app/views/application/_profile_menu.html.erb b/app/views/application/_profile_menu.html.erb index 49c1d0bcf..d96c6bd17 100644 --- a/app/views/application/_profile_menu.html.erb +++ b/app/views/application/_profile_menu.html.erb @@ -2,9 +2,7 @@
  • <%= pa_link_to_unless_current "Your alerts", alerts_path %>
  • <%= pa_link_to_unless_current "Create new alert", new_alert_path %>
  • <%= pa_link_to_unless_current "Your comments", personal_comments_path %>
  • - <% if Flipper.enabled?(:trial_api_keys, current_user) %> -
  • <%= pa_link_to_unless_current "Your API keys", api_keys_path %>
  • - <% end %> +
  • <%= pa_link_to_unless_current "Your API keys", api_keys_path %>
  • <%= pa_link_to_unless_current "Edit account", edit_user_registration_path %>
  • <%# Setting "Sign out" to a block breaks on ios/safari %>
  • <%= button_to "Sign out", destroy_user_session_path, method: :delete, class: "#{pa_link_classes(quiet: false)} cursor-pointer" %>
  • diff --git a/app/views/documentation/api_developer.html.erb b/app/views/documentation/api_developer.html.erb index 3f47b8286..3b36ab383 100644 --- a/app/views/documentation/api_developer.html.erb +++ b/app/views/documentation/api_developer.html.erb @@ -30,11 +30,7 @@ You need an API key to try out the examples below and use the API for yourself.

    - <% if Flipper.enabled?(:trial_api_keys, current_user) %> - <%= render ButtonComponent.new(tag: :a, size: "xl", type: :primary, href: confirm_api_keys_path).with_content("Create API key") %> - <% else %> - <%= pa_button_to "Create API key", api_keys_path, method: :post %> - <% end %> + <%= render ButtonComponent.new(tag: :a, size: "xl", type: :primary, href: confirm_api_keys_path).with_content("Create API key") %>
    <% end %> <% else %> diff --git a/app/views/documentation/api_howto.html.erb b/app/views/documentation/api_howto.html.erb index 1d0dd7ac3..d1c5f1e69 100644 --- a/app/views/documentation/api_howto.html.erb +++ b/app/views/documentation/api_howto.html.erb @@ -1,217 +1,256 @@ -<%= content_for :page_title, "Get the Data" %> +<%= content_for :page_title, "Planning Alerts API" %> -<%= render HeadingComponent.new(tag: :h1) do %> - <%= yield :page_title %> -<% end %> +
    + <%# Using non-standard size %> + <%= render HeadingComponent.new(tag: :h1, size: "2xl") do %> + <%= yield :page_title %> + <% end %> + +

    + Seamlessly integrate planning alerts data into your custom application +

    -
    + <%= image_tag "illustration/data.svg", alt: "Abstract illustration of data moving around" %> +
    + +
    <%= render ProseComponent.new do %>

    - Planning application data is available programmatically. Details of the API are listed below. -

    -

    - All the API calls listed below return planning application sorted by the date they were scraped from the planning authority website with the most - recent listed first. -

    -

    - The API can return different formats including JSON, GeoJSON and GeoRSS. - The examples below return JSON. To get GeoJSON instead simply replace ".json" in the URL with ".geojson". For GeoRSS replace ".json" with ".rss". + <%# TODO: Is this saying too much of the same thing as the "who uses our API" section below? %> + Planning Alerts Application Programming Interface (API) serves community groups, businesses, NGOs, and civic-minded individuals by providing access to trusted planning and development application data.

    + <% end %>
    -
    -
    - <% if current_user %> - <% if api_key %> -

    - The API examples below contain your API key: - <%= api_key %> +

    + <%= render HeadingComponent.new(tag: :h2, extra_classes: "mb-6").with_content("Who uses our API?") %> +
    +
    +

    Lots of people!

    +

    + Real estate developers and agents, construction companies, urban planners, architects, + local government and municipalities, property management firms, community advocacy groups, environmental and heritage organizations, + academics, + legal firms, conveyancers, utility companies, insurance companies, researchers, tech startups and app developers are interested in this data. +

    +
    + <%= image_tag "illustration/headshots_three_people.svg", alt: "Illustration of headshot of three different people", class: "max-w-64" %> +
    +
    + +
    +
    +
    + <%= image_tag "plans/community.svg", alt: "", class: "mb-8" %> + <%= render HeadingComponent.new(tag: :h2, extra_classes: "mb-8") do %> + Community Plan + <% end %> +
    +

    + API data for strictly non-commercial use for public benefit.

    - <% else %> +

    + $0 + AUD + / month +

    +
    + <%= render BulletListComponent.new do |c| %> + <%= c.with_item do %> + Return up to + <%= number_with_delimiter(ApiKey.default_daily_limit_community * Application.max_per_page) %> + applications per day + <% end %> + <%= c.with_item.with_content("Full use of the API") %> + <% end %> +
    +
    +
    +

    + <%= pa_link_to "Contact us", api_contact_path, extra_classes: "block" %> to apply +

    +
    + +
    +
    + <%= image_tag "plans/standard.svg", alt: "", class: "mb-8" %> + <%= render HeadingComponent.new(tag: :h2, extra_classes: "mb-8") do %> + Standard Plan + <% end %> +

    - You need an API key to try out the examples below and use the API for yourself. + Set and forget reliable API service, effortlessly integrated into your application.

    -
    - <% if Flipper.enabled?(:trial_api_keys, current_user) %> - <%= render ButtonComponent.new(tag: :a, size: "xl", type: :primary, href: confirm_api_keys_path).with_content("Create API key") %> - <% else %> - <%= pa_button_to "Create API key", api_keys_path, method: :post %> +

    + $3499 + AUD + + GST / month +

    +
    + <%= render BulletListComponent.new do |c| %> + <%= c.with_item do %> + Return up to + <%= number_with_delimiter(ApiKey.default_daily_limit_commercial * Application.max_per_page) %> + applications per day + <% end %> + <%= c.with_item do %> + 1 product + <% end %> + <%= c.with_item do %> + Priority email support + <% end %> <% end %>
    +
    +
    +

    + <%= pa_link_to "Contact us", api_contact_path, extra_classes: "block" %> + to sign up +

    +
    + +
    +
    + <%= image_tag "plans/premium.svg", alt: "", class: "mb-8" %> + <%= render HeadingComponent.new(tag: :h2, extra_classes: "mb-8") do %> + Premium Plan <% end %> - <% else %> -

    - To use the API you will to - <%= pa_link_to "register for an account", new_user_registration_path %> - or - <%= pa_link_to "sign in", new_user_session_path %> - to your existing account. Once you've done that, return to this page - and the you will be able to create an API key here. -

    - <% end %> -
    - <%= image_tag "illustration/key.svg", alt: "", size: "287x189" %> +
    +

    + More power and flexibility. Talk to us for pricing. +

    +

    + Potential add ons can include: +

    +
    + <%= render BulletListComponent.new do |c| %> + <%= c.with_item do %> + <%# TODO: Add documentation for bulk data API %> + Access to bulk data API + <% end %> + <%= c.with_item do %> + Multiple products + <% end %> + <%= c.with_item do %> + Return more than + <%= number_with_delimiter(ApiKey.default_daily_limit_commercial * Application.max_per_page) %> + applications per day + <% end %> + <%= c.with_item do %> + Search for applications by description + <% end %> + <%= c.with_item do %> + Customised integration options + <% end %> + <% end %> +
    +
    +
    +

    + <%= pa_link_to "Contact us", api_contact_path, extra_classes: "block" %> + to discuss your needs +

    +
    -
    - <%= render HeadingComponent.new(tag: :h2).with_content("API calls") %> -
    -
    - <%= render HeadingComponent.new(tag: :h3).with_content("Single Location by longitude/latitude") %> -

    - Return applications near a given longitude/latitude. The area included is a circle with a radius of the given size (in metres) - with the longitude/latitude at its center. Suggested sizes are 400, 800 or 4000 metres. -

    - - <%= api_example_latlong_url_html(format: "json", key: api_key) %> - - <% if api_key %> - <%= render ButtonComponent.new(tag: :a, size: "xl", type: :primary, href: api_example_latlong_url(format: "json", key: api_key)) do %> - View example +<%# Only show this section if you don't have an API key yet %> +<% if api_key.nil? %> +
    +
    +
    + <%= render HeadingComponent.new(tag: :h2) do %> + Instant access <%= ApiKey.default_trial_duration_days %> day trial <% end %> - <% end %> -
    -
    - <%= render HeadingComponent.new(tag: :h3).with_content("Area by longitude/latitude") %> -

    - Return applications within a rectangle defined by longitude/latitude. -

    - - <%= api_example_area_url_html(format: "json", key: api_key) %> - - <% if api_key %> - <%= render ButtonComponent.new(tag: :a, size: "xl", type: :primary, href: api_example_area_url(format: "json", key: api_key)) do %> - View example - <% end %> - <% end %> -
    -
    - <%= render HeadingComponent.new(tag: :h3).with_content("Planning authority") %> -

    - Return applications for a specific planning authority (e.g. a local council) by authority short name. To discover the authority short name - to use here, find the planning authority on the - <%= pa_link_to "list of authorities", authorities_path %> - and follow the link. The url has the authority short name in it. -

    - - <%= api_example_authority_url_html(format: "json", key: api_key) %> - - <% if api_key %> - <%= render ButtonComponent.new(tag: :a, size: "xl", type: :primary, href: api_example_authority_url(format: "json", key: api_key)) do %> - View example - <% end %> - <% end %> -
    -
    - <%= render HeadingComponent.new(tag: :h3).with_content("Postcode") %> -

    - Return applications for a specific postcode area -

    - - <%= api_example_postcode_url_html(format: "json", key: api_key) %> - - <% if api_key %> - <%= render ButtonComponent.new(tag: :a, size: "xl", type: :primary, href: api_example_postcode_url(format: "json", key: api_key)) do %> - View example - <% end %> - <% end %> -
    -
    - <%= render HeadingComponent.new(tag: :h3).with_content("Suburb") %> -

    - Return applications in a suburb. Including “state” and “postcode” in the search is optional. +

    + Build, test and explore with live API data +

    +
    +

    + Enjoy up to + <%= ApiKey.default_daily_limit_trial %> + requests a day (returning up to a total of + <%= number_with_delimiter(ApiKey.default_daily_limit_trial * Application.max_per_page) %> + applications per day) for + <%= pluralize(ApiKey.default_trial_duration_days, "day") %>.

    - - <%= api_example_suburb_state_and_postcode_url_html(format: "json", key: api_key) %> - - <% if api_key %> - <%= render ButtonComponent.new(tag: :a, size: "xl", type: :primary, href: api_example_suburb_state_and_postcode_url(format: "json", key: api_key)) do %> - View example - <% end %> + <%= image_tag "illustration/key.svg", alt: "", size: "237x155", class: "my-8" %> + <% if current_user %> + <%= render ButtonComponent.new(tag: :a, size: "xl", type: :primary, href: confirm_api_keys_path).with_content("Create API key") %> + <% else %> +

    + To get an instant API key simply + <%= pa_link_to "create an account", new_user_registration_path %> + or + <%= pa_link_to "sign in", new_user_session_path %>. +

    <% end %> - +
    -
    -
    - <%# TODO: Using non-standard style %> - <%= render HeadingComponent.new(tag: :h2).with_content("Extra query parameters") %> -

    - There are several parameters that can be applied to each of the above queries for extra usefulness. +<% end %> + +

    + <%= render HeadingComponent.new(tag: :h2, extra_classes: "mb-6").with_content("What's in the API?") %> +
    +
    +

    + In our API you can find Australia-wide data, updated daily:

    -
    - <%= render HeadingComponent.new(tag: :h3).with_content("page") %> -

    - API calls return a maximum of <%= Application.max_per_page %> results. To retrieve more results simply do another request with page - set to 2, 3, etc… Not setting the page parameter is the same as requesting page 1. -

    - - <%= api_example_postcode_url_html(format: "json", key: api_key, postcode: "2780", extra_params: { page: 2 }) %> - -
    -
    - <%= render HeadingComponent.new(tag: :h3).with_content("count") %> -

    - API calls by default return a maximum of <%= Application.max_per_page %> results. To return less than that per page simply set the count parameter to the maximum number you want to return. +

    + <%= render BulletListComponent.new do |c| %> + <%= c.with_item.with_content("Single Location by longitude/latitude") %> + <%= c.with_item.with_content("Area by longitude/latitude") %> + <%= c.with_item.with_content("Planning authority") %> + <%= c.with_item.with_content("Postcode") %> + <%= c.with_item.with_content("Suburb") %> + <% end %> +
    + + <%# # TODO: Explain the general shape of the returned data. So far we've only explained how we can search for it. %> + + <%= pa_link_to "View the developer documentation", api_developer_path %> + +
    + <%= render HeadingComponent.new(tag: :h3).with_content("What's not in the API?") %> +

    + For privacy reasons our API does not return personal information including Planning Alerts user comments or names associated with applications.

    - - <%= api_example_postcode_url_html(format: "json", key: api_key, postcode: "2780", extra_params: { count: 10 }) %> -
    -
    -
    - <%= render HeadingComponent.new(tag: :h2) do %> - Warning about client side API queries - <% end %> -

    - Client-side API queries are supported using - <%= pa_link_to "CORS", "https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS" %>. You might do this, for example, - in a Javascript application that runs in the browser making requests directly to the Planning Alerts API. This is fine for testing. However, this should not be used - in production as you would be effectively making your API key public, which is a very bad. It is your responsibility to keep the API key - safe and secure. -

    -

    - Instead we recommend either loading the data ahead of time server-side and passing the data to your client or alternatively proxying the client-side requests - through your own server where you add the API key. -

    -
    -
    - <%= render HeadingComponent.new(tag: :h2).with_content("Usage") %> -

    - Low volume, - non–commercial - use of the API service is free. We ask that personal and non–profit use of this service attribute the OpenAustralia Foundation on your website or application. -

    -

    - Standard agreements for commercial use are at - <%= pa_link_to "oaf.org.au/standard-agreements/planningalerts-commercial", "https://www.oaf.org.au/standard-agreements/planningalerts-commercial/" %>. - Please - <%= pa_link_to "contact us", api_contact_path %> - for - commercial - use. Commercial users may include Real Estate Agencies, Architects, Planners or Builders. -

    -

    - Also, please - <%= pa_link_to "get in touch", api_contact_path %> - if you intend to use the service on a large scale. - In order to maintain quality of service for our API users, this service is rate limited by default to approximately <%= ApiKey.default_daily_limit %> requests per day. -

    -

    - We offer a range of paid options, from rate–limited to unlimited use of this service. -

    -
    -
    - <%= render HeadingComponent.new(tag: :h2).with_content("Be Nice") %> -

    - The Planning Alerts service is intended to help people be aware of what's happening in their local neighborhood, and to enable a civil discussion about those changes. -

    -

    - Don't use the service (or information obtained from the service) to market goods or services to individuals. -

    -

    - Don't use the service (or information obtained from the service) to harass or intimidate a person. + <%= image_tag "illustration/person_big_arms.svg", alt: "Illustration of headshot of three different people", class: "max-w-64" %> +

    +
    + +
    + <%= render HeadingComponent.new(tag: :h2, extra_classes: "mb-16").with_content("Some of our customers") %> + +
    + +
    + <%= render HeadingComponent.new(tag: :h2, extra_classes: "mb-6") do %> + Trustworthy and up to date data + <% end %> +
    +
    + 14 yrs +
    +

    + <%# TODO: Add something about complex automations and data integrity checks, etc.. %> + We've been doing this for more than 14 years with an extremely experienced team. + Leverage that for your own needs rather than trying to reinvent the wheel.

    -
    + diff --git a/app/views/documentation/api_landing.html.erb b/app/views/documentation/api_landing.html.erb deleted file mode 100644 index fa7acd783..000000000 --- a/app/views/documentation/api_landing.html.erb +++ /dev/null @@ -1,256 +0,0 @@ -<%= content_for :page_title, "Planning Alerts API" %> - -
    - <%# Using non-standard size %> - <%= render HeadingComponent.new(tag: :h1, size: "2xl") do %> - <%= yield :page_title %> - <% end %> - -

    - Seamlessly integrate planning alerts data into your custom application -

    - - <%= image_tag "illustration/data.svg" %> -
    - -
    - <%= render ProseComponent.new do %> -

    - <%# TODO: Is this saying too much of the same thing as the "who uses our API" section below? %> - Planning Alerts Application Programming Interface (API) serves community groups, businesses, NGOs, and civic-minded individuals by providing access to trusted planning and development application data. -

    - - <% end %> -
    - -
    - <%= render HeadingComponent.new(tag: :h2, extra_classes: "mb-6").with_content("Who uses our API?") %> -
    -
    -

    Lots of people!

    -

    - Real estate developers and agents, construction companies, urban planners, architects, - local government and municipalities, property management firms, community advocacy groups, environmental and heritage organizations, - academics, - legal firms, conveyancers, utility companies, insurance companies, researchers, tech startups and app developers are interested in this data. -

    -
    - <%= image_tag "illustration/headshots_three_people.svg", alt: "Illustration of headshot of three different people", class: "max-w-64" %> -
    -
    - -
    -
    -
    - <%= image_tag "plans/community.svg", alt: "", class: "mb-8" %> - <%= render HeadingComponent.new(tag: :h2, extra_classes: "mb-8") do %> - Community Plan - <% end %> -
    -

    - API data for strictly non-commercial use for public benefit. -

    -

    - $0 - AUD - / month -

    -
    - <%= render BulletListComponent.new do |c| %> - <%= c.with_item do %> - Return up to - <%= number_with_delimiter(ApiKey.default_daily_limit_community * Application.max_per_page) %> - applications per day - <% end %> - <%= c.with_item.with_content("Full use of the API") %> - <% end %> -
    -
    -
    -

    - <%= pa_link_to "Contact us", api_contact_path, extra_classes: "block" %> to apply -

    -
    - -
    -
    - <%= image_tag "plans/standard.svg", alt: "", class: "mb-8" %> - <%= render HeadingComponent.new(tag: :h2, extra_classes: "mb-8") do %> - Standard Plan - <% end %> -
    -

    - Set and forget reliable API service, effortlessly integrated into your application. -

    -

    - $3499 - AUD - + GST / month -

    -
    - <%= render BulletListComponent.new do |c| %> - <%= c.with_item do %> - Return up to - <%= number_with_delimiter(ApiKey.default_daily_limit_commercial * Application.max_per_page) %> - applications per day - <% end %> - <%= c.with_item do %> - 1 product - <% end %> - <%= c.with_item do %> - Priority email support - <% end %> - <% end %> -
    -
    -
    -

    - <%= pa_link_to "Contact us", api_contact_path, extra_classes: "block" %> - to sign up -

    -
    - -
    -
    - <%= image_tag "plans/premium.svg", alt: "", class: "mb-8" %> - <%= render HeadingComponent.new(tag: :h2, extra_classes: "mb-8") do %> - Premium Plan - <% end %> -
    -

    - More power and flexibility. Talk to us for pricing. -

    -

    - Potential add ons can include: -

    -
    - <%= render BulletListComponent.new do |c| %> - <%= c.with_item do %> - <%# TODO: Add documentation for bulk data API %> - Access to bulk data API - <% end %> - <%= c.with_item do %> - Multiple products - <% end %> - <%= c.with_item do %> - Return more than - <%= number_with_delimiter(ApiKey.default_daily_limit_commercial * Application.max_per_page) %> - applications per day - <% end %> - <%= c.with_item do %> - Search for applications by description - <% end %> - <%= c.with_item do %> - Customised integration options - <% end %> - <% end %> -
    -
    -
    -

    - <%= pa_link_to "Contact us", api_contact_path, extra_classes: "block" %> - to discuss your needs -

    -
    -
    - -<%# Only show this section if you don't have an API key yet %> -<% if api_key.nil? %> -
    -
    -
    - <%= render HeadingComponent.new(tag: :h2) do %> - Instant access <%= ApiKey.default_trial_duration_days %> day trial - <% end %> -

    - Build, test and explore with live API data -

    -
    -

    - Enjoy up to - <%= ApiKey.default_daily_limit_trial %> - requests a day (returning up to a total of - <%= number_with_delimiter(ApiKey.default_daily_limit_trial * Application.max_per_page) %> - applications per day) for - <%= pluralize(ApiKey.default_trial_duration_days, "day") %>. -

    - <%= image_tag "illustration/key.svg", alt: "", size: "237x155", class: "my-8" %> - <% if current_user %> - <%= render ButtonComponent.new(tag: :a, size: "xl", type: :primary, href: confirm_api_keys_path).with_content("Create API key") %> - <% else %> -

    - To get an instant API key simply - <%= pa_link_to "create an account", new_user_registration_path %> - or - <%= pa_link_to "sign in", new_user_session_path %>. -

    - <% end %> -
    -
    -<% end %> - -
    - <%= render HeadingComponent.new(tag: :h2, extra_classes: "mb-6").with_content("What's in the API?") %> -
    -
    -

    - In our API you can find Australia-wide data, updated daily: -

    -
    - <%= render BulletListComponent.new do |c| %> - <%= c.with_item.with_content("Single Location by longitude/latitude") %> - <%= c.with_item.with_content("Area by longitude/latitude") %> - <%= c.with_item.with_content("Planning authority") %> - <%= c.with_item.with_content("Postcode") %> - <%= c.with_item.with_content("Suburb") %> - <% end %> -
    - - <%# # TODO: Explain the general shape of the returned data. So far we've only explained how we can search for it. %> - - <%= pa_link_to "View the developer documentation", api_developer_path %> - -
    - <%= render HeadingComponent.new(tag: :h3).with_content("What's not in the API?") %> -

    - For privacy reasons our API does not return personal information including Planning Alerts user comments or names associated with applications. -

    -
    -
    - <%= image_tag "illustration/person_big_arms.svg", alt: "Illustration of headshot of three different people", class: "max-w-64" %> -
    -
    - -
    - <%= render HeadingComponent.new(tag: :h2, extra_classes: "mb-16").with_content("Some of our customers") %> - -
    - -
    - <%= render HeadingComponent.new(tag: :h2, extra_classes: "mb-6") do %> - Trustworthy and up to date data - <% end %> -
    -
    - 14 yrs -
    -

    - <%# TODO: Add something about complex automations and data integrity checks, etc.. %> - We've been doing this for more than 14 years with an extremely experienced team. - Leverage that for your own needs rather than trying to reinvent the wheel. -

    -
    -
    diff --git a/config/initializers/flipper.rb b/config/initializers/flipper.rb index d0b61c517..d1741a618 100644 --- a/config/initializers/flipper.rb +++ b/config/initializers/flipper.rb @@ -17,8 +17,7 @@ "maintenance_mode" => "Put a banner across the site and give helpful message to the user if trying to write to the database", "full_text_search" => "Allow searching for all applications containing the word 'tree', for example", "view_application_versions" => "Can view the update history of an application", - "request_api_keys" => "Allow a new experimental flow for requesting API keys", - "trial_api_keys" => "New API keys expire, new API landing page and user can show and manage API keys inside their profile" + "request_api_keys" => "Allow a new experimental flow for requesting API keys" } end diff --git a/spec/features/documentation_pages_spec.rb b/spec/features/documentation_pages_spec.rb index 1065aa6cb..200cbeadf 100644 --- a/spec/features/documentation_pages_spec.rb +++ b/spec/features/documentation_pages_spec.rb @@ -71,7 +71,7 @@ # TODO: Percy snapshot is being done in contact_us_spec.rb - very confusing end - describe "api page in the new design" do + describe "api landing page" do before do sign_in create(:confirmed_user, name: "Jane Ng") visit api_howto_path @@ -90,6 +90,25 @@ # rubocop:enable RSpec/NoExpectationExample end + describe "api developer page" do + before do + sign_in create(:confirmed_user, name: "Jane Ng") + visit api_developer_path + end + + describe "accessibility tests", :js do + it "passes" do + expect(page).to be_axe_clean + end + end + + # rubocop:disable RSpec/NoExpectationExample + it "renders a snapshot for a visual diff", :js do + page.percy_snapshot("API developer") + end + # rubocop:enable RSpec/NoExpectationExample + end + describe "get involved page in the new design" do before do sign_in create(:confirmed_user, name: "Jane Ng") diff --git a/spec/features/user_sign_up_spec.rb b/spec/features/user_sign_up_spec.rb index 009b8cc9d..3d282b913 100644 --- a/spec/features/user_sign_up_spec.rb +++ b/spec/features/user_sign_up_spec.rb @@ -6,7 +6,7 @@ include Devise::Test::IntegrationHelpers it "Successfully signing up", :truncation do - visit "/api/howto" + visit "/api/developer" click_on "register for an account" fill_in "Your full name", with: "Henare Degan"