On the team and templates pages we have a pattern for adding a new
‘thing’, which is a green button in the top right.
This commit changes the API key page to follow the same pattern.
When we show an identifier, like an ID or a key, we have a pattern which
adds a ‘copy to clipboard’ button. We weren’t using this pattern for
service ID.
This commit also moves it under the table, so hopefully people will be
less likely to confuse the service ID for an API key when scanning down
the page.
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.
Screen reader users have the option to navigate by jumping between
anchor tags and reading out the content. "Find out more" does not
provide a lot of context about what the link does.
This commit adds some visually hidden text which screen readers will
still read that makes the link work without the visual context.
With the upgrade of pep8 to 1.7.0 module imports are required to be at the top of the file,
meaning I had to add a noqa line to some of the init files. Are those init files wrong or is pep8 too strict.
On the check page, we show what the message will look like with the data
from the first row of the CSV, if the CSV contains all the required
data.
We should do the same for the subject line.
> We show the last weeks template usage on the dashboard, which is
> great, but if you're looking for longer term trends, you're out of
> luck...
> So, let's let you see more on a more detailed page (linked from the
> dashboard). Initially this should just show you all templates that you
> have used ever and the count for each. Order same as dashboard, most
> popular first.
https://www.pivotaltracker.com/story/show/117614585
Previous the table of templates on the dashboard was for all time.
This commit uses the `limit_days` parameter of the API endpoint to only
show template usage from the last 7 days, aligning with the big numbers
shown above.
We want to align all our stats to be for the last 7 days.
This means summing up the stats response from the API to make the Big
Number. Previously the big number was counting sent notifications as
successful. This commit changes it to only look at delivered
notifications.
Right now, the API doesn’t have a way of filtering to only show the last
7 days. So for the moment the dashboard will show statistics for all
time.
The upshot of this is that we can link from the dashboard to the
activity page when there are failures.
Elsewhere (eg the dashboard, the activity page) we have email first.
Emails are also anticipated to be slightly more popular in terms of the
number of services sending them.
Therefore it makes sense to have emails first in the main navigation.
For users who:
- want to send messages from a template
- want to edit templates
For developers:
- who need to get the ID of a template
This commit mainly cleans up the choose template page so there are less
options, and the options that are there are less wordy.
This means:
- moving ‘send yourself a test’ onto the send messages page, and making
it button
- stripping a lot of stuff out of the ‘send from API’ page, so it’s more
obvious what the template ID is