Commit Graph

9566 Commits

Author SHA1 Message Date
Chris Hill-Scott
e24083ce9d Add a page to choose a contact list
You’ll be able to use a contact list by first choosing a template, then
choosing the list you want to use.

At the moment this shows all lists, not just the ones that are
compatible with your template.
2020-03-16 13:08:07 +00:00
Chris Hill-Scott
aa85870ee1 Add a page to view a single contact list 2020-03-16 13:08:00 +00:00
Chris Hill-Scott
f15b9b8d38 Rename URL for consistency
We say `…/upload-letter` not `…/upload-a-letter`
2020-03-16 13:07:53 +00:00
Chris Hill-Scott
460b779d11 Add endpoint to redirect from contact list to send
In order to use a contact list we’re going to put you in the normal
upload a spreadsheet journey. Except without having to upload again.

So this commit adds an endpoint that takes the file from the contact
list bucket, puts it in the same place it would have gone if you’d
uploaded it, then sends you on your way.
2020-03-16 13:07:46 +00:00
Chris Hill-Scott
03f2368deb Use the correct bucket for storing contact lists
We don’t want to muddy them up with the normal CSV uploads.

I’ve tried to reuse the existing S3 code where possible because it’s
well tested.

Buckets have already been created.
2020-03-16 13:07:39 +00:00
Chris Hill-Scott
1c02476ee7 Let users upload a contact list to use later
We increasingly have teams wanting to do business-continuity type
messaging. They might be without access to their normal systems, which
is where they would otherwise go to get the list of email addresses or
phone numbers.

So we want to give them a place in Notify where they can store their
spreadsheets and use them at a later date.

For the initial pass we’re going to scope this to only allowing
spreadsheets with one column, ie just phone numbers/email addresses.
This is because:
- it minimises the amount of personal info we’re storing
- it reduces the chance of getting a placeholder error when you go to
  send the message, which is probably a high-stress situation where you
  might not be able to re-generate the file

The code for this is mostly copied from the existing upload CSV journey.
It’s quite duplicative, but that’s what I needed to do to get this out
quickly. There are opportunities for refactoring later.

Similarly, I would have liked to split this up into better commit
messages, but it really was a case of just bashing code out until it
worked 😳

This commit does not:
- implement the ‘view a contact list page’ (it just has a placeholder
  because the API isn’t ready at the moment)
- link to this page (because it’s not ready to use yet)
2020-03-16 13:07:28 +00:00
David McDonald
6c3bdff13c Merge pull request #3372 from alphagov/increase-ajax
Increase all ajax calls to 5 seconds
2020-03-16 10:54:25 +00:00
David McDonald
5b818dcd68 Increase all ajax calls to 5 seconds
The default is 2 seconds and this will mean that we are halving traffic
for these ajax calls which can only be good for trying to limit queries
on the database.

I think the user impact on this will likely not be noticable.

Debatable whether we should up them all even further to 10 seconds but
this is definitely a quick although maybe small win.
2020-03-16 10:41:41 +00:00
Leo Hemsted
206dc87426 Merge pull request #3370 from alphagov/remove-unused-templates
Remove unused templates
2020-03-13 15:07:19 +00:00
Leo Hemsted
669a6ce95a Merge pull request #3365 from alphagov/typo
link_to_file, not link_to_document
2020-03-13 14:59:39 +00:00
Tom Byers
fd4b5e0d1f Remove separate page for adding a folder
The route for this was removed in: 8512e26d6f (diff-f0af582449ebf426f27f37e38f310057)
2020-03-13 14:56:12 +00:00
Tom Byers
6b291729b7 Remove separate page for adding a template
The route for this was removed in 7d7b790dc1 (diff-f0af582449ebf426f27f37e38f310057)
2020-03-13 14:54:49 +00:00
Leo Hemsted
f7992b3b98 link_to_file, not link_to_document 2020-03-12 13:27:48 +00:00
Chris Hill-Scott
9c24323bdd Merge pull request #3364 from alphagov/quis-patch-1
Show uploads link even without letters permission
2020-03-12 11:09:29 +00:00
Chris Hill-Scott
f2c0765c02 Give everyone who can see dashboard the upload nav 2020-03-12 10:37:59 +00:00
Chris Hill-Scott
64dbae179f Merge pull request #3343 from alphagov/show-letter-upload-guidance
Show guidance on how to upload a letter
2020-03-11 17:35:32 +00:00
David McDonald
577091cec7 Merge pull request #3363 from alphagov/remove-user-from-service-event
Add event for remove_user_from_service
2020-03-10 15:49:37 +00:00
David McDonald
c248fee772 Add event for remove_user_from_service
Follows our existing patterns of events for managing users
2020-03-10 13:52:39 +00:00
Rebecca Law
6bd69be5d8 Merge pull request #3362 from alphagov/fix-message-too-long-error
Fix the error message for message-too-long
2020-03-10 13:07:13 +00:00
Katie Smith
227b940800 Merge pull request #3360 from alphagov/international-letters-permission
International letters permission
2020-03-10 13:06:44 +00:00
Rebecca Law
040da762ed Fix the error message for message-too=long
There was a bug that displayed the error message with 2 red error boxes around the error message.
Also need another else to handle a new error message from the API, the old one can be removed after the API is deployed. But this can go first. I tested this branch with API master and the API branch with the change. I tested one off SMS and a CSV upload.
2020-03-10 09:29:38 +00:00
Leo Hemsted
81e4902afb Merge pull request #3361 from alphagov/revert-3357-flask-login
Revert "upgrade flask_login to 0.5.0"
2020-03-09 17:03:48 +00:00
Leo Hemsted
5535db273c Revert "upgrade flask_login to 0.5.0" 2020-03-09 16:48:27 +00:00
Leo Hemsted
2862cd1d30 Merge pull request #3357 from alphagov/flask-login
upgrade flask_login to 0.5.0
2020-03-09 16:07:47 +00:00
Katie Smith
99fd317087 Update letter pricing
The pricing page had the correct data, but there were a few pages where
the minimum and maximum price were out of date.
2020-03-09 16:05:23 +00:00
Katie Smith
4a832cfebb Fix tests relating to buttons on uploads and service settings pages
Some of the tests for buttons on the uploads page were not testing that
the right button was present / absent. There are hidden cookie buttons
in the HTML which means that we were sometimes finding one of these on
the page instead of the intended button.

On the service settings page, we changed the service setting buttons to
links some time ago, so tests that the buttons weren't on the page were
always passing.
2020-03-09 15:29:48 +00:00
Katie Smith
8c30dbfb69 Add international_letters permission to settings page
This is a permission that can only be toggled by Platform Admin and
which requires the `letter` permission in order to be turned on.
2020-03-09 14:17:20 +00:00
Leo Hemsted
e4cd77a645 upgrade flask_login to 0.5.0
flask_login sets a bunch of variables in the session object. We only use
one of them, `user_id`. We set that to the user id from the database,
and refer to it all over the place.

However, in flask_login 0.5.0 they prefix this with an underscore to
prevent people accidentally overwriting it etc. So when a user logs in
we need to make sure that we set user_id manually so we can still use
it.

flask_login sets a bunch of variables on the `flask.session` object.
However, this session object isn't the one that gets passed in to the
request context by flask - that one can only be modified outside of
requests from within the session_transaction context manager (see [1]).
So, flask_login populates the normal session and then we need to copy
all of those values across.

We didn't need to do this previously because we already set the
`user_id` value on line 20 of tests/__init__.py, but now that
flask_login is looking for `_user_id` instead we need to do this
properly.

[1] https://flask.palletsprojects.com/en/1.1.x/testing/#accessing-and-modifying-sessions
2020-03-09 12:04:17 +00:00
Chris Hill-Scott
4a154fddcf Merge pull request #3353 from alphagov/reverse-sort-scheduled-jobs
Reverse sort scheduled jobs
2020-03-06 16:40:16 +00:00
Chris Hill-Scott
6b17fb1dce Merge pull request #3350 from alphagov/org-breadcrumb-alignment
Tweak the spacing of the organisation breadcrumb
2020-03-06 16:40:05 +00:00
David McDonald
c89944747e Merge pull request #3356 from alphagov/statsd-prefix
Remove unused environment variable
2020-03-06 16:00:27 +00:00
Leo Hemsted
a2ebc2fb7a Merge pull request #3355 from alphagov/invite-bug
move invite error handler to top level
2020-03-06 14:44:11 +00:00
David McDonald
0a304faf3d Merge pull request #3342 from alphagov/tidy-makefile
Tidy makefile
2020-03-06 14:13:16 +00:00
David McDonald
5f548a395a Remove unused environment variable
We no longer use this.

See f56795655e
for further details.
2020-03-06 13:25:53 +00:00
Leo Hemsted
2d8d2d712a move invite error handler to top level
ensure we catch org errors as well as regular errors
2020-03-06 13:20:31 +00:00
Katie Smith
4a2b216956 Merge pull request #3321 from alphagov/govuk-frontend-grid
Convert all layouts to GOV.UK Frontend style
2020-03-06 13:10:44 +00:00
Katie Smith
6bd7ec03b6 Fix class name
Co-Authored-By: Chris Hill-Scott <me@quis.cc>
2020-03-06 12:50:12 +00:00
Katie Smith
ee9a396de1 Stop using -govuk-spacing(n) in SASS
Using `-govuk-spacing(n)` in the SASS files was not working, so this
replaces it with `-1 * govuk-spacing(n)` instead.
2020-03-06 11:23:24 +00:00
Katie Smith
e2099d6170 Update a couple more old grid styles 2020-03-06 11:11:41 +00:00
Katie Smith
66006e24b0 Stop importing layout from GOV.UK Elements 2020-03-06 11:11:41 +00:00
Katie Smith
bc83ff6c09 Replace $gutter with govuk-spacing function
Replaced `$gutter` and similar variables such as `$gutter-half` with the
`govuk-spacing()` static spacing function. This uses `govuk-spacing()`
instead of `$govuk-gutter` because `$govuk-gutter` should only be used
for the gaps in between grid columns and we were mostly using `$gutter`
to add more space around elements.

There are other places in the SCSS files where we had hardcoded a
measurement in px which could be replaced with `govuk-spacing`, but this
commit only replaces the existing uses of `$gutter`.
2020-03-06 11:11:41 +00:00
Katie Smith
a85f7fa2c1 Replace the .column-... classes in _grids.scss
We had 7 classes in _grids.scss named `.column-...` which were being
used to give a certain column width. These worked by using `@include
grid column()`, which is now deprecated.

`.column-whole` and `.column-three-quarters` can be removed and replaced
with `govuk-grid-column-full` and `govuk-grid-column-three-quarters`
respectively. The other column classes don't have a direct replacment in
GOV.UK Frontend. To get round this, we overwrite the `$govuk-grid-width`
SASS map in `extensions.scss` to add in extra widths, then use this with
the `govuk-grid-column` mixin to create new classes in for our custom
widths in `_grids.scss`
2020-03-06 11:11:41 +00:00
Katie Smith
e2952e6a7a Replace site-width-container with govuk-width-container 2020-03-06 11:11:41 +00:00
Katie Smith
6f8cc1f003 Remove unecessary id and class from product page
Stopped using `#content` on the product page - this was from GOV.UK elements.
Also removed the `override-elements-content` class since the page looks
the same without it.
2020-03-06 11:11:41 +00:00
Katie Smith
15f9eeeaf2 Replace column-half with govuk-grid-column-one-half 2020-03-06 11:11:41 +00:00
Katie Smith
b0d714f313 Replace column-one-quarter with govuk-grid-column-one-quarter 2020-03-06 11:11:41 +00:00
Katie Smith
bf949044bc Replace column-two-thirds with govuk-grid-column-two-thirds 2020-03-06 11:11:41 +00:00
Katie Smith
07bcb4220e Replace column-one-third with govuk-grid-column-one-third
Also replaces `column-third`, with `govuk-grid-column-one-third`, since
this appears to be an alias of `column-one-third`.
2020-03-06 11:11:41 +00:00
Katie Smith
076d99c9dc Replace column-full with govuk-grid-column-full 2020-03-06 11:11:41 +00:00
Katie Smith
b9b9a138f9 Replace grid-row with govuk-grid-row
Replaced all instances of `grid-row` in the HTML and JavaScript with
`govuk-grid-row`, which is the new GOV.UK Frontend class.
2020-03-06 11:11:41 +00:00