Commit Graph

7170 Commits

Author SHA1 Message Date
Chris Hill-Scott
31a47a4621 Merge pull request #2699 from alphagov/trafford.gov.uk
Mark agreement signed by Trafford
2019-01-30 12:15:27 +00:00
Chris Hill-Scott
f3eeb4a87f Merge pull request #2698 from alphagov/pyup-update-flake8-3.6.0-to-3.7.1
Update flake8 to 3.7.1
2019-01-30 12:15:17 +00:00
Chris Hill-Scott
b760703b26 Fix indentation 2019-01-30 12:02:45 +00:00
Chris Hill-Scott
e04087ba93 Mark agreement signed by North Somerset council 2019-01-30 11:54:25 +00:00
Tom Byers
f4d9c37940 Move setting of sticky mode out of recalculate
The `recalculate` method currently does three
things:
1. sync's the internal store with the DOM
2. updates the saved positional and dimensional
data from the new DOM
3. allows the mode to be set

The problem with using it as the way to set the
mode is that, every call to it is effectively
setting the mode but this isn't always the
intention.

This splits off setting the mode so other modules
have to explicity set it and those that don't
intend to can just call `recalculate` to notify of
DOM changes.
2019-01-30 11:45:24 +00:00
Tom Byers
177f30248e Fix bug with DOM sync'ing
If a sticky element was already in the store, the
code for adding it would return early. This meant
dimensions and positions for it were not being
recalculated.
2019-01-30 11:35:31 +00:00
Chris Hill-Scott
2df98f6d79 Mark agreement signed by Trafford 2019-01-30 11:09:12 +00:00
pyup-bot
8a254add0d Update flake8 from 3.6.0 to 3.7.1 2019-01-30 08:21:26 +00:00
pyup-bot
130dcb7363 Update pytest-xdist from 1.26.0 to 1.26.1 2019-01-29 20:55:19 +00:00
Chris Hill-Scott
b459d14f0c Merge pull request #2693 from alphagov/gov.wales
Add Welsh Government domain
2019-01-29 16:42:46 +00:00
Chris Hill-Scott
d867ee73a7 Grey-out ‘Not set’ for email reply-to address
The `default_reply_to_email_address` variable was not set anywhere so
the conditional was having no effect.
2019-01-29 16:40:44 +00:00
Chris Hill-Scott
fb8555f171 Add Welsh Government domain 2019-01-29 16:31:37 +00:00
Chris Hill-Scott
e77a6ae09f Merge pull request #2689 from alphagov/southlanarkshire.gov.uk
Mark agreement signed by South Lanarkshire Council
2019-01-29 16:19:42 +00:00
Chris Hill-Scott
016d426928 Merge pull request #2691 from alphagov/pkc.gov.uk
Mark agreement signed by Perth & Kinross council
2019-01-29 16:19:33 +00:00
Chris Hill-Scott
3b15b04fc2 Let users switch channels on and off by themselves
We let people do this for letters already. We should let them do it for
emails and texts too, rather than have to email us.
2019-01-29 16:05:32 +00:00
Chris Hill-Scott
b251dbc3d1 Mark agreement signed by Perth & Kinross council 2019-01-29 13:42:25 +00:00
Chris Hill-Scott
e211fb7f60 Remove duplicative calls to init_app
Easier to read without the repetitive boilerplate.
2019-01-29 12:14:36 +00:00
Chris Hill-Scott
d054e97d45 Mark agreement signed by South Lanarkshire Council 2019-01-29 12:12:49 +00:00
Chris Hill-Scott
1d3a4e5043 Inherit don’t duplicate API client constructor
This removes some code which is duplicative and obscure (ie it’s not
very clear why we do `"a" * 73` even though there is a Very Good Reason
for doing so).
2019-01-29 12:11:27 +00:00
Katie Smith
eae0a5a632 Merge pull request #2688 from alphagov/dunbarton
Mark agreement signed by West Dunbartonshire
2019-01-29 12:03:11 +00:00
Katie Smith
5675e20319 Merge pull request #2687 from alphagov/sticky-footer-set-email
Use sticky footer when setting email branding
2019-01-29 12:03:05 +00:00
Katie Smith
b8a2c0c825 Merge pull request #2685 from alphagov/govuk-services
Change breadcrumb to reflect new Service Toolkit nomenclature
2019-01-29 12:02:58 +00:00
Katie Smith
ff1b3fc72e Merge pull request #2684 from alphagov/selected-counter-right-position
Fix jumpy right position of selected items counter
2019-01-29 12:02:51 +00:00
Katie Smith
5fded8daf5 Merge pull request #2683 from alphagov/email-branding-fixes
Email branding form validation fixes
2019-01-29 12:02:43 +00:00
Katie Smith
5b77329e63 Validate name field on ServiceUpdateEmailBranding form
This introduces a validator to validate that the name field is not empty
on the ServiceUpdateEmailBranding form, but only if the form details are
being submitted. If a file is being uploaded, the name is allowed to be
empty.
2019-01-29 11:37:27 +00:00
Katie Smith
52acf890dd Stop persisting email branding logos if saving to db fails
We were previously persisting the logo for the email branding and
deleting the temp files that get created before trying to update the
database with the new email branding. This meant that if there was an
error when saving (e.g. the domain used was a duplicate) the final logo
was already in S3 and trying to go 'back' in the browser would give an
error since the temp files needed to display the create branding page
had already been deleted.

This changes the order we do things in, so that we try persisting the
email branding to the database first.
2019-01-29 11:37:27 +00:00
Katie Smith
0bf3a4b16d Refactor to add separate letter branding client
We were getting all letter logos from a method in the email branding
client. Since we will be adding more client methods to deal with
letters, it makes things clearer to separate the email and letter
branding clients.
2019-01-29 11:37:27 +00:00
Chris Hill-Scott
a03855ab60 Mark agreement signed by West Dunbartonshire 2019-01-29 11:35:38 +00:00
Chris Hill-Scott
284ec3ee3e Merge pull request #2686 from alphagov/blue-badge-agreements
Mark agreements signed by multiple councils
2019-01-29 10:37:56 +00:00
Chris Hill-Scott
220abea41c Use sticky footer when setting email branding
You don’t want to scroll all the way through the big list to get to the
button.
2019-01-29 10:01:10 +00:00
Chris Hill-Scott
842de39478 Mark agreements signed by multiple councils
Catching up while I’ve been away…
2019-01-29 09:55:05 +00:00
Chris Hill-Scott
0d3dec1058 Merge pull request #2661 from alphagov/cant-choose-postage-if-can-choose-template
Don’t give postage choice on service and template
2019-01-29 09:48:39 +00:00
Chris Hill-Scott
44ebf1485d Merge pull request #2681 from alphagov/show-domains-against-brands
Show domains, not owners against brands
2019-01-29 09:48:27 +00:00
Chris Hill-Scott
dc2ce54b74 Change breadcrumb to reflect new Service Toolkit nomenclature
The Service Toolkit[1] used to categorise GaaP Programme[2] things under
‘Components’ so the breadcrumb reflected this.

This commit also fixes the anchor link, which has also changed[3] to the
new terminology.

1. https://www.gov.uk/service-toolkit
2. Rest in peace
3. https://www.w3.org/Provider/Style/URI
2019-01-29 09:35:12 +00:00
Chris Hill-Scott
7f202b026f Fix jumpy right position of selected items counter
The negative right margin counteracts the sticky footer being wider than
its containing column. This is only the case when it’s actually sticky.
2019-01-29 09:30:06 +00:00
Tom Byers
f8f4c4efb0 Merge pull request #2682 from alphagov/prevent-sticky-overflowing-screen
Prevent sticky overflowing screen
2019-01-28 15:23:39 +00:00
Leo Hemsted
d5e95af446 make classes in folder dialog states consistent
make sure the class is applied to a child element, so that `$el.find`
will always find something for `js-will-stick-at-bottom-when-scrolling`.

Also, clean up code by treating all stickies on the template folder
form as dialogs - they all are after all all dialogs - modals that
expect your attention on top of the main page content.
2019-01-25 16:47:49 +00:00
Tom Byers
05c455250c Fix calculation of in-page position
When the screen resizes, the dimensions of our
elements may change so we run
`setElementDimensions` again to update our store
of those values.

This caused a bug with the stored position of
stuck elements. When stuck, elements are
'fixed' so their position is relative to the
window position. We need the value stored to be
from the position in the document flow, not the
'fixed' value.

This change means, when an element is stuck, we
check its shim for the position instead. The shim
occupies the space the element would do in the
page so it makes sense to use it for this.
2019-01-23 16:55:18 +00:00
Tom Byers
c66caaf047 Add stop point for stick-to-bottom folder controls 2019-01-23 16:55:18 +00:00
Tom Byers
59b02e0fe0 Change when folder controls become sticky
The controls for the template folders are all
present in the page when it loads. The
templateFolderForm JS filters them so you only see
the one you need to for the thing you're trying to
do.

This changes when the controls are made sticky so
it happens after the templateFolderForm JS has
performed its filtering.
2019-01-23 16:55:18 +00:00
Tom Byers
98789c98c8 Reset onload flag when recalculate called
This ensures sticky elements don't fade in if
in a sticky position when the page loads.

The fade is there to show when an element is
becoming sticky. This has no use if it was already
sticky the first time you see it.

Because the same situation applies when
recalculate is called, we also want the flag to be
reset before this happens.
2019-01-23 16:55:18 +00:00
Tom Byers
a9b7a0d887 Add box shadow by JS
When mode === 'dialog', sticky elements are
stacked so we need to apply the box shadow to the
top (when sticking to the bottom edge) and bottom
(when sticking to the top edge) elements in the
stack.

From what I can see, we need the version of
`nth-child` that supports targeting by selector.
As of this date, support for this is only in
Safari:

https://caniuse.com/#feat=css-nth-child-of

Until we can use this version of `nth-child`, we
need to use JS to apply the styles.
2019-01-23 16:55:18 +00:00
Tom Byers
4e845c3125 Move setting of events into separate method 2019-01-23 16:55:18 +00:00
Tom Byers
1e8e8908ee Move sync'ing this._els with DOM into own method
We'll need to run this whenever recalculate runs
to ensure `this._els` matches the present state of
the DOM.
2019-01-23 16:55:18 +00:00
Tom Byers
a6a7057d64 Deal with elements no longer in the DOM
Instead of keeping references to nodes detached
from the DOM, remove them from the store.
Likewise, add node appended to the DOM.

This includes code to 'clean' DOM nodes when
removed. This is important because nodes can
retain classes and styles. If they are re-attached
in future this can cause problems with how the
state of the element is determined.
2019-01-23 16:55:18 +00:00
Tom Byers
03e38dfdef Add mode for grouping sticky elements as a dialog
We want a mode for when a single task is shared
between all sticky elements on the page and that
task has the highest priority on the page. In that
case:
- they should stack together into a single block,
  attached to the top/bottom of the viewport
- that block should adjust to the vertical space
  available

This should also adjust to the height of the
viewport, dropping whatever elements that don't
fit back into the page flow. When this happens, we
scroll the page so all the parts of the dialog are
seen together at the start of the task.
2019-01-23 16:55:12 +00:00
Tom Byers
ea675f45da Make the sticky states more robust
If the screen resizes, sticky elements can end up
moving from one part of the screen to another,
sometimes without passing through their different
states (in-page, stuck, stopped) in the normal
order.

This makes the methods that change their states
better at dealing with those state changes.
2019-01-23 16:33:32 +00:00
Tom Byers
c0706b9cef Split move_to forms into separate sticky elements 2019-01-23 15:30:28 +00:00
Tom Byers
7b3ac55103 Add method for adding a sticky element 2019-01-23 15:30:28 +00:00
Chris Hill-Scott
88f868c57d Show domains, not owners against brands
The owner is often repetetive, eg

> *Hackney Council*
> Default for Hackney Council

Instead it’s more useful to reflect what the person setting up the brand
has entered – the domain.

This also adds an empty hint for non-default brands so that the page is
evenly spaced and nothing overlaps.
2019-01-23 14:16:44 +00:00