Commit Graph

2343 Commits

Author SHA1 Message Date
Leo Hemsted
f7f9dd8530 fix user permissions save button sometimes deleting
when you hit the delete button, it flashes the delete button and takes
you to the `/service/../user/../delete` url. If you then click the save
button, it would make a POST to the delete URL... and delete the user.

now the page stays on the edit url, but adds a `?delete=yes` query
string. The dangerous flash banner now has an action field which
defines where the browser will make the POST to (which remains at
/delete).
2019-03-26 15:52:37 +00:00
Chris Hill-Scott
8fb576e60a Allow excluding services from live services count
Adds a front end for:
https://github.com/alphagov/notifications-api/pull/2417

> Sometimes we have to make a few services for what really is one
> service, for example GOV.UK Pay and GOV.UK Pay Direct Debit. We also
> have our own test services which aren’t included in the count of live
> services. We currently count these as one service by not including
> them in the beta partners spreadsheet.
2019-03-25 15:46:35 +00:00
Chris Hill-Scott
cff009bc0d Run isort 2019-03-25 11:23:58 +00:00
Chris Hill-Scott
50bb20ad32 Allow up to 20 domains per organisation
The most we have in the spreadsheet is 18
2019-03-22 16:27:30 +00:00
Chris Hill-Scott
8b81d3594a Prevent duplicate domains 2019-03-22 16:10:34 +00:00
Chris Hill-Scott
eaa7af8692 Make navigating organisations a bit easier 2019-03-22 14:23:25 +00:00
Chris Hill-Scott
936883bf7b Allow editing of an organisation’s details
Adds a user interface for updating all the columns added in
https://github.com/alphagov/notifications-api/pull/2368

Sorry for the mega commit 😓
2019-03-22 14:23:24 +00:00
Pea (Malgorzata Tyczynska)
307e959fd6 Merge pull request #2862 from alphagov/show-templates-across-user-folders
When replying to inbound sms show templates in all user's folders
2019-03-22 14:15:13 +00:00
Katie Smith
7654d3c5fd Send folders if inviting user for service without edit folder permissions
If a new user is being invited for a service which doesn't have edit
folder permissions turned on, we want to send all folders for that
service to api.
2019-03-22 13:29:13 +00:00
Pea Tyczynska
0743a68e09 Reflect template folder structure on inbound conversation reply page 2019-03-21 16:06:47 +00:00
Pea Tyczynska
3fc4f6866c When replying to inbound sms show templates in all user's folders 2019-03-21 16:06:47 +00:00
Katie Smith
3fb752a009 Delete cached template-folders when adding user to service
The api endpoint to get all template folders also returns the users who
can see each folder.

We need to clear the template-folder cache when adding a user to a service so
that we are not using out of date data about who can see each folder.
2019-03-21 10:17:05 +00:00
Katie Smith
c39f6d49ea Set folder permissions when creating and accepting invites to services
Added a folder permissions form to the page to invite users to services.
This only shows if the service has 'edit_folder_permissions' enabled,
and all folder checkboxes are checked by default. This change means that
InviteApiClient.create_invite now sends folder_permissions through to
notifications_api (so invites get created with folder permissions).

Started passing the folder_permissions through to notifications-api when
accepting an invite. This changes UserApiClient.add_user_to_service to
send folder_permissions to notifications_api so that new users get folder
permissions when they are added to the service.
2019-03-21 10:17:05 +00:00
Katie Smith
782bd34394 Use folder_permissions in the InvitedUser model
We were already invitializing InvitedUser with folder_permissions
(defaulting to None), but this removes the default and adds
folder_permissions to the serialize method. Folder permissions should
now always be returned from api, either as an empty list or a list of
UUIDs.
2019-03-21 10:17:05 +00:00
Rebecca Law
980f75029f This is a fix for delete folder when the service has permission to edit folder permissions. 2019-03-20 17:04:44 +00:00
Rebecca Law
42e63667f7 Updated copy on the page.
Added unit tests.
Added error when file is too big.
2019-03-20 11:31:29 +00:00
Pea Tyczynska
6925b36b27 Get templates from all folders a user can see 2019-03-19 17:54:44 +00:00
Pea (Malgorzata Tyczynska)
c994552fc2 Merge pull request #2856 from alphagov/edit-members-who-see-folder
Edit members who see folder
2019-03-19 14:11:59 +00:00
Pea Tyczynska
fb5983cc2e Test manage folder viewing permissions page 2019-03-18 17:58:53 +00:00
Pea Tyczynska
e85969f6fa Change folder viewing permissions from manage folder page 2019-03-18 17:52:02 +00:00
Chris Hill-Scott
3b6af41660 Merge pull request #2830 from alphagov/put-current-branding-in-branding-request
Put current email branding in new branding request
2019-03-18 12:05:59 +00:00
Chris Hill-Scott
ce1adce97a Put current email branding in new branding request
When we get a request for new branding it’s helpful to quickly see what
the service’s current branding is, so we can get a better sense of why
they want to change it.
2019-03-18 10:50:49 +00:00
Pea Tyczynska
1ab36dd026 Show checkboxes for users with permission to view the managed folder 2019-03-15 14:13:27 +00:00
Pea Tyczynska
077a533d81 Subheader for edit users who can see a folder 2019-03-14 17:21:18 +00:00
Katie Smith
d3c256e80a Change format of data sent to api when adding user to service
The endpoint for adding a user to a service in api will now deal with
both user permissions and a user's folder permissions, so this changes
the format of the data we pass through.
2019-03-14 13:36:14 +00:00
Pea Tyczynska
a9be6015dc Test if auth type can be chosen while inviting user 2019-03-12 16:53:46 +00:00
Pea (Malgorzata Tyczynska)
2bc6792c5a Merge pull request #2823 from alphagov/hide-folders-when-no-permissions
Only show folders that user has permission to see
2019-03-11 16:26:56 +00:00
Pea Tyczynska
33c3b14feb Test how user folder permissions work on the page 2019-03-11 14:30:50 +00:00
Alexey Bezhan
80bfd8e347 Add space around folder name separator when flattening folder path 2019-03-11 14:30:49 +00:00
Alexey Bezhan
1fb7a2515f Return all templates for the user if the folder permissions flag is off
Putting the permission check in the get_user_template_folders allows
us to replace `all_template_folders` usage with the new method without
having to worry about the temporary service permission flag.
2019-03-11 14:30:49 +00:00
Pea Tyczynska
de237e9e6f Test that folders are filtered based on user permission at service level 2019-03-11 14:30:49 +00:00
Katie Smith
e4edddbeab Delete unused functions and their tests 2019-03-11 10:27:38 +00:00
Chris Hill-Scott
1af844c95f Fix the logic about showing extra task list items
It should be:
- if they have said they are going to send by a certain channel, show
  the extra required task(s) for that channel
- if they haven’t said, infer from which templates they have
2019-03-08 15:21:41 +00:00
Chris Hill-Scott
cd59919ad1 Merge pull request #2827 from alphagov/depend-on-service-volumes
When going live, make reply-to address and text message sender dependent on estimated sending volumes
2019-03-08 13:56:49 +00:00
Alexey Bezhan
6fa975e867 Send updated user folder permissions to the API
Integrates the folder permissions form with the updated API endpoint
to store changes in the user folders.

Since user folder permissions are returned in the full list of template
folders for the service we need to invalidate the cache key for it each
time we update user permissions.
2019-03-05 11:44:34 +00:00
Pea Tyczynska
7413423243 Display nested folders permissions form on user permissions page
We're reusing the logic for the `move_to` nested radios field for the
user folder permissions nested checkboxes.

The main difference between the two forms (aside from the different
input type) is that "Move" form contains the root "Templates" as an
option, whereas the folder permissions doesn't.

It turns out that, because of the way NestedFieldMixin.children and
select_nested macro are implemented the easiest way to get the desired
folder permissions behaviour is to add the root folder as a choice with
a `None` value and `NONE_OPTION_VALUE = None` set on the field, which
allows the `child_map` to be constructed but doesn't display the root
folder checkbox itself since it gets overwritten in the final `child_map`.
2019-03-05 11:44:34 +00:00
Chris Hill-Scott
87c62e6c52 Only hide channel-specific tasks if volume is 0
If you have email templates but haven’t told us what volumes you’re
sending we should assume you are going to send emails. We should only
stop asking you to add a reply-to address once you’ve told us for sure
you’re not going to send any emails.

This also applies to changing the text message sender – this should only
be hidden if you don’t have text message templates or you’ve said you’re
not going to be sending any text messages.
2019-03-05 11:03:21 +00:00
Chris Hill-Scott
531219b87e Make SMS sender dependent on estimated SMS volumes
We have a number of go live requests where people have said they’re
sending text messages, but haven’t changed the text message sender from
the default of `GOVUK` (we ask teams who aren’t central government to do
this). At the moment we don’t prompt them to, because we look at whether
they have text message templates as indicative of whether they’re going
to send text messages.

Now that we explicitly ask for the volumes of text messages they’re
sending we should use this to determine whether or not we prompt them to
change their text message sender because it’s a stronger signal of
intent than what templates they’ve set up.
2019-03-05 10:05:47 +00:00
Chris Hill-Scott
24ee280632 Make reply to address dependent on sending intent
We have a number of go live requests where people have said they’re
sending email, but haven’t set up a reply-to address. At the moment we
don’t prompt them to, because we look at whether they have email
templates as indicative of whether they’re going to send email.

Now that we explicitly ask for the volumes of email they’re sending we
should use this to determine whether or not we prompt them to set up an
email reply to address because it’s a stronger signal of intent than
what templates they’ve set up.
2019-03-05 10:05:47 +00:00
Rebecca Law
184ea5b92b Update the message when changing a users mobile phone number. 2019-03-04 11:14:35 +00:00
Chris Hill-Scott
4cae924379 Don’t prefil answer to research consent question
We were treating `None` (not answered) the same as `False` (previously
answered no).
2019-03-01 12:22:57 +00:00
Chris Hill-Scott
7ac9884dd5 Tag tickets that haven’t filled volumes 2019-02-27 17:34:24 +00:00
Chris Hill-Scott
5f4280cf81 Let people go live without filling the volumes
At the moment it 500s because it can’t format the `None` values as
numbers.

In the future we will stop people requesting to go live until they’ve
provided this info. For now it has to be optional.
2019-02-27 17:05:02 +00:00
Chris Hill-Scott
6a6b3f78b1 Revise error message for non-numeric responses
Things we talked about:
• asking users to write the number 'as numerals' or 'using digits' isn't
  very plain English
• the style guide says to use an example in the error `..., like 5,000`
  but not if you have an example in the hint text, so we can't do that
• I have reservations about 'correct format', because it sounds odd if
  you're not describing something like a phone number, NI number or
  credit card number.

Looking back through Request to Go Live tickets on Zendesk.
---

I got to September before I found anything that would count as invalid
under our new rules:

> Possibly around 1,000,000- not planning on implementing emails yet but
might change

I'll keep looking, but if most people enter the number according to the
hint example we might be able to go with a much simpler error just
prompting them to enter a number – no convoluted descriptions of what we
mean by a number

There seemed to be more problems when the Qs were about start volume and
peak volume. Users felt the need to explain their plans more.

Using 'number' instead of 'volume' is more explicit too – so that
probably helps.

In terms of errors:
`Enter the number of emails you expect to send`
`Enter the number of text messages you expect to send`
`Enter the number of letters you expect to send`
– will probably do it, right?
2019-02-27 15:13:42 +00:00
Chris Hill-Scott
9691ef27da Round max number limit down
A round number feels better than a very arbitrary-looking one.
2019-02-27 15:13:33 +00:00
Chris Hill-Scott
1a94137ff6 Add latest content
From: https://docs.google.com/document/d/1aykf1MjJH5y21Bz1ht6WJncb9cKu0fsPlac3-bkMPe8/edit
2019-02-27 15:13:23 +00:00
Chris Hill-Scott
61ac7fa069 Don’t reformat numbers if there are errors
It’s confusing to at the same time:
1. change what you’ve inputted
2. tell you it’s wrong

This commit makes it so that 1. only happens if 2. doesn’t.
2019-02-27 13:26:23 +00:00
Chris Hill-Scott
a24c853dce Also allow spaces in numbers
Apparently this is a French thing.
2019-02-27 13:23:15 +00:00
Chris Hill-Scott
9f63449384 Make answers to volume questions optional
It’s annoying and very ‘computer says no’ to make people type `0` in a
box. We can see from our analytics that this error is affecting about 7%
of users trying to go live.

This commit relaxes the validation to only require a number greater than
1 for at least one of the questions.

It also lets people enter their numbers comma-separated – like our
examples suggest – but normalises them to integers before sending them
over to the API.
2019-02-27 13:20:20 +00:00
Chris Hill-Scott
8791134c60 Move the ‘estimated usage’ questions
We get a bunch of requests to go live where people have told us they're
going to send email but there is no email reply-to address present.

These come from 2 scenarios:

1. when there are email templates, and no reply to address – but they
   ignore the checklist
2. when there are no email templates (yet) but they provide anticipated
   volumes for email

At the moment we only auto-check for a reply to address when they have
email templates. And because the question about anticipated volumes
follows the checklist, you'll get a checklist that passes (reply
addresses not required as no templates present) - but your future intent
that differs (reply address IS required because you have anticipated
volumes).

So let’s bring the request for anticipated volumes into the checklist,
that way we can dynamically add the requirement for a reply to address
if they say they will send email but don't have templates yet.

We should begin storing it in the database against the service to stop
people having to re-enter it each time they try to complete the go live
screens.

This also means moving the ‘consent to research question’ along with
the questions about volume, because
- we want people to answer both before going live
- we don’t want to clutter up the summary page by asking questions there
  too
2019-02-27 13:17:28 +00:00