Commit Graph

7490 Commits

Author SHA1 Message Date
Tom Byers
6aaa4d906b Convert radios on add nhs local org page (basic) 2020-12-02 16:00:32 +00:00
Tom Byers
52929d835d Convert radios for P.Admin email branding (basic) 2020-12-02 16:00:32 +00:00
Chris Hill-Scott
b579f68411 Limit jobs sent from contact list by data retention
On the uploads page we only show jobs which are within a service’s data
retention.

This commit does the same for when we’re listing the jobs for a contact
list. This matches the UI, which says a contact list has been ‘used
`<count_of_jobs>` in the last <data_retention> days’
2020-12-01 13:57:56 +00:00
Chris Hill-Scott
4b2744b684 Merge pull request #3440 from alphagov/show-jobs-on-contact-list
Show jobs grouped within the contact list they were sent from
2020-12-01 11:48:02 +00:00
Tom Byers
8ab756709a Merge pull request #3717 from alphagov/fix-nesting-in-content-page-sub-nav
Fix nesting in content page sub nav
2020-12-01 11:08:46 +00:00
Chris Hill-Scott
45b60e9555 Show usage count on uploads page
Because we’re be grouping jobs under their parent contact lists it’s
good to have some information ‘scent’ to help people find their jobs,
ie by clicking into a contact list. It also lets you see which list have
been used more than others, maybe because the update hasn’t been sent
to that group of people yet.

The hint text under uploads always says when they were used. For contact
lists this is a bit more complicated, since they can:
- never have been used
- been used multiple times

This commit makes use of the new fields being returned by the API to say
determine when these messages are relevant. They also let us
differentiate between a contact list that’s never been used, and one
that has been used, but not recently enough to show any jobs against it.
2020-11-30 13:54:54 +00:00
Chris Hill-Scott
423875011c Show jobs on contact list
It’s a bit unintuitive that starting a job from a contact list makes a
copy of the file, which has no relationship to the list it was copied
from. This is more of an implementation detail, rather than something
that comes from people’s mental models of what is going on. Or at least
that’s what I hypothesise.

I think it’s clearer to show jobs that come from contact lists within
the lists that they were created from. By naming the jobs by template
this gives a clearer view of what messages have been sent to the group
over time.
2020-11-30 13:54:54 +00:00
Chris Hill-Scott
149456b73a Add some more macros for counting things 2020-11-30 13:54:53 +00:00
Chris Hill-Scott
8f5c07336d Add method to get jobs for a contact list
Because the API lets us query jobs by contact list now, let’s add the
model and client layer code that will let us display them in the admin
app.
2020-11-30 13:54:53 +00:00
Chris Hill-Scott
236ddf053d Make created_at a property of contact lists
The view layer shouldn’t be having to deal with converting dates as
strings. This is an artefact of how we send data from the API to the
admin app. The model layer should be responsible for turning JSON into
richer types, where it can.
2020-11-30 13:54:53 +00:00
Chris Hill-Scott
fc1ca3ab2f Refactor to make pagination reusable
The responses we get to paginated queries from the API are fairly
consistent, so we should be able to reuse the code that takes JSON
from the API and turns it into Python objects. This commits factors out
that code so that it is reusable (by inheriting from it).
2020-11-30 13:54:53 +00:00
Rebecca Law
9463a94263 Remove the api_key component that was not being used on a few pages but imported. 2020-11-26 08:37:33 +00:00
Tom Byers
2f5f836dda Correct 'thing' to users on manage folder page
The checkboxes component that lets you choose
which users have permission to see the folder is
currently using the noun of 'folder' in the
summary it generates.

This is because this page users the
TemplateFolderForm class, which defaults the
permissions to 'folder'.

This updates the field_label attribute, used by
the code that generates the summary, to 'user' to
match the type of permission.
2020-11-24 14:22:08 +00:00
Chris Hill-Scott
6ebecec1f1 Merge pull request #3714 from alphagov/fix-focus-colour-edit-letter-links
Fix the focus colour on edit template links
2020-11-20 09:58:10 +00:00
Chris Hill-Scott
806552ce1d Remove line about beta from the roadmap
We’re not in beta any more, and we don’t need to explain what beta means
any more.
2020-11-19 15:59:18 +00:00
karlchillmaid
83c3d31629 Remove bullets and update content 2020-11-19 15:05:35 +00:00
Tom Byers
1801793440 Update 'last reviewed' date 2020-11-19 14:44:19 +00:00
Tom Byers
ee03eb0767 Remove issue with blank alt text in email images
This is no longer happening with the NVDA screen
reader, which had the issue, when testing in
Outlook.

The hack added as a temporary solution has now
been removed. It went live on 19 November 2020 at
2.20pm.
2020-11-19 14:43:08 +00:00
Tom Byers
1941151513 Merge pull request #3715 from alphagov/add-govuk-radios
Add GOVUK radios [part 1]
2020-11-18 11:38:25 +00:00
Tom Byers
45488b21c0 Replicate styling in existing pages 2020-11-17 21:39:34 +00:00
Tom Byers
cd0b900c2f Nest child lists inside list items
It's not valid HTML for <ol> or <ul> tags to have
<ol> or <ul>'s as direct children.

See:
https://www.w3.org/TR/html52/grouping-content.html#the-ol-element
https://www.w3.org/TR/html52/grouping-content.html#the-ul-element
2020-11-17 21:36:40 +00:00
Tom Byers
ad3ff9e539 Merge pull request #3713 from alphagov/fix-fix-for-template-list-focus-styles
Fix how template list item focus extends
2020-11-17 11:23:43 +00:00
Katie Smith
b49b789b8c Merge pull request #3711 from alphagov/add-extended-character-set-content
Add content about the extended character set
2020-11-17 10:18:35 +00:00
Tom Byers
070ed818cf Add HTML and CSS for extended GSM characters
Based on feedback from this pull request:

https://github.com/alphagov/notifications-admin/pull/3711
2020-11-13 22:40:32 +00:00
Tom Byers
b0bab205da Plug GovukRadiosField into edit sms|email pages
Proof of concept for the GovukRadiosField class.

Includes the removal of the a DataRequired
validator. This doesn't seem to be needed as the
RadioField superclass catches any submissions
without any data from field.choices in its
pre_validate method (which also outputs the
correct error message).
2020-11-12 10:13:22 +00:00
Tom Byers
dd36137e3f Add GovukRadiosField
Roughly based on GovukCheckboxesField.
2020-11-12 10:13:20 +00:00
Chris Hill-Scott
1a1b3bb9a8 Fix the focus colour on edit template links
Since the focus background colour is now Design System yellow, the text
should be black for sufficent contrast.

This wasn’t happening because the `:link` selector’s definition had
greater specificity.
2020-11-11 14:58:21 +00:00
Tom Byers
48499f0c00 Bring in Jinja and Sass for radios component 2020-11-11 10:21:32 +00:00
Tom Byers
5293e3e1eb Refactor GovukCheckboxField and all variants
Aims to make the structure of their code more like
GovukTextInputField so this convention can be
extended for radios.

It does that by:
- moving the code in their widget methods out into
  the govuk_checkbox_field_widget helper function
- moving the code that wraps the checkboxes
  in HTML to make them collapsible into the helper
  function
- remove GovukCheckboxesMixin in favour of having
  the extend_params method as a stand-alone
  function*

*The code is generic enough that it can be used
with other fields that share the same type of
data.

These changes also:
- don't alter the interface of any classes
  involved
- don't break any tests
2020-11-10 22:25:40 +00:00
Tom Byers
d648af5b76 Rename govukCheckboxField and similar
Follows naming conventions for classes and matches
work done on GovukTextInputField.
2020-11-10 12:35:29 +00:00
Tom Byers
3f71138a39 Make name of govuk_field_widget more specific
There will be a variant for each type of field so
make the original specific to text input fields.
2020-11-10 12:35:29 +00:00
karlchillmaid
c1151c5e8e Update content
The _Long text messages_ section of the page is probably the most relevant place to talk about this – so users are aware of the double-characters before they see the table of message lengths.
2020-11-09 16:21:10 +00:00
Katie Smith
1d1973050d Stop live services requesting to go live
Live services shouldn't be able to request to go live again. Once a
service is live we remove the option to go live from the Settings page,
but we still link to the page to request to go live from other places
e.g. the 'Get started' page. As a result, we've seen some services make
another request to go live when their service has already been live for
months - this change will stop that from happening.
2020-11-09 14:00:52 +00:00
Tom Byers
44402e0949 Fix how template list item focus extends
We use a hack to extend the focus style of single
links in template list items (those not part of a
path of links).

This extended the 'focus box' downwards so it
covered the hint text below the link by the height
of the link (which is block-level).

Problems happen if the link wraps to multiple
lines. The hint is always on one line so the focus
looks over-extended.

These changes guard against those problems by
using the line-height instead of the block-height.
They include adding a Sass function to reference
the line-heights in GOVUK Frontend's Sass API:

https://frontend.design-system.service.gov.uk/sass-api-reference/#govuk-typography-scale
2020-11-06 15:25:47 +00:00
karlchillmaid
b4c21280e3 Update draft content 2020-11-05 14:43:22 +00:00
karlchillmaid
b4f8e6e4ac Add content about the extended character set 2020-11-05 14:38:05 +00:00
Katie Smith
247e7c2d93 Stop checking query string for filename when sending a job
We look for `original_file_name` in the metadata now. Initially we were
still checking the query string too, but now that the change to add the
filename to the metadata has been deployed for a while there shouldn't
be any cases of the filename still being in a query string.

Since the `original_file_name` is not being added to the metadata in
`.check_messages` (it has happened earlier in the process) a few tests
are no longer needed.
2020-11-05 10:03:21 +00:00
Katie Smith
18e4e86565 Stop checking query string for filename if uploading contact list
The code was looking for `original_file_name` in the metadata for a
contact list, or the query string if it wasn't in the metadata. Now that
the change to use the metadata for the file name has been deployed for a
while e can stop looking in the query string for the
`original_file_name`.
2020-11-05 10:03:21 +00:00
Pete Herlihy
672531c559 Remove reference to sending personally or commercially sensitive data
These data are fine to send if the service team determines they are. It's not for us to determine that.
2020-11-04 12:14:52 +00:00
Tom Byers
36708ccad0 Merge pull request #3700 from alphagov/fix-template-list-item-focus-style
Fix template list item focus style
2020-10-30 15:58:35 +00:00
David McDonald
79ff26d6b5 Remove old line from send file by email feature
You do not need to contact us to use it anymore. You can set it up
yourself and is documented in our API docs.
2020-10-30 15:10:27 +00:00
Tom Byers
cad8953e25 Fix indent for folder items without ancestors
These make space for the folder icon using
padding-left when they have ancestors as they are
inline so it only effects the line the first link
is on. Without ancestors they are block-level so
padding-left pads the whole block.

We had a block of CSS that fixed this, by using
text-indent for those without ancestors but the
selector was broken by changes to the HTML (it was
no longer the :first-child).

This uses the :first-of-type pseudo-class instead
to ignore preceding elements of different types.

Also includes changes that move styles for links
out from under elements with a class of
.message-name, which was removed in the previous
commit.
2020-10-30 13:44:02 +00:00
Katie Smith
6940291c96 Put filename in metadata when sending via a CSV
When sending from an uploaded CSV `.send_messages` now puts the filename
in the metadata. It previously used the query string to pass the
filename to `.check_messages`, where it can be lost.
2020-10-29 13:53:50 +00:00
Katie Smith
a6c103841e Check metadata for file name when sending from contact list
The `.send_from_contact_list` function redirected to `.check_messages`
with `original_file_name` in the query string. Contact lists already
have `original_file_name` as part of their metadata, so we can stop
sending it in the query string and use the metadata instead.
2020-10-29 13:53:50 +00:00
Katie Smith
e07651ed80 Use metadata to store filename when uploading contact list
We were passing `original_file_name` from the `.upload_contact_list`
view function to the `.check_contact_list` view function as a query
param. We now store it in the metadata instead. `.check_contact_list`
still checks for `original_file_name` in the query string if it's not in
the metadata - this is necessary until the code has been deployed for a
few days and we can be sure that there are no contact lists that are
mid-way through the upload stage.
2020-10-29 13:53:50 +00:00
Katie Smith
e074fb0631 Delete unused function 2020-10-29 13:53:50 +00:00
Chris Hill-Scott
51af3dcac6 Remove word ‘still’ from training mode slide
You might alternate between training mode and live mode. It’s not like
normal Notify where you start in one mode and then transition out of it
– which is what ‘still’ implies.
2020-10-28 17:20:59 +00:00
Chris Hill-Scott
b6e100448d Merge pull request #3687 from alphagov/remove-custom-getattr
Remove custom `getattr` implementation from JSONModel
2020-10-28 10:46:13 +00:00
Chris Hill-Scott
38e9e84f77 Raise exception when overriding a custom property
If a subclass of `JSONModel` defines a property then we shouldn’t try
to override it with the value from the underlying dictionary.

Rather than silently fail we should raise an exception because it will
help keep our list of `ALLOWED_PROPERTIES` nice and tidy.
2020-10-28 10:08:45 +00:00
Tom Byers
2d5a165a2d Swap headings for list items in template list
I'm mainly making this change because it's useful
for the CSS that styles the hint text when the
link is focused for the link to have no parent
container.

That being said, there isn't really enough content
underneath these headings to justify them as it is.
I've wrapped them in a list instead because:
- they're structured like a list
- we already called them a `template-list`

This commit also replaces the `message-type` class
on the paragraph below where the headings went,
for consistency. It also removes the CSS for that
class as I couldn't find anywhere else that used
it now.
2020-10-27 21:31:08 +00:00