Commit Graph

262 Commits

Author SHA1 Message Date
David McDonald
d4ed909d0f Revert "Revert "Statsd to prometheus"" 2020-07-01 13:27:12 +01:00
David McDonald
5fb58260e2 Revert "Statsd to prometheus" 2020-07-01 10:00:39 +01:00
David McDonald
043e6ac69c Add GDS metrics package to admin app
Follows the code from the API
2020-06-30 14:24:34 +01:00
Chris Hill-Scott
45697aac43 Stop expecting letter contact block in service JSON
We’re removing it for performance reasons.

This means removing the old pages that edited the letter contact block
when it was stored directly on the service, rather than the current
model where a service can have multiple contact blocks.
2020-06-23 08:13:52 +01:00
Chris Hill-Scott
8bc5fa5bb0 Rename URL to remove term ‘whitelist’
See c31264d4c for rationale. To avoid confusion the codebase should use
the same terminology as the UI.
2020-06-12 10:27:55 +01:00
Chris Hill-Scott
23f9728108 Rename endpoint to remove term ‘whitelist’
See c31264d4c for rationale. To avoid confusion the codebase should use
the same terminology as the UI.
2020-06-12 10:26:59 +01:00
Chris Hill-Scott
f12f0fae87 Remove robots.txt
Google’s documentation says:

> robots.txt is not a mechanism for keeping a web page out of Google. To
> keep a web page out of Google, you should use noindex directives

We’ve implemented a noindex directive now, so we don’t need to serve
robots.txt any more.
2020-05-27 10:20:07 +01:00
Chris Hill-Scott
de459e5709 Redirect old URL 2020-05-21 11:17:44 +01:00
karlchillmaid
a823f3d77f Update who_its_for to who_can_use_notify 2020-05-20 15:54:15 +01:00
Chris Hill-Scott
2800b0a0c3 Add page to show all uploaded letters
Because we won’t be showing uploaded letters individually on the uploads
page any more we need a way of listing them. This should be by printing
day, to match how we’re grouping them on the uploads page.

This code reuses the notifications.html template, but flips the
precedence of the filename and recipient because I reckon when you’re
looking at uploads you’re thinking filename-first.
2020-05-11 14:27:43 +01:00
Chris Hill-Scott
3e6d9a564b Add interstitial page before using email auth token
Some email clients will pre-fetch links in emails to check whether
they’re safe. This has the unfortunate side effect of claiming the token
that’s in the link.

Long term, we don’t want to let the link be used multiple times, because
this reduces how secure it is (eg someone with access to your browser
history could re-use the link even if you’d signed out).

Instead, this commit adds an extra page which is served when the user
clicks the link from the email. This page includes a form which submits
to the actual URL that uses the token, thereby not claiming the token as
soon as the page is loaded.

For convenience, this page also includes some Javascript which clicks
the link on the user’s behalf. If the user has Javascript turned off
they will see the link and can click it themselves. This is going on the
assumption that whatever the email clients are doing when prefetching
the link doesn’t involve running any Javascript.

This Javascript is inlined so that:
- it is run as fast as possible
- it’s more resilient – even if our assets domain is unreachable or the
  connection is interrupted, it will still run
2020-05-04 15:53:27 +01:00
Chris Hill-Scott
ae8dd8e8cd Tidy up the platform admin pages
This commit does two things:
- brings the ‘All organisations’ page back within the platform admin
  part of the site (because it’s hard to find otherwise)
- makes the layouts of all the pages within platform admin a bit closer
  to the service-specific pages in terms of heading sizes, spacing, etc
  so that moving between them doesn’t feel so jumpy
2020-04-23 13:50:36 +01:00
Leo Hemsted
c4d839d4f5 input letter address data in a single block
rather than in multiple placeholders - this is the first step towards
making postcodes non-required, which is the first step towards
international letters.

they still populate address_line_# and postcode fields under the hood -
to keep validation working the same, the last line always goes into
`postcode`.

the form normalises whitespace, removes extra new lines, and enforces
that you have between three and seven lines.

if the letter repeats address placeholders further down (eg "Dear
((address_line_1))"), then it'll fill those in as well. It'll still
prompt you to fill them in, but they'll be pre-filled.
2020-03-30 19:29:26 +01:00
Chris Hill-Scott
57ec58ab4e Merge pull request #3377 from alphagov/delete-contact-list
Let users delete a contact list
2020-03-27 16:13:32 +00:00
Chris Hill-Scott
41dd7a883b Add who’s its for page
We have a policy about how suppliers are allowed to use Notify. But we
don’t explain it anywhere. Which drives contact to our support form.

This commit that adds a new page that explains the policy.

I’ve moved the related content about who else can use Notify from the
get started page to this page as well, where it doesn’t need to sit in
a details element.
2020-03-26 14:55:51 +00:00
Chris Hill-Scott
61ab9661fb Direct members of the public somewhere more useful
We can’t give advice to members of the public, but increasingly we’re
seeing them try to use our support form to ask.

It would be better for them if we can direct them straight to somewhere
more useful, before they have the chance to raise a support ticket.

This commit replaces the report a problem/ask a question triaging for
users who aren’t signed in. It’s not possible for non-signed-in users to
raise an priority 1 ticket, so we never need to triage the tickets in
this way.

Instead we can triage people based on whether they work in the public
sector or not. If they do then we send them on to the feedback form. If
not then they go to a new page which contains some useful links. We’ve
chosen these links based on some analysis of the support tickets we’ve
received recently[1]

1. https://docs.google.com/spreadsheets/d/1uBQn-ZnCYfz6ltFaUKZpytgvBF0-MeshCLZ1cD74R0c/edit?usp=sharing
2020-03-24 17:48:11 +00:00
Chris Hill-Scott
8f15eee5e0 Let users delete a contact list
Follows our standard pattern of confirming with a red banner for actions
that are destructive.
2020-03-19 15:17:01 +00:00
Chris Hill-Scott
2a76fd9ee8 Reduce usage of the platform admin index page
This page is slow to load which means:
- it’s annoying for us
- it’s potentially causing load on the database

This commit does two things to reduce the amount we’re unnecessarily
looking at this page:

1. Avoid redirecting to it when signing in as a platform admin user
2. Don’t go directly to it when clicking ‘platform admin’ at the top,
   but instead show a holding page (there’s a fair chance you’ve clicked
   that link in order to go and manage some email branding or find a
   user, not wait for stats to load)
2020-03-19 10:59:21 +00:00
Chris Hill-Scott
b598af1eca Add an endpoint to download a contact list
In case you need to download it, modify it, and re-upload it when you
don’t have access to the existing list.
2020-03-16 13:08:46 +00:00
Chris Hill-Scott
e24083ce9d Add a page to choose a contact list
You’ll be able to use a contact list by first choosing a template, then
choosing the list you want to use.

At the moment this shows all lists, not just the ones that are
compatible with your template.
2020-03-16 13:08:07 +00:00
Chris Hill-Scott
460b779d11 Add endpoint to redirect from contact list to send
In order to use a contact list we’re going to put you in the normal
upload a spreadsheet journey. Except without having to upload again.

So this commit adds an endpoint that takes the file from the contact
list bucket, puts it in the same place it would have gone if you’d
uploaded it, then sends you on your way.
2020-03-16 13:07:46 +00:00
Chris Hill-Scott
1c02476ee7 Let users upload a contact list to use later
We increasingly have teams wanting to do business-continuity type
messaging. They might be without access to their normal systems, which
is where they would otherwise go to get the list of email addresses or
phone numbers.

So we want to give them a place in Notify where they can store their
spreadsheets and use them at a later date.

For the initial pass we’re going to scope this to only allowing
spreadsheets with one column, ie just phone numbers/email addresses.
This is because:
- it minimises the amount of personal info we’re storing
- it reduces the chance of getting a placeholder error when you go to
  send the message, which is probably a high-stress situation where you
  might not be able to re-generate the file

The code for this is mostly copied from the existing upload CSV journey.
It’s quite duplicative, but that’s what I needed to do to get this out
quickly. There are opportunities for refactoring later.

Similarly, I would have liked to split this up into better commit
messages, but it really was a case of just bashing code out until it
worked 😳

This commit does not:
- implement the ‘view a contact list page’ (it just has a placeholder
  because the API isn’t ready at the moment)
- link to this page (because it’s not ready to use yet)
2020-03-16 13:07:28 +00:00
Chris Hill-Scott
3df3db1609 Fix navigation around uploads and jobs
The uploads and jobs page should start showing in the _Uploads_ menu on
the left hand side.

If you’ve navigated to a job from the uploads page (ie you haven’t got
to that page because you’ve just sent the job) then you should see a
link back to the uploads page.
2020-03-03 14:33:20 +00:00
Pea Tyczynska
a601d6e700 Send files by email on for everyone and only depending on service
having contact details set up.

Display not set up yet for send files by email row when contact_link not set up
2020-02-27 13:36:27 +00:00
Tom Byers
9a6916ff31 Replace links in navigation
Includes:
- removing all styling of those links
  outside of GOV.UK Frontend (except for a few fixes
  due to their interaction with our design)
- bringing together some duplicate styles into one
  block
- changing how links are marked as selected, now
  they have multiple classes

Fix Sass-lint error in navigation.scss
2020-02-25 10:52:03 +00:00
Tom Byers
5b306dde4d Revert "Convert all links to govuk frontend" 2020-02-24 11:56:38 +00:00
Tom Byers
97172cca30 Merge branch 'master' into convert-all-links-to-govuk-frontend 2020-02-24 10:12:58 +00:00
Chris Hill-Scott
d00e37541c Make dashboard navigation active for returned letters 2020-02-20 11:58:57 +00:00
Tom Byers
c51d414197 Replace links in navigation
Includes:
- removing all styling of those links
  outside of GOV.UK Frontend (except for a few fixes
  due to their interaction with our design)
- bringing together some duplicate styles into one
  block
- changing how links are marked as selected, now
  they have multiple classes

Fix Sass-lint error in navigation.scss
2020-02-20 09:11:26 +00:00
Pea Tyczynska
caf77341b3 Send 2fa email and move user to waiting page when they need to re-validate email access 2020-02-17 11:34:24 +00:00
Katie Smith
a26e8c55ef Remove unused pages with buttons
We had two templates that contained a link styled as an old style
button but that weren't being used anywhere (one would actually give a
`500` if you tried to visit it). This removes them and the view function
for one of them (the other no longer had a view function).
2020-02-17 08:05:05 +00:00
karlchillmaid
38fd842d33 Merge pull request #3213 from alphagov/add-guidance-content
Add first iteration of guidance content, including updating navigation menus and footer.
2020-02-12 11:43:07 +00:00
Chris Hill-Scott
d29f23bfc8 Add left hand navigation
Due to the way the navigation dictionaries are built this mean being
less smart about the view method for the guidance pages.
2020-01-24 16:25:32 +00:00
Pea M. Tyczynska
ba6b412bca Merge pull request #3268 from alphagov/proper-form-for-letter-branding
Parametrise branding request flow so it serves both email and letter branding
2020-01-23 16:50:41 +00:00
Chris Hill-Scott
365fcb0ff8 Add guidance pages to navigation classes 2020-01-23 16:03:27 +00:00
Pea Tyczynska
5a32177982 Delete old letter branding request page 2020-01-21 16:47:42 +00:00
Chris Hill-Scott
3762daad84 Add a redirect for the letter specification
This way we have a URL we can give people that always points to the
latest version of the spec.

And it makes our code more Flask-idiomatic to be using `url_for` to be
generating a URL, rather than passing around a constant.
2020-01-15 11:54:14 +00:00
Chris Hill-Scott
3b7dc05dd6 Add a page for each report
It’s useful to get some kind of preview of the report before you
download it.

And if there’s only a few letters in there then you might not even need
to download it at all.

For teams with lots of letters we don’t want the page to load too slowly
so let’s cap the number of displayed items to 50, same as previewing
a spreadsheet.
2019-12-31 14:39:12 +00:00
Rebecca Law
729281532d Added returned-letter-summary page.
This page displays a list of available reports, a report is a set of returned lettters that have been reported on the same day.
Each line of the page is a link that can download the report.

I'm not sure the format of the csv is right. The data might be confusing especially if the service has a mix of precompiled templates and jobs.
Units tests are still to come.
2019-12-24 08:44:56 +00:00
Chris Hill-Scott
16ebdfeb8b Add page showing priority of two SMS providers
It’s not very useful to know the priority of one provider without
knowing the other. And these pages were never really designed, so they
weren’t super easy to understand anyway.

This commit adds a page that takes the first two text message providers
and shows their relative priority against each other.

It follows the design of the events page, as a pattern for showing a
log of historical events.
2019-12-11 10:17:44 +00:00
Leo Hemsted
3be9150dcf change letter previews to be in the no_cookies blueprint
this blueprint should be applied to every endpoint that is loaded async
(as in via a src tag on an img, iframe, etc)
2019-12-03 17:06:15 +00:00
Chris Hill-Scott
41113081f3 Merge pull request #3201 from alphagov/remove-letter-validation-preview
Remove the letter validation preview endpoints
2019-11-27 15:53:27 +00:00
Chris Hill-Scott
b9de27d1c2 Remove the letter validation preview endpoints
We can use the ‘Uploads’ feature to check if letters are printable now.

This code works in a completely different way, so if we kept it we’d
have to maintain two different code paths, and make sure that they
didn’t diverge.

Also deletes the related HTML templates.
2019-11-27 14:28:42 +00:00
Tom Byers
ec72bcd00c Fix issues raised in pull request
Includes:
- replacing of conditional with statement that
  returns the same values
- making lins to GDS page actually go there
2019-11-27 14:15:32 +00:00
Tom Byers
2271ff3d56 Use header component for masthead
Replaces the following blocks/variables with the
`header` block filled by the `header` component:
- header_class
- proposition_header
- global_header_text
- homepage_url

Also rewrites code that selects header nav items

The original code inserts a class name to mark the
nav item as selected.

The GOVUK Frontend header just needs a boolean to
be passed to indicate an item is selected.

This uses the `header_navigation.is_selected`
method, as before, but changes its return value to
a boolean.
2019-11-27 14:15:31 +00:00
Tom Byers
e09d510ab8 Revert "Replace govuk template with govuk frontend components - rewrite" 2019-11-26 12:14:09 +00:00
Tom Byers
d695823d55 Fix issues raised in pull request
Includes:
- replacing of conditional with statement that
  returns the same values
- making lins to GDS page actually go there
2019-11-25 11:43:30 +00:00
Tom Byers
be2f246995 Use header component for masthead
Replaces the following blocks/variables with the
`header` block filled by the `header` component:
- header_class
- proposition_header
- global_header_text
- homepage_url

Also rewrites code that selects header nav items

The original code inserts a class name to mark the
nav item as selected.

The GOVUK Frontend header just needs a boolean to
be passed to indicate an item is selected.

This uses the `header_navigation.is_selected`
method, as before, but changes its return value to
a boolean.
2019-11-25 11:43:30 +00:00
Tom Byers
e02f94f238 Revert "Replace govuk template with govuk frontend components" 2019-11-25 10:37:35 +00:00
Tom Byers
aa9df17ef3 Fix issues raised in pull request
Includes:
- replacing of conditional with statement that
  returns the same values
- making lins to GDS page actually go there
2019-11-22 17:45:45 +00:00