The CSV upload route has always quietly ignored excess personalisation.
We changed the API to do the same here:
https://github.com/alphagov/notifications-api/pull/853
This means that removing a placeholder from a template is never a
breaking change, because the data that you were providing to populate it
is now just ignored.
So we don’t need to show the interstitial page in this case.
It makes the error message quite noisy.
We’re going to move the table right underneath the error message, so
you’ll be able to see the column names right there.
Send yourself a test is:
- a good way of explaining how placeholders work
- a useful tool for checking your work before you send a big batch
It’s not a good way of learning about the relationship between columns
in a spreadsheet and placeholders. The ‘example spreadsheet’ thing is
good at making that connection. The table on this page isn’t, because
it doesn’t _feel_ like you’re making a spreadsheet with the send
yourself a test feature (even though that’s what you’re doing in the
background). This will be even more the case when we stop putting the
input boxes horizontally on one page.
By removing the table from this page it makes the page simpler, which
allows people to focus on the important thing – what’s happening to
their message.
before each request, we put the current service on the flask session,
except for with the static folder, cos it's not needed.... except, if
we 404, then we return the 404 template, which checks if you're logged
in or not to display different nav bar items. This was crashing when
current_service wasn't set, so we now set it.
also cleaned up some imports and stuff in test files
Users might be interested in letters. And when they’re fully
available, users will probably be able to control whether letters are
on/off for their service.
Until that point, the only way of getting the feature is to ask us. So
let’s make an in-the-meantime page that directs them to ask us, from the
place where they’d be able to do it themselves.
Wording TBC.
Users might be interested in international SMS. And when it’s fully
available, they’ll probably be able to control whether it’s on/off for
their service.
Until they point, the only way of getting it is to ask us. So let’s
make an in-the-meantime page that directs them to ask us, from the place
where they’d be able to do it themselves.
If a service can send internationally, our CSV validation should not
catch valid international phone numbers. This means calling through
to code added to utils in:
- [ ] https://github.com/alphagov/notifications-utils/pull/156
This has been removed from utils (so things will break if utils is
upgraded without this change isn’t made). I think it’s friendlier to
present the phone number as the user entered it anyway – because this is
what they think a ‘correct’ phone number representation looks like
anyway.
If you go back to this part of the registration flow then you get a 500
error, because we’re relying on something in the session. We clear the
registration info from the session after you’ve registered successfully.
Also there were no tests for the happy path of this page either
¯\_(ツ)_/¯
Does two main things:
- defines what ‘brands’ we support, in terms of the ID that DVLA use
- adds a form to choose which branding a service uses (currently
platform admin only, like email branding)
By doing this we will be able to (with some more work) preview and send
letters with a variety of different branding.
Story: https://www.pivotaltracker.com/story/show/143506905
This is a hangover from when we had separate email/SMS template pages.
If the view doesn’t use a parameter Flask adds it to the querystring. So
we were getting URLs that ended in `?template_type=sms`, to no effect.
This is another problem with sanitising HTML, this with with it getting
encoded where it shouldn’t be. The result was, when editing a template,
the API getting sent an encoded rather than raw version of the subject
(for letters and emails).
The reason this happened is because BeautifulSoup behaves in an
unexpected way.
When accessing the `value` attribute of an `input` BeautifulSoup returns
an unencoded version of the contents. In other words it returns what the
user would see in the page, not what is in the raw HTML of the page.
This meant that we were trying too hard to see an `&` instead of a
`&` in our tests[1]. So things were actually working fine before adding
the call to `escape_html`[2], but from the output of the tests it didn’t
look like HTML was getting escaped.
So this commit fixes the bug by removing the call to `escape_html` and
adding a test that looks at the raw HTML, to complement the existing
test which looks at just the `value` attribute.
1. Relevant test added here: https://github.com/alphagov/notifications-admin/pull/1178/files#diff-f2eb304b93cc383727c0ab7fc8fbd464R289
2. Call added here: https://github.com/alphagov/notifications-admin/pull/1178/files#diff-f0af582449ebf426f27f37e38f310057R252
We’ve seen in letters usability testing that people get stuck in a
“no-man’s land” when trying to go back from the _Send yourself a test_
page.
This was broken for two reasons:
- we hadn’t considered that a letter template without placeholder still
requires you to fill in
- we’ve changed subsequently made the _view template_ page the place
where you do your actions, rather than the (old) page with all the
templates shown
So this commit fixes it so that the back link always take you back to
the page you were previously on, and adds some more test cases so we
have all the scenarios accounted for.