Commit Graph

371 Commits

Author SHA1 Message Date
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
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
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
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
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
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
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
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
86ad77e545 Add question about research consent
Since GDPR came into effect it’s less clear about whether we can
contact teams for user research purposes.

If we make people opt-in (or not) we know we’re safe to contact them (or
not).

Since we mostly care about how services are using Notify for real (ie
live services) or services that are considering adopting it (ie those
who have contacted us with a question) it feels like the go-live process
is the most appropriate place to collect this consent.
2018-08-30 15:31:46 +01:00
Chris Hill-Scott
12e0e12ced Replace channels and volumes with volumes/channel
Now that we’re a more mature platform we don’t care so much about the
load that one service might put on our platform.

We do care about intended volumes for two reasons:
- modelling the benefits that services get from using Notify
- managing stocks of envelopes (while our letter volumes are small
  enough that they could be skewed by one new service)

Changing to the ‘how many per year’ question also has the benefit of
mapping directly to the data we store in the ‘beta partners’
spreadsheet.
2018-08-30 15:31:46 +01:00
Chris Hill-Scott
80339046df Remove question about which features people use
This is an optional question. We don’t really use the answer to it now
that we have some adoption of all these features.
2018-08-30 15:31:45 +01:00
Chris Hill-Scott
278f7e534c Remove GOV.UK as option when creating a branding
It doesn’t make sense to create a brand which doesn’t get shown.

This will make it safe to remove this option from the database.
2018-08-29 12:42:42 +01:00
Tom Byers
0df88ea182 Remove branding_type from set_email_branding page
Includes updates to the controller so
branding_type is got from the email_branding model
instead of from user input.

Follows on from:

https://github.com/alphagov/notifications-admin/pull/2249
2018-08-29 11:43:35 +01:00
Rebecca Law
2b08b84c9e Merge branch 'master' into add-brand-type-to-email-branding 2018-08-24 11:09:31 +01:00
Rebecca Law
f7f202b670 Fix the EmailBranding 2018-08-23 17:44:34 +01:00
Rebecca Law
34d938ce18 Add brand type to email branding.
Removed banner_colour and single_id_colour.
We only really need one colour now.
2018-08-23 14:21:41 +01:00
Chris Hill-Scott
9b9acfa291 Select a branding with a link, not form
Selecting a branding just takes you to a new page, it doesn’t change
any state.

Links are generally the way you go from one page to another on the web.
2018-08-23 09:52:50 +01:00
Chris Hill-Scott
b73e42650d Refactor hex colour preview Javascript
This commit improves the code that previews a hex colour when setting up
or changing an email branding.

Specifically it:
- refactors the Javascript to conform to our patterns (module pattern,
  preprocessed with Gulp)
- makes the code work when there are multiple colour previews on one
  page

It also does some visual prettifying, because I couldn’t help myself…
2018-08-22 16:31:05 +01:00
Chris Hill-Scott
864e732c38 Merge pull request #2241 from alphagov/add-colours-and-domain-to-email-branding
New columns for email branding
2018-08-22 16:29:42 +01:00
Rebecca Law
473c8378fc Created a method to decide which colour to pass into the notifications-utils method to preview the template.
Removed the ServiceCreateEmailBranding form - it is identical to the other form.
2018-08-22 12:56:08 +01:00
karlchillmaid
60f64ee5e5 'Email reply-to address' updated
Updated 'reply-to address' to include a hyphen
2018-08-20 16:50:56 +01:00
Rebecca Law
3fda171f80 New columns for email branding
Added banner_colour, single_id_colour and domain to email branding view. Now able to set the fields.

However, the new fields are not being used yet.
2018-08-20 13:27:17 +01:00
Tom Byers
1269071da2 Add 'name' field to brand creation/edit page 2018-08-14 14:18:16 +01:00
Katie Smith
979fd9bbe4 Allow service contact details to be phone number, email or url
Service contact details are needed if the upload document permission is
enabled - this used to be a link but services can now choose to use a
link, email address or phone number. The form to add or change service
contact details now gives these options and validates the data according
to the type of contact details provided.

When validating phone numbers we can't use the existing validation
because we want to allow landlines too, so there is a basic check that
the phone number is the right length and doesn't include certain
characters.
2018-08-13 10:33:39 +01:00
Chris Hill-Scott
fdf3670661 Remove basic view setting and preview 2018-08-09 17:51:34 +01:00
Chris Hill-Scott
347912876c Relabel existing permissions
Since we have added a new, 5th permission the existing permissions
should be relabelled so that the five make sense as a coherent set.

We especially want to make sure that:
- the labels work against the checkboxes and against the tick/crosses on
  the manage users page (a long time ago this page was layed out
  differently so didn’t have space for full labels)
- there is no confusion between usage and reports

This commit also:
- re-adds a line about what all users can see (‘sent messages’) but
  continues to omit the additional bullet points about templates and
  team members (because we think this is clear enough from reading the
  permissions)
- refactors the `Form` subclass so that the content and order of the
  permissions only have to be defined once
- brings back the ‘permissions’ legend on the `fieldset`
2018-08-09 13:49:06 +01:00
Chris Hill-Scott
646ba6e8c3 Add a ‘See dashboard’ permission
Our research and prototyping around ‘basic view’ found that:
- a lot of users who send messages rarely or never look at the dashboard
  (yet it’s the first page they see when they sign in)
- team managers like the idea of taking away things that users don’t
  need in order to make the interface simpler

We’ve disentangled the simpler way of sending messages from being part
of ‘basic view’. This means we can give managers the option of taking
away the dashboard as an independent choice, not something that’s
wrapped up in a separate ‘view’.

I think that this checkbox is a more straightforward proposition than
‘basic view’ ever was (despite all the work we did to explain it and
develop the nested checkbox pattern). In research users would often
explain the feature back to us as being about hiding the dashboard – we
should try to make Notify operate in terms of concepts that come
naturally to people wherever possible.
2018-08-09 13:49:06 +01:00
Chris Hill-Scott
015d656d34 Merge pull request #2208 from alphagov/label-message-type-search
Label the search box dependent on message type
2018-08-09 09:37:01 +01:00
Chris Hill-Scott
214bfa9873 Label the search box dependent on message type
It doesn’t make sense to say ‘Search by email address or phone number’
when you’re only looking at emails.
2018-08-08 14:58:58 +01:00
Tom Byers
a2a02a5185 Add preview step to branding selection flow
Gives platform admins a chance to preview the
combination of brand type and custom brand
(coloured banner and logo) set for service before
saving.
2018-08-07 16:56:37 +01:00
Rebecca Law
ae1f1c95d6 Merge branch 'master' into flexible-data-retention 2018-08-06 15:37:11 +01:00
Chris Hill-Scott
19632ea4ab Add option to copy existing template when adding
Sometimes when setting up a service you might have a few very similar
templates, in which only a small amount of content. Or you might even
have a few of services, which are used by different teams but have
similar templates.

Copy and pasting, especially from one service to another, is a pain.
This commit makes it easier by allowing users to copy an existing
template when choosing to add a new one, instead of starting from
scratch.
2018-07-30 11:31:51 +01:00
Rebecca Law
4b8b571a87 Adding views to view, add and edit service data retention policies.
Only visible to a platform admin.
A service can have a custom number of days to retain the notification data for each notification type.
2018-07-17 14:39:04 +01:00
Pea Tyczynska
4cd465753a Add view that displays user information, including:
- name
- email
- phone number
- services
- last login
- failed login attempts if any

The view can be accessed from results of find_users_by_email

logged_in_at added to User serialization on admin frontend as
a part of this work
2018-07-13 16:01:52 +01:00
Pea Tyczynska
57e9c1d6e6 Validate against empty form submission for find_users_by_email
This included:
- creating a new form SearchUsersByEmailForm with validation
on its search field

- introducing 400 status to the view  if the form does not validate

- fixing the POST request data structure in the tests (it was
incorrect before and uncaught due to lack of validation and mocking
the response from the API.
2018-07-13 11:58:29 +01:00
Chris Hill-Scott
3683f99c3b Guess people’s names when they’re invited
Most people’s names, especially in government are in the format
firstname.lastname@department.gov.uk. This means that you can pretty
reliably guess that their name is ‘Firstname Lastname’.

When users are invited to Notify we know their email address already.

So this commit pre-populates the registration form based on this guess.

This is a nice little detail, but it should also stop the browser
pre-filling the name field with someone’s email address (which I think
happens because the browser assumes a registration form will have an
email field).
2018-07-11 10:35:25 +01:00
Chris Hill-Scott
4d3a4ef9af Add form to let users switch basic view on and off
This commit adds radio buttons to the ‘basic view’ page. This will let
users choose whether basic view is on or off for their service.

As before, this page will only be linked to if a service already has
basic view, so this commit does not launch the new feature.
2018-07-10 11:44:40 +01:00
Chris Hill-Scott
c30b86714e Merge pull request #2147 from alphagov/manage-not-modify
Relabel ‘modify service’ to ‘manage service’
2018-07-10 11:42:20 +01:00
Chris Hill-Scott
08dc248abc Relabel ‘modify service’ to ‘manage service’
We are not consistent about this. We use ‘manage service’ on:
- the page listing all the users
- the request to go live checklist

We use modify service on:
- the page where you edit a team member’s permissions
- the page where you invite a new team member

This commit changes the latter to be consistent with the former.
2018-07-09 10:58:35 +01:00
Chris Hill-Scott
5794a54385 Rename ‘caseworker’ to ‘basic view’
‘Caseworker’ was a bad name because it:
- suggested that Notify might be expanding into case management
- may or may not map to someone’s actual role, in a confusing way (this
  is why ‘manager’ is also a bad name)

‘Basic view’ is the best name we could come up with because:
- it describes the purpose of feature, not the user
- a ‘view’ changes what you can _see_ as much as it changes what you can
  do

Admin remains a good word – in research users self-describe their use
of Notify in using it. This commit makes the name ‘admin view’ to match
‘basic view’.

This also means we can hide the legend for this fieldset because the
choices are self-explanatory.
2018-07-09 10:39:09 +01:00