Commit Graph

2056 Commits

Author SHA1 Message Date
Pea Tyczynska
e6e363ba3f Add antivirus scan to letter validation preview view 2018-10-05 16:27:57 +01:00
Pea Tyczynska
a61393a68e Test letter validation preview flow 2018-10-05 15:46:44 +01:00
Pea Tyczynska
3cdacaaf0a Introduce validation and error handling for validation preview 2018-10-05 15:46:44 +01:00
Pea Tyczynska
3be129241f Add letter validation preview functionality
- add get/post view
- create a pdf upload form
- add a template where user can upload the file
- check boundaries of the letter by calling template-preview
- display banner messages with boundaries validation result
- display pages of the document, with visible boundaries overlay
if the document did not pass validation, and without overlay
if they do pass validation
2018-10-05 15:46:44 +01:00
Katie Smith
4188c0297d Display letter postage on the usage page
The monthly letter cost was already broken down by price on the usage
page, but this change adds postage details to the usage page too.
2018-10-03 13:20:44 +01:00
Katie Smith
b1f2b1bc0f Update billing mocks and get_sum_billing_units function
Updated the 'get_sum_billing_units' function to no longer multiply the
billing units by the rate multiplier. The billing_units that come from
notifications-api already consist of the billable_units * rate_multiplier.
The rate_multiplier is also not returned from the api response anymore.

Also updated the billing mocks since these were not mocking the right fields in
the JSON responses from the API billing endpoints, and added the new
'postage' field which will get returned from the monthly-usage endpoint
in notifications-api.
2018-10-03 12:05:49 +01:00
Chris Hill-Scott
0f84ed40e9 Show all pages of a letter on the preview page
We’ve had a support ticket saying:
> Hi, where a letter goes over to two sides, is there a way in the
> 'Preview' screen (or anywhere else) that I can see page two? I can
> see page one OK, but can't work out how to see what's generated on the
> second page.

Whether you’re about to send 1000s of letters – or just want to preview
how one will look – it’s probably useful to be able to see more than
just the first page.
2018-10-01 16:03:06 +01:00
Leo Hemsted
432f1286fe update notifications page to take into account first class! 2018-10-01 11:07:35 +01:00
Leo Hemsted
efab189ae8 update jobs to take into account first class 2018-10-01 11:07:33 +01:00
Leo Hemsted
32f39475d2 remove dupe of get_letter_timings
it was moved from admin to utils a while ago
2018-09-28 15:02:32 +01:00
Rebecca Law
0591d3e667 Merge pull request #2334 from alphagov/fix-download-bug
Fix download csv to use the service data retention if it exists.
2018-09-27 16:07:17 +01:00
Rebecca Law
7b9df8de29 Fix download csv to use the service data retention if it exists. 2018-09-27 14:51:36 +01:00
Chris Hill-Scott
6de0374492 Merge pull request #2327 from alphagov/add-mou-to-checklist
Add line about the data sharing and financial agreement to the checklist
2018-09-26 16:33:13 +01:00
Pea (Malgorzata Tyczynska)
6d32d8b756 Merge pull request #2324 from alphagov/state_postage
Display postage on letter notification page
2018-09-25 13:36:34 +01:00
Chris Hill-Scott
5dd45da08c Add line about MOU to checklist
2/3 of our incomplete requests to go live are incomplete because the
Data Sharing and Financial Agreement isn’t signed.

We reckon we can be pushier about this by saying it’s ‘incomplete’ where
we know the agreement is signed.

Where the agreement is signed we should confirm this, rather than make
the line disappear. This is so it makes more sense to someone who sees
it as ‘incomplete’, signs it, then comes back to the page.

If we don’t know whether or not the agreement is signed we should wait
until someone has got in touch with us by requesting to go live to
figure it out. So that’s why we’re not showing that line at all.
2018-09-25 10:33:50 +01:00
Chris Hill-Scott
21d29a3090 Fix missing ‘complete’ tag in go live request
This tag was not showing up in the call to the Zendesk API because the
return value of a generator is not included as a member of that
generator (on things `yield`ed from it are).
2018-09-24 17:47:56 +01:00
Chris Hill-Scott
8bb23e09f2 Refactor to reduce nesting and repetition 2018-09-24 14:52:32 +01:00
Chris Hill-Scott
f29cfc0d48 Auto-tag email branding requests 2018-09-24 14:52:31 +01:00
Chris Hill-Scott
de65c30624 Tag request to go live tickets automatically
At the moment we manually tag tickets as they come in so we can analyse
how many of each type we’re getting.

Further, we manually tag all the request to go live tickets once a month
to analyse how many are complete/incomplete.

All this tagging is useful, but quite time consuming. Notify already
knows this information and – using the Zendesk API – we can tag them
automatically.

I’ve checked with Holly and this is the taxonomy we want to use.
2018-09-24 14:52:31 +01:00
Chris Hill-Scott
f29c6c90c0 Add info about checklist to ticket
So that someone picking up a ticket can be warned that they should be
checking these things.
2018-09-24 14:52:31 +01:00
Chris Hill-Scott
45b1b11abb Refactor go-live readyness into service model
All this info is info about the service. So it’s better to put it on
the service model because:
- encapsulation
- later reuse
2018-09-24 14:52:30 +01:00
Pea Tyczynska
64f356d7b0 Display postage on letter notification page 2018-09-24 11:29:33 +01:00
Katie Smith
7aedc3a91d Merge pull request #2311 from alphagov/show-postage-class
Add letter class row to settings page, visible to platform admin only
2018-09-20 09:52:24 +01:00
Katie Smith
3815a04a6f Merge pull request #2308 from alphagov/quis-patch-1
Remove unused variable
2018-09-20 09:52:18 +01:00
Chris Hill-Scott
36eac9d031 Set min text message sender length to 4 characters
We’ve learned of a change implemented today by the UK mobile
network operators, to stop allowing text message sender names
of 3 or less characters.

Adding this validation will not affect existing senders, only those
users trying to add to or update their senders.
2018-09-19 16:32:34 +01:00
Katie Smith
9660f372f3 Change naming in code to use 'postage'
Renamed everything that was previously called 'letter class' or 'postage
class' to 'postage', which is the new name we have decided to use.
2018-09-19 09:20:09 +01:00
karlchillmaid
a2a8496d52 Updated postage radio labels
Updated postage radio labels
2018-09-18 11:12:12 +01:00
Katie Smith
de9759b99a Add letter class row to settings page, visible to platform admin
Added a new row to the settings table, 'Post class', which shows the
default letter class of a service and is only visible to Platform Admin.

Also added a new page to enable Platform Admin users to change the
default letter class for a service - this only has two options at the
moment, 1st class only and 2nd class only.
2018-09-18 10:31:01 +01:00
Chris Hill-Scott
5adacdab39 Remove unused variable 2018-09-14 14:27:29 +01:00
Chris Hill-Scott
c800312281 Don’t attempt to store domain as empty string
When there is a uniqueness constraint on a DB column you can still have
multiple null values.

You can’t have multiple empty string values.

We are trying to save the domain as empty string when creating or
updating a new branding. This means that it’s currently not possible to
create or update a branding with no domain, because the uniqueness
constraint is violated.
2018-09-13 15:37:52 +01:00
Alexey Bezhan
5198009550 Merge pull request #2300 from alphagov/submit-returned-letters
Add a platform admin page to submit returned letter references
2018-09-07 15:06:24 +01:00
Chris Hill-Scott
94cd7c0899 Merge pull request #2291 from alphagov/remove-redundant-args
Remove redundant arguments to notification page
2018-09-07 13:26:03 +01:00
Chris Hill-Scott
09daf03ec9 Merge pull request #2290 from alphagov/link-to-notification
Link to single notification page from API integration page
2018-09-07 13:25:57 +01:00
Chris Hill-Scott
e45eca20c6 Revert "Require name when adding email branding" 2018-09-07 11:43:32 +01:00
Alexey Bezhan
b75681dfbc Add a platform admin page to submit returned letter references
A platform admin form accepts a list of references (one per line)
received from DVLA and sends them to the API to update notification
statuses.

References we get from DVLA start with `NOTIFY00\d`, which isn't
part of the reference we store in the database, so we remove them
before sending the data to the API.

The new `returned-letter` status should be treated as `delivered`
for now until we decide a way to display returned letters to users.
2018-09-07 11:13:01 +01:00
Chris Hill-Scott
72ca78e824 Merge pull request #2294 from alphagov/no-canonical-magic
Validate non canonical domains
2018-09-06 15:34:11 +01:00
Chris Hill-Scott
34ed0da362 Validate non canonical domains
At the moment we transform what the user gives us, so if someone enters
`digital.cabinet-office.gov.uk` it will automagically be saved as
`cabinet-office.gov.uk`. This happens without the user knowing, and
might have unintended consequences.

So let’s tell them what the problem is, and let them decide what to do
about it (which might be accepting the canonical domain, or adding a
new organisation to domains.yml first).
2018-09-06 12:35:52 +01:00
Chris Hill-Scott
4fe3bbf380 Remove redundant arguments to notification page
This stuff doesn’t seem to be used anywhere.
2018-09-06 12:25:33 +01:00
Chris Hill-Scott
1bd7df7797 Require name when adding email branding
Otherwise name can be blank and it never appears in the list, so you can’t find it again.
2018-09-06 11:53:30 +01:00
Chris Hill-Scott
e4341f5d5b Indicate messages sent with a test key
If a message has been sent with a test key it’s a bit confusing to just
say ‘Delivered’ on the page, because it hasn’t gone to anyone’s phone.

So this commit adds a bit of hint text to disambiguate what ‘Delivered’
actually means in this context.
2018-09-06 10:50:19 +01:00
Chris Hill-Scott
01fdcb8998 Use NHS.UK branding is for all NHS services
Anyone choosing ‘NHS’ for their organisation type gets should get the
NHS branding. We don’t want to hard-code an ID for NHS branding anywhere
because it won’t be consistent between environments.

So instead we can say that anyone who chooses ‘NHS’ as their
organisation type should get whatever branding has `nhs.uk` as its
domain.

This allows us to easily manage the branding the same way we do other
brands, but gives us the efficiency of having it auto applied.
2018-09-05 10:32:44 +01:00
Chris Hill-Scott
46dcaf3e54 Mark which brands are used as default on list
So that:
- we can see when a brand should be getting used as a default but isn’t
- we’re careful updating brands which will get auto-applied to new
  services
2018-09-05 10:32:44 +01:00
Chris Hill-Scott
243fdb0260 Assign email branding based on user’s email domain
When a user creates a service we can take a pretty good guess at what
organisation they’re from.

For many organisations, especially local councils, GOV.UK branding is
not appropriate for their service. But right now every service:
- gets created with GOV.UK branding
- has to ask us to change it, even if they’ve already done so for other
  services they run

This commit starts using the `domain` field on the email branding table
to lookup what email branding to assign to a service automatically,
where we’re sure there’s a sensible default.
2018-09-05 10:32:44 +01:00
Chris Hill-Scott
2e7ae91029 Persist canonical domain in email branding
When saving an email branding it’s possible we might not enter the
canonical domain for an organisation into the domain field. Because
we’re going to use the canonical domain to look up the brandings this
will cause a mismatch.

Rather than validate this and show an error, let’s just save the correct
thing instead. From the user’s perspective this means everything will
just work (ie a user with a given email address will automatically get
the right branding for their organisation).
2018-09-05 10:32:44 +01:00
Chris Hill-Scott
80423dfb3f Don’t allow adding unknown domains to branding lookup
We should make sure we’re not putting typos in the branding list. We can
validate what gets entered here against our known list of public-sector
domains.
2018-09-05 10:32:43 +01:00
Chris Hill-Scott
d80b735b2b Refactor some of the logic into form
It’s messy having a lot of logic in the view methods. Handling the form
stuff can be better encapsulated inside the `Form` subclass itself.
2018-09-05 10:25:39 +01:00
Chris Hill-Scott
80801d827a Put the currently selected branding top of list
There’s something that feels a bit off about not being able to see the
name of the currently-selected branding when you land on the page.

Putting it at the top also means that you can easily switch back to it
if you change your mind.
2018-09-05 10:07:36 +01:00
Chris Hill-Scott
f387f1e6ba Merge pull request #2268 from alphagov/request-to-go-live-better-data
Make the data we get from the go live requests more useful
2018-09-04 16:25:59 +01:00
Tom Byers
3655e63d34 Merge pull request #2262 from alphagov/remove_branding_type_from_set_email_branding_page
Remove branding type from set email branding page
2018-08-31 13:56:44 +01:00
Chris Hill-Scott
3c563ddca6 Use commas not tabs to delimit service info
Zendesk strips out the tabs. Commas are the next best thing because
Excel will automatically use them if you select ‘Split text into
columns’.
2018-08-30 15:31:46 +01:00