Commit Graph

9833 Commits

Author SHA1 Message Date
Chris Hill-Scott
bead6a9ad6 Merge pull request #3453 from alphagov/accept-file-id-in-url
Accept file_id in URL instead of as form parameter when sending uploaded letter
2020-05-21 13:33:27 +01:00
karlchillmaid
d7739669a2 Merge pull request #3452 from alphagov/update-who-its-for-content
Update and move the 'who it's for' page
2020-05-21 12:22:07 +01:00
Chris Hill-Scott
4761b117b9 Use features nav on ‘Who can use Notify’ page
This page sits in the features section now, so it should have the same
navigation as the other pages in that section.
2020-05-21 12:05:03 +01:00
Chris Hill-Scott
de459e5709 Redirect old URL 2020-05-21 11:17:44 +01:00
karlchillmaid
1d9964ae0f Fix filename 2020-05-20 16:09:25 +01:00
karlchillmaid
08712bc7b9 Update file name 2020-05-20 16:07:35 +01:00
karlchillmaid
a171f964f9 Update who_can_use_notify 2020-05-20 16:06:57 +01:00
karlchillmaid
bae7adcae5 Update who_can_use_notify link 2020-05-20 16:04:45 +01:00
karlchillmaid
829e247f45 Update who_can_use_notify link 2020-05-20 16:03:58 +01:00
karlchillmaid
f06dfbafbc Update who_can_use_notify link 2020-05-20 15:59:30 +01:00
karlchillmaid
50ae629721 Update who_can_use_notify link 2020-05-20 15:58:36 +01:00
karlchillmaid
084992c66b Update who_can_use_notify link 2020-05-20 15:57:32 +01:00
karlchillmaid
67316679bb Update who_can_use_notify link 2020-05-20 15:56:09 +01:00
karlchillmaid
a823f3d77f Update who_its_for to who_can_use_notify 2020-05-20 15:54:15 +01:00
Chris Hill-Scott
1c5e661264 Accept file id in URL, not as form parameter
In the future we need to get the metadata from the file in order to work
out what form validation rules should apply (postage is only required
for UK letters).

To start doing this we need all instances of the app accepting `post`
requests with the `file_id` in the URL, as well as in the form data (for
backwards compatibility).
2020-05-19 17:44:39 +01:00
karlchillmaid
2e48535fd0 Update page title and header 2020-05-19 16:25:01 +01:00
karlchillmaid
ca2d13023f Move 'who it's for' to the About subnav menu 2020-05-19 16:24:06 +01:00
karlchillmaid
a7b28161fb Move 'who it's for' to About menu 2020-05-19 15:39:46 +01:00
Katie Smith
930b565510 Merge pull request #3451 from alphagov/dont-deep-link-support
Don’t deep link to our support form
2020-05-19 14:16:31 +01:00
Katie Smith
03cc9f9c74 Merge pull request #3446 from alphagov/fix-invite-errors
Catch errors when user register from invite
2020-05-19 14:09:08 +01:00
karlchillmaid
b169d098a9 Move 'charities' section above 'public' section 2020-05-19 14:08:04 +01:00
Katie Smith
313d39415d Catch errors when user register from invite
API gives an error if it tries to add a user to a service and that user is
already a member of the service. This situation shouldn't occur - admin checks
if an invited user is a member of a service before calling API, but we
have seen this error occurring when there are two requests processing at
the same time.

This change catches the errors from API if a user is already a member of
a service and redirects the user to the service dashboard so that they
don't see an error page.
2020-05-19 13:49:17 +01:00
Chris Hill-Scott
ba41057679 Don’t deep link to our support form
By deep linking to the support form we skip the question that asks if
someone is a member of the public.

This seems like a helpful thing when we’re directing people to where
they can ask for document download to be switched on. But what I think
is happening (backed up from one example I can see in Kibana):

1. Someone searches for something like ‘email GOV.UK’
2. They land on https://www.notifications.service.gov.uk/features/email
3. They scan the page and think, hmm not sure what this is, I’m not
   seeing what I’m looking for here…
4. …but aha, there’s a link that says ‘contact us’
5. They click it and land on
   https://www.notifications.service.gov.uk/support/ask-question-give-feedback
   which has a nice big box to type in

This commit removes these deep links from non-logged-in pages, so that
everyone has to go through the ‘are you a member of the public’ question
before they get to the big typey box.
2020-05-19 12:03:11 +01:00
karlchillmaid
acb3ee08b5 Move charities to its own section 2020-05-19 12:00:02 +01:00
Katie Smith
dede87c95e Always add user to service using User.add_to_service
The `_add_invited_user_to_service` function was calling the
`user_api_client` directly to add a user to a service. It now calls the
`add_to_service` method on the User model instead so that there is only
one place in the code that calls the `user_api_client`.
2020-05-19 11:36:59 +01:00
David McDonald
84dedb9cae Merge pull request #3450 from alphagov/non-ascii-metadata
Non ascii metadata
2020-05-19 11:31:26 +01:00
David McDonald
3185505612 Add unit test for LetterMetadata class 2020-05-19 11:20:03 +01:00
Chris Hill-Scott
9306bc3197 Merge pull request #3437 from alphagov/group-uploaded-letters
Group uploaded letters by printing date
2020-05-19 09:49:04 +01:00
David McDonald
387fcfda3f Move recipient decoding into LetterMetadata class
This is for consistency with how we do it for filenames in the previous
commit and moves the decoding into the `LetterMetadata` class for
abstracting this behaviour.

Small refactor of the LetterMetadata class needed to handle None case as
recipient can be None.
2020-05-18 16:13:31 +01:00
David McDonald
7923760345 Ensure pdf letter filename is ascii encoded and decoded
S3 can only handle ascii characters, therefore for filename which could
include non ascii characters, for example a filename with the character
'£' in it, we must encode these using urllib before saving it as s3
metadata. We then also make sure that it comes back decoded when
presenting it to the user.
2020-05-18 16:13:31 +01:00
David McDonald
1fb31a8861 Remove unused args in test
These args are not inputs to the function under test, neither as way of
named arguments or as GET query parameters. I assume this has been
leftover from a previous refactor of behaviour.
2020-05-18 16:13:31 +01:00
David McDonald
ba80d5b7cd Introduce abstraction for s3 metadata
S3 metadata only supports ascii characters. Whenever we save data to it
we need to make sure we encode it to save it and then decode it to
display it again to users. This abstraction will act as the place for
that decoding to happen so the rest of the code in our views doesn't
need to care about the encoding abstraction.
2020-05-18 16:13:31 +01:00
Chris Hill-Scott
6b93de1cb4 Merge pull request #3449 from alphagov/bump-utils-39.2.0
Bump utils to 39.2.0
2020-05-18 12:45:38 +01:00
Chris Hill-Scott
92f90d2ff4 Merge pull request #3445 from alphagov/handle-org-domain-exists-error
Catch error when organisation domain already in use
2020-05-18 12:45:23 +01:00
Chris Hill-Scott
064b1eb05a Bump utils to 39.2.0
This will start loggin Zendesk ticket IDs when people use the support
pages.
2020-05-18 11:08:54 +01:00
Pea Tyczynska
adcd798d88 Catch error when organisation domain already in use
Up till now, when adding new organisation domain, if it was already
in use, we didn't handle the 400 we got back from API. This PR
adds handling for that error.
2020-05-15 17:50:30 +01:00
Chris Hill-Scott
99ab99a232 Merge pull request #3443 from alphagov/international-postage-envelope
Add envelope for international letters
2020-05-15 16:01:20 +01:00
Chris Hill-Scott
a3b690fde6 Test notification page shows international postage
Just to make sure we’re passing the right postage argument through to
the `LetterPreviewTemplate` constructor.
2020-05-15 15:38:58 +01:00
Chris Hill-Scott
73fe640c9c Bump utils to 39.1.0
Allows letters to be previewed with international postage
2020-05-15 15:37:35 +01:00
Chris Hill-Scott
85dbe19611 Add envelope for international letters
International letters aren’t sent by first or second class post. In
keeping with the little touch of skeumorphism, let’s label them with the
commonly recognised marker of international mail instead.
2020-05-15 15:13:31 +01:00
Chris Hill-Scott
336e566d5a Merge pull request #3444 from alphagov/stop-caching-page-count
Don’t cache page count for one off letters
2020-05-15 15:04:14 +01:00
Chris Hill-Scott
2f79ef136d Don’t cache page count for one off letters
Why we did this originally[1]:

> Calculating the number of pages in a letter is quite slow. And the
> send yourself a test pages need to load _fast_. Since filling in
> placeholders is very unlikely to change the number of pages in the
> resultant letter, it’s pretty safe to cache that count, and makes the
> subsequent pages load a lot faster.

However things have changed since then:
- this journey is used for sending real letters, not just test ones
- we’re doing enough letters that even an unlikely discrepancy will (and
  does) happen
- we cache the generation of the PDF now[2], so at least it’s not
  generating the PDF twice, once for the preview and once for the page
  count
- it’s no longer necessary to step through each address placeholder to
  populate a one-off letter, so a little bit slower isn’t so bad

1. e7896f283a
2. c9c6271aa0/app/preview.py (L140)
2020-05-15 13:55:04 +01:00
Tom Byers
9927537d60 Merge pull request #3442 from alphagov/revert-3441-change-checkboxes-to-govuk-frontend
Revert "Change checkboxes to GOVUK frontend"
2020-05-14 17:04:55 +01:00
Tom Byers
f0f461f5c9 Revert "Change checkboxes to GOVUK frontend" 2020-05-14 16:59:34 +01:00
Tom Byers
f893cceec6 Merge pull request #3441 from alphagov/change-checkboxes-to-govuk-frontend
Change checkboxes to GOVUK frontend
2020-05-14 15:23:14 +01:00
Tom Byers
c9420418b3 Fix issues in tests from new fields 2020-05-13 17:37:44 +01:00
Tom Byers
1240ca47a9 Remove all unused checkbox macros and imports 2020-05-13 17:37:44 +01:00
Tom Byers
49ec2d77bb Update all single field checkboxes
Includes adding some code to govukCheckboxesField
to add a single boolean-like option by default, if
there are no choices added.
2020-05-13 17:37:44 +01:00
Tom Byers
33d8171675 Update templates page
Includes:
- changes to the govukCheckboxesField class
  to allow params to be extended at render time
- updates to templates and folders CSS
2020-05-13 17:37:42 +01:00
Tom Byers
0291fbc1cb Update manage folder page 2020-05-13 17:36:40 +01:00