branch for "has service sent anything today" was around the intial
paragraph, rather than around the "you can still send..." bit -
they should always see the first paragraph, especially the bit that
points out if they're in trial mode. They don't need to see how
many messages they have remaining today if it's the same amount as
their daily limit.
we don't want to use the old statistics endpoints any more
also a couple of quality of life changes
* moves some logic out of the _totals.html template
* tidies up statistics_utils
When we say ‘delivery information is available for 7 days’ you have to
infer _when_ the seven days starts. When you come back to the page it
still says ‘available for 7 days’ even if you only have a day left to
download it. This is confusing.
This commit changes the text to be relative to now, eg ‘available for 7
days’, ‘available for 1 day’.
The date is counted to midnight on the seventh day, which is when the
data is actually deleted.
The previous text didn’t make it clear _what_ you were downloading as a
CSV file, you had to infer it from the context.
And the fact that it’s a CSV file is immaterial, it’s the data you care
about, not the format.
Tables with a `layout` of `fixed` determine column widths from the
width of the column headings.
We weren’t setting the width of the first column heading, so our tables
were getting out of alignment.
There’s no point in collapsing […] the email on the single template
page because it’s the only thing on the page.
Users will probably be going back and forth quite a bit to edit their
template and see the changes; they shouldn’t have to expanded it evey
time to check they’ve got the heading syntax right, for example.
Implements: https://github.com/alphagov/notifications-utils/pull/51
Copies the same regex.
Adds some CSS to display conditional placeholders differently to
normal placeholders (vertical rather that curved right-hand edge).
Currently images in our email template are hardcoded to be served from
the live domain[1].
In order for the admin app, running locally or in preview/staging, to be
able to load these images when previewing an email template, the CSP
headers need to allow this domain.
Also splits the header string up using string literal concatenation[2]
so that it’s easier to read.
1. https://notifications.service.gov.uk
2. https://docs.python.org/3/reference/lexical_analysis.html#string-literal-concatenation
If something has failed and you don’t know why, you should be able to
find out why. Let’s try adding a link to the page explaining why, so
it’s not just buried in the footer.
This commit makes the CSV download use the same language for failure
reasons as the frontend.
It also adds a test around this stuff, which was patchily tested before.
‘Phone number doesn’t exist’ as opposed to ‘Permanent failure’ has
tested well because it talks in terms of things people understand.
We should do the same for ‘Temporary failure’, because users are
unclear:
- why this is happening
- if it’s temporary, is Notify going to retry it (it’s not)
We think that ‘Phone/inbox not currently accepting messages’ answers
makes these things clearer.
I’ve reworded it slightly to:
- ‘Inbox not accepting messages right now’
- ‘Phone not accepting messages right now’
Right now, a user can change their name and masquerade as someone else
and the service manager has no way of telling who is who.
This is also true for platform admins, where they can see the users of
a service but can’t identify which department they are from.
This commit adds a user’s email address next to their name to remedy
this.
The team page was a bit of a mess:
- invited and active tables didn’t line up
- lots of things were wrapping onto two lines
- the empty fields for when a user didn’t have permissions looked broken
This commit splits each row of the table (not actually a table any more)
onto two lines. First line has the user’s info, second has their
permissions and any associated actions.
This is re-fixing a bug which was re-introduced when adding the
`Spreadsheet` class in 1409ca36ca.
It was previously fixed in 19662d8329:
> Fix bug with large file uploads
>
> Depending on the size of the uploaded file, Flask will temporarily store
> it in different ways. This means that it comes back as a `TempFile` if
> the file is roughly <500k and as `BytesIO` if the file is larger.
>
> `TempFile` supports the `.getvalue()` method, but `BytesIO` does not.
> Both support the `.read()` method, so this commit changes to use that
> instead.
This visually chunks the page up into three parts:
- keys
- service ID
- documentation
Also fixes the documentation link (because it’s not service-specific).
Since this page is more than just your API keys, it should be named
something else.
Hopefully the word ‘integration’ will give non-techical users a clue
that it’s possible to use Notify without doing the CSV dance.
Our templates are a littered with `request.args.get('help', '0')`.
This commit refactors these into a single helper method, which can be
used by the view functions, then passed to the template.
This makes the templates cleaner, and should make it easier to refactor
`help` out of the query parameters entirely in the future.