Commit Graph

2141 Commits

Author SHA1 Message Date
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
Chris Hill-Scott
bc6b9c7af7 Use named arguments for clearer string formatting
Helps when the string is long.

Also helps disambiguate between the CDN domain used for the logos and
those for CSS/JS.
2018-11-29 11:56:01 +00:00
Chris Hill-Scott
fe6610c221 Fix content security policy for the CDN
The CDN URLs aren’t in included in the content security policy. So
browsers will refuse to load them.

This commit:
- adds each of the CDN URLs to the
- only prepend URLs in CSS files with `/static/` if we’re running
  locally (because the CDN URLs are like `static.example.com` not
  `example.com/static`)
2018-11-29 11:29:52 +00:00
Leo Hemsted
d07de58cd9 split out new folder into two separate forms
move_to_new_folder and add_new_folder are now two separate html fields
and form items - so that we can more easily manipulate them on the
front end
2018-11-28 14:14:20 +00:00
Leo Hemsted
6743bd11fa moved existing template folder tests into test_template_folders
also refactored slightly to work with new html, and separate succesful
and bad-permissions test cases
2018-11-28 14:14:20 +00:00
Chris Hill-Scott
0000ca6629 Merge pull request #2535 from alphagov/launch-first-class
Launch first class postage feature
2018-11-26 16:33:21 +00:00
Chris Hill-Scott
84a3c80eb4 Launch first class postage feature
This commit makes it available to everyone. Available just means they
can select 1st class for all their letters, if they want it.
2018-11-26 15:53:14 +00:00
Pea Tyczynska
6d00e1dfcb Test Data available message for jobs with flexible data retention 2018-11-26 15:28:09 +00:00
Pea Tyczynska
9d8e602ac8 time_left considers flexible data retention periods
Also update tests
2018-11-26 15:15:06 +00:00
Chris Hill-Scott
ee991d0142 Allow any sub-items to be moved from a folder
Since you can now see them when searching you should also be able to
select and move them. Which means that they needed to be included in
the `Form`’s list of possible choices of things to move.
2018-11-23 16:29:21 +00:00
Chris Hill-Scott
cdb03d1eeb Only live search on template or folder name
If you have a folder structure like this:

> FA / FB / FC

and you search for ‘FA’, it’s very noisy to see:

> FA / FB
> FA / FB / T1
> FA / FB / T2
> FA / FB / FC
> FA / FB / FC / T3
> …

It’s clearer to just show:

> FA / FB

This also has the benefit of, if you type ‘template’ (for example) you
don’t get every item any more, because it’s only looking at the name of
the thing. It used to look at the entire description, ie:

> A / B / C / Example
> Text message template

Now it only searches on the name:

> A / B / C / *Example*
> Text message template
2018-11-23 14:39:45 +00:00
Chris Hill-Scott
28ef6910a3 Hide templates and folders not at current level
Things in subfolders need to be in the page so we can search for them.
But the default view should be only the things are the current level.
So we can use CSS to hide items that are below the current level.
2018-11-23 14:34:25 +00:00
Chris Hill-Scott
148492a635 Put all nested items on page
So that the live search can filter things, they need to be on the page
when it loads. We want to make search work across folders, so all the
things in subfolders need to be in the page.

They also need the full path appending to them, so that you can tell
which ones are in which folders.

This won’t show items that are in a folder above the one you’re
currently in – my reckon is that when you’re narrowing down by clicking
into a folder that you only want to search for things in that folder.
2018-11-23 14:31:05 +00:00
Chris Hill-Scott
82d8207612 Refactor template list logic into one place
The Jinja template for the ‘choose templates’ page is now pulling in
data from a lot of diparate places in order to work out what to show. As
we add more logic about what to show (in order to make the live search
work) it’s going to get harder to have all this logic in the Jinja
template.

This commit refactors it back into Python where we have more language
features for managing complex logic.

It’s a bit weird to call this file a model, in that it’s dealing with
some presentational logic, rather than just data. Conceptually it’s more
like a view model[1].

1. https://en.wikipedia.org/wiki/Model%E2%80%93view%E2%80%93viewmodel
2018-11-23 14:00:40 +00:00
Chris Hill-Scott
741a8856fa Remove the word ‘printable’
Don’t think it’s necessary. Makes things consistent with the sent letter
page, which only says ‘Download as a PDF’.

This inconsistency would be more glaring now these pieces of text appear
in the same place, in adjacent steps of a journey.
2018-11-22 12:36:29 +00:00
Chris Hill-Scott
5d13c639b1 Fix logic around showing search box
It was looking at the count of items at the root level (because it was
passing `parent_folder_id=None` as an argument).

This changes it to look at the total count of items for a service (which
was the intended behaviour).
2018-11-20 16:12:50 +00:00
Chris Hill-Scott
8f2547b7a7 Merge pull request #2518 from alphagov/delete-folder-refinements
Make some refinements to the delete folder journey
2018-11-20 14:53:05 +00:00
Chris Hill-Scott
c52dc8e972 Merge pull request #2488 from alphagov/copy-template-name
Put ‘copy’ at end of new template name
2018-11-20 14:14:09 +00:00
Chris Hill-Scott
65389b0bb5 Merge pull request #2513 from alphagov/empty-folder-message
Improve the empty folder state
2018-11-20 13:50:53 +00:00