Commit Graph

3916 Commits

Author SHA1 Message Date
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
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
Chris Hill-Scott
68078041dd Show personalisation in individual letters
Adds a new endpoint that works like view template/view preview of
letter, so that this page works the same way it does for emails/text
messages (ie showing the full content of the message, including
personalisation).

We’re not worrying about redaction in letters for now.
2017-07-19 19:01:39 +01:00
Chris Hill-Scott
63e9ef44e7 Don’t show status for individual letters
The status won’t ever change from sending for letters. For now at least.
And even when we do come up with more useful statuses I’m not convinced
it’s useful to expose them to our admin users.

A more useful piece of information to show is when we think the letter
will be delivered.
2017-07-19 19:01:39 +01:00
Chris Hill-Scott
b003162932 Merge pull request #1368 from alphagov/quis-patch-1
Reduce spacing before button on invite page
2017-07-19 09:13:36 +01:00
Chris Hill-Scott
35e7866b96 Merge pull request #1372 from alphagov/correct-descalation-link
Fix broken link in support process
2017-07-19 09:13:31 +01:00
Chris Hill-Scott
95347a89db Merge pull request #1371 from alphagov/fix-form-focus-list-entry
Fix button keyboard focus on whitelist
2017-07-19 09:13:21 +01:00
Chris Hill-Scott
3950c6938d Show confirmation after pressing big green button
There’s no immediate feedback with letter jobs, unlike email or text
messages jobs where you see the numbers starting to tick over straight
away.

We need to reassure the user that the thing they asked us to do (send
letters) is underway. ‘Printing’ feels like the natural first state of
the letter-making process. So this commit adds a banner to tell the
user that printing is the thing that’s happening.
2017-07-18 11:00:54 +01:00
Chris Hill-Scott
ad897cd820 Hide report on letter job 2017-07-18 11:00:53 +01:00
Chris Hill-Scott
7881753193 Replace blue boxes with total + delivery estimate
The sending/failed/delivered thing:
- doesn’t map to the actual states of letters
- doesn’t respond quickly enough to give you feedback that something is
  happening (because "sending" doesn’t even go to "probably delivered"
  for a few days)

This commit replaces these 4 boxes with some more useful information:
- one number – how many letters were in the job in total
- when we estimate that the letters will be delivered
2017-07-18 11:00:08 +01:00
Chris Hill-Scott
202c9aea62 Hide status for individual letters
The status for each letter in a job will be the same for every single
letter (at least until we start dealing with returns).

It’s redundant to show this information over and over again. This commit
removes it.
2017-07-18 10:37:54 +01:00
Chris Hill-Scott
a282850a0c Allow get template fixture to accept version
The other template fixtures do, because the real API call does, it was
omitted from the letter equivalent.
2017-07-18 10:37:54 +01:00
Chris Hill-Scott
9a81489066 Merge pull request #1362 from alphagov/letter-delivery-estimates
Add function to estimate letter delivery date
2017-07-18 09:44:56 +01:00
Chris Hill-Scott
5b4a15495e Fix remove button keyboard focus on whitelist
Replicates @pcraig3’s work here:
https://github.com/alphagov/digitalmarketplace-frontend-toolkit/pull/333
2017-07-17 09:55:11 +01:00
Chris Hill-Scott
109b41a430 Fix broken link in support process
The idea is if you decide your problem isn’t such an emergency after
all, we direct you to the form where you can report it as such. This
link wasn’t working because it didn’t understand `False` to mean ‘not
severe’. Only ‘no’ means not severe.

The result was that users got sent in a bit of a convoluted loop
where they were asked again if their problem was an emergency or not.

Testing this by making sure that both:
- the URL in the link is what we expected
- when visited it gives the page title we expect

Because even if we had had the first test only, it wouldn’t have caught
this bug.
2017-07-15 07:23:22 +01:00
Chris Hill-Scott
e20483c462 Add print timings to letter timings
It will also be useful to know (especially for the API):
- when a letter was printed
- if it’s been printed or not

This commit:
- adds code to calculate these two pieces of information
- refactors the function to return a `namedtuple` – a tuple of two items
  was manageable, but with four items it was getting hard to know what
  each one meant – this lets us label each piece of information that is
  being returned
2017-07-14 20:09:23 +01:00
Chris Hill-Scott
6ceffd02c4 Reduce spacing before button on invite page
It was too much, the button looked adrift.
2017-07-13 15:55:32 +01:00
Chris Hill-Scott
a6b3ae0965 Merge pull request #1360 from alphagov/ajax-conversation-page
Make conversation and inbox pages update using AJAX
2017-07-13 15:18:33 +01:00
Chris Hill-Scott
a6eb18fbf3 Merge pull request #1366 from alphagov/roadmap-july
Updates for July for the Roadmap
2017-07-13 15:01:52 +01:00