Commit Graph

2259 Commits

Author SHA1 Message Date
Chris Hill-Scott
0c1a797a82 Keep param on multiple lines
so it scans the same as preceeding test cases

Co-Authored-By: leohemsted <leohemsted@gmail.com>
2019-01-04 11:34:26 +00:00
Katie Smith
3cf36c592f Change move folder form to not have default radio btn and to show hint
Updated the move folder form to add a hint for the radio button for the
current folder saying 'current folder'. This hint does not get shown if
you are viewing all folders (so you are not inside a folder).

Also stopped a default radio button from being selected on the form.
2019-01-03 16:51:47 +00:00
Tom Byers
3c4a186a25 Display the template folders nested on the move template/folder form
Before, all the folders were displayed in a list which was ordered but
not nested. This changes the move form to nest the template folders.
2019-01-03 16:51:47 +00:00
Chris Hill-Scott
3a2cfda8b2 Don’t show postage to users who can’t choose it
If you can’t choose postage on a per-template basis, you shouldn’t be
see the thing that indicates that postage can be changed.
2019-01-03 16:04:16 +00:00
Chris Hill-Scott
aaf3322662 Use folder buttons in empty state
It’s confusing to have one way of adding things when your service is new
(green button) but a different way once you’ve added your first thing
(the new grey buttons).

For services that have a `edit_folders` permission, this commit
standardises on the grey buttons for a consistent experience.
2019-01-03 11:14:22 +00:00
Pea (Malgorzata Tyczynska)
5d99b2d2f6 Merge pull request #2616 from alphagov/choose_postage
Choose and display postage on template
2019-01-02 15:39:15 +00:00
Chris Hill-Scott
893163ff84 Reflect normalisation of whitespace in attributes
BeautifulSoup version 4.7.0 changes how it handles whitespace in
attribute values. See more detail here:
https://bugs.launchpad.net/beautifulsoup/+bug/1787453
2019-01-02 11:57:11 +00:00
Leo Hemsted
5961f470a4 don't apply marks directly in pytest
specifically - don't use `pytest.mark.xfail` directly in parametrize,
instead use `pytest.param(*args, marks=pytest.mark.xfail)`. the old way
is deprecated in pytest4 - for more information see
https://docs.pytest.org/en/latest/deprecations.html#marks-in-pytest-mark-parametrize

Also, make this an error in pytest.ini so if someone adds a new xfail,
it'll crash
2018-12-31 13:37:20 +00:00
Pea Tyczynska
97058d3c5b Add service setting switch to choose postage per template 2018-12-27 18:05:30 +00:00
Pea Tyczynska
50935e79ca Test mock_update_service_template called with right args 2018-12-21 17:18:18 +00:00
Pea Tyczynska
bc1e0b7167 Test choose postage section display when editing letter template 2018-12-21 17:13:19 +00:00
Pea Tyczynska
cbead5d665 Refactor tests for displaying template postage 2018-12-21 17:13:19 +00:00
Pea Tyczynska
5144db7baa Test postage display on view template page 2018-12-21 17:13:18 +00:00
Pea Tyczynska
85b8b343e2 Service deafault radio checked by default, existing tests pass. 2018-12-21 17:13:18 +00:00
Pea Tyczynska
e1191326f4 Fix tests after enabling editing of postage on letter templates 2018-12-21 17:13:18 +00:00
Leo Hemsted
94da05ebc4 only catch HTTPError
also add tests
2018-12-17 15:25:27 +00:00
Leo Hemsted
5c3c4ec78c change error message for not selecting a template
needed to subclass RadioField for this
2018-12-17 15:25:27 +00:00
Leo Hemsted
6f8dc7e6d3 fix being able to add template without selecting a radio button 2018-12-17 15:25:27 +00:00
Chris Hill-Scott
5ec673b84d Merge pull request #2578 from alphagov/add-existing-live-to-go-live
Note existing live services in go live ticket
2018-12-13 10:43:57 +00:00
Chris Hill-Scott
b51410baba Merge pull request #2575 from alphagov/remove-commas-volumes
Strip commas from estimated volumes
2018-12-13 10:41:50 +00:00
Chris Hill-Scott
9a70f6a7f4 Don’t let non-government users request to go live
Only users who work for government can accept the terms of use. This
will save us from having to email these requesters back telling them
they need to find someone else to submit the request.
2018-12-12 12:56:13 +00:00
Chris Hill-Scott
688bdd1d7a Note existing live services in go live ticket
It’s useful for analysing our growth to know if someone who’s requesting
to go live is already a live user of Notify.
2018-12-12 12:22:38 +00:00
Chris Hill-Scott
3cb0b164e8 Strip commas from estimated volumes
We suggest people format their numbers with commas when telling us how
many things they’re going to send.

This causes problems when we paste these values into a spreadsheet,
because the commas get interpreted as column separators.
2018-12-11 10:47:28 +00:00
Pea (Malgorzata Tyczynska)
77c61238e9 Merge pull request #2565 from alphagov/update_fields_csv_report
Add sender email to downloadable csv reports for notifications
2018-12-10 14:10:59 +00:00
Chris Hill-Scott
28d60124c2 Merge pull request #2568 from alphagov/fix-typod-test-name
Fix beheaded test name
2018-12-07 13:58:58 +00:00
Chris Hill-Scott
184a9fa605 Use email fields for feedback form
Otherwise we can end up collecting invalid email addresses…

This required some refactoring to allow our email fields to be optional
(but not by default).
2018-12-07 13:11:41 +00:00
Pea Tyczynska
1858ee93fd Notifications CSV Report now also shows sender email address 2018-12-07 11:20:20 +00:00
Chris Hill-Scott
b0ca82c0bd Fix beheaded test name
Tests wont run unless the function name starts with the word `test`.

Was accidentally deleted here:
de92950d8e (diff-3f993e348666469cc699ac3bf0e0cc5bR543)
2018-12-07 10:39:41 +00:00
Chris Hill-Scott
60f7aef3f7 Remove sticky textbox for one-off text messages
The idea behind the sticky textbox on this page is so you can scroll
through a long email or letter to find where in the message the
placeholder appears, while still being able to see the textbox you
should be typing in.

With text messages, they’re hardly ever long enough for anything to be
off the screen – ie no scrolling is required.

However if the user does scroll, they can end up covering the message
content with the sticky top panel. Which then looks like the message
has disappeared, so they click ‘back’ in the browser, then click into
the message again to make the page reload.

This commit removes the stickyness when sending from a text message
template.
2018-12-07 10:34:16 +00:00
Chris Hill-Scott
971c64a0a9 Merge pull request #2553 from alphagov/better-live-search-team
Scope live search on team page to name and email
2018-12-05 16:46:15 +00:00
Chris Hill-Scott
d81af78977 Merge pull request #2559 from alphagov/template-js
Template folder form smart JS
2018-12-05 16:36:12 +00:00
Katie Smith
31956999e2 Merge pull request #2562 from alphagov/allow-letters-to-be-cancelled
Allow letters to be cancelled
2018-12-05 16:07:46 +00:00
Chris Hill-Scott
c7f34cc211 Fix email branding preview for no branding
The value that means no branding (in the form) has changed from `'None'`
to `'__NONE__'`.

This commit:
- accounts for that value
- makes sure that no branding (ie plain GOV.UK) is still displayed when
  no query argument is given
2018-12-05 11:28:10 +00:00
Katie Smith
5406efa0cc Add link to cancel letters
Added a link to cancel letters from the letter notification pages if the
letter is still able to be cancelled. Clicking on this link will show a
confirmation box, and will then cancel the letter if the user confirms.
2018-12-05 11:12:05 +00:00
Katie Smith
429a23934d Display cancelled letters show as failed
In the long term, we don't want to show cancelled letters. But for now,
this changes cancelled letters to display in the same way that letters
with a status of permanent-failure, since we are currently giving
letters that we want to cancel the status of permanent failure.
2018-12-05 11:03:59 +00:00
Katie Smith
1ee972bd04 Add endpoint for cancelling letters to NotificationApiClient 2018-12-05 11:03:59 +00:00
Leo Hemsted
97f663f99e change operations to kebab-case
so that they better align with the front-end, where they'll be used in
data attributes. Also, making the kebab case is nice because it doesn't
give favouritism to either JS or python naming conventions
2018-12-04 16:41:47 +00:00
Leo Hemsted
1a5ebb3e62 Merge pull request #2541 from alphagov/choose-new-template
Let users add new template from the choose page
2018-12-04 16:41:38 +00:00
Alexey Bezhan
7a7a9ae854 Cache service data retention in Redis
Adds caching for service data retention. This removes separate API
client methods to retrieve individual data retention records by id
or type in favor of a single method that fetches and caches all
retention settings configured for the service. This makes it much
easier to invalidate cache when settings change.

Lookup by id or type is provided by helper methods in the service
model.
2018-12-03 17:57:02 +00:00
Chris Hill-Scott
2fcf278a5b Use unambiguously magic value for None choices
WTForms coerces `None` as a choice to `'None'` as a string when
rendering form fields (form fields will only ever have string data
because that what the browser posts back).

But internally WTForms coerces `None` to mean an unset value, ie where
the user hasn’t selected a radio button:
283b280320/src/wtforms/utils.py (L1-L20)

We shouldn’t use `None` to mean two different things. And in fact we
can’t, because it in effect means that we’re always getting a value
for the `move_to` field, even if the user hasn’t chosen to move any
templates. Which results in some very expected behaviour.
2018-12-03 17:49:10 +00:00
Chris Hill-Scott
8d0b3f47fd Set form choices as a list, not an iterator
Iterators can be exhausted, causing options to unexpectedly disappear
from the radio buttons.
2018-12-03 17:38:37 +00:00
Chris Hill-Scott
10100e51b6 Let users add new template from the choose page
Since we’re letting users add new folders directly from the choose page
it makes sense that they should also be able to add templates from
there.

This resolves the problem we saw in user research where people found it
hard to know where to go to add a new folder when they were all behind
one green button.
2018-12-03 17:38:37 +00:00
Pea (Malgorzata Tyczynska)
8aeea9929f Merge pull request #2551 from alphagov/one_off_bug
Back button on one-off message preview takes user to their flow
2018-12-03 17:12:58 +00:00
Chris Hill-Scott
538a06c0bf Refactor filtering out accepted invites to client
None of our model or view layer code should need to know about accepted
invites. We don’t use them anywhere because once an invite is accepted
that person is now a user.

Putting this logic in the client means that:
- none of the code calling the client needs to care about accepted
  invites
- it’s easier to (if we want) update the API code to not return accepted
  invites
2018-12-03 11:06:03 +00:00
Katie Smith
b9688f9ad3 Update banner message for CSV letters
This was always showing the text 'Your letter has been sent...' This has
now been updated to start 'Your letters have been sent...' if a job has
more than one notification in it.
2018-12-03 10:42:47 +00:00
Katie Smith
088d6ee4b0 Content changes for notification pages
This commit adds content pages for the notifications pages, particularly
the letter pages, which will make things clearer now that we will soon be allowing
letters to be cancelled.

The main changes are:
* The confirmation banner for letters sent from a CSV file now states when
printing will start.
* We state the CSV file that notifications were sent from on the
notifications page
* The notification page for letters shows when printing starts (today,
tomorrow, or that date that the letter was printed)
2018-12-03 10:42:47 +00:00
Pea Tyczynska
0b45eda53f Update tests 2018-12-03 09:56:24 +00:00
Alexey Bezhan
ef4921d2f9 Merge pull request #2534 from alphagov/final_countdown
'Data available for {}' message on job page accounts for flexible data retention
2018-11-29 15:49:27 +00:00
Chris Hill-Scott
643dca0071 Use asset fingerprinter to serve images
This means we can cache them forever, and only invalidate the cache
when the image changes.
2018-11-29 14:31:31 +00:00
Chris Hill-Scott
dd711f51b3 Fix asset path in asset fingeprinter
The asset fingerprinter was hard coded to always point to `/static`.

It needs to change depending on which environment the app is running
in.
2018-11-29 13:14:52 +00:00