Commit Graph

3450 Commits

Author SHA1 Message Date
Chris Hill-Scott
0e8ae2c8ca Merge pull request #1245 from alphagov/edit-link-positioning
Make position of letter edit links absolute
2017-04-25 17:37:27 +01:00
Martyn Inglis
cca5145e54 updated run_tests to not use venv in the app if VIRTUAL_ENV is set 2017-04-25 17:12:16 +01:00
Chris Hill-Scott
cf80d0da26 Make position of letter edit links absolute
Previously they were relative (ie percentages). This made sure that they
worked on mobile, when the letter might be narrower.

However it broke when the preview was more than one page, because
13% of the height of 2 pages is different to 13% of the height of one
pages.

This commit changes the positions to be pixel values, which match the
calculated percentage values when the preview is one page.
2017-04-25 16:01:14 +01:00
Chris Hill-Scott
7f6e6ad2d9 Merge pull request #1242 from alphagov/quis-patch-1
Remove edit address block link
2017-04-25 15:33:28 +01:00
Chris Hill-Scott
05b9f6e736 Merge pull request #1237 from alphagov/multi-page-previews
Show all pages of a letter in the app
2017-04-25 15:33:22 +01:00
Chris Hill-Scott
dd5ae93d58 Merge pull request #1243 from alphagov/quis-patch-2
Make download PDF link work
2017-04-25 15:33:08 +01:00
Chris Hill-Scott
85b8a32360 Make download PDF link work
To see what happens if people click it in the lab tomorrow.
2017-04-25 13:03:45 +01:00
Chris Hill-Scott
77f761e788 Remove edit address block link
It was confusing because it didn’t do anything. We think the research
tomorrow will go more smoothly if we remove it. It should come back
in the same place when it actually works.
2017-04-25 13:00:17 +01:00
Chris Hill-Scott
d88199e414 Merge pull request #1239 from alphagov/dvla-org-fix
Fix setting and display of letter branding
2017-04-24 15:27:03 +01:00
Chris Hill-Scott
f3e69a808e Fix setting and display of letter branding
API and Admin were not using the same name for the organisation ID that
we have set with DVLA.
2017-04-24 14:46:19 +01:00
Chris Hill-Scott
eb9214978e Merge pull request #1234 from alphagov/letter-branding
Add platform admin setting for letter branding
2017-04-24 10:33:39 +01:00
Chris Hill-Scott
75f5829c1e Get organisations list from API rather than config
Hard coding the organisations means this information is duplicated
between the admin and the API, and could get out of sync.
2017-04-24 10:25:37 +01:00
Chris Hill-Scott
cfc031cfbf Pass dvla_org_id through to template preview app 2017-04-24 10:25:36 +01:00
Chris Hill-Scott
61470391bf Add platform admin setting for letter branding
Does two main things:
- defines what ‘brands’ we support, in terms of the ID that DVLA use
- adds a form to choose which branding a service uses (currently
  platform admin only, like email branding)

By doing this we will be able to (with some more work) preview and send
letters with a variety of different branding.

Story: https://www.pivotaltracker.com/story/show/143506905
2017-04-24 10:25:36 +01:00
Imdad Ahad
c370b8dfd2 Merge pull request #1238 from alphagov/44-46
44 to 46 for 2 new MOJ services
2017-04-21 17:35:19 +01:00
Imdad Ahad
341143451b Merge pull request #1236 from alphagov/fix-csv-download-timeout-issue
Fix CSV download timeout issue
2017-04-21 17:11:48 +01:00
Pete Herlihy
720ea941f4 44 to 46 for 2 new MOJ services 2017-04-21 16:53:56 +01:00
Chris Hill-Scott
36db0ad598 Show all pages of a letter in the app
In research we’ve seen two problems with the click-to-see-PDF thing:

- it’s not very intuitive that the letter is clickable, or what you
  can expect when clicking the letter
- people get lost of stuck in the PDF view because it opens in the same
  tab, or they open it in a new tab and then get find their way back, or
  …

So this commit changes the show template page to show the entire
contents of the letter, same as we do for emails and text messages.

Right now it only does it on the view template page. I think we’ll have
to work out a way of showing some kind of truncated version on the _Send
yourself a test_ and _Preview_ pages. But that’s for later.
2017-04-20 15:57:43 +01:00
Imdad Ahad
6c377b0ecd Remove unused method 2017-04-20 15:20:02 +01:00
Imdad Ahad
99805fb592 Add extra flag to indicate we want a csv notification response 2017-04-20 15:18:47 +01:00
Imdad Ahad
19f42a8984 Refactor report download:
* Remove formatting (most performance intensive) as this will happen on API
* Remove buffering of notifications so we can yield them back straight away
* Refactor existing tests to match new format of the notification resp for csv
2017-04-20 15:18:42 +01:00
Chris Hill-Scott
38fbc3c47d Merge pull request #1235 from alphagov/fix-button-padding-product-page
Fix button padding on the product page
2017-04-20 15:18:20 +01:00
Chris Hill-Scott
baa2ff9332 Fix button padding on the product product-page
It’s uneven ever since we upgraded the toolkit. Guess it’s probably
allowing space for an arrow image. But I don’t like the arrow image
because it looks like it’s pointing at the ‘or sign in’ link.

So this commit overrides the button’s default spacing.
2017-04-20 15:03:38 +01:00
Chris Hill-Scott
76c1de1460 Merge pull request #1232 from alphagov/move-delete-link
Move delete link from the edit template page to the view template page
2017-04-20 14:18:35 +01:00
Leo Hemsted
2c3f588e42 Merge pull request #1233 from alphagov/template-service
add template preview service to cf manifest
2017-04-18 16:49:13 +01:00
Leo Hemsted
0850f5dd22 add template preview service to cf manifest 2017-04-18 16:43:55 +01:00
Leo Hemsted
4fcee5f216 Merge pull request #1224 from alphagov/letters-from-a-service
Letters from template-preview service
2017-04-18 15:56:24 +01:00
Leo Hemsted
ba6c6b4923 node requires brew to install 2017-04-18 14:04:10 +01:00
Chris Hill-Scott
5b763d935a Remove template type parameter on redirect
This is a hangover from when we had separate email/SMS template pages.
If the view doesn’t use a parameter Flask adds it to the querystring. So
we were getting URLs that ended in `?template_type=sms`, to no effect.
2017-04-18 13:49:01 +01:00
Chris Hill-Scott
c887c3d5b2 Add more spacing under the flash banner
It was a bit too close to the page title, just felt like it needed room
to breathe.
2017-04-18 13:49:01 +01:00
Chris Hill-Scott
ac948ceb19 Make delete link flush left when there’s no button
The delete link was designed to be used with a button, where it needs
some padding to separate it from the button.

We now have a case where it’s being used without an accompanying button,
so we need a variation without that padding.
2017-04-18 13:49:01 +01:00
Chris Hill-Scott
d5b78fac17 Move delete link from edit to view template page
Users were having trouble finding the delete template link. It sort of
made sense having it on the edit page before we had the view template
page. But it doesn’t make sense now – having to choose to ‘edit’ the
template before you can delete is counterintuitive.

The single template page is where you go to choose an action to perform
on your template. Deleting is a good example of an action you can
perform on a template.

So this commit moves the delete link from the edit template page to the
view template page.

It also puts the confirm banner on same page as the delete link

The idea being that, in order to make a decision about whether to delete
the template, it’s useful to be able to see the template you’re
deleting. There’s no user need to edit the template before you delete
it.
2017-04-18 13:47:36 +01:00
kentsanggds
c86e195911 Merge pull request #1231 from alphagov/letter-jobs-title
Add title to letter jobs page
2017-04-18 13:07:06 +01:00
Ken Tsang
6b1bce091b Add title to letter jobs page 2017-04-18 12:23:40 +01:00
Chris Hill-Scott
e775b2a181 Merge pull request #1230 from alphagov/fix-entities-in-subjects
Stop template subjects getting saved encoded
2017-04-18 10:34:10 +01:00
Chris Hill-Scott
bb45ab025e Merge pull request #1228 from alphagov/banner-spacing
Fix spacing on no permissions banner
2017-04-18 10:10:21 +01:00
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
Leo Hemsted
d655a38e14 don't allow bad filetypes to preview 2017-04-12 12:12:11 +01:00
Chris Hill-Scott
685cce37bf Remove ‘mode’ banner type
No longer used anywhere.
2017-04-12 09:58:47 +01:00
Chris Hill-Scott
c14b860d0a Fix spacing on no permissions banner
Didn’t align with navigation.
2017-04-12 09:56:15 +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
Leo Hemsted
a0470b40ea fix test syntax 2017-04-11 17:15:31 +01:00
Leo Hemsted
6d5f90eea2 Merge branch 'master' into letters-from-a-service 2017-04-11 17:11:51 +01:00