Commit Graph

6943 Commits

Author SHA1 Message Date
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
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
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
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
Katie Smith
05c7b685ab Merge pull request #2677 from alphagov/email-auth-fixes-take-2
Stop automatically resending email verification links
2019-01-23 12:51:23 +00:00
Chris Hill-Scott
fc7e4e554d Merge pull request #2679 from alphagov/cyfoethnaturiolcymru.gov.uk
Add Natural Resources Wales to list of domains
2019-01-23 12:20:33 +00:00
Chris Hill-Scott
a9f21a9818 Add Natural Resources Wales to list of domains
Pretty sure they are crown…
2019-01-23 11:55:59 +00:00
Chris Hill-Scott
b19e865fb5 Merge pull request #2678 from alphagov/middlesbrough.gov.uk
Mark agreement signed by Middlesbrough Council
2019-01-23 11:41:53 +00:00
Chris Hill-Scott
e8aed9cda9 And Orkney… 2019-01-23 11:31:04 +00:00
Chris Hill-Scott
46542129e1 Mark agreement signed by Middlesbrough Council 2019-01-23 11:26:13 +00:00
Katie Smith
c30d94bf5c Stop automatically resending email verification links
This commit stops a new email verification link from being sent to a
user if they click on an email link which has expired or which has
already been used. Instead, they will be see an error message with a
link to the sign in page. This stops the situation where someone could
log in indefinitely (without the needing to enter their password) by
trying to use a used / expired email verification link and receiving a
valid link automatically.
2019-01-22 13:59:16 +00:00
Chris Hill-Scott
a9effaa82e Merge pull request #2669 from alphagov/test-key-letters
Show if letters are sent using a test key
2019-01-22 11:36:13 +00:00
Chris Hill-Scott
085856e062 Revised wording to avoid negative contraction 2019-01-22 10:38:40 +00:00
Katie Smith
436bdcbf89 Merge pull request #2674 from alphagov/fix-non-gov-user-invites
Ensure non-gov invited users get added to services
2019-01-22 10:38:37 +00:00
Chris Hill-Scott
cfcdfcc38c Show if letters are sent using a test key
It’s inaccurate to have an estimated delivery date for letters sent
using a test key. We shouldn’t reassure people that:
- the letter won’t be printed
- (in the case of precompiled letters) that the letter has passed
  validation
2019-01-22 09:54:40 +00:00
Katie Smith
bbc7b173f0 Ensure non-gov invited users get added to services
We were adding invited users to services in the `main.add_service` view
function as the last step in the process of inviting users. Since this
view function is decorated with `@user_is_gov_user`, invited users with
non-governmental email addresses would never reach this point and would
be able to register an account but would not get linked to a service.

To fix this, we now add the invited user to the service at the point at
which the user gets activated and also ensure that non-gov users don't
get redirected to a page which they don't have permission to view.
2019-01-22 09:52:55 +00:00
Katie Smith
63889cb047 Merge pull request #2676 from alphagov/revert-2664-email-auth-fixes
Revert "Stop automatically resending email verification links"
2019-01-21 15:51:13 +00:00
Katie Smith
398aef6d4c Revert "Stop automatically resending email verification links" 2019-01-21 15:44:15 +00:00
Katie Smith
061235958e Merge pull request #2664 from alphagov/email-auth-fixes
Stop automatically resending email verification links
2019-01-21 14:40:26 +00:00
Katie Smith
9095893e03 Stop automatically resending email verification links
This commit stops a new email verification link from being sent to a
user if they click on an email link which has expired or which has
already been used. Instead, they will be see an error message with a
link to the sign in page. This stops the situation where someone could
log in indefinitely (without the needing to enter their password) by
trying to use a used / expired email verification link and receiving a
valid link automatically.
2019-01-21 14:29:22 +00:00
Chris Hill-Scott
55a41f9239 Merge pull request #2675 from alphagov/somerset.gov.uk
Mark agreement signed by Somerset council
2019-01-21 11:28:45 +00:00
Chris Hill-Scott
ed2ead73e9 Mark agreement signed by Somerset council 2019-01-21 11:16:05 +00:00
Chris Hill-Scott
ade460d6bf Merge pull request #2673 from alphagov/enfield.gov.uk
Mark agreement signed by Enfield Council
2019-01-18 16:43:52 +00:00
Chris Hill-Scott
dcfd65e193 Mark agreement signed by Enfield Council 2019-01-18 15:29:03 +00:00
Chris Hill-Scott
dc3b3cf358 Merge pull request #2672 from alphagov/wra.gov.wales
Mark agreement signed by Welsh Revenue Authority
2019-01-18 11:26:24 +00:00
Chris Hill-Scott
423648f4db Mark agreement signed by Welsh Revenue Authority
They signed it ages ago, but only just noticed the have their own email domain now.
2019-01-18 11:20:29 +00:00
Chris Hill-Scott
2d9467dbe0 Merge pull request #2671 from alphagov/service-count
Updated service and org counts to 553 and 164
2019-01-18 11:01:34 +00:00
Pete Herlihy
e21ffa9dd9 Updated service and org counts to 553 and 164 2019-01-18 10:45:41 +00:00
Chris Hill-Scott
533e6800a3 Merge pull request #2670 from alphagov/mansfield.gov.uk
Mark agreement signed by Mansfield Council
2019-01-18 10:32:34 +00:00
Chris Hill-Scott
0b56b6338d Mark agreement signed by Mansfield Council 2019-01-18 10:05:58 +00:00
Alexey Bezhan
ec0575009b Merge pull request #2667 from alphagov/template-and-notification-stats-use-one-api-call
Use single api call for service notification stats and template usage stats
2019-01-17 15:35:00 +00:00