Commit Graph

1505 Commits

Author SHA1 Message Date
Chris Hill-Scott
eb395db2d6 Fix error when file has header rows but no data
Previously the error was saying ‘It needs at least one row of data, and
columns called None’.
2017-12-20 11:59:51 +00:00
Chris Hill-Scott
c3e2bce98b Add URLs for previewing all rows of a 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. So this commit is the first step towards being able
to preview an arbitrary row of a template, by extending the URL
structure to optionally accept a row number for pages or files (ie PNG)
that preview successfully uploaded spreadsheets.

What this commit doesn’t do is link to these pages; that will come as
part of a subsequent commit.
2017-12-20 11:15:38 +00:00
Chris Hill-Scott
3e5deeffdb Split successful upload test into two
Easier to test the individual aspects of what’s going on here if they’re
two separate tests, one hitting the initial `POST`, and one hitting the
page that they’re subsequently redirected to.
2017-12-20 11:15:37 +00:00
Chris Hill-Scott
71368301f7 Make test use new fixture
The `client_request` fixture means the tests take fewer lines of code
and also checks some extra things (eg page titles matching <h1>s).

Changing it in this commit, independently of functional changes to this
test.
2017-12-20 11:15:37 +00:00
Chris Hill-Scott
08c007d998 Add Marine Management Organisation as email domain
Seems like sometimes they use a Defra email address, sometimes their
own .org.uk one.
2017-12-18 11:52:56 +00:00
Chris Hill-Scott
a8829cd154 Make whitespace stripping work for whitelists too
It’s a bit hacky, but it fixes a potential issue for users.

Code adapted from:
2c34f678ab
2017-12-14 11:06:55 +00:00
Chris Hill-Scott
d0d230f119 Remove existing whitespace stripping code
Since we’re doing this globally, we don’t need to handle it in a custom
way for the sign in form (and it’s much nicer encapsulated like this).

Also added some more extensive tests in this commit.
2017-12-14 11:06:55 +00:00
Chris Hill-Scott
3f01da05c7 Fix order of callbacks
Delivery comes before inbound. The order of the URLs was jumbled in two
places:
- in the view function
- in the Jinja template

So as the user saw it the URLs were in the right order, because the
double jumbling cancelled itself out. But it made the code _really_
confusing to read.
2017-12-13 11:58:21 +00:00
Chris Hill-Scott
f02ec30979 Make table labels match titles of callback pages
This makes it consistent from page to page, and match the wording that
Thom came up with.
2017-12-13 11:56:26 +00:00
Katie Smith
87f5a9e124 Fix bug when editing letter contact block from letter template page
When viewing a letter template, there is a button to edit the letter
contact block. This should take the user to the page to edit the letter
contact block, but if a service has not set any letter contact blocks, the
button was returning a 404 error.

The code has now been changed so that if the service has no letter contact
blocks the edit button will link to the page to add a letter contact
block.

Pivotal story: https://www.pivotaltracker.com/story/show/152881444
2017-12-12 16:38:07 +00:00
venusbb
6f0ce3b33d rewrite one of the obsolete test 2017-12-11 17:17:40 +00:00
venusbb
3377efb267 Merge branch 'master' of https://github.com/alphagov/notifications-admin into vb-callback-admin
Some content change
Refractor api_integration to api_keys to reduce git difference.
2017-12-11 13:43:29 +00:00
chrisw
9c0d2c2a39 refactor of api callbacks admin work 2017-12-11 11:37:33 +00:00
chrisw
df383b5c0f renamed api_keys file 2017-12-11 11:37:26 +00:00
chrisw
76117c148c Allow service to set callback url for notifications 2017-12-11 11:37:26 +00:00
Chris Hill-Scott
eef66b70de Reword because ‘inbetween’ isn’t a word 2017-12-11 11:19:33 +00:00
Chris Hill-Scott
242a216c1b Update error message about commas in placeholders
We call the yellow things ‘double brackets’ on the frontend, not fields
or placeholders. This error message was a bit out of date.

Also refactored it to use the `Field` class; this code was probably
written before `Field` was factored out of `Template`.
2017-12-11 11:19:33 +00:00
Chris Hill-Scott
bef8e8887b Strip spaces from email addresses when signing in
If you copy and paste an email address into the sign in box, there’s a
chance you’ll also copy some leading or trailing spaces. This is
especially likely to happen if you’re doing this while using your
computer upside down.

If this happens, it never even gets as far as looking up the user,
because the form validation doesn’t consider a string with a leading
space to be a valid email address.

This commit makes sure that accidental spaces are handled, by removing
them before doing any validation or hitting the API to look up the user.
2017-12-08 16:17:45 +00:00
Leo Hemsted
292350633f update tests 2017-12-04 17:08:53 +00:00
Leo Hemsted
2a28278cb8 make sure service api client doesnt expect free sms fragment 2017-12-04 16:57:00 +00:00
Leo Hemsted
b9b3d7e9f3 remove other line 2017-12-04 16:45:12 +00:00
Leo Hemsted
eb3d4acb45 update free sms fragment limit to go via billing client instead of service 2017-12-04 16:03:11 +00:00
Leo Hemsted
9c412a7f4e Merge pull request #1679 from alphagov/ken-add-send_letters_as_pdf-setting
Add send letters as PDF service setting
2017-12-04 11:59:41 +00:00
Leo Hemsted
cab61a3d0a Merge pull request #1665 from alphagov/change-csrf-token-status
Change the CSRF error from 400 to 403
2017-12-04 11:59:29 +00:00
Ken Tsang
8fb7f79e5e Add send letters as PDF service setting 2017-12-01 19:12:22 +00:00
Chris Hill-Scott
fd908671b0 Make page titles match <h1> tags on static pages
This commit fixes pages where this isn’t the case, and modifies the test
to use the `client_request` fixture, which checks for this mismatch.
2017-12-01 09:52:23 +00:00
Chris Hill-Scott
4b77ef0533 Merge pull request #1667 from alphagov/email-auth-pword-reset
ensure that email auth users don't get 2fa codes when resetting passwords
2017-11-30 15:50:24 +00:00
Chris Hill-Scott
87b58afdb0 Merge pull request #1671 from alphagov/auth-type-by-request
Invite users to choose how team members sign in
2017-11-30 15:49:47 +00:00
Chris Hill-Scott
ba1c98ed49 Invite users to choose how team members sign in
Email auth is a new feature that currently we’ve only given to teams
who have contact us with a problem.

At the moment, we’re aware of all the teams that are sharing phone
numbers when they sign in. We think that in the future there will be
other teams who encounter this problem. So we should let them know that
they should contact us if they are having the problem.

At the moment we want to talk to teams before giving them access to the
feature, so that we’re confident it’s only going to teams from whom it’s
more secure than using a text message code.
2017-11-30 15:32:12 +00:00
chrisw
90e18e04ee Updated support views to represent new url structure 2017-11-29 13:58:12 +00:00
Leo Hemsted
f7e2a12aba ensure that email auth users dont get 2fa codes when resetting passwords 2017-11-28 15:25:29 +00:00
Leo Hemsted
18b50ddfde error handlers should not raise. Not even abort(400)s.
Refactor csrf handler into the normal error handler area, and then add
some tests to make sure it does the right thing. Also, change it back
to a 400, because the 403 err page talks about being in the wrong
place, but this is about sending the wrong data through, even though
it's technically a 403. Will need to think about wording but this is a
fine first pass
2017-11-28 12:28:16 +00:00
chrisw
6b98e62f4c Updated support logic to represent new urls structure 2017-11-28 11:59:11 +00:00
chrisw
ed33e03d82 Adjusted and added static page views logic 2017-11-28 11:56:30 +00:00
Richard Chapman
93bb0a6605 Merge pull request #1662 from alphagov/rc-update-template-usage-to-use-new-end-point
Disabled the template_history endpoint
2017-11-27 09:39:07 +00:00
Richard Chapman
155e432aa6 Disabled the template_history endpoint
- Updated tests and added a new mock_get_monthly_template_usage
- Deleted get_monthly_template_statistics_for_service
- Added new test to test the redirection of the old endpoint
2017-11-24 15:20:40 +00:00
Leo Hemsted
36b95a740e update utils to 23.1.0 - to show alphanumeric inbound messages on the frontend 2017-11-23 16:40:29 +00:00
Pete Herlihy
2b8fe86e36 Adding a test for the domain biglotterfund.org.uk 2017-11-21 13:58:49 +00:00
Athanasios Voutsadakis
0dfd1d61f7 Merge branch 'master' into add_proxy_header_check 2017-11-20 17:41:12 +00:00
Chris Hill-Scott
5f40eabdf3 Improve page titles later on in the one off flow
Now that the page title for picking a sender/reply to has been improved,
I think these pages are also less clear than they could be.

This commit changes the page titles to (I hope) be clearer about what is
needed from the user on these pages.
2017-11-20 16:54:07 +00:00
Chris Hill-Scott
4a1dad9a66 Hide form legend on choose reply page
The `<h1>` on this page says all the user needs to know. In research
we saw that users didn’t even read the legend, even when prompted to!
2017-11-20 16:53:11 +00:00
Chris Hill-Scott
ecd43cee5e Fix misleading <h1> in one-off flow
Changing the `<h1>` in https://github.com/alphagov/notifications-admin/pull/1638
turned out to be quite confusing. The combination of the word
"recipient" and a selection of email addresses on the page was confusing.

This commit changes the page title to be much more explicit about what
is expected from the page, rather than what is consistent with the text
of the link that the user clicked.
2017-11-20 16:53:00 +00:00
Chris Hill-Scott
4105b6ff55 Fix misleading <h1> in one-off flow
Changing the `<h1>` in https://github.com/alphagov/notifications-admin/pull/1638
turned out to be quite confusing. The combination of the word
"recipient" and a selection of email addresses on the page was confusing.

This commit changes the page title to be much more explicit about what
is expected from the page, rather than what is consistent with the text
of the link that the user clicked.
2017-11-20 16:50:33 +00:00
Athanasios Voutsadakis
ce54467c16 Merge branch 'master' into add_proxy_header_check 2017-11-20 10:31:43 +00:00
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
Athanasios Voutsadakis
6349312684 Merge branch 'master' into add_proxy_header_check 2017-11-17 14:35:35 +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
Athanasios Voutsadakis
bde734dc75 Use test_client() as context manager 2017-11-16 17:02:38 +00:00
Chris Hill-Scott
7d1cf2169d Show text message sender in send one-off flow
If you’ve chosen a text message sender then it’s good to see
confirmation of your choice.

This replicates what we do when you choose an email reply-to address.
2017-11-16 16:43:44 +00:00
Athanasios Voutsadakis
3b30895a73 Merge branch 'master' into add_proxy_header_check 2017-11-16 16:35:39 +00:00