Commit Graph

1114 Commits

Author SHA1 Message Date
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
09a5065a78 Merge remote-tracking branch 'origin/main-heading' 2017-05-16 11:22:48 +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
3efae3a57f Call letter subjects ‘main heading’
This is a term that one of our research participants used to describe
the big bold text that starts each letter. I think it’s quite a nice
plain english term for it.

Also changes the formatting guidance to use the word heading instead of
title, for consistency.
2017-05-11 12:10:37 +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
Chris Hill-Scott
698580ef0a Merge pull request #1256 from alphagov/unclickable-letters
Make letter previews unclickable
2017-05-05 14:10:25 +01:00
Ken Tsang
050c90fb64 Updated pricing page 2017-05-04 10:36:21 +01:00
Chris Hill-Scott
91ccd6a7bd Make letter preview show up on job page
It wasn’t being called with the URL, so the contents of the letter were
just showing up as plain text on the page.
2017-05-03 12:20:46 +01:00
Chris Hill-Scott
d1cd74daa8 Update utils with to make letters unclickable
Brings in:
- [ ] https://github.com/alphagov/notifications-utils/pull/159

Means:
- renaming a bunch of things
- removing any CSS that targeted the link, and making it target the
  containing element too
2017-05-03 12:20:45 +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
c373e3771a Make label for key type grammatically correct
Wasn’t changed when we changed the options. 

Matches the ‘Name for this key’ label on the field above.
2017-04-26 13:21:27 +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
Chris Hill-Scott
f3e69a808e Fix setting and display of letter branding
API and Admin were not using the same name for the organisation ID that
we have set with DVLA.
2017-04-24 14:46:19 +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
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
99805fb592 Add extra flag to indicate we want a csv notification response 2017-04-20 15:18:47 +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
d5b78fac17 Move delete link from edit to view template page
Users were having trouble finding the delete template link. It sort of
made sense having it on the edit page before we had the view template
page. But it doesn’t make sense now – having to choose to ‘edit’ the
template before you can delete is counterintuitive.

The single template page is where you go to choose an action to perform
on your template. Deleting is a good example of an action you can
perform on a template.

So this commit moves the delete link from the edit template page to the
view template page.

It also puts the confirm banner on same page as the delete link

The idea being that, in order to make a decision about whether to delete
the template, it’s useful to be able to see the template you’re
deleting. There’s no user need to edit the template before you delete
it.
2017-04-18 13:47:36 +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
kentsanggds
04da9359ef Merge pull request #1223 from alphagov/letter-jobs-page
Letter jobs page
2017-04-11 17:30:40 +01:00
Leo Hemsted
6d5f90eea2 Merge branch 'master' into letters-from-a-service 2017-04-11 17:11:51 +01:00
Ken Tsang
e5a377edd8 Add letter jobs page, client and test 2017-04-11 10:59:50 +01:00
Leo Hemsted
9391181b2c Add cloudfoundry config values
also added tests
2017-04-10 19:25:08 +01:00
Leo Hemsted
a6318f2674 remove pdf/png code from admin app entirely
while PDFs work on paas, they only do that because it turns out the
python buildpack happens to have imagemagick preinstalled - if that
ever changes then it'd break. so move those to the template preview
service. This also means we can get rid of weazyprint and wand
dependencies
2017-04-10 17:45:22 +01:00
Leo Hemsted
64d162d96e Generate letter previews in the new notifications-template-preview service
by calling through to this, we no longer require admin app to ship
with binary dependencies (imagemagick/cairo/etc)
2017-04-10 16:06:34 +01:00