Commit Graph

8596 Commits

Author SHA1 Message Date
karlchillmaid
6160be9db4 Update 401 error content 2019-11-11 08:54:27 +00:00
Katie Smith
c3c224dcc8 Merge pull request #3178 from alphagov/show-recipient-address-for-uploads
Show recipient when about to send uploaded letter
2019-11-08 13:12:41 +00:00
Katie Smith
a542047581 Show recipient when about to send uploaded letter
The recipient of the letter now displays at the bottom of the page when
previewing a valid letter. The template preview `/precompiled/sanitise`
endpoint returns the address, but we format it to display on a single
line with commas between each line. We also need to convert the
recipient address to ASCII so that it can be stored as S3 metadata.
2019-11-08 10:17:11 +00:00
Pea (Malgorzata Tyczynska)
21a59598b2 Merge pull request #3170 from alphagov/show-users-why-their-precompiled-letter-failed-validation
Show users why their precompiled letter failed validation
2019-11-07 11:23:30 +00:00
Chris Hill-Scott
653926f636 Merge pull request #3149 from alphagov/resize-all-textbox-dem
Let textareas resize automatically without having to highlight placeholders
2019-11-07 11:13:06 +00:00
Pea Tyczynska
678e0bed81 Show users more detailed validation failed mesage on notification page
Show valdiation failed messages on letter notifications in red text,
not in the banner like we do on Uploads and Validation checker pages.
This is because it is a different step in the journey: the user
has already sent the notification and styling needs to be in line
with other places where user is checking the notification she already
has sent.
2019-11-07 11:10:27 +00:00
Chris Hill-Scott
b671ad239d Merge pull request #3166 from alphagov/usage-back-on-dashboard
Put usage summary back on the dashboard
2019-11-07 10:32:51 +00:00
Pea Tyczynska
f12dc823cb Show dynamic message when letter fails validation in validation checker - part 2 2019-11-06 14:26:16 +00:00
Pea Tyczynska
5e10ed23a1 Refactor uploads preview error banner to use a shared component
Also refactor a corresponding test to avoid asserting on the content
2019-11-06 14:26:14 +00:00
Pea Tyczynska
f2c7eb5c3e Tell user why validation failed on letter validation page - part 1 2019-11-06 12:21:18 +00:00
Pea Tyczynska
c843940b14 Test letter too long error banner using exisitng data-error-type attribute
This way we can avoid both creating an id attribute for testing
and testing by content.
2019-11-06 12:21:18 +00:00
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
889d601475 Put usage summary back on the dashboard
This reverts 1b1839ad30, which removed
the usage from the dashboard because it was causing performance
problems:

> **The yearly usage section on the dashboard page takes too log as a
> result services with large yearly stats are timing out.**
>
> As a short term fix we have taken the yearly stats off the dashboard.
>
> There is a plan to create permanent statistic tables to warehouse the
> data.

The long term fix (the fact tables) is now in place, so it should be OK
to bring this back.

This is part of a wider piece of work to refresh the dashboard page now
that jobs are moving to their own page.
2019-11-04 14:54:16 +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
Chris Hill-Scott
6fa0f06f5d Enable autosizing for some textboxes
This commit makes textboxes auto-resize any time they might be used to
enter long passages of text which would otherwise make them scroll
internally.
2019-10-31 17:53:45 +00:00
Chris Hill-Scott
6c0e853db4 Rename module
HighlightTags was bad because:
- we haven’t called placeholders ‘tags’ for a long time
- it also does resizing of the `<textarea>`, not just highlighting the
  placeholders
2019-10-31 17:53:44 +00:00
Chris Hill-Scott
d0ce4d07a3 Autosize textboxes w/out highlighting placeholders
Scrolling within textareas on the page is a bit grim. Which is why we
don’t do it for the textboxes that people use to edit templates.

This commit will allow us to extend the auto-resizing of `<textarea>`s
to those which don’t need the highlighting of placeholders.

The code is still quite coupled to the placeholder highlighting code,
because both work by copying the content of the `<textarea>` into a
`<div>` that underlaps the textbox. This `<div>` is used for both
rendering the placeholder highlights, and calculating the natural height
of the content. So it would be hard/confusing to split the two bits of
code into separate modules.
2019-10-31 17:53:44 +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