Commit Graph

1076 Commits

Author SHA1 Message Date
Chris Hill-Scott
ab150d876d Stop letting people enter empty SMS senders
This shouldn’t be deployed until we’ve migrated the database to default
to GOVUK.
2017-05-19 22:42:17 +01:00
Chris Hill-Scott
42ebc44b83 Make removing placeholders a non-breaking change
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.
2017-05-17 13:10:23 +01:00
Chris Hill-Scott
d9f5884e3d Fix argument order bug with page count 2017-05-16 11:43:19 +01:00
Chris Hill-Scott
11394bce8e Merge remote-tracking branch 'origin/all-pages-everywhere' 2017-05-16 11:22:33 +01:00
Chris Hill-Scott
24817de387 Merge remote-tracking branch 'origin/spreadsheet-error-tweaks' 2017-05-16 11:22:19 +01:00
Chris Hill-Scott
acae449ab9 Show all pages of a letter everywhere
Right now showing all the pages in full is the only way we have of
showing a letter that makes sense to our users. Maybe in the future we
show some kind of truncated version, but the end of the first page is
not a good place to truncate the letter.

This commit just extracts the code for showing multiple pages from the
template view, refactors it for reuse, and includes it in the send
views.
2017-05-16 11:09:34 +01:00
Chris Hill-Scott
d37f7b6bc5 Don’t repeat _your file_ at start of paragraph
Looks weird, like we’re telling you two contradictory things. Doesn’t
scan well.
2017-05-11 11:33:25 +01:00
Chris Hill-Scott
f836f206e6 Say ‘missing’ rather than ‘doesn’t have’
Missing gives more of a suggestion that this is something to be fixed,
rather than just a statement of fact.
2017-05-11 11:23:58 +01:00
Chris Hill-Scott
30fe6db2e2 Don’t repeat names of columns in the error message
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.
2017-05-11 11:14:27 +01:00
Chris Hill-Scott
3bccf39c77 Make the ‘no recipient column’ error more concise
Word salad.
2017-05-11 11:11:59 +01:00
Chris Hill-Scott
0697c62616 Hide the recipient table on send yourself a test
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.
2017-05-11 10:55:44 +01:00
Chris Hill-Scott
bf15c12380 Merge pull request #1259 from alphagov/letters-are-a-thing
Tell users that letters are coming
2017-05-05 14:10:34 +01:00
Leo Hemsted
d6de5508ca make sure static subdir 404s correctly
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
2017-05-04 11:28:45 +01:00
Ken Tsang
79e1df33cf Update rates to avoid confusion 2017-05-03 13:19:15 +01:00
Ken Tsang
829bcd632f Handle future dates 2017-05-02 14:10:56 +01:00
Chris Hill-Scott
3e16372169 Tell users that letters are coming
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.
2017-05-02 11:04:24 +01:00
Ken Tsang
53e78c2b60 Update page to handle international stats 2017-04-28 14:49:41 +01:00
Ken Tsang
79b4b37b0e Add tests for sms breakdown adjusted free allowance 2017-04-28 14:49:41 +01:00
Ken Tsang
260dfb1e32 Updated code and added tests 2017-04-28 14:49:41 +01:00
Chris Hill-Scott
55a0ed22d9 Merge pull request #1252 from alphagov/international-invite
Tell users international text messaging is coming
2017-04-28 13:27:06 +01:00
Leo Hemsted
cf125d0a14 add sent as a new status
functions as delivered - shows up in delievered column, contributes
to delivered stats etc.
2017-04-27 16:17:10 +01:00
Chris Hill-Scott
49b73cfe63 Tell users international text messaging is coming
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.
2017-04-27 14:35:00 +01:00
Chris Hill-Scott
ca90c922ed Merge pull request #1250 from alphagov/validate-international-csv
Allow international phone numbers in spreadsheet
2017-04-27 14:27:52 +01:00
Chris Hill-Scott
fd7a34f1e4 Allow international phone numbers in spreadsheet
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
2017-04-27 13:52:04 +01:00
Chris Hill-Scott
de2886dbaf Remove ‘human-readable’ phone number formatting
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.
2017-04-27 13:50:55 +01:00
Chris Hill-Scott
1a05e33fa4 Fix 500 error if revisiting registration page
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
¯\_(ツ)_/¯
2017-04-27 11:55:50 +01:00
Chris Hill-Scott
dfbe330fa9 Don’t show scheduler when sending letters 2017-04-26 10:49:51 +01:00
minglis
5352c81e99 Merge pull request #1244 from alphagov/order-platform-admin-by-activity
Sort platform admin page by requested messages.
2017-04-26 10:23:18 +01:00
minglis
afc14d3648 Merge pull request #1241 from alphagov/feat-show-intl-providers-on-page
Show intl providers separately on providers page
2017-04-26 09:56:37 +01:00
kentsanggds
e37ce051e7 Merge pull request #1240 from alphagov/add-international-sms-feature-flag
Add international sms feature flag
2017-04-25 19:09:07 +01:00
Imdad Ahad
116eac60d1 Handle case where provider does not have international flag 2017-04-25 16:26:33 +01:00
Chris Hill-Scott
05b9f6e736 Merge pull request #1237 from alphagov/multi-page-previews
Show all pages of a letter in the app
2017-04-25 15:33:22 +01:00
Martyn Inglis
146772f22e Sort platform admin page by requested messages.
- puts services that are doing things at the top.
2017-04-25 12:54:58 +01:00
Imdad Ahad
1788f10959 Show intl providers separately on providers page 2017-04-25 11:10:59 +01:00
Ken Tsang
d958a58b1b Tests for enable / disable international sms 2017-04-24 14:02:07 +01:00
Ken Tsang
b1706fd213 Updated service settings for international sms 2017-04-24 13:52:10 +01:00
Chris Hill-Scott
eb9214978e Merge pull request #1234 from alphagov/letter-branding
Add platform admin setting for letter branding
2017-04-24 10:33:39 +01:00
Chris Hill-Scott
75f5829c1e Get organisations list from API rather than config
Hard coding the organisations means this information is duplicated
between the admin and the API, and could get out of sync.
2017-04-24 10:25:37 +01:00
Chris Hill-Scott
cfc031cfbf Pass dvla_org_id through to template preview app 2017-04-24 10:25:36 +01:00
Chris Hill-Scott
61470391bf Add platform admin setting for letter branding
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
2017-04-24 10:25:36 +01:00
Imdad Ahad
341143451b Merge pull request #1236 from alphagov/fix-csv-download-timeout-issue
Fix CSV download timeout issue
2017-04-21 17:11:48 +01:00
Chris Hill-Scott
36db0ad598 Show all pages of a letter in the app
In research we’ve seen two problems with the click-to-see-PDF thing:

- it’s not very intuitive that the letter is clickable, or what you
  can expect when clicking the letter
- people get lost of stuck in the PDF view because it opens in the same
  tab, or they open it in a new tab and then get find their way back, or
  …

So this commit changes the show template page to show the entire
contents of the letter, same as we do for emails and text messages.

Right now it only does it on the view template page. I think we’ll have
to work out a way of showing some kind of truncated version on the _Send
yourself a test_ and _Preview_ pages. But that’s for later.
2017-04-20 15:57:43 +01:00
Imdad Ahad
6c377b0ecd Remove unused method 2017-04-20 15:20:02 +01:00
Imdad Ahad
19f42a8984 Refactor report download:
* Remove formatting (most performance intensive) as this will happen on API
* Remove buffering of notifications so we can yield them back straight away
* Refactor existing tests to match new format of the notification resp for csv
2017-04-20 15:18:42 +01:00
Chris Hill-Scott
76c1de1460 Merge pull request #1232 from alphagov/move-delete-link
Move delete link from the edit template page to the view template page
2017-04-20 14:18:35 +01:00
Leo Hemsted
4fcee5f216 Merge pull request #1224 from alphagov/letters-from-a-service
Letters from template-preview service
2017-04-18 15:56:24 +01:00
Chris Hill-Scott
5b763d935a Remove template type parameter on redirect
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.
2017-04-18 13:49:01 +01:00
Chris Hill-Scott
267b58a66d Stop template subjects getting saved encoded
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
2017-04-14 08:52:02 +01:00
Ken Tsang
b02df9ba4b Redirect after letter-jobs post 2017-04-12 18:19:55 +01:00
Leo Hemsted
d655a38e14 don't allow bad filetypes to preview 2017-04-12 12:12:11 +01:00