Commit Graph

8526 Commits

Author SHA1 Message Date
Chris Hill-Scott
220da2e5be Rename usage with letters template
It’s the only usage template now.
2019-10-29 16:29:33 +00:00
Chris Hill-Scott
6c841affc8 Always show letter counts on dashboard
We hid letters originally because it wasn’t a mature feature. We rolled
it out by letting teams choose to use it (#1803)
and then automatically giving it to new teams (notifications-api/#1600).

This commit doesn’t change who has access to letters, but it does make
it more discoverable by revealing it in the UI. This is the same thing we do for emails/texts, where even if you switch them off they still show up on the dashboard and usage
page.
2019-10-29 16:19:38 +00:00
Chris Hill-Scott
2732a0b80b Make things line up on the usage page
The mixture of three column/two column layouts on this page has always
looked a bit disjointed. And since the left column will only even
contain the names of months, which are short, it doesn’t need a full
half of the page width.
2019-10-29 16:18:31 +00:00
Chris Hill-Scott
7e699c93ca Always show letters on the usage page
Even if your service doesn’t send letters now, it might have done
previously.

The original reason for hiding letters was because it wasn’t a mature
feature. But now that it is, we should make it discoverable even for
existing teams. So that means not conditionally hiding it.

This is the same thing we do for emails/texts, where even if you switch
them off they still show up on the dashboard and usage page.
2019-10-29 16:17:14 +00:00
Chris Hill-Scott
58cfce8760 Merge pull request #3143 from alphagov/jobs-are-uploads
Merge ‘uploaded files’ and ‘uploads’ pages
2019-10-29 14:01:24 +00:00
Chris Hill-Scott
7a55a5c9f2 Hide prev/next when neither prev nor next are set
Otherwise it still takes up vertical space on the page.
2019-10-25 12:48:31 +01:00
Chris Hill-Scott
938b38d082 Let caseworkers see uploads page
At the moment they can only see it if there are existing jobs. This
commit lets them also see it if their service can upload letters,
because caseworkers might be the ones uploading some letters.
2019-10-25 12:48:31 +01:00
Chris Hill-Scott
2ddc6216a5 Let any user see the uploads page
Even if you can’t send messages you might still want to see the messages
that other people have sent.
2019-10-25 12:48:30 +01:00
Chris Hill-Scott
93322d41e5 Make jobs and uploads page the same
This makes these pages call the same code.

We can resolve the multiple URLs once we’ve removed the feature flag.
2019-10-25 12:48:30 +01:00
Chris Hill-Scott
f9094cb98b Rename uploaded files to uploads
Uploads is the name that we’ve been using in the prototype.
2019-10-25 12:48:30 +01:00
Chris Hill-Scott
7eb547a9e8 Put upload letters button on jobs page
This is going to become the one true ‘Uploads’ page, so it need the
sticky footer that takes users into the new upload letters journey.
2019-10-25 12:48:30 +01:00
Leo Hemsted
a8722703b8 Merge pull request #3157 from alphagov/gunicorn-server-header
remove gunicorn server header
2019-10-23 16:49:44 +01:00
Leo Hemsted
ec867c04c2 remove gunicorn server header
see https://github.com/alphagov/notifications-api/pull/2640 for more
information
2019-10-23 16:37:58 +01:00
Tom Byers
d516c85279 Merge pull request #3105 from alphagov/add-js-tests-for-live-search
Add js tests for live search
2019-10-23 15:37:32 +01:00
Tom Byers
2a7f464df7 Merge pull request #3106 from alphagov/add-js-tests-for-preview-pane
Add js tests for preview pane
2019-10-23 15:22:23 +01:00
Chris Hill-Scott
cc6ab01c9b Merge pull request #3159 from alphagov/fix-event-sorting
Fix sorting of events
2019-10-23 15:14:02 +01:00
Tom Byers
d7b99c733d Merge pull request #3110 from alphagov/add-js-tests-for-update-content
Add JS tests for update content
2019-10-23 15:12:55 +01:00
Chris Hill-Scott
0185270308 Fix sorting of events
Events should be sorted reverse-chronologically, no matter what order
they come back from the API in, or which field in the API response
they’ve been extracted from.
2019-10-23 15:05:26 +01:00
Chris Hill-Scott
5469119ef0 Merge pull request #3152 from alphagov/history-page-redesign
Redesign the history page as one stream of events
2019-10-23 14:06:29 +01:00
Chris Hill-Scott
a765920f65 Add years to old dates
Just to disambiguate things without introducing unnecessary noise.
2019-10-23 13:18:58 +01:00
Chris Hill-Scott
600e3affc1 Show user names for events without API changes
This commit introduces a slightly hacky way of putting usernames against
events, given that the API only returns user IDs.

It does so without:
- making changes to the API
- making a pages that could potentially fire off dozens of API calls (ie
  one per user)

This comes with the limitation that it can only get names for those team
members who are still in the team. Otherwise it will say ‘Unknown’.

In the future the API should probably return the name and email address
for the user who initiated the event, and whether that user was acting
in a platform admin capacity.
2019-10-23 13:15:41 +01:00
Chris Hill-Scott
9055a33dca Only show the filters if they will have an effect
If you never create any API keys we shouldn’t give you the option to see
API-related events – it will only confuse things.

And since there’s (currently) only one type of event left once you take
API key events out of the picture it doesn’t make sense to show the
filters at all.
2019-10-23 13:13:37 +01:00
Chris Hill-Scott
63f6a3ab12 Let users filter by type of event
At the moment we have two types of event, ‘service’ events and ‘API key’
events. They are munged together which is useful initially, but could
get noisy.

This commit adds filters (copied from the choose template page) that let
users narrow down the list to one of the two types of event. This might
help users get a clearer picture of what’s going on.
2019-10-23 13:09:47 +01:00
Chris Hill-Scott
d93ebd99d3 Refactor history off the service model
Directly referencing the `ModelList` instances will let us more easily
make choices at the view layer about which kinds of events to show, and
is one less layer of indirection to jump through.
2019-10-23 13:08:06 +01:00
Chris Hill-Scott
b2ebaf153a Chunk events by day
Scanning the page is difficult at the moment because it’s hard to tell
how far apart in time events are, and thereby determine which events
might be related.

Grouping the events by day quickly lets users narrow their focus to
a meaningful subset of the events.
2019-10-23 13:06:25 +01:00
Chris Hill-Scott
59b4d60c91 Munge stuff into a consistent event data type
We store our audit history in two ways:

  1. A list of versions of a service
  2. A list of events to do with API keys

In the future there could be auditing data which we want to display that
is stored in other formats (for example the event table).

This commit adds some objects which wrap around the different types of
auditing data, and expose a consistent interface to them. This
architecture will let us:
- write clean code in the presentation layer to display these events on
  a page
- add more types of events in the future by subclassing the `Event` data
  type, without having to rewrite anything in the presentation layer
2019-10-23 13:02:11 +01:00
Chris Hill-Scott
055f000020 Merge pull request #3151 from alphagov/history-page-tidy-up
Bring the service history page up to our current coding standards
2019-10-22 13:48:16 +01:00
Katie Smith
e221024ae7 Merge pull request #3154 from alphagov/no-uploading-letters-in-trial-mode
Stop allowing uploaded letters to be sent for trial mode services
2019-10-22 10:52:07 +01:00
Leo Hemsted
f1eefaa9a2 Merge pull request #3156 from alphagov/tech-docs-url-change
move rest api docs to new url
2019-10-21 16:53:27 +01:00
Leo Hemsted
07e7b03bf3 move rest api docs to new url 2019-10-21 16:34:10 +01:00
Chris Hill-Scott
7c2ecfa094 Use service model for history
Rather than have the view layer interact directly with the API client.
This will let us add extra transformation in the model layer at some
point.
2019-10-21 16:29:06 +01:00
Chris Hill-Scott
ae2db8d2ec Use page header component 2019-10-21 16:29:05 +01:00
Chris Hill-Scott
8c7f9a8286 Add a simple test for the history page 2019-10-21 16:29:05 +01:00
Chris Hill-Scott
8db94eafc8 Use service-specific page template for history 2019-10-21 16:29:05 +01:00
Chris Hill-Scott
fce0397b55 Move service history into it own file
We’re going to do some work on this page, let’s put it in a sensible
place first before we add a bunch more code to the wrong place.
2019-10-21 16:29:05 +01:00
Katie Smith
3732e45126 Stop allowing uploaded letters to be sent for trial mode services
We weren't checking if a service was in trial mode when they try to send
an uploaded file. If a service is in trial mode, we now show a banner at
the top of the preview page and no send button.
2019-10-21 14:42:39 +01:00
Katie Smith
fe78d53643 Merge pull request #3137 from alphagov/upload-letter-errors
Update the errors seen when uploading a letter
2019-10-21 13:21:23 +01:00
Katie Smith
b0ffca2774 Only show overlay when content is outside the printable area
The overlay was showing for any invalid pdf - we only want to show the
overlay for invalid pdf files where there is content outside the
printable area.
2019-10-21 11:10:27 +01:00
Katie Smith
3b3f74bbf0 Use the new error messages when uploading a letter
We now use the pattern of showing a box at the top of the page with the
error. The error message has a heading and can have additional details.
Error messages and the invalid pages get stored in the S3 metadata.
2019-10-21 08:37:55 +01:00
Katie Smith
3223956ba2 Allow extra metadata fields when uploading letter to S3 2019-10-21 08:37:55 +01:00
Katie Smith
8f7a05200d Add function to map template-preview errors to user-friendly errors
Template preview now returns a short string as it's error message plus
a list of invalid pages.
2019-10-21 08:35:04 +01:00
Katie Smith
3ad639f571 Link to latest version of letter spec everywhere 2019-10-21 08:35:04 +01:00
David McDonald
3e9a4b97e8 Merge pull request #3153 from alphagov/second-class-default
Send precompiled letters with a postage value to the API
2019-10-18 16:43:24 +01:00
David McDonald
3436a190a7 Send precompiled letters with a postage value to the API
We hardcode this as second class for the moment but eventually
will let the user pick.

Currently the API appears to do no validation, e.g. a json
schema, that rejects API calls with the extra key for postage.

Next steps will be to put a PR into the API that will expect a
postage value in the request and save it with the rest of the
notification. Then when that is done we can add the user interface
to the admin app to let the user pick the postage.
2019-10-18 16:35:16 +01:00
Chris Hill-Scott
5c9f238c12 Merge pull request #3097 from alphagov/add-js-tests-for-highlight-tags
Add JS tests for highlight tags module
2019-10-17 15:30:24 +01:00
Chris Hill-Scott
cb82cfedd1 Merge pull request #3146 from alphagov/transparent-conditional-text
Make text transparent on conditional placeholders
2019-10-17 15:27:39 +01:00
Chris Hill-Scott
f52847fd58 Merge pull request #3150 from alphagov/back-links-support
Add standard back links to the support journey
2019-10-17 15:27:34 +01:00
Chris Hill-Scott
7e3b7711bc Add standard back links to the support journey
Removes the non-standard, bottom of page back links where present.

Adds sticky footer to pages with long text boxes.
2019-10-17 13:44:04 +01:00
Pea (Malgorzata Tyczynska)
53ef438a1e Merge pull request #3135 from alphagov/enforce_letter_10_page_limit
Enforce letter 10 page limit
2019-10-16 13:14:30 +01:00
Pea Tyczynska
4b5a131072 Harmonise content of error message with the document laid out by our content designer 2019-10-16 13:02:11 +01:00