Commit Graph

17 Commits

Author SHA1 Message Date
Chris Hill-Scott
53724dacd1 Tell template preview whether a letter can be sent internationally
If a service has permission to send international letters then the admin
app should tell template preview, so that template preview knows what
rules to apply when it’s validating the address of the letter.

We don’t need to wait for template preview to start looking at this
query string argument – it will just ignore it for now.
2020-05-01 15:43:54 +01:00
Katie Smith
7368245c9a Show letter preview once file is uploaded
This shows the sanitised letter preview if the file had no validation
errors or the preview with the overlay if it failed validation.
2019-09-12 09:54:36 +01:00
Katie Smith
8a322b844b Sanitise uploaded letters and store in S3
This sanitises uploaded letters and stores the sanitised result in S3
with if it passes validation or the original PDF in S3 if validation
fails. A metadata value of 'status' is set to either 'valid' or
'invalid'.
2019-09-12 09:54:36 +01:00
Katie Smith
d904c7e5c5 Show letter branding preview when selecting a brand
This adds a preview pane which is visible when updating a letter brand.

If JavaScript is enabled, the preview pane shows on the set-letter-branding
page, and submitting the form saves updates the letter brand for a service
immediately. If Javascript is not enabled, there is a separate 'Preview email
branding' page which shows a preview of the brand and has a 'Save' button on it.
2019-02-19 10:44:51 +00:00
Leo Hemsted
0e3d47bc08 use letter branding object instead of letter_logo_filename
This is part of migrating away from dvla organisations. This only
affects in-app previews and not actual letters printed by the api.
2019-02-13 13:52:06 +00:00
Katie Smith
a489e7a26b Stop passing dvla_org_id to template preview
We were passing both dvla_org_id and filename to template-preview
temporarily while we switch to only using filename. Now that
template-preview is set up to use filename, we can stop sending the
dvla_org_id too.
2018-10-23 16:21:18 +01:00
Katie Smith
0362265cb6 Pass letter logo filename to template preview
We now pass through `filename` to the Template Preview `/preview.<filetype>'
endpoint in addition to the `dvla_org_id`. Template Preview will be
changed to only use `filename`, and once this has been done, we can change
the code to only pass through `dvla_org_id` instead of passing through
both pieces of information.
2018-10-17 15:17:11 +01:00
Chris Hill-Scott
1304561a70 Use service model to look up service attributes
This is better than just keying into the JSON because it means you get
an exception straight away when looking up a key that doesn’t exist
(which via mocking you could ordinarily miss).
2018-07-30 14:56:36 +01:00
Chris Hill-Scott
f3a0c505bd Enforce order and style of imports
Done using isort[1], with the following command:
```
isort -rc ./app ./tests
```

Adds linting to the `run_tests.sh` script to stop badly-sorted imports
getting re-introduced.

Chosen style is ‘Vertical Hanging Indent’ with trailing commas, because
I think it gives the cleanest diffs, eg:
```
from third_party import (
    lib1,
    lib2,
    lib3,
    lib4,
)
```

1. https://pypi.python.org/pypi/isort
2018-02-27 16:35:13 +00:00
chrisw
7271d4fbde Allow letter templates to select the default contact block from the list 2018-01-10 11:20:40 +00:00
Chris Hill-Scott
ff00058847 Don’t hit template preview app when running tests
It’s annoying for tests to pass locally because the template preview app
is running locally, but fail on Jenkins because the template preview app
doesn’t exist.

This commit changes it’s hostname to use a dummy port in tests.
2017-05-25 15:03:49 +01:00
Chris Hill-Scott
d9f5884e3d Fix argument order bug with page count 2017-05-16 11:43: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
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
Chris Hill-Scott
cfc031cfbf Pass dvla_org_id through to template preview app 2017-04-24 10:25:36 +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
Leo Hemsted
9391181b2c Add cloudfoundry config values
also added tests
2017-04-10 19:25:08 +01:00