Commit Graph

1419 Commits

Author SHA1 Message Date
Chris Hill-Scott
beffb9e123 Reword choose sender/reply to address pages
Make it clear that:

- In the case of text messages, it’s about who the message comes from
- In the case of emails, it’s about where the user will reply to
2017-11-13 11:56:05 +00:00
chrisw
04f6d0a5e0 Updated code used flow 2017-11-09 17:06:57 +00:00
chrisw
0fac7125d2 Don't 'use my own number' if user doesn't have one 2017-11-09 16:09:00 +00:00
chrisw
1effec78e5 alter login flow to allow for email auth login 2017-11-09 16:07:28 +00:00
Rebecca Law
ef5f5ca43a Merge pull request #1628 from alphagov/remove-unused-code-for-sms-sender
Remove unused routes
2017-11-09 15:59:09 +00:00
Leo Hemsted
fcefd2a80c pass in data to posts 2017-11-09 15:02:59 +00:00
Leo Hemsted
2f37b00989 use active-endpoint 2017-11-09 14:58:44 +00:00
Leo Hemsted
cbf1b3ec38 replace user PUT with POSTs
the update_user fn was used in two places, for things that are handled
fine by update_user_attribute. Reduce complexity in the API by killing
the PUT, which is more dangerous (might silently overwrite things that
shouldn't be, like "last_logged_in_at" etc).

Had to change the code not received mobile number form, and the
activate user function.
2017-11-09 14:58:33 +00:00
Leo Hemsted
bfa6980913 Revert "replace user PUT with POSTs" 2017-11-09 14:57:01 +00:00
Leo Hemsted
b9eca67b0d Revert "use new activate endpoint" 2017-11-09 14:55:08 +00:00
Leo Hemsted
7b0fcf8c08 use active-endpoint 2017-11-09 14:37:33 +00:00
Rebecca Law
8c9d90c0f8 Remove unused routes 2017-11-09 13:48:27 +00:00
Leo Hemsted
302a024d3b replace user PUT with POSTs
the update_user fn was used in two places, for things that are handled
fine by update_user_attribute. Reduce complexity in the API by killing
the PUT, which is more dangerous (might silently overwrite things that
shouldn't be, like "last_logged_in_at" etc).

Had to change the code not received mobile number form, and the
activate user function.
2017-11-09 12:30:12 +00:00
Chris Hill-Scott
6325f26081 Revert "Stop escaping special characters in inbound messages" 2017-11-07 17:22:57 +00:00
Chris Hill-Scott
279c76eb18 Merge pull request #1614 from alphagov/fix-escaped-characters-inbound
Stop escaping special characters in inbound messages
2017-11-07 17:12:07 +00:00
Chris Hill-Scott
9e600b6051 POST to the correct endpoint when updating
`prefix_sms_with_service_name` is a computed attribute on the service
model. It’s where we get the value from, and the API does some work to
get it from the database, or derive it from the default SMS sender.
It can’t be updated, because it’s not itself a database column.

`prefix_sms` is the name of the actual database column. This is the
thing that we need to update.

This will go away eventually.
2017-11-06 15:08:34 +00:00
Chris Hill-Scott
31497945c0 Change wording based on Thom’s feedback 2017-11-06 14:12:25 +00:00
Chris Hill-Scott
f6950ae987 Stop escaping special characters in inbound
At least one of our providers gives us messages with special characters
escaped, ie a newline comes through as `\n`, not a literal newline. We
shouldn’t be showing these backslashes to any of our users.

Python has built in codecs for dealing with encoding/decoding of
strings – see
https://docs.python.org/3/library/codecs.html#text-encodings
for details. Using these builtins is safer than trying to do anything
regex or parsing-based.
2017-11-06 13:24:16 +00:00
Chris Hill-Scott
6d3855bba4 Allow updates to SMS prefixing setting
We’re extracting this from being determined based on what the sender
name is to its own setting.

This commit will let users set it independently.

Until the explicitly set it, it will still be determined based on
whether their default sender name matches the default for the platform.
2017-11-06 11:24:46 +00:00
Chris Hill-Scott
1d10ad2247 Stop content security policy blocking GA
In https://github.com/alphagov/notifications-admin/pull/1583 we changed
our Google Analytics settings to use newer browsers’ `sendBeacon`
feature. The advantage of this is that it

> [ensures] that the data has been sent during the unloading of a
> document [which] is something that has traditionally been difficult
> for developers

– https://developer.mozilla.org/en-US/docs/Web/API/Navigator/sendBeacon

To transmit this data it uses a AJAX request (`XMLHttpRequest`)
underneath. AJAX requests are governed by the `connect-src` content
security policy (or the `default-src` if one is not present).
`connect-src`:

> Applies to XMLHttpRequest (AJAX), WebSocket or EventSource. If not
> allowed the browser emulates a 400 HTTP status code.

– https://content-security-policy.com/

Because we didn’t have one in place, `sendBeacon` requests to GA were
getting blocked in browsers that support content security policy (pretty
much everything better than IE11[1]).

1. https://caniuse.com/#feat=beacon
2017-11-06 10:25:30 +00:00
Chris Waszczuk
98c8ddca38 Merge pull request #1598 from gov-cjwaszczuk/master
Email auth for inviting members and editing permissions
2017-11-06 10:00:15 +00:00
Pete Herlihy
8985f3978e Merge pull request #1611 from alphagov/inbound-callback
Inbound callback page
2017-11-03 16:22:48 +00:00
Chris Hill-Scott
240f25eaf9 Fix failing tests 2017-11-03 16:15:39 +00:00
Pete Herlihy
55093691f1 Updated test to reflect new label on callback URL field 2017-11-03 16:05:10 +00:00
Chris Hill-Scott
ba128d05bc Use service setting to determine prefixing of SMSs
Rather than doing this nasty `if` statement, let the API work out what
to do. Also means that the logic is not repeated between the two apps.
2017-11-03 13:14:10 +00:00
Pete Herlihy
9eb83792cf Added test for new callbacks static page 2017-11-03 11:57:29 +00:00
Rebecca Law
fa6e4971c9 Merge pull request #1603 from alphagov/sms-sender-for-one-off
Select text message sender for one off notifications
2017-11-02 16:35:51 +00:00
Rebecca Law
3e10cfb165 Rename test 2017-11-02 16:30:49 +00:00
Rebecca Law
ff22c83b1d Added a hint to show default and receives text messages 2017-11-02 15:48:19 +00:00
Rebecca Law
83bfc50884 Added a hint for Receives replies 2017-11-02 14:58:14 +00:00
Leo Hemsted
04adb15e85 make sure old invites get the proper message
we were accidentally covering up the expiry message with a more
generic one
2017-11-02 13:49:24 +00:00
chrisw
c6ea90a7d8 Email auth for inviting members and editing permissions 2017-11-02 12:38:01 +00:00
Rebecca Law
2ea921952f This PR adds the ability to select a text message sender if more than one exist for the service. 2017-11-02 12:07:46 +00:00
Rebecca Law
5e175954d2 Merge pull request #1600 from alphagov/add-letters-to-platform-admin
Add letter counts to the platform admin page.
2017-11-02 10:16:02 +00:00
Leo Hemsted
80b5af6ed9 Merge branch 'master' into load-service-err 2017-11-01 16:43:51 +00:00
Rebecca Law
4acfd4101f Add letter counts to the platform admin page.
The big number counts are based on how many messages have been delivered. For letters we are using the requested count.
2017-11-01 16:33:06 +00:00
Leo Hemsted
9eb5e6a532 make sure invite tokens still check token on admin for error handler to kick in 2017-11-01 16:17:04 +00:00
Leo Hemsted
19f731ec07 add error handler that catches invalid tokens, and returns 404 2017-11-01 15:47:05 +00:00
Leo Hemsted
aff9d47323 don't hit API when checking new account email-token
we currently store new account email verify tokens in the database, and
check against that to work out if they've expired. But we don't need to
do that, tokens have their own timing mechanism. So lets just use that,
and free up the database to do other things.

Also, standardised the forgot password, change email, and new account
email verification timeouts to all be an hour, from the config val
'EMAIL_EXPIRY_SECONDS'
2017-11-01 15:32:24 +00:00
Leo Hemsted
3128b5424d make sure load_service_before_request handles 404s
if it 404s, because the service id doesn't exist, then it should die
gracefully (showing a 404 error page), rather than what it currently
does, which is die kicking and screaming with a 500
2017-10-30 16:59:24 +00:00
chrisw
d02cd67b0d Fixed broken edit functionality 2017-10-30 15:31:35 +00:00
chrisw
4e721c95ce Added Multiple SMS sender functionality 2017-10-30 13:40:34 +00:00
Leo Hemsted
fcef77738c add test to make sure all buttons are plat admin only 2017-10-27 14:34:38 +01:00
Leo Hemsted
ba07fcff2d move all mocks and things to the fixture to avoid duplication 2017-10-27 12:07:22 +01:00
Leo Hemsted
151605180a Add email auth platform admin toggle
also added tests to check visibility, url, and button content
2017-10-27 11:44:40 +01:00
Leo Hemsted
0ea68f9c6d fix linter errors 2017-10-27 10:56:03 +01:00
Chris Hill-Scott
056c88be2a Merge pull request #1534 from alphagov/collect-service-type
Collect organisation type when user creates a service and use it to calculate text message allowance
2017-10-24 12:24:07 +01:00
Chris Hill-Scott
d9104ba59f Add page to change SMS allowance
There may be exceptions to the rule, so we should have a way of
overriding this manually.
2017-10-23 17:45:44 +01:00
Chris Hill-Scott
d438109630 Add page to change organisation type
If a user picks the wrong thing, we should be able to override it when
they go live.
2017-10-23 17:45:44 +01:00
Chris Hill-Scott
8cc8a0bf05 Change None to Not set
‘None’ is a bit Pythony. ‘Not set’ is a bit more human.
2017-10-23 17:45:43 +01:00