There was a bug that displayed the error message with 2 red error boxes around the error message.
Also need another else to handle a new error message from the API, the old one can be removed after the API is deployed. But this can go first. I tested this branch with API master and the API branch with the change. I tested one off SMS and a CSV upload.
Some of the tests for buttons on the uploads page were not testing that
the right button was present / absent. There are hidden cookie buttons
in the HTML which means that we were sometimes finding one of these on
the page instead of the intended button.
On the service settings page, we changed the service setting buttons to
links some time ago, so tests that the buttons weren't on the page were
always passing.
flask_login sets a bunch of variables in the session object. We only use
one of them, `user_id`. We set that to the user id from the database,
and refer to it all over the place.
However, in flask_login 0.5.0 they prefix this with an underscore to
prevent people accidentally overwriting it etc. So when a user logs in
we need to make sure that we set user_id manually so we can still use
it.
flask_login sets a bunch of variables on the `flask.session` object.
However, this session object isn't the one that gets passed in to the
request context by flask - that one can only be modified outside of
requests from within the session_transaction context manager (see [1]).
So, flask_login populates the normal session and then we need to copy
all of those values across.
We didn't need to do this previously because we already set the
`user_id` value on line 20 of tests/__init__.py, but now that
flask_login is looking for `_user_id` instead we need to do this
properly.
[1] https://flask.palletsprojects.com/en/1.1.x/testing/#accessing-and-modifying-sessions
We had 7 classes in _grids.scss named `.column-...` which were being
used to give a certain column width. These worked by using `@include
grid column()`, which is now deprecated.
`.column-whole` and `.column-three-quarters` can be removed and replaced
with `govuk-grid-column-full` and `govuk-grid-column-three-quarters`
respectively. The other column classes don't have a direct replacment in
GOV.UK Frontend. To get round this, we overwrite the `$govuk-grid-width`
SASS map in `extensions.scss` to add in extra widths, then use this with
the `govuk-grid-column` mixin to create new classes in for our custom
widths in `_grids.scss`
Now that scheduled jobs are mixed in with regular jobs it looks weird
for the sort order to be different. This makes the sort order
consistently go from furthest in the future to furthest in the past.
The old sort order made sense when scheduled jobs were displayed
separately on the dashboard.
We’re going to change the jobs page so that it only shows jobs within
the last n days (your data retention)<sup>1</sup>.
This will match how long uploaded letters stick around for.
Therefore it’s not accurate to say ‘yet’, because that implies all-time.
Since the data retention for different channels could be different it’s
hard and maybe unhelpful to give an exact time period. ‘Recently’ is
content we used here before, but then changed.
1. https://www.pivotaltracker.com/story/show/171623239
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.
The postage covers up some of the letter, so it can hide the problem. It
also implies that the letter has been put in an envelope, which will
never happen if it fails validation.
This matches what we do for uploaded letters.
We didn’t have a test that checked for the first two lines of the
address being displayed when rendering one-off letters on the uploads
page.
I double checked in the database and we store addresses in the `to`
field with newlines, not commas.
This is the pattern we use to display counts of things on the dashboard
and usage pages. It does some nice stuff like dealing with
comma-separating and formatting monetary amounts.
This commit also adds some logic to show the free allowance used if the
service hasn’t spent anything on text messages yet.
We think that we need to make it clear what the difference between
uploading a letter and uploading a spreadsheet is, and where you go to
do each.
We get some confusion about uploading being behind the ‘Send’ button on
the template page. There’s some concern that launching the upload page
will increase this confusion, unless we head it off with some messaging.
I’m hoping that if I can design something that clearly differentiates
them then we won’t need to do so by putting them in separate tables,
which then need labelling, which would clutter up the page.