Commit Graph

3933 Commits

Author SHA1 Message Date
Chris Hill-Scott
befe93ec0b Make sure confirmation/danger banners have a H1
This makes errors on all pages have a `<h1>` element, which is important
for accessibility. It means a bit of rewriting the messages, but I think
they’re better for it.
2017-07-27 11:52:54 +01:00
Chris Hill-Scott
40e79c6827 Use confirmation banner for revoking API keys
Currently revoking an API key takes you to a separate page. It should
work the same way as other destructive actions, ie staying on the same
page but with a banner asking you to confirm the action.
2017-07-27 11:52:54 +01:00
Chris Hill-Scott
d51ffe6b39 Use yellow warning banner for permissions message
The green bordered banner feels too much like ‘success’ or
‘confirmation’. Doesn’t feel like it’s something which just gives you
the status of a thing, or here’s a thing you should be aware of.
2017-07-27 11:52:54 +01:00
Chris Hill-Scott
c15491974d Use black text with a border for default banner
We use panels with a blue banner to indicate something that’s clickable.
So we should move away from this style for things that are just
notifications. We can’t use teal like other bits of GOV.UK because it
doesn’t pass colour contrast.

Pay are using a box with a green border, similar to the error validation
box (which has a red border). So let’s do the same for now.
2017-07-27 11:52:38 +01:00
Chris Hill-Scott
05b1292e9d Make text black in error/danger banners
For consistency with what GOV.UK Elements does, the text in our banners
should be black, not red. See examples here:
http://govuk-elements.herokuapp.com/errors/#summarise-errors

This also makes us consistent with what Pay are doing.
2017-07-27 11:52:38 +01:00
Chris Hill-Scott
88ff4a3264 Merge pull request #1388 from alphagov/bypass-api-client-init
Don’t set combined API on Notify python client
2017-07-26 12:13:46 +01:00
Chris Hill-Scott
415e1a401a Don’t set combined API on Notify python client
Because we’re setting the API key and service ID after calling the
`__init__` method of the client it wasn’t doing the thing where it
splits the combined key into the two individual UUIDs. So we still need
to set them directly, individually on the client.
2017-07-26 12:08:10 +01:00
Chris Hill-Scott
ae1a0b4804 Merge pull request #1387 from alphagov/fix-breaking-change-python-client
Fix things that broke when I merged Pyup’s changes
2017-07-26 11:42:01 +01:00
Chris Hill-Scott
9b8397db1c Merge pull request #1383 from alphagov/fix-one-off-errors
Fix error messages in one-off flow
2017-07-26 11:41:55 +01:00
Chris Hill-Scott
a41a61fe45 Merge pull request #1380 from alphagov/continue-not-next
Use ‘Continue’ not ‘Next’ for button text
2017-07-26 11:41:45 +01:00
Chris Hill-Scott
ce114f1342 Use import from its new location
Making this change gets rid of a deprecation warning from our logs.
2017-07-26 11:20:33 +01:00
Chris Hill-Scott
66196420d7 Remove deprecated decorator
Should use the normal Flask error handler. Making this change gets rid
of a deprecation warning from our logs.
2017-07-26 11:19:42 +01:00
Chris Hill-Scott
5596da3ff9 Address deprecation warning around wtf Form
It’s been renamed to avoid a conflict. Not a conflict we have to worry
about. So we can just change our import and get rid of the deprecation
warning.
2017-07-26 11:18:44 +01:00
Chris Hill-Scott
5fdbbda022 For some reason we’re generating XHTML <br>s now
¯\_(ツ)_/¯
2017-07-26 11:15:55 +01:00
Chris Hill-Scott
68a1426e58 More Python client weirdness
There’s some weird interaction between the message attribute of the
exception and mocking.

Luckily there is an internal attribute – `_message` which doesn’t go
through all the magic.
2017-07-26 11:13:37 +01:00
Chris Hill-Scott
9f9c2d5e87 Fix test which looks at text of radio buttons
Looks like `radio_button.text` no longer works. Probably a BeautifulSoup
change. More robust to look at the text of the label and the value of
the input anyway.
2017-07-26 11:12:32 +01:00
Chris Hill-Scott
5ddbe80ea9 Fix calls to API client which now takes fewer args
The Notify API client changed in version 4 to take two arguments, not
three (service ID was removed in favour of the combined API key).

This gets a bit gnarly because the API key has to be at least a certain
length so it can be substringed internally.
2017-07-26 11:10:37 +01:00
Chris Hill-Scott
bd484cbe03 Merge pull request #1386 from alphagov/pyup-update-pytest-mock-1.6.0-to-1.6.2
Update pytest-mock to 1.6.2
2017-07-26 09:49:57 +01:00
Chris Hill-Scott
63f75a4cdc Merge pull request #1385 from alphagov/pyup-update-pyexcel-xlsx-0.4.0-to-0.4.1
Update pyexcel-xlsx to 0.4.1
2017-07-26 09:49:52 +01:00
Chris Hill-Scott
f88a8debfd Merge pull request #1384 from alphagov/pyup-update-pyexcel-0.5.0-to-0.5.2
Update pyexcel to 0.5.2
2017-07-26 09:49:44 +01:00
pyup-bot
34fbf4759a Update pytest-mock from 1.6.0 to 1.6.2 2017-07-26 09:43:43 +01:00
pyup-bot
5eac2bdbd0 Update pyexcel-xlsx from 0.4.0 to 0.4.1 2017-07-26 09:43:40 +01:00
pyup-bot
b19ed257a1 Update pyexcel from 0.5.0 to 0.5.2 2017-07-26 09:43:36 +01:00
Chris Hill-Scott
3d076efeea Merge pull request #1357 from alphagov/pyup-initial-update
Initial Update
2017-07-26 09:43:27 +01:00
Chris Hill-Scott
a58d881647 Make one-off error refer to correct message type
This was hard coded to say ‘You can’t send to this phone number’ even
when you were trying to send an email.
2017-07-26 07:50:01 +01:00
Chris Hill-Scott
2291c4faf4 Make sure errors on one-off flow have red border
When I split up the error messages on the check CSV page into multiple
templates, I also reduced the repetition of wrapping `<div>`s and macro
calls by moving them up outside the conditional blocks (see
8e947f315d).

Unfortunately I didn’t make the same adjustments for the one-off flow,
which meant that errors on these pages lost their styling. This commit
re-adds the styling for these error messages.
2017-07-26 07:46:20 +01:00
Chris Hill-Scott
b4c05ed697 Use ‘Continue’ not ‘Next’ for button text
The service manual recommends to:

> Make sure your ‘Continue’ button is:
>
> - labelled ‘Continue’, not ‘Next’
> - aligned to the left so users don’t miss it

– https://www.gov.uk/service-manual/design/question-pages
2017-07-24 16:52:17 +01:00
Chris Hill-Scott
2c768544d9 Merge pull request #1370 from alphagov/utils-bump-17.5.5
Bump utils
2017-07-21 13:26:46 +01:00
Chris Hill-Scott
32ae0a9b36 Merge pull request #1364 from alphagov/letter-job-page-real
Customise the job page to make sense for letters
2017-07-21 13:10:09 +01:00
Imdad Ahad
e3676249e2 Merge pull request #1378 from alphagov/revert-1377-imdad-fix-remove-vendor-folder-before-build
Revert vendoring dependencies for cloundfoundry
2017-07-21 11:28:43 +01:00
Imdad Ahad
85a59746a0 Revert d06a72 and 6b9b1be but keep the wheel-removal changes 2017-07-21 11:21:17 +01:00
Imdad Ahad
82b8321d07 Revert "Remove vendor folder before building artefact" 2017-07-21 11:06:00 +01:00
Imdad Ahad
dc7424524e Merge pull request #1377 from alphagov/imdad-fix-remove-vendor-folder-before-build
Remove vendor folder before building artefact
2017-07-21 10:36:13 +01:00
Imdad Ahad
90dd4101b1 Remove vendor folder before building artifact 2017-07-21 10:10:31 +01:00
Imdad Ahad
0468d9bab3 Merge pull request #1376 from alphagov/imdad-fix-copy-packages-into-vendor
Copy all the dependencies into the directory
2017-07-21 09:38:29 +01:00
Imdad Ahad
6b9b1be521 Copy all the dependencies into the directory 2017-07-20 17:50:31 +01:00
Chris Hill-Scott
c356c3c54c Bump utils
Brings in:
- [ ] https://github.com/alphagov/notifications-utils/pull/182
2017-07-20 17:36:58 +01:00
Imdad Ahad
e892f61dca Merge pull request #1373 from alphagov/imdad-feat-remove-wheels-and-optimise-deploy
Speed up deployment (cleanup wheels/vendor dependencies for cf)
2017-07-20 16:40:52 +01:00
Chris Hill-Scott
5ddb3a5ac7 Merge pull request #1375 from alphagov/fix-missing-in-recipient-row-error
Fix error message for missing cells in CSV file
2017-07-20 16:14:07 +01:00
Chris Hill-Scott
cfd44c94f6 Fix error message for missing cells in CSV file
This was causing a 500 because of a bug in utils. It only occurred when
there was missing data for a cell in the recipient column. I’ve also
added a test for missing data in a non-recipient column just in case.
2017-07-20 15:51:07 +01:00
Imdad Ahad
d06a72224e Don't create wheels for dependencies but store offline:
Previously we used AWS which meant that we could create wheels
from our requirements and then install them offline which made
deployments quicker.

We're no longer using AWS so let's remove that.

Although CloudFoundry supports installing dependencies in an offline
environment as documented here:
http://docs.cloudfoundry.org/buildpacks/python/#vendoring

To achieve this we create a vendor/ directory which will contain
the packages to install. This uses --no-index and --find-links so will
not resolve for any dependencies from pypi. For this reason there is
assumed confidence that the vendor/ directory will contain all
of the dependencies we need.
2017-07-20 14:17:10 +01:00
Chris Hill-Scott
35e39eb45b Merge pull request #1374 from alphagov/split-the-check
Split the ‘check’ template into three separate templates, add error tracking
2017-07-20 14:02:12 +01:00
Chris Hill-Scott
34db44a96a Merge pull request #1367 from alphagov/letter-notification-page
Letter notification page
2017-07-20 14:02:03 +01:00
Chris Hill-Scott
82233340b6 Track errors when uploading spreadsheets
Uses the new javascript event tracking stuff so that we can see what
errors people are getting when they upload spreadsheets.
2017-07-20 12:06:15 +01:00
Chris Hill-Scott
eb264f34b7 Add a little JS module to track events
Google analytics lets you send:
- pageviews
- events

Page views are used by default. But sometimes you wanna count something
which isn’t the user navigating to a new page, or you wanna track
something which isn’t just what page they were looking it. This is where
events are useful.

This commit adds a small JS module that lets us fire off an event when
the presence of an element with the right data attributes are present on
the page.
2017-07-20 12:06:15 +01:00
Chris Hill-Scott
56945565ba Don’t indent column headings if no row errors
The reason to indent the first column heading is so that the number 1
lines up with the numbers of subsequent rows.

This only happens when the subsequent rows are indented because of the
red bars. This is only when there are row errors, not when there are
more general errors.
2017-07-20 12:01:59 +01:00
Chris Hill-Scott
8e947f315d Refactor check error templates to repeat less
There was a lot of repetetive wrapping code being repeated for every
conditional block in these files. Let’s wrap it around the whole
conditional bit once instead.
2017-07-20 12:00:56 +01:00
Chris Hill-Scott
94bc8191ae Remove irrelevant stuff from error check pages
If you have errors in your file then there’s stuff you’re not going to
see on the page. So this doesn’t need to be in the Jinja templates that
are only used when there are errors.

Basically the conditional stuff is moving up to the level above these
templates.
2017-07-20 11:56:37 +01:00
Chris Hill-Scott
5a9f817e52 Remove anything error-related from the OK view
If you’ve uploaded a file and everything is OK, the page that you see
doesn’t need to look at any errors (because there won’t be any).
2017-07-20 11:55:46 +01:00
Chris Hill-Scott
ddeed88210 Refactor check page into 3 separate templates
The check page is a very complex Jinja template. It needs breaking up
to make it easier to understand what’s going on.

I think there are three di
2017-07-20 11:47:04 +01:00