Commit Graph

2056 Commits

Author SHA1 Message Date
Chris Hill-Scott
2f6cf3df38 Refactor permissions handling to use sets
We didn’t like the nested conditional way of doing this. So this commit
refactors the way that permissions are set by:

- splitting it up into multiple, clearly named methods
- treating the list of permissions as `set`s, which they naturally are,
  because you can’t have duplicate permissions (this removes a lot of
  the complexity around having to test for membership before removing
  a permission, for example)
2017-09-27 12:02:17 +01:00
Chris Hill-Scott
fb3e7b5fde Add letters to the request to go live page
It’s not either text messages, or emails, or both now – it’s any
combination of the three channels.

This commit adds ‘letters’ as an option on the request to go live page
by changing the radio buttons to a group of checkboxes, so the user can
choose as many or as few as they want.

This commit also does a bunch of housekeeping stuff around the tests for
this page, because they haven’t been touched in quite some time.
2017-09-27 10:46:52 +01:00
Imdad Ahad
fdabe814cc Make the letter contact block (service settings form) compulsory 2017-09-26 14:41:07 +01:00
Chris Hill-Scott
9581a3bb77 Allow services to turn international SMS on/off
We didn’t make this self-service before because the pricing information
wasn’t published (ie we had to send it to services that asked for it).

Now that we publish pricing information in the app, there’s no reason
why services can’t make an informed decision about whether they want
international SMS or not.

So this commit:
- removes the platform admin button
- adds some radio buttons that our users can click with their mice
2017-09-26 14:21:06 +01:00
chrisw
f012ec57c0 Allow user to add multiple reply-to addresses 2017-09-25 17:05:41 +01:00
venusbb
b0e267f677 Fixed tests 2017-09-22 23:09:44 +01:00
venusbb
0895717680 Merge branch 'master' of https://github.com/alphagov/notifications-admin into vb-platform-admin-admin 2017-09-22 15:47:19 +01:00
venusbb
3a1e76ba92 Progress: passed trial_mode to /service end point 2017-09-22 15:46:52 +01:00
Chris Hill-Scott
d01c397bb4 Allow creation of an organisation without a logo
Now we have the org banner branding, not all organisations need a logo.
So it shouldn’t be an error to not provide one.

Depends on:
- [ ] https://github.com/alphagov/notifications-api/pull/1265
2017-09-21 11:57:39 +01:00
Leo Hemsted
03397f416e move status mapping logic to the api client
also added tests 👼
2017-09-20 16:02:15 +01:00
Leo Hemsted
f8fab35ee7 show letters as accepted, not created or sending, on the api page 2017-09-20 14:38:15 +01:00
venusbb
d14bdbe899 Merge branch 'master' of https://github.com/alphagov/notifications-admin into vb-platform-admin-admin 2017-09-19 14:44:06 +01:00
chrisw
4312789b60 Add a non-GOV.UK banner option for email branding
Added extra radio button for 'org_banner' option
Updated service setting template to display appropriate text when option is selected
Updated tests to also accomodate new radio option
2017-09-19 13:34:31 +01:00
venusbb
2a5acd9c77 platform-admin in progress 2017-09-19 10:13:12 +01:00
venusbb
4d794a464b Add and pass notifications filter trial_mode_services 2017-09-15 14:45:57 +01:00
Chris Hill-Scott
c26d308a32 Show row errors before trial mode errors
It’s useful to be able to play with the CSV upload thing and find out
how it works before you’re interrupted by the error telling you that
you’ve got as far as you can in trial mode.
2017-09-14 12:21:40 +01:00
Rebecca Law
74e7590fbc If a service does not have an inbound number and they click change on Receive text messages, they should see a message saying contact the Notify team to enable this feature.
That will now happen again.
2017-09-05 16:18:29 +01:00
Pete Herlihy
7a7e71ce5d Adding Using Notify to the footer links 2017-08-31 11:10:39 +01:00
Pete Herlihy
f7ff745872 New Using Notify static page
Adds the new Using Notify view

Adds route to Using Notify page.

Add redirects for old pages

Removes the delivery and failure page as it's now in the Using Notify one

Removes the trial mode page due to Using Notify page
2017-08-31 11:10:02 +01:00
Chris Hill-Scott
188ce5e5a7 Let users register with int’national phone numbers
Right now Notify restricts you to registering with a UK mobile number.
This is because when we built the user registration stuff we couldn’t
send to international mobiles.

However we can send to international mobile numbers, and it’s totally
reasonable to expect employees of the UK government to be working
abroad, and have a foreign mobile phone – we’ve heard from one such
user.

So this commit:
- changes all places where users enter their own phone number to use
  the validation function which allows international phone numbers
- renames the `mobile_number` validation to `uk_mobile_number` to make
  it explicit, and force it to break the tests if there’s somewhere it’s
  being used that I haven’t thought of
2017-08-29 14:52:24 +01:00
Chris Hill-Scott
edf54d8fe0 Don’t show trial mode error if making test letter
We don’t want users in trial mode sending real letters. So we’ve
introduced an error message. This error message is also showing up when
users in trial mode and making a test letter (and having the knock on
effect of hiding the download button).

They should be able to make a test letter in trial mode, because it
doesn’t cost anything.
2017-08-25 14:20:15 +01:00
Chris Hill-Scott
ea95493b42 Merge pull request #1445 from alphagov/inbound-sms-number-shown-bug
Put the inbound number on the invite page
2017-08-24 14:03:50 +01:00
Chris Hill-Scott
d958b5f00f Merge pull request #1446 from alphagov/no-n-dvla
Don’t add newlines to DVLA markup view of template
2017-08-24 13:58:49 +01:00
Chris Hill-Scott
da70310f8e Merge pull request #1407 from alphagov/no-letters-trial-mode
Don’t let users in trial mode send letters
2017-08-24 13:58:43 +01:00
Chris Hill-Scott
7e097e887e Make sure empty inbox also show the correct number
…since it’s divorced from the SMS sender now.
2017-08-24 13:57:12 +01:00
Chris Hill-Scott
9c080466a7 Don’t add newlines to DVLA markup view of template
It’s more confusing than helpful.
2017-08-24 11:44:43 +01:00
Chris Hill-Scott
453ee44dfb Put the inbound number on the invite page
Inbound number and SMS sender are divorced from each other now. This
page was assuming that they were the same thing.
2017-08-24 10:02:02 +01:00
Leo Hemsted
f68cdb20b5 Merge pull request #1439 from alphagov/dvla-endpoint
Add platform–admin-only page to preview DVLA code
2017-08-22 14:44:48 +01:00
Chris Hill-Scott
dd5d6e4d59 Merge pull request #1435 from alphagov/manage-templates-permission
Separate ‘manage service’ and ‘manage templates’ permissions
2017-08-22 12:30:57 +01:00
Chris Hill-Scott
5ffd7c4448 Add platform–admin-only page to preview DVLA code
Debugging the DVLA markup stuff is quite slow, because it’s split
between the API and utils, and things that work in tests don’t always
work with real template content.

This commit adds us a private endpoint that will let us see what DVLA
markup will be generated for any template, enabling a quicker feedback
loop.
2017-08-22 12:03:05 +01:00
Rebecca Law
2de66e8801 Renamed file to follow naming conventions. 2017-08-22 08:53:11 +01:00
Rebecca Law
8cf29a7d04 Merge branch 'master' into inbound_number_admin 2017-08-21 13:50:49 +01:00
Chris Hill-Scott
d591b9aeb9 Add a fourth, ‘manage templates’ permission
We’ve seen from research (a long time ago) that the ‘manage service’
permission is too broad, and gives too much control to someone who only
needs the ability to edit templates. In other words, editing content
should be its own, separate permission, rather than being rolled up
into manage service.

Since this is already disaggregated on the API side, making this change
just means changing the mapping on the admin side and adding an extra
checkbox on the invite/edit page. Which is what this commit does.

So for now, an existing user who has the manage service permission gets
both manage service and manage templates (ie no change to what they can
do). Newly invited users will get to choose if they have both, either,
or neither.
2017-08-17 17:47:30 +01:00
Chris Hill-Scott
fd5dfdf4ad Refactor form -> permissions function into helper
This functionality was implemented twice, in two different ways. This
commit factors it out into a helper method that can be reused in the
two places. We chose to go with the more explicit implementation because
it’s easier to understand.
2017-08-17 17:39:23 +01:00
Imdad Ahad
fa99af6598 Merge pull request #1432 from alphagov/imdad-feat-make-usage-use-new-endpoints
Update the usage page to use new billing endpoints
2017-08-17 15:37:26 +01:00
Imdad Ahad
32242c4501 Update the usage page to use new billing endpoints
* Create new billing_api_client for separation and remove
older methods in the service_api_client
2017-08-16 16:31:47 +01:00
Rebecca Law
27a9180d2a Merge branch 'master' into inbound_number_admin 2017-08-15 15:08:58 +01:00
Rebecca Law
c6a8ef43ec When setting the permisssion to allow inbound numbers the client will call an api endpoint that will set the next avaiable inbound number for the service.
As before the service manager will not be able to change the Text message sender once they have the inbound sms permission.
If the inbound sms permission is turned off the Text message sender setting is once more configurable by the service manager.
The inbound number remains bound to the service, but has "inactive", so that the number can not be used again.
2017-08-15 15:02:20 +01:00
Rebecca Law
0387b72c00 Get the inbound sms working.
Created a new test file for the inbound sms service settings changes, felt like the other file was too massive
2017-08-15 13:34:29 +01:00
venusbb
9d446bc942 Tests not completed 2017-08-14 11:56:12 +01:00
Chris Hill-Scott
77452b1b25 Merge pull request #1418 from alphagov/local-email-address-for-local-government
Tell local government folk that they can sign up
2017-08-11 16:20:06 +01:00
venusbb
87e987b148 merge master 2017-08-11 09:36:05 +01:00
venusbb
6ffd8b9b2e test written before merge Kens change 2017-08-11 09:17:01 +01:00
venusbb
981aa1aaea some test codes 2017-08-10 17:08:01 +01:00
Chris Hill-Scott
a10e76a9c2 Stop referring to central gov in error messages 2017-08-10 13:51:46 +01:00
venusbb
050c68142b merged codes 2017-08-10 10:29:31 +01:00
Rebecca Law
9b9c6d75dc - Change update service name to check that the name/email_from is unique across all services.
- This is done using a new endpoint in the api.
- Removed the AddServiceForm in favor or using the ServiceNameForm
- Removed ServiceApiClient.find_all_service_email_from
2017-08-09 16:52:10 +01:00
Chris Hill-Scott
5eb2cf859c Merge pull request #1403 from alphagov/ken-admin-orgs
Add pages to create and manage organisation branding for Emails
2017-08-09 13:15:27 +01:00
Rebecca Law
98595d8d80 Added an else: raise 2017-08-08 15:04:45 +01:00
Rebecca Law
7e8c76bbc5 Let the API error when the service name is a duplicate.
- Remove the name_func from the AddServiceForm
- Catch the HTTPError and set the error on the form
2017-08-08 11:15:22 +01:00