Commit Graph

2056 Commits

Author SHA1 Message Date
Chris Hill-Scott
2bf2b4b460 Merge pull request #1619 from alphagov/remove-references-to-computed-column
Remove references to computed column
2017-11-20 10:27:30 +00:00
Richard Chapman
2ce3cca7a8 Merge pull request #1652 from alphagov/rc-update-template-usage-to-use-new-end-point
Refactor to be more pythonic and convert float to int
2017-11-17 15:01:32 +00:00
Richard Chapman
9eb544338d Refactor to be more pythonic and convert float to int
- Implementation wasn't pythonic so updated it to be more inline with the
rest of the code for maintainability.
- The API is return a float in some cases for the month which is causing
the date to string method to fail.
2017-11-17 14:35:25 +00:00
Chris Hill-Scott
832c1cf75f Merge pull request #1634 from alphagov/smaller-font-for-bigger-numbers
Make dashboard totals smaller if numbers are big
2017-11-17 13:29:39 +00:00
Richard Chapman
de9548bba2 Only Allow Admins
Changed the decorator to only allow admin users access to the page.
2017-11-17 09:26:03 +00:00
Richard Chapman
d03df16db5 Added new template usage page which will replace template-activity
The current template-activity page is slow as it is using the end point
which uses notification_history  and hence is timing out. This adds a
new pages (so that they can be compared side by side) which will be
hidden until is is approved with the larger data set and tested.
2017-11-16 16:55:07 +00:00
Chris Hill-Scott
274249b4d9 Merge pull request #1635 from alphagov/pdf-of-sent-letter
Add a link to download a PDF of a sent letter
2017-11-16 11:44:43 +00:00
Chris Hill-Scott
a358acfd05 Remove references to computed service attribute
`prefix_sms` is the real database column, which should be referred to
from now on.
2017-11-16 11:35:05 +00:00
Leo Hemsted
96ad2a09be Merge pull request #1649 from alphagov/existing-user-email-auth-invite
Existing user email auth invite
2017-11-16 10:16:56 +00:00
Leo Hemsted
b8c8372f77 Merge pull request #1617 from alphagov/remove-flask-script
remove flask-script
2017-11-15 17:47:30 +00:00
Leo Hemsted
ddf88b70c0 clean up logic around existing users accepting invites
* if the service issuing the invite does not have permission to edit
  auth types, don't let them do anything. This will stop them turning
  existing email_auth users back to sms auth
* if the user hasn't got a mobile number, but the invite is for sms
  login, don't do anything either. They won't have a phone number if
  they signed up via an email_auth invite previously.

in these cases, we accept the invite and add the user to the service
as normal, however, just don't update the user's auth type.
2017-11-15 17:19:32 +00:00
Leo Hemsted
ab4504f517 fix logged in user not having auth type set from invite 2017-11-15 15:42:23 +00:00
Venus Bailey
f039e64a6d Merge pull request #1594 from alphagov/vb-free-sms-history
Use annual_billing tables at backend for getting and updating free_sm…
2017-11-15 14:57:46 +00:00
Chris Hill-Scott
d6fec9f921 Add named argument for clarity 2017-11-15 09:59:52 +00:00
venusbb
a9f06c23f7 Commit out using the new end points until data is migrated 2017-11-14 16:23:08 +00:00
Leo Hemsted
8c14113da5 only show mobile number on register from invite page if user is sms_auth
also clean up the way the form is invoked - it now populates from an
invited_user object
2017-11-14 15:53:38 +00:00
Leo Hemsted
c8dbd819ef add tests for registering from an email_auth invite 2017-11-14 15:18:14 +00:00
Leo Hemsted
65ba7e88c8 refactor RegisterFromInvite to make auth_type required, and update test fixtures 2017-11-14 15:18:14 +00:00
chrisw
79393c97ef Updated invite email auth user flow 2017-11-14 15:18:14 +00:00
venusbb
581759931f Merge branch 'master' of https://github.com/alphagov/notifications-admin into vb-free-sms-history 2017-11-14 09:40:05 +00:00
Chris Hill-Scott
23a1c388f3 Add a link to download a PDF of a sent letter
This is useful for service teams to keep a copy for their records. The
letter won’t be available in Notify once the 7 day retention period has
passed.
2017-11-13 12:17:16 +00:00
Chris Hill-Scott
87a3bd38eb Retitle choose sender page as first page in flow
We have a sort of principle that when clicking a link, the page you land
on should be titled the same as the link you clicked.

This also reduces unnecessary repetition between the page title and the
form label.
2017-11-13 11:59:39 +00:00
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
Chris Hill-Scott
1412933356 Make dashboard totals smaller if numbers are big
Numbers over a billion overflow the two column layout. Numbers over one
hundred thousand overflow the three column layout.

This commit makes the type size smaller in these cases, so that the
numbers still fit in the boxes.
2017-11-09 17:50:19 +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
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
Rebecca Law
8c9d90c0f8 Remove unused routes 2017-11-09 13:48:27 +00:00
venusbb
1ab4681ff5 Use the revise api endpoints without current-year parameter 2017-11-09 13:18:09 +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
86abb7dba9 Refactor for number reuse 2017-11-09 10:56:54 +00:00
venusbb
66b49821a7 Merge branch 'master' of https://github.com/alphagov/notifications-admin into vb-free-sms-history 2017-11-09 09:24:49 +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
Leo Hemsted
2cd77e628e remove wsgi.py - always serve with whitenoise
We're now running our app as a wsgi app locally, so don't need to
distinguish between the two processes by having wsgi and application.py
whitenoise just serves static files nicely - we don't lose anything
by doing that locally.
2017-11-07 11:50:13 +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
f329e138cd Factor out string escaping code
So that it only lives in one place.
2017-11-06 13:24:16 +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
fed4275403 Factor out code that gets message content
The nesting is getting pretty deep here. Let’s make it into its own
method so it doesn’t get out of hand when we add more functionality to
it.
2017-11-06 13:10:02 +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 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
431e269cf9 Updated the field label for the callback URL 2017-11-03 16:02:43 +00:00
Pete Herlihy
2c74027e0d Adding a route for 'callbacks' page
Gone with callbacks as this page may be extended for delivery receipts in the future.
2017-11-03 11:56:15 +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
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