Commit Graph

3406 Commits

Author SHA1 Message Date
Chris Hill-Scott
267b58a66d Stop template subjects getting saved encoded
This is another problem with sanitising HTML, this with with it getting
encoded where it shouldn’t be. The result was, when editing a template,
the API getting sent an encoded rather than raw version of the subject
(for letters and emails).

The reason this happened is because BeautifulSoup behaves in an
unexpected way.

When accessing the `value` attribute of an `input` BeautifulSoup returns
an unencoded version of the contents. In other words it returns what the
user would see in the page, not what is in the raw HTML of the page.

This meant that we were trying too hard to see an `&` instead of a
`&` in our tests[1]. So things were actually working fine before adding
the call to `escape_html`[2], but from the output of the tests it didn’t
look like HTML was getting escaped.

So this commit fixes the bug by removing the call to `escape_html` and
adding a test that looks at the raw HTML, to complement the existing
test which looks at just the `value` attribute.

1. Relevant test added here: https://github.com/alphagov/notifications-admin/pull/1178/files#diff-f2eb304b93cc383727c0ab7fc8fbd464R289
2. Call added here: https://github.com/alphagov/notifications-admin/pull/1178/files#diff-f0af582449ebf426f27f37e38f310057R252
2017-04-14 08:52:02 +01:00
kentsanggds
569cd93c49 Merge pull request #1229 from alphagov/redirect-letter-jobs-post
Redirect after letter-jobs post
2017-04-13 15:11:31 +01:00
Leo Hemsted
8c5ec33825 Merge pull request #1209 from alphagov/paas_failwhale
Add Paas failwhale app
2017-04-13 09:36:47 +01:00
Ken Tsang
b02df9ba4b Redirect after letter-jobs post 2017-04-12 18:19:55 +01:00
Chris Hill-Scott
030a80c965 Merge pull request #1227 from alphagov/fix-checkboxes
Fix new checkboxes
2017-04-11 17:50:10 +01:00
Chris Hill-Scott
d58be228dd Fix new checkboxes
Problems:
- WTForms expects the value of checkboxes to always be `y` (they don’t
  work like radio buttons, which is where I copied this code for)
- WTForms `BooleanField`s don’t have a checked attribute, they set their
  data attibute to `True` or `False`
2017-04-11 17:47:16 +01:00
kentsanggds
04da9359ef Merge pull request #1223 from alphagov/letter-jobs-page
Letter jobs page
2017-04-11 17:30:40 +01:00
Chris Hill-Scott
c933b886d9 Merge pull request #1226 from alphagov/hover-state-new-radio-select
Add hover state for new radio select styles
2017-04-11 17:23:41 +01:00
Chris Hill-Scott
7fcabbc0e6 Add hover state for new radio select styles
Because they look like links, they should have all the clicking
affordance of links.
2017-04-11 17:22:44 +01:00
Chris Hill-Scott
cd926a46bc Merge pull request #1225 from alphagov/fix-radio-select-overflow
Fix overlapping UI with new radio buttons
2017-04-11 17:07:29 +01:00
Chris Hill-Scott
bde140f560 Fix overlapping UI with new radio buttons
Not sure what about the new radios is causing this, but they no longer
expand the size of the container, causing an overlap.

The fixed height was originally for performance reasons, but removing
it doesn’t seem to cause the page to jump around on load, so I think
it’s OK.
2017-04-11 17:05:02 +01:00
Ken Tsang
0f3131cf21 Refactor test_letter_jobs 2017-04-11 15:17:18 +01:00
Ken Tsang
9ce4ce8031 Add count and disabled checkbox until ready / dvla state 2017-04-11 15:02:20 +01:00
Chris Hill-Scott
53b10f14f6 Merge pull request #1222 from alphagov/toolkit-upgrade
Upgrade GOV.UK Template, Frontend Tookit, and Elements
2017-04-11 14:03:08 +01:00
Chris Hill-Scott
3fceab3bc1 Merge pull request #1221 from alphagov/letter-edit-width-final
Increase width of edit letter textbox
2017-04-11 14:03:02 +01:00
Sakis
5b2e677127 Fix formatting in README 2017-04-11 13:01:50 +01:00
Athanasios Voutsadakis
51617658dc Add README.md for the failwhale 2017-04-11 12:58:35 +01:00
Rebecca Law
39dd969d5c Merge pull request #1214 from alphagov/refactor-s3-upload
Refactor s3upload.
2017-04-11 11:15:51 +01:00
Ken Tsang
e5a377edd8 Add letter jobs page, client and test 2017-04-11 10:59:50 +01:00
Rebecca Law
c9a519dac7 Update the version of notification-utils. 2017-04-10 15:41:57 +01:00
Chris Hill-Scott
ec33f843ef Use small font sizes in tables by default
GOV.UK Elements changed tables to be a larger font size here:
https://github.com/alphagov/govuk_elements/pull/185

This is good in principle (and a lot of our tables are 19px already).
However, the ones that aren’t are still 16px because there’s a lot of
info to fit on the page (eg when previewing someone’s CSV file).
2017-04-10 14:54:28 +01:00
Chris Hill-Scott
f7f0128f0c Remove button padding override
Not sure why we were doing this. But as part of the Elements upgrade
our back buttons got bigger (because they weren’t constrained by the
line in our `app.scss`) but any green submit buttons stayed smaller in
height, so didn’t line up.

This commit removes the override, so all buttons have the size that
Elements intended.
2017-04-10 14:54:28 +01:00
Chris Hill-Scott
8d5af47620 Change class names for validation errors in html
Implements the class name changes detailed in:
https://github.com/alphagov/govuk_elements/pull/405
2017-04-10 14:54:27 +01:00
Chris Hill-Scott
87c81c994f Ensure disabled radio buttons are still legible
The Elements CSS was making the `label` and `input` of disabled radio
buttons `opacity: 0.5`. This was resulting in text that was:
- too pale, especially where we were nesting 16px ‘hint’ text inside the
  label
- waaaay too pale when inside a link inside the label

This commit overrides elements to dim the disabled radio button by
making it’s text colour grey, rather than making the whole thing
semi-transparent.
2017-04-10 14:54:27 +01:00
Chris Hill-Scott
a592898eff Make radio select work w/ new checkboxes/radios
The visual appearance of radio and checkbox form inputs changed in
GOV.UK Elements here:

https://github.com/alphagov/govuk_elements/pull/296

This was subsequently reimplemented with different markup and no
Javascript here:
https://github.com/alphagov/govuk_elements/pull/406

This has meant making the following changes to our app:
- changing the markup in our radio/checkbox macros to match the example
  markup given by GOV.UK Elements
- removing the previous Javascript file because it’s no longer needed to
  make the radios appear visual selected
- making the buttons on the scheduled job picker look like links,
  because the grey button style looked weird with the new radio buttons
2017-04-10 14:18:12 +01:00
Chris Hill-Scott
31d03acc11 Remove external link styling
The external link icon, and associated mixin, were deprecated in
https://github.com/alphagov/govuk_frontend_toolkit/pull/293

This means we can’t and shouldn’t use them any more.
2017-04-10 14:16:45 +01:00
Chris Hill-Scott
e62bd2a018 Remove override to make beta banner blue
Previously the beta bar was orange, which we didn’t want. So we wrote
some SASS to make it blue.

Now that GOV.UK Frontend Toolkit makes it blue, we can remove this SASS.

See https://github.com/alphagov/govuk_frontend_toolkit/pull/370
2017-04-10 14:14:53 +01:00
Chris Hill-Scott
bb9fe35ab5 Upgrade GOV.UK toolkit, template and elements
We should make sure that the parts of the UI that we inherit from these
packages are kept up to date.

This commit:
- updates each dependency to the latest version
- makes patch (bug fixing) version bumps automatic because
  - it makes less work for us
  - we don’t get so far behind
  - we should be able to trust dependencies that are coming from other
    teams in this building

Full changes that this brings in:

GOV.UK Template
---

- Increase skiplink colour contrast ([GOV.UK Template PR #263](https://github.com/alphagov/govuk_template/pull/263))

GOV.UK Elements
---
- Too many to show – see
  https://github.com/alphagov/govuk_elements/compare/v1.1.1...v3.0.2#diff-4ac32a78649ca5bdd8e0ba38b7006a1e

GOV.UK Frontend Toolkit
---
- Too many to show – see
  https://github.com/alphagov/govuk_frontend_toolkit/compare/v4.6.0...v5.2.0#diff-4ac32a78649ca5bdd8e0ba38b7006a1e
2017-04-10 14:02:41 +01:00
Rebecca Law
4d49fabcdd Merge branch 'master' into refactor-s3-upload
Conflicts:
	requirements.txt
2017-04-10 11:44:56 +01:00
Rebecca Law
80a82cfdab Update notifications-utils to the latest version 2017-04-10 11:43:45 +01:00
Chris Hill-Scott
80898e350e More tweaks to width of elements
- SMS message preview gets slightly wider so it lines up with a 4/8
  column
- Edit email box gets wider to match more closely the width of the
  previewed and delivered emails
2017-04-10 10:28:27 +01:00
Chris Hill-Scott
27d2e3a738 Merge pull request #1219 from alphagov/fix-back-link-check-page
Fix broken journey when going back from check page
2017-04-10 09:39:57 +01:00
Chris Hill-Scott
0ba7d11097 Fix alignment of edit letter links
Not sure how these got out of line (maybe when we brought the date into
the left-hand text area). But this commit updates the percentages to
match the comments.

This is so it’s clear from the position of the link which part of the
letter you’re editing.
2017-04-10 09:29:26 +01:00
Chris Hill-Scott
7904256bce Increase width of edit letter textbox
The textbox we use for editing letters is the same size as that for
email and text messages.

This is problematic because:
- it feels quite cramped – letters will often be longer than emails or
  text messages
- it has a narrower line length than the printed letters (which is a
  constant, unlike for emails and text messages)

The printed letters have a line length of 137.5mm and a font size of
12.5pt.

137.5mm = 5.41 inches = 389.7pt line length

389.7pt/12.5pt = 31.8em

So we could make the box 31.8em wide, but then it wouldn’t align to our
grid.

Our grid splits the page into quarters initially because this is how
wide the navigation is. So this means that we can use grid units of
1/multiples of four, eg 1/4, 1/8, 1/12, 1/16, etc. But the smaller the
denominator, the less effective the grid will be – it gets closer to no
grid at all.

After having a play around, 5/8 of the page looks closest to 31.8em.
Since the main column of the page is 3/4, we set a column of 5/6 width
inside that, which equals 5/8 of the total page.
2017-04-10 09:06:15 +01:00
Ken Tsang
02c77da97b Add letter-jobs page, update admin menu 2017-04-07 15:37:49 +01:00
Leo Hemsted
331b59eef8 Merge pull request #1220 from alphagov/letter-jobs-on-dashboard
Letter jobs on dashboard
2017-04-07 11:21:19 +01:00
Leo Hemsted
2bb0cba430 add new letter job statuses to job api client
add test to test_dashboard to confirm we're getting for the right queus
2017-04-07 11:08:40 +01:00
Leo Hemsted
c509d3d24f remove unused imports 2017-04-07 10:54:52 +01:00
Chris Hill-Scott
db37a16eda Fix broken journey when going back from check page
We’ve seen in letters usability testing that people get stuck in a
“no-man’s land” when trying to go back from the _Send yourself a test_
page.

This was broken for two reasons:
- we hadn’t considered that a letter template without placeholder still
  requires you to fill in
- we’ve changed subsequently made the _view template_ page the place
  where you do your actions, rather than the (old) page with all the
  templates shown

So this commit fixes it so that the back link always take you back to
the page you were previously on, and adds some more test cases so we
have all the scenarios accounted for.
2017-04-07 09:18:00 +01:00
Chris Hill-Scott
d1c99715b7 Merge pull request #1218 from alphagov/quis-patch-1
Bump utils
2017-04-06 17:06:08 +01:00
Chris Hill-Scott
f5b4d72f8f Bump utils
Didn’t bump it enough versions as part of https://github.com/alphagov/notifications-admin/pull/1215/files

😔
2017-04-06 17:05:55 +01:00
Chris Hill-Scott
a7162b2bd2 Merge pull request #1215 from alphagov/fix-address-column-handling
Fix address column handling
2017-04-06 16:25:18 +01:00
Chris Hill-Scott
7bbb99c461 Merge pull request #1216 from alphagov/88mph
Fix future ‘last edited’ date
2017-04-06 16:02:39 +01:00
Chris Hill-Scott
e0738ec869 Merge pull request #1213 from alphagov/roadmap-typo
Fix typo in roadmap
2017-04-06 15:02:58 +01:00
Pete Herlihy
6052409430 Merge pull request #1217 from alphagov/43-44
43-44 for MOT reminders
2017-04-06 14:36:43 +01:00
Pete Herlihy
e949f19297 43-44 for MOT reminders 2017-04-06 12:01:41 +01:00
Chris Hill-Scott
8df01f7f3f Fix future ‘last edited’ date
The `format_datetime_relative` filter is only used by the scheduling
stuff, which only deals with dates in the future.

When used on dates in the past (more than 1 day ago) it gets confused
and defaults to ‘tomorrow’.

The `format_delta` method does a similar thing, but works for past and
future dates.

Users can still click through to the next page to see the exact date and
time of the edits.
2017-04-06 11:20:47 +01:00
Rebecca Law
faad2f5a09 correct version number in requirements. 2017-04-06 10:26:31 +01:00
Chris Hill-Scott
0b2a11daf2 Don’t fill out address line 3 in the example
Address line 3 is optional. Currently the only way we have of indicating
to users what is/isn’t optional is by using the example. Which probably
isn’t ideal, but should at least be correct.
2017-04-06 10:25:05 +01:00
Rebecca Law
b2088762c3 Update requirements with notifications-utils version 2017-04-06 10:24:23 +01:00