Commit Graph

8605 Commits

Author SHA1 Message Date
Chris Hill-Scott
0361fb6991 Fix duplicated ‘GOV.UK Notify’ in page titles
The `per_page_title` block appends ‘– GOV.UK Notify’ – there’s no need
to hard code it (see e4b040b380/app/templates/admin_template.html (L15))
2019-11-18 17:08:20 +00:00
Tom Byers
272c6a3c91 Update tests with new error message content 2019-11-12 17:06:06 +00:00
Tom Byers
74e280ce51 Fix reference to main.support in views 2019-11-12 17:02:38 +00:00
karlchillmaid
894fc6eacf Update page title 2019-11-11 09:43:35 +00:00
karlchillmaid
0c18f3c55a Update 500 error content 2019-11-11 09:16:39 +00:00
karlchillmaid
0d9f5f5acf Update 413 error content 2019-11-11 09:07:05 +00:00
karlchillmaid
d2c3705d57 Update 410 error content 2019-11-11 09:05:15 +00:00
karlchillmaid
e8c53ac2c5 Update 404 error content 2019-11-11 09:02:57 +00:00
karlchillmaid
ee1c3d6853 Update 403 error content 2019-11-11 08:57:09 +00:00
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