Commit Graph

4775 Commits

Author SHA1 Message Date
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
cf11c1dc99 Mark agreement signed by Neath Port Talbot County Borough Council 2018-12-03 15:32:38 +00:00
Chris Hill-Scott
ba51e395f1 Fix apostrophe 2018-12-03 13:55:54 +00:00
Chris Hill-Scott
fb73fd228c Fix indentation 2018-12-03 13:55:47 +00:00
Chris Hill-Scott
4e3ddb22dc Remove go-live requirement content 2018-12-03 13:55:14 +00:00
Chris Hill-Scott
8807028097 Refactor team members into the model
Follows the pattern we’re using elsewhere of having less logic in the
view methods.
2018-12-03 12:07: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
Chris Hill-Scott
29830da5e6 Scope live search on team page to name and email
It’s not useful for the search to also be picking up ‘Send messages’ or
‘Signs in with an email link’.
2018-12-03 11:05:10 +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
Chris Hill-Scott
07a1d903eb Merge pull request #2550 from fidejoseph/patch-5
Update email_domains.yml
2018-12-03 10:12:51 +00:00
Pea Tyczynska
0b45eda53f Update tests 2018-12-03 09:56:24 +00:00
Pea Tyczynska
b9abeb91d3 Back button on one-off message preview takes user to their flow
Earlier it always took user to one-off flow, even when they came
from test flow.

Also adjust steps calculation for test flow.
2018-12-03 09:56:24 +00:00
Chris Hill-Scott
d951919f40 Mark agreement signed by East Renfrewshire Council 2018-11-30 16:20: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
fidejoseph
784870fdd8 Update email_domains.yml
Adding careinspectorate.com  - they're a scrutiny body specialising in health and social care, early learning and childcare, social work, children’s services, and community justice
2018-11-29 14:24:22 +00:00
Chris Hill-Scott
5bf6bdcd20 Serve images from the CDN
Because it should be quicker than serving them from our app directly.
2018-11-29 14:09:44 +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
23cc182b6f Get config from current app 2018-11-29 12:07:48 +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
karlchillmaid
b9234227fd Added description
Added description of what a reply-to address should and should not be.
2018-11-29 11:33:38 +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
karlchillmaid
8d8c66e94e Updated reply-to address content
Updated reply-to address content to better explain why users need to add a reply-to address.
2018-11-29 11:26:19 +00:00
Chris Hill-Scott
74459b2f2a Merge pull request #2542 from alphagov/static-domain
Use static domains for static assets
2018-11-29 09:58:38 +00:00
Chris Hill-Scott
b1c0778bde Since moving to putting the admin app on Cloudfront anything on the
`www.notifications.service.gov.uk` domain is:
- not gzipped

The PaaS proxy used to GZip and set headers for anything served from a
path starting with `/static/`:
76dd511a8a/ansible/roles/paas-proxy/templates/admin.conf.j2 (L53-L64)

Anything served from `static.notifications.service.gov.uk` is:
- GZipped
- and as a bonus, cached by Cloudfront where possible (meaning the
requests won’t ever hit our app)

This commit moves to serving static asset from `/static/` to
`static.notifications.service.gov.uk`, to get the above listed benefits.

***

We could do even better by setting long cache expiry headers on the static subdomain (currently they’re only set to cache for 60 seconds). But that’s out of scope for this commit.
2018-11-28 15:50:21 +00:00
Leo Hemsted
1bb7e98722 add fieldsets to template/folder form and update docstrings
also remove erroneous pytest.ini cfg and reset button
2018-11-28 14:14:20 +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
690585c017 move add new folder and move to folder into one dialog box
this lets us combine the two actions to create "Move to a new folder".
If the user hits enter rather than clicking a button, there is a hidden
submit button that (for now) prevents them from taking any action.
A future commit will try and understand what the user might be doing
based on which fields are populated/selected.
2018-11-28 14:14:20 +00:00
Leo Hemsted
9dec9ed626 add new folder from the choose template page 2018-11-28 14:14:20 +00:00
Chris Hill-Scott
ad4bc57aa6 Add Social Work England to list of email domains
Social Work England will be the new, specialist regulator for social workers in England.

https://www.gov.uk/government/publications/social-work-england-secondary-legislation

https://www.socialworkengland.org.uk
2018-11-28 09:57:38 +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
d5c4c7590c Merge pull request #2531 from alphagov/search-within-folders
Make template search work across folders
2018-11-26 16:30:54 +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
9d8e602ac8 time_left considers flexible data retention periods
Also update tests
2018-11-26 15:15:06 +00:00
Katie Smith
c48f54aba4 Bump notifications-utils to 30.7.0
Bumped the notifications-utils version. The `gmt_timezones` function in
this repo and the `utc_string_to_aware_gmt_datetime` in
notifications-utils are the same, so have updated the code to always use
the version in utils.
2018-11-26 14:43:42 +00:00
Chris Hill-Scott
7d20846d94 Render selected links with box shadow not outline
Because there’s a mystery 2px gap between the outline and the element in
Firefox.
2018-11-26 11:33:27 +00:00
Chris Hill-Scott
adcd699712 Maintain full width for items without a path 2018-11-26 10:56:48 +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
ecdd605bca Allow wrapping within folder/template names
It takes up a lot of vertical space if folders and templates can only
break on the path separator (the `/`).
2018-11-23 14:38:47 +00:00
Chris Hill-Scott
d7e6e6ae90 Make live search restore items to default state
At the moment live search works by either setting something to hidden
or displayed. When the search term is empty, it sets everything to
visible.

This doesn’t work with folders because some of them should be hidden by
default (the ones not at the current level).

We can account for this special case (empty search term) by removing
the `display` CSS attribute when the search term is empty. This means
that each item’s visibility will be controlled by whatever is set in the
CSS file. Using jQuery Setting a property to `''` removes it.
2018-11-23 14:35:58 +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
d8a0a192c3 Mark agreement signed by Plymouth City Council 2018-11-22 17:24:00 +00:00
Chris Hill-Scott
5df1978c62 Merge pull request #2529 from alphagov/download-pdf-footer
Put download PDF link in the sticky footer on the sent letter page
2018-11-22 13:23:10 +00:00
Chris Hill-Scott
fe5112a4c3 Merge pull request #2528 from alphagov/dont-wrap-users
Don’t wrap users onto multiple lines
2018-11-22 13:23:02 +00:00