Commit Graph

8581 Commits

Author SHA1 Message Date
David McDonald
4ca4cef1b3 Merge pull request #3144 from alphagov/choose-postage
Choose postage
2019-11-05 10:14:40 +00:00
Chris Hill-Scott
f5e906c00c Merge pull request #3174 from alphagov/update_get_started_page
Update Get started page
2019-11-04 16:13:02 +00:00
Chris Hill-Scott
8782049548 Merge pull request #3165 from alphagov/letters-always-on-usage
Always show letters on the dashboard and usage page
2019-11-04 14:49:47 +00:00
Chris Hill-Scott
6c5255f30b Merge pull request #3167 from alphagov/hide-len-1-template-statistics
Don’t show template statistics on dashboard if only one template has been used
2019-11-04 14:45:33 +00:00
Rebecca Law
47a491af92 Merge pull request #3171 from alphagov/start-app-script-with-exec
Change how the bash script is started.
2019-11-04 10:53:35 +00:00
karlchillmaid
0950781a5b Fix links and heading 2019-11-04 10:25:27 +00:00
Chris Hill-Scott
07475f23f3 Merge pull request #3172 from alphagov/flake8-bugbear
Do extra code style checks with flake8-bugbear
2019-11-01 12:07:55 +00:00
David McDonald
159d2ff6b2 Add form.validate_on_submit for sending uploaded letter
Decided it was better to call this then not. This does rely on
the file_id not being corrupted so the file_id passed
into `uploaded_letter_preview` is valid but am taking that risk
given it should only change if a user is changing the form html.
2019-11-01 10:56:34 +00:00
David McDonald
183c45d523 Assert radio buttons exist in form 2019-11-01 10:47:42 +00:00
David McDonald
36e5317da8 Use page_footer macro instead of manually writing HTML 2019-11-01 10:47:42 +00:00
David McDonald
4ddc82d148 Access request values from form object 2019-11-01 10:47:42 +00:00
David McDonald
11a271b6c5 Bump requirements to use 36.0.0 of utils 2019-11-01 10:47:42 +00:00
David McDonald
1c3095329b Change radio buttons to inline
Adds ability to have inline radio buttons using the fieldset.inline
functionality from gov.uk elements.

Then implements this for the radio buttons for choosing postage
class.

Also overrides the gov uk elements styling for the inline radio
buttons to place them slightly closer together as this looks
better.
2019-11-01 10:47:42 +00:00
David McDonald
2b8b4c25aa Send postage value to API when sending pre compiled letter 2019-11-01 10:47:42 +00:00
David McDonald
9ba1dbfffa Do not show postage stamp for letter preview 2019-11-01 10:47:42 +00:00
David McDonald
fdf74572b9 Add radio button and convert from to WTForm 2019-11-01 10:47:42 +00:00
Chris Hill-Scott
fcc84ac514 Do extra code style checks with flake8-bugbear
Flake8 Bugbear checks for some extra things that aren’t code style
errors, but are likely to introduce bugs or unexpected behaviour. A
good example is having mutable default function arguments, which get
shared between every call to the function and therefore mutating a value
in one place can unexpectedly cause it to change in another.

This commit enables all the extra warnings provided by Flake8 Bugbear,
except for the line length one (because we already lint for that
separately).

It disables:
- _B003: Assigning to os.environ_ because I don’t really understand this
- _B306: BaseException.message is removed in Python 3_ because I think
  our exceptions have a custom structure that means the `.message`
  attribute is still present
2019-11-01 10:43:01 +00:00
Chris Hill-Scott
9e781177fd Merge pull request #3148 from alphagov/add-get-started-page
Add a 'Get started' page
2019-11-01 10:36:47 +00:00
Rebecca Law
d69de324ea Change how the bash script is started.
By adding `exec` to the entrypoint bash script for the application, we can trap an EXIT from the script and execute our custom `on_exit` method with checks if the application process is busy before terminating, waiting up to 10 seconds.

Written by:
@servingupaces
@tlwr
2019-10-31 16:38:17 +00:00
Chris Hill-Scott
e73ce0561d Merge branch 'master' into add-get-started-page 2019-10-31 10:54:11 +00:00
Chris Hill-Scott
239e3079d1 Fix import sort order 2019-10-31 10:53:45 +00:00
Chris Hill-Scott
d298949a5a Style the page to look like the Pay one 2019-10-31 10:10:01 +00:00
Chris Hill-Scott
9b91132276 Test that static pages work w/out current_service
If you sign in, don’t choose a service then navigate to a state page
then it’s possible `current_service` won’t be set, in which case you
shouldn’t be generating URLs that need `current_service.id`.
2019-10-31 09:43:16 +00:00
karlchillmaid
fa72c35fce Update app/templates/views/get-started.html
Co-Authored-By: Chris Hill-Scott <me@quis.cc>
2019-10-31 08:40:25 +00:00
Chris Hill-Scott
0ac6a2c1ab Remove unused variable
We use different logic to decide whether to show/hide the template
statistics part of the dashboard now.
2019-10-30 11:12:58 +00:00
Chris Hill-Scott
c919c25bf8 Remove unreachable code
An `if` statement higher up the page means this code will never get run
now. We can simplify the template by removing it.
2019-10-30 11:12:26 +00:00
Chris Hill-Scott
88a557f6c8 Don’t show template stats if one template used
If you’ve only used one template then this section of the page isn’t
doing its job, which is to show a comparison of the different kinds of
message you’re showing.

I think our initial assumption was that everyone would be using multiple
templates, so it was good to show this part of the page during the
onboarding, to show users where the information was going to appear.

But we have lots of services who only send one template now, typically
where they’re populating the contents of the template themselves. In
which case this part of the page doesn’t offer them any value.
2019-10-30 11:12:26 +00:00
karlchillmaid
0b089bda32 Update settings content 2019-10-30 10:49:05 +00:00
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