Commit Graph

7115 Commits

Author SHA1 Message Date
Katie Smith
1cb1ce310a Add update_letter_branding view function
This works in a similar way to the create_letter_branding view function,
but with a few minor differences:
* Since we already have a file, uploading a file is no longer required
(since we can just use the current file if a new one is not uploaded)
* We save the changes in the database, then upload the new files to S3.
If saving to S3 raises an error, we now rollback the database changes to
prevent any errors when trying to view letters with the original logo.
2019-02-12 14:59:29 +00:00
Katie Smith
53627fd1ba Add update letter branding method to letter branding client 2019-02-12 14:59:29 +00:00
Rebecca Law
8efb075550 Merge pull request #2757 from alphagov/update-email-domain
Update email domains
2019-02-12 14:13:09 +00:00
Rebecca Law
8fa95159ab Adult Social Care Workforce Data Set service is funded by the Department of Health and Social Care and is being delivered by Skills for Care as a delivery partner 2019-02-12 13:59:49 +00:00
Tom Byers
6135b77c39 Merge pull request #2741 from alphagov/template-form-focus
Template form focus
2019-02-12 13:04:24 +00:00
Tom Byers
30844143ec Fix bugs around operations happening between modes
The `release` method is meant to clean up a sticky
element before removal from the store.

The part of this that cleared CSS added due to
being in dialog mode was only run if still in that
mode.

In the template folder JS, we set the mode before
running `recalculate` so elements can be cleaned
in a different mode to that they were last in.
This meant some CSS wasn't being cleaned up.

This sometimes caused an effect where elements
that were added back to the DOM but not stuck
would still have CSS used when they were last
stuck.

This commit also includes the addition of some
missing code that adds back CSS to offset an
element when in a dialog stack.
2019-02-11 17:50:47 +00:00
Tom Byers
09848009c1 Correct reference to 'self' variable
It doesn't exist in this scope so the 'self' in
the scope above was being referenced instead,
preventing it from erroring.
2019-02-11 16:10:29 +00:00
Tom Byers
4c477d08a6 Put shift in focus after change to state
Moving focus before letting the sticky JS set the
position of sticky elements means focus is shifted
to them when they are still in the page. This
causes the browser to scroll so the focused
elements are visible.

This moves when focus is set to after the sticky
JS has set position therefore avoiding the issue.
2019-02-11 15:24:09 +00:00
Tom Byers
693ddadbc4 Deal with focus state following cancelation
Follows pattern from dialogs whereby focus returns
to the button/link that fired the dialog when it
closes.
2019-02-11 15:24:09 +00:00
Tom Byers
d633bdbb6d Tidy up JS code for focusing & associated html
Makes sure the tabindex we add for focusing is
removed.

Also removes the outer fieldset from the radios
for new templates. We don't wrap form buttons in
fieldsets anywhere else and it doesn't add any
useful semantics to the form.
2019-02-11 15:24:09 +00:00
Tom Byers
2b2641b039 Use JS for applying focus & add styling for it
Adds some extra styles so <fieldset>'s show as
focused when they are.

Also includes replacement of `overflow: hidden` on
sticky elements with a clearfix. hiding overflow
clips the outline and the clearfix can be used for
containing any floats instead. (I'm assuming that's
why it was set here.)
2019-02-11 15:24:09 +00:00
Chris Hill-Scott
0c823db970 Merge pull request #2748 from alphagov/fylde.gov.uk
Mark agreement signed by Fylde Council
2019-02-11 10:30:54 +00:00
Chris Hill-Scott
0b9f5c5657 Merge pull request #2749 from alphagov/gateshead.gov.uk
Mark agreement signed by Gateshead
2019-02-11 10:22:36 +00:00
Chris Hill-Scott
7a692bc424 Mark agreement signed by Gateshead 2019-02-11 10:20:45 +00:00
Chris Hill-Scott
8a6ad43e32 Mark agreement signed by Fylde Council 2019-02-11 10:07:27 +00:00
Chris Hill-Scott
d0c4cb98e3 Merge pull request #2746 from alphagov/postage-flicker
Stop flicker when hovering postage on precompiled
2019-02-08 16:54:44 +00:00
Chris Hill-Scott
980fc249d8 Stop flicker when hovering postage on precompiled
We were removing the border to ‘unfold’ the corner of the page. This was
causing the size of the element to shrink.

This meant that it you hovered the bottom 1px of the element it would
cycle in and out of the hover state as fast as the browser could render
it.

This commit fixes that by making the border transparent, rather than
removing it.
2019-02-08 16:44:37 +00:00
Chris Hill-Scott
77eaabf24b Merge pull request #2727 from alphagov/pyup-update-notifications-python-client-5.2.0-to-5.3.0
Update notifications-python-client to 5.3.0
2019-02-08 15:38:51 +00:00
Chris Hill-Scott
25c9b04904 Freeze requirements 2019-02-08 15:25:31 +00:00
pyup-bot
154bfdd711 Update notifications-python-client from 5.2.0 to 5.3.0 2019-02-08 15:24:33 +00:00
Chris Hill-Scott
72a7d0d5d8 Merge pull request #2745 from alphagov/614-services
Updated the service and org counts
2019-02-08 15:23:04 +00:00
Pete Herlihy
7ae58f97e3 Updated the service and org counts 2019-02-08 15:14:45 +00:00
Chris Hill-Scott
60ad32bb8e Merge pull request #2743 from alphagov/reveal-full-precompiled-letter
Allow people to see the full precompiled letter
2019-02-08 12:01:30 +00:00
Katie Smith
f9a34768b6 Merge pull request #2744 from alphagov/letter-branding-list
Add '/letter-branding' page to show all letter brands
2019-02-08 09:36:57 +00:00
Chris Hill-Scott
6824eeebf5 Allow people to see the full precompiled letter
Sometimes people print stuff under where we’re folding the letter. It’s
annoying to not be able to see it.

This commit adds a little detail where, once you’ve sent the letter
you can unfolds the corner to see what’s underneath.

It’s better that we do this for all letters for discoverability.
2019-02-07 16:19:13 +00:00
Katie Smith
f78b3bff81 Add '/letter-branding' page to show all letter brands
This is a platform admin page which lists all letter brands and their
domain. Once the page to edit a letter brand has been created, each
brand will link to its edit page, but for now this is just a list of
brand names and domains.
2019-02-07 16:16:22 +00:00
Leo Hemsted
f87f89bfd2 Merge pull request #2734 from alphagov/set-letter-branding
Set letter branding for a service
2019-02-07 14:36:53 +00:00
Chris Hill-Scott
1efdf5e06c Merge pull request #2740 from alphagov/change-not-edit-postage
Say ‘Change’ not ‘Edit’ postage
2019-02-07 12:00:30 +00:00
Chris Hill-Scott
1b89b7d7da Merge pull request #2742 from alphagov/t…
Add tooltip to ‘Templates’ in breadcrumb
2019-02-07 12:00:22 +00:00
Leo Hemsted
f83910599c remove option for branding to sometimes not show search
it wouldn't show search if there were under a certain amount of letter
or email branding options - however we know there will always be more
than that amount so lets remove some complexity.

Also, rename the SearchTemplatesForm because it can search anything -
it just prompts you to search by name is all.
2019-02-07 11:39:23 +00:00
Leo Hemsted
7590b3dba9 remove unused sort_key param 2019-02-07 11:38:20 +00:00
Leo Hemsted
d5446774fa letter branding text fields should be optional 2019-02-07 11:38:20 +00:00
Leo Hemsted
5405c2e1be fix service settings letter branding tests
some tests are now expanded to handle the fact that letter branding
can be null
2019-02-07 11:38:20 +00:00
Leo Hemsted
3be82bafd5 fix request letter branding page
(it can now have a null type). also fix nav.py
2019-02-07 11:38:20 +00:00
Leo Hemsted
8266635a7a remove dvla_organisation and other unused things
dvla_organisation, branding_dict, a weird `branding` property on
update_service. all gone 💥
2019-02-07 11:38:20 +00:00
Leo Hemsted
a1caf77b0e use new letter branding instead of dvla organisation id
new code is copied stylistically from the email branding patterns.
Instead of `service.dvla_organisation`, there's now
`service.letter_branding` and `service.letter_branding_id`. However,
unlike email branding we're not currently showing a preview of the
logo. That can come later when we work out how we want to do it.
2019-02-07 11:30:18 +00:00
Leo Hemsted
0e20ca44a3 rename branding to email_branding
to help transition to having letter branding as well
2019-02-07 11:30:18 +00:00
Chris Hill-Scott
3d45f5b9c3 Add tooltip to ‘Templates’ in breadcrumb
Because sometimes we show it truncated to ‘T…’
2019-02-07 11:05:47 +00:00
Katie Smith
b81704ab69 Merge pull request #2719 from alphagov/create-letter-branding
Add platform admin page to create letter branding
2019-02-07 10:13:41 +00:00
Chris Hill-Scott
8e1ce9b191 Merge pull request #2738 from alphagov/leeds.gov.uk
Mark agreement signed by Leeds Leeds Leeds
2019-02-06 17:28:08 +00:00
Chris Hill-Scott
e45024affd Say ‘Change’ not ‘Edit’ postage
To match the call to action on the template page.

Karl said:

> I feel good about it. You're not really editing it so much as choosing between 2 options. It feels more human.
>
> I think it only started out as edit to match all the other sections of the letter – it certainly wasn't given any real consideration.
2019-02-06 17:27:32 +00:00
Katie Smith
bbc5eaa12f Handle the database errors on name and domain fields
Form errors were being shown (such as a domain not being a valid), but
we weren't showing nicely formatted error messages if the database
failed to save a new row.
2019-02-06 17:26:58 +00:00
Katie Smith
529d7df5f5 Add page to create new letter branding
This has a form with 3 fields - the file upload field, logo name, and an
optional logo domain. Logos need to be uploaded in `.svg` format and we
then convert this to `.png` format and upload both file types to S3 as
well as saving the letter branding details in the database.
2019-02-06 17:26:58 +00:00
Katie Smith
446b9ccbb2 Add create_letter_branding method to letter branding client 2019-02-06 17:26:58 +00:00
Katie Smith
b68d0722bb Fix mocks in existing s3 client tests
Some of the tests were calling methods that didn't exist on MagicMock
objects, which meant that they were always passing. For example, tests
using the format of MagicMock.called_once_with(...) were always passing
since a MagicMock does not have the method `called_once_with`. Changing
this to `assert_called_once_with` ensures that the tests fail if they're
called with the wrong arguments.
2019-02-06 17:26:58 +00:00
Katie Smith
d654a87f5c Rename the current s3 logo client functions
We will be adding methods to deal with letter logos, so this adds 'email' to
the method names for email logos to avoid confusion later.
2019-02-06 17:26:58 +00:00
Katie Smith
f005d7a569 Refactor to split s3_client.py into multiple files
Separated s3_client.py into 3 files - for logos, CSV files and the MOU.
This helps to keep things clearer now that we need to add lots more logo
functions for letters.
2019-02-06 17:26:58 +00:00
Chris Hill-Scott
5e6d48e50f Merge pull request #2739 from alphagov/sequential-gulp
Ensure Gulp tasks run sequentially
2019-02-06 16:24:26 +00:00
Chris Hill-Scott
0d3642148c Always pin to exact versions 2019-02-06 16:16:28 +00:00
Chris Hill-Scott
06a9e56589 Ensure Gulp tasks run sequentially
So that images are always copied into place before trying to build the
SASS.
2019-02-06 16:09:39 +00:00