Commit Graph

7170 Commits

Author SHA1 Message Date
Chris Hill-Scott
70ac96fed9 Make sure all domains are lowercased 2019-02-12 13:33:14 +00:00
Chris Hill-Scott
ba8d2ff1e3 Don’t let domains have none values 2019-02-12 13:33:13 +00:00
Chris Hill-Scott
0ce4dca799 Don’t allow domains to be none 2019-02-12 13:29:27 +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
Chris Hill-Scott
8512e26d6f Remove add folder as a separate page
This has moved to the choose template page.
2019-02-11 17:55:58 +00:00
Chris Hill-Scott
7d7b790dc1 Remove add template as separate page
This has moved to the choose template page.
2019-02-11 17:55:58 +00:00
Chris Hill-Scott
3a5bfeb7aa Remove folders feature flag
Every service has this feature now[1] so we don’t need to check whether
or not it’s switched on any more.

1. https://github.com/alphagov/notifications-api/pull/2286
2019-02-11 17:55:57 +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
cb866ecc7b Make font size bigger on profile page
We use 19px for tables almost everywhere now. This is one that escaped
that change.
2019-02-11 13:12:34 +00:00
Chris Hill-Scott
1f2cb07deb Make hit area bigger on settings ‘change’ links
Bigger hit areas are generally better (cf Fitt’s law[1]), as long as
they’re not ambiguous.

This commit enlarges the hit area of the edit links (using a border) so
they fill the same vertical space as the smallest possible row (going
to the full height might look weird because some of these rows get very
tall).
2019-02-11 13:12:34 +00:00
Chris Hill-Scott
1117984f5a Make hit area bigger on team members ‘edit’ links
Bigger hit areas are generally better (cf Fitt’s law[1]), as long as
they’re not ambiguous.

This commit enlarges the hit area of the edit links (using a border) so
they fill the same vertical space as the row they sit in.
2019-02-11 13:00:24 +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