Commit Graph

1560 Commits

Author SHA1 Message Date
Chris Hill-Scott
52241b8f3e Use client from app in tests
Means we don’t have to instantiate it in every test, keeps things
consistent with parent commit.
2018-02-09 15:04:52 +00:00
Chris Hill-Scott
1908e7b091 Tell API what URL to use for email auth links
So that we can keep people on the prototype URL when doing user
research.

Depends on:
- [ ] https://github.com/alphagov/notifications-api/pull/1645
2018-02-09 15:01:20 +00:00
chrisw
5d26d4457f manage api keys permission should be able to see senders 2018-02-08 11:25:49 +00:00
Chris Waszczuk
7f8e53ee96 Merge pull request #1843 from gov-cjwaszczuk/organisations-to-email-branding
Change organisations to email branding
2018-02-08 10:37:15 +00:00
chrisw
9ad4435d94 Change organisations to email branding 2018-02-07 17:41:23 +00:00
Chris Waszczuk
c2136b0ffb Merge pull request #1768 from gov-cjwaszczuk/add-letters-to-monthly-messages-sent
Include letters on monthly messages sent
2018-02-07 10:52:52 +00:00
Chris Hill-Scott
9aa4a7267a Use <button> not <input>s for form submission
Both `<button type='submit'>Submit<button>` and
`<input type='submit' value='Submit'>` can be used to submit a form.

We have historically[1] used `<input>` because it’s better-supported by
IE6 in that:
- the `submit` attribute is mandatory on `<button>`, not on `<input>`
- the `innerHTML` of a button will be submitted to the server, not the
  value (as in other browsers)

Reasons to now use `<button>` instead:
- IE6/7 support is no longer a concern (especially with deprecation of
  TLS 1.0 on the way)
- Because an `<input>` element can’t have children, the pseudo-element
  hack[2] used to ensure the top edge of the button is clickable doesn’t
  work. We’re seeing this bug[3] affect real users in research.

1. We inhereted our buttons from Digital Marketplace, here is me making
   that change in their code:  8df7e2e79e (diff-b1420f7b7a25657d849edf90a70ef541)
2. 24e1906c0d (diff-ef0e4eb6f1e90b44b0c3fe39dce274a4R79)

3. https://github.com/alphagov/govuk_elements/issues/545
2018-02-01 13:53:45 +00:00
Chris Hill-Scott
934a271322 Allow full stops in SMS senders
We have a team who want their (short) web address as the text message
sender. This commit updates the validation of text message senders to
allow `.` as a valid character, which is currently blocking them from
doing this.

We can be fairly confident this works because:

- the team are sending large volumes of messages already with their
  existing provider
- we’ve tested it with all combinations of
  - both our text message providers
  - an Android phone and n iPhone
2018-01-31 11:11:44 +00:00
Chris Hill-Scott
b9e5194fbd Add test case for spaces
Turns out we accept spaces in text message senders. But there was no
test case which covered this.
2018-01-31 11:11:40 +00:00
Chris Hill-Scott
0ff2daab20 Add valid and invalid examples to SMS sender tests
I personally think it’s more robust to have a test also cover the
counter-fact.

And it’s easy to understand what’s going on if you can see the valid and
invalid examples side by side.
2018-01-31 11:11:35 +00:00
Chris Hill-Scott
b11653fe08 Refactor to use validator class
Using a separate validator class to check for appropriate characters in
a text message sender means that we’re not doing this validation in a
different way from the other checks (length and required). So the code
is cleaner.
2018-01-31 11:11:32 +00:00
chrisw
82302626ad Include letters on monthly messages sent 2018-01-30 12:08:46 +00:00
Chris Hill-Scott
532458cf3c Merge pull request #1827 from alphagov/highways
Adding Highways England to the list of domains that can register
2018-01-30 11:33:57 +00:00
Pete Herlihy
57b711ebdc Adding Highways England to allowed domains tests 2018-01-30 11:22:17 +00:00
Chris Hill-Scott
29c31c45f2 Merge pull request #1815 from alphagov/add-letters-to-product-page
Update product page to talk about letters
2018-01-30 11:09:06 +00:00
Chris Hill-Scott
2221a8ca48 Change display of cancelled users, fix edit link
It’s confusing showing green ticks for cancelled invites. This commit
changes the appearance so that only pending or active users (ie those
that could actually do some damage) get green ticks.

Also fixes missing edit links caused by instances of `User` having
`.state` but instances of `InvitedUser` having `.status`.

Right now these are two separate lists. Which makes it harder to add
improvements that will make large numbers of users easier to manage.
2018-01-29 15:23:54 +00:00
Chris Hill-Scott
959490ea85 Sort users by email address
Some teams have a lot of users now (I think the record is 172). So we
should make it easier for teams to manage large numbers of users.

This is the same change we made for templates (from most recent to
alphabetical) when the number of templates was getting unmanageable.

Sorted on email address because invited users don’t have a name (and
not sorted on both, because a lot of departments have a
`lastname.firstname` scheme for email addresses, but people generally
enter their names as `Firstname Lastname`).
2018-01-27 09:38:49 +00:00
Chris Hill-Scott
c20884003f Rename pending to invited
Pending is a bit of a technical word. Pending what? Invited is clear
enough, and doesn’t introduce a new concept.
2018-01-27 09:36:32 +00:00
Chris Hill-Scott
79ddf657bf Combine invited and active team members
Right now these are two separate lists. Which makes it harder to add
improvements that will make large numbers of users easier to manage.
2018-01-27 09:35:13 +00:00
Chris Hill-Scott
893d9deb7c Update product page to talk about letters
Letters is now a mature enough feature that we should:
- be raising awareness amongst our users that it’s a thing we offer
- not have letters be a surprise to anyone creating a Notify account for
  the first time

Shouldn’t be merged until:
- [ ] https://github.com/alphagov/notifications-api/pull/1600
2018-01-24 16:34:05 +00:00
Chris Hill-Scott
86e21f2b4b Remove platform admin letter/international buttons
Users can choose whether to have these features on or off now. And
a platform admin can still use the same controls to switch the features
on or off on behalf of a user. There’s no need for the separate buttons.
2018-01-24 11:49:39 +00:00
Chris Hill-Scott
555392b5da Allows services to choose if they can send letters
Our support ticket analysis shows that the most common action request
after going live is turning on letters.

We just do this for any team that requests it – there’s no gatekeeping.
So we should just allow people to make the change themselves.

This will be a better experience for our users, and less work for us.
The design of the page replicates roughly what we have for international
text messaging.
2018-01-24 11:49:39 +00:00
Chris Hill-Scott
05c93822e0 Add information about pricing to inbound SMS page
One of the things that came out of the support analysis was that people
were asking how much inbound SMS costs. There wasn’t a significant
volume of these requests, but the fix seems low-effort and
non-disruptive enough that we should do it.

Content by Thom.
2018-01-22 14:05:45 +00:00
chrisw
e52921bc00 add view link in message log for letter notifications 2018-01-17 15:39:39 +00:00
Alexey Bezhan
a23efc9a93 Replace Deskpro ad-hoc requests with a client from utils
Moves the duplicated calls to Deskpro to notification_utils and
rewrites feedback and service go-live requests to use the shared
client.
2018-01-17 14:31:27 +00:00
Leo Hemsted
2edb1eb704 remove free sms fragment limit from go live flow 2018-01-16 17:40:31 +00:00
Chris Hill-Scott
3b564b4f29 Add option for one off in request to go live
When we first made this form you couldn’t send one off messages with
Notify. It’s interesting to us because it might help identity teams who
would benefit from email auth, or other features that we build in the
future for caseworkers.
2018-01-16 11:41:47 +00:00
Chris Hill-Scott
48106f22a3 Include organisation type in request to go live
This is so we can catch organisations that are going live with the wrong
free text message allowance.
2018-01-16 11:41:47 +00:00
Chris Hill-Scott
e573f492db Check for unknown permissions
This guards against anyone mispelling or using the wrong words for a
permission, which could introduce unexpected or hard to catch errors.
2018-01-16 11:24:37 +00:00
Chris Hill-Scott
d9a63c07a9 Refactor user permissions to use args, not list
This makes the interface a bit cleaner and less verbose.
2018-01-16 11:22:57 +00:00
Chris Hill-Scott
072f8e0f87 Make row in URL match displayed row
Spreadsheets start at row 1 (the header row), and the values don’t start
until row 2. The row numbers in our URLs start at 0, which is a concept
that only makes sense to programmers.

It’s more predictable and consistent to make the number in the URL match
the row number displayed on the page when previewing the spreadsheet.
2018-01-15 14:45:38 +00:00
Chris Hill-Scott
ba0a010d64 Link each row in the spreadsheet
We’ve heard from some users, especially those sending letters, that
they’d like to check that a spreadsheet they’ve uploaded has populated
the template correctly.

My reckon is that seeing just one row of the spreadsheet populate the
template isn’t enough to give people confidence that everything’s
working properly.

This commit adds links to all but the currently-previewed row. Clicking
that link will populate the preview with values from that row. These
pages already exist; they were created in this PR:
https://github.com/alphagov/notifications-admin/pull/1696
2018-01-15 14:45:37 +00:00
Chris Hill-Scott
b5c114b66e Remove error handling code when no errors
`ok.html` is only used if the file has no errors. Therefore there will
never been any need to highlight which rows in the file have errors.
2018-01-15 14:45:36 +00:00
Chris Hill-Scott
67b54d850f Add link back to API integration from callbacks
Matches what we do on the API keys and whitelist pages.
2018-01-15 10:10:12 +00:00
Chris Hill-Scott
ebd5721d42 Correct description of how service name appears
This has changed since we made prefixing text messages its own setting.
2018-01-12 16:55:54 +00:00
Rebecca Law
59ac514655 Fix bug. 2018-01-12 14:03:31 +00:00
Rebecca Law
6070e2e197 Merge branch 'master' into download_link-activity-page 2018-01-10 16:06:40 +00:00
chrisw
7271d4fbde Allow letter templates to select the default contact block from the list 2018-01-10 11:20:40 +00:00
Leo Hemsted
b27eacb03b oops 2018-01-10 10:56:21 +00:00
Leo Hemsted
224b9e5098 Update test_validators.py 2018-01-10 10:48:58 +00:00
Alexey Bezhan
0088d588e1 Use VCAP_APPLICATION to detect CloudFoundry environment
VCAP_SERVICES is not set on PaaS if no services are bound to the
application, so we need to check for VCAP_APPLICATION to parse the
application name and environment.
2018-01-09 14:50:41 +00:00
Alexey Bezhan
8346e1b8be Remove VCAP_SERVICES parsing code
We're no longer using user-provided services for application secrets
so we can remove the cloudfoundry_config code responsible for parsing
VCAP_SERVICES.
2018-01-09 14:18:32 +00:00
Chris Hill-Scott
22de67fa19 Show all pages of a sent letter
Because we weren’t specifying how many pages the letter has, it was
defaulting to only showing the first page. This looked broken.
2018-01-05 12:19:55 +00:00
Chris Hill-Scott
b24c23fe3b Lint for print statements
flake8-print is a flake8 plugin that checks for `print()` statements in
Python files.

This should save us having to manually spot these when reviewing pull
requests.

The `--enable=T` flag needs to be set until this bug is fixed:
https://github.com/JBKahn/flake8-print/issues/27
2018-01-05 12:14:28 +00:00
Chris Hill-Scott
1e7b330bd9 Add British Museum to whitelist
> BM is an executive non-departmental public body, sponsored by the
> Department for Digital, Culture, Media & Sport.
>
> British Museum has a separate website (http://www.britishmuseum.org)

– https://www.gov.uk/government/organisations/british-museum
2018-01-04 15:36:22 +00:00
Rebecca Law
e71bbc1bb5 [WIp] 2018-01-03 13:21:00 +00:00
Rebecca Law
1fccb3da5e Merge branch 'master' into download_link-activity-page 2018-01-03 12:48:02 +00:00
Chris Hill-Scott
86d76baa0d Have admin specify host to use for invite links
When we’re doing user research we often:
- start the task by inviting the participant to a service on Notify
- have them use a prototype version of the admin app, hosted on a
  different domain

Currently we can’t do both of these things together, because the invite
emails always send people to notifications.service.gov.uk (because it’s
the API that sends the emails, and the prototype admin app points at the
production API).

This commit changes the admin app to tell the API which host to use when
creating the invite links.

Depends on:
- [ ] https://github.com/alphagov/notifications-api/pull/1515
2018-01-03 10:37:29 +00:00
Chris Hill-Scott
a604ed60b6 Remove value of download attribute on links
We should standardise on <a download> rather than
<a download="download"> everywhere. The value of the download attribute
tells the browser what filename to use, but is overridden by the
Content-Disposition HTTP header. Since it’s not being used, we should
remove it for the sake of disambiguation.
2018-01-02 16:52:17 +00:00
Katie Smith
309396c906 Make email addresses case insensitive when inviting users to services
Email addresses in invites should be case insensitive. This is to stop
the bug where a user creates their account using a lower case email
address (e.g. user1@gov.uk), but is then invited to a service using
their email address in a different case (e.g. USER1.gov.uk) and sees
an error message telling them that they can't accept an invite for a
different email address.
2018-01-02 09:26:49 +00:00