Commit Graph

7497 Commits

Author SHA1 Message Date
Chris Hill-Scott
700e073d0f Stop sending service domain to the API
The API doesn’t look at it, and the rest of the admin code isn’t calling
the method with this argument any more.
2019-04-12 17:15:51 +01:00
Pea (Malgorzata Tyczynska)
5ac6255be7 Merge pull request #2897 from alphagov/overlay-for-failed-letters
Precompiled show preview with overlay when validation fails
2019-04-12 16:37:53 +01:00
Chris Hill-Scott
8084dce705 Merge pull request #2896 from alphagov/remove-domains-yml
Use organisations from database rather than YAML file
2019-04-12 16:37:15 +01:00
Chris Hill-Scott
3212915a51 Simplifying code for checking email domains
Since this code isn’t trying to inherit from the code that also looked
up domain names in `domains.yml` it can go back to being a lot simpler.

This code is thoroughly tested already here:
a249382e69/tests/app/main/test_validators.py (L74-L155)
2019-04-12 15:23:08 +01:00
Chris Hill-Scott
07c7544049 Use crown not crown_status as prop name
It’s confusing having a property name which is different from the
attribute returned in the JSON from the API.
2019-04-12 15:23:08 +01:00
Chris Hill-Scott
5d091b214a Remove domains.yml file
Since we’ve now removed the code that reads this file, it can safely be
deleted.
2019-04-12 15:23:08 +01:00
Chris Hill-Scott
9d99c78c3a Remove code that reads domains.yml
Since we’ve removed calls to this code from the rest of the app, it can
safely be removed now.
2019-04-12 15:23:08 +01:00
Chris Hill-Scott
470b8a2912 Remove domains from branding forms
We’re deprecating storing the domain as text on a branding in favour of
a database relationship between branding and organisation.

We need to do this now in order to remove the validation on these fields
(which depends on the data in `domains.yml`)
2019-04-12 15:23:07 +01:00
Chris Hill-Scott
9684e962ae Refactor go live tags into service model
Since this function only takes one argument, a service, it might as well
be a method of the service.
2019-04-12 15:19:32 +01:00
Chris Hill-Scott
3565ffc33f Remove dependence on domains.yml from settings
Settings looked at `domains.yml` when users were making go live requests
or email branding requests.

This will allow us to remove the `domains.yml` file, by using
information about organisations that is now stored in the database
instead.
2019-04-12 15:19:31 +01:00
Chris Hill-Scott
b41c3779c4 Merge pull request #2906 from alphagov/auto-service-counts
Automate counting of live services and orgs
2019-04-12 14:15:41 +01:00
Chris Hill-Scott
835d11d8d6 Remove domains.yml dependence from agreement pages
This will allow us to remove the `domains.yml` file, by using
information about organisations that is now stored in the database
instead.
2019-04-12 14:12:10 +01:00
Chris Hill-Scott
98249158cb Stop trying to infer branding when adding services
The API handles this now.
2019-04-12 14:08:33 +01:00
Chris Hill-Scott
72f49a9a1e Remove dependence on domains.yml from static pages
This will allow us to remove the `domains.yml` file, by using
information about organisations that is now stored in the database
instead.
2019-04-12 14:05:00 +01:00
Chris Hill-Scott
718f440720 Get info about organisations from database table
This is the first step of replacing the `domains.yml` file.

In order to replicate the same functionality we get from the
`domains.yml` file and its associated code this commit adds a
`Organisation` model. This model copies a lot of methods from the
`AgreementInfo` class which wrapped the `domains.yml` file.

It factors out some stuff that would otherwise be duplicated between the
`Organisation` and `Service` model, in such a way that could be reused
for making other models in the future.

This commit doesn’t change other parts of the code to make use of this
new model yet – that will come in subsequent commits.
2019-04-12 14:01:14 +01:00
Chris Hill-Scott
9863aa3c48 Automate counting of live services and orgs
Returns the data calculated by the API. Stored in Redis against a
hardcoded key so that no-one hammering the home page is directly hitting
the database.
2019-04-12 13:59:33 +01:00
Alexey Bezhan
df1a1b5b66 Merge pull request #2905 from alphagov/pin-gunicorn-pyup
Stop pyup from trying to upgrade gunicorn
2019-04-12 10:21:21 +01:00
Chris Hill-Scott
278317b222 Merge pull request #2907 from alphagov/no-go-live-without-checklist
Block incomplete requests to go live
2019-04-11 16:23:55 +01:00
karlchillmaid
f997b446ff Update app/templates/views/service-settings/request-to-go-live.html
Co-Authored-By: quis <me@quis.cc>
2019-04-11 15:44:28 +01:00
Chris Hill-Scott
436d023722 Block incomplete requests to go live
Dealing with users who request to go live but haven’t completed all the
steps still represents a significant support overhead for our team.
We’ve made some improvements to the percentage of incomplete requests
with a better page design, but ultimately because it still shows the
button people think it’s OK to press the button while some of the items
on the page still say [Not completed].

We can do this now because organisations are in the database, which
means we can mark the agreement signed as soon as we get it back,
without having to deploy code.
2019-04-11 14:35:30 +01:00
Alexey Bezhan
3c302e4595 Stop pyup from trying to upgrade gunicorn 2019-04-10 11:04:55 +01:00
Katie Smith
55eaa066f1 Merge pull request #2892 from alphagov/add-audit-events
Add audit event when a service manager changes someones profile
2019-04-10 11:00:17 +01:00
Katie Smith
19fe587640 Make InvitedUser class always expect folder_permissions to be returned
InvitedUsers now always have folder_permissions (if they can't view any
folders their folder permissions will be `[]`).
2019-04-09 14:37:37 +01:00
Katie Smith
88e9a0ff61 Add audit event when a service manager changes someones profile
We should audit when a service manager changes a user profile that is not
their own. This can be recorded in our events table, which is currently
only used to record successful logins.

This adds two new types of event, `update_user_email` and
`update_user_mobile_number` which store the
- browser fingerprint
- IP address
- user id of the user being updated
- user id of the service manager  making the change
- original email address and new email address (for `update_user_email`
events)
- original mobile number and new mobile number (for
`update_user_mobile_number` events)
2019-04-09 14:37:37 +01:00
Leo Hemsted
a249382e69 Merge pull request #2898 from alphagov/user-permission-count
add count of folders visible per user to the team members page
2019-04-05 14:20:52 +01:00
Chris Hill-Scott
04c0b5cd4b Merge pull request #2900 from alphagov/cefas.co.uk
Let Centre for Environment Fisheries and Aquaculture Science sign up for Notify
2019-04-05 11:58:31 +01:00
Chris Hill-Scott
e56aeaefda Merge pull request #2899 from alphagov/update-service-count
Updated service and org counts
2019-04-05 11:48:20 +01:00
Chris Hill-Scott
86c15771e0 Let Centre for Environment Fisheries and Aquaculture Science sign up for Notify 2019-04-05 11:46:59 +01:00
Pete Herlihy
23b3710875 Updated service and org counts 2019-04-05 10:29:57 +01:00
Leo Hemsted
249b80762a add count of folders visible per user to the team members page
Shows a count of how many folders that user can see - this doesn't do
anything smart with parent folder stuff, it's just "how many checkboxes
are ticked on the edit page".

* doesn't show if service has no folders
* doesn't show if service hasn't got folder permissions enabled
2019-04-04 17:55:37 +01:00
Leo Hemsted
16d1526c46 bump utils to 31.2.4
brings in dev logging filter
2019-04-04 14:05:15 +01:00
Pea Tyczynska
858e98736f Test that preview with overlay gets called 2019-04-04 13:41:30 +01:00
Pea Tyczynska
e0b61e3d70 Call precompiled letter preview with overlay 2019-04-04 12:05:17 +01:00
Tom Byers
eb8a856c10 Merge pull request #2880 from alphagov/add-logic-to-autofocus
Prevent autofocus when page has scrolled
2019-04-03 15:37:25 +01:00
Chris Hill-Scott
79eb7d0f45 Merge pull request #2894 from alphagov/fix.lancaster.gov.uk
Fix name of Lancaster City Council
2019-04-03 14:50:27 +01:00
Tom Byers
cf07579a6b Correct name of forceFocus data attribute
Data attributes need to be '-' separated strings
in the HTML to appear as camelCase keys in the
`.dataset` (`.data()` in jQuery) property.

This corrects the assumption that the camelCasing
would carry through from the HTML.

More info:

https://developer.mozilla.org/en-US/docs/Learn/HTML/Howto/Use_data_attributes
2019-04-03 14:41:09 +01:00
Tom Byers
cb55fbb344 Fix reference to non-existent jQuery collection
Raised on PR as comment:

e4b4be9d45 (r270781103)
2019-04-03 14:41:09 +01:00
Tom Byers
8d5e7e70ab Prevent autofocus when page has scrolled
If users scroll a page with an autofocus component
on so it is off-screen it seems safe to assume
they won't want it focused if they return to it.

This prevents that happening.

This adds a data-attribute flag to allow this
behaviour to be overridden.

We have some situations where the assumption here
isn't appropriate, for example on pages where the
component with autofocus is in a sticky element.
This means it will appear offscreen when the page
loads but, when its parent becomes sticky, will be
visible again.
2019-04-03 14:41:09 +01:00
Chris Hill-Scott
9619c64cb3 Fix name of Lancaster City Council
The county council is _Lancashire_
2019-04-03 14:25:50 +01:00
Leo Hemsted
1984128d1f Merge pull request #2893 from alphagov/copy-service-folder
fix bug with copying template from folder in other service
2019-04-03 14:13:27 +01:00
Chris Hill-Scott
a754eca29f Merge pull request #2886 from alphagov/hint-current-email-branding
Say what the current email branding is
2019-04-03 14:05:54 +01:00
Leo Hemsted
3e3c11f3a0 fix bug with copying template from folder in other service 2019-04-03 13:59:44 +01:00
Chris Hill-Scott
c2367010c4 Merge pull request #2891 from alphagov/dorsetcouncil.gov.uk
Add alternate domain for Dorset Council
2019-04-03 13:25:10 +01:00
Chris Hill-Scott
d749586f25 Add alternate domain for Dorset Council 2019-04-03 13:13:47 +01:00
Chris Hill-Scott
b1b496ba56 Say what the current email branding is
We keep getting people requesting branding when they already have the
branding they want set. Seems like they don’t realise we’re doing it
automatically. This might help.
2019-04-03 11:54:33 +01:00
Chris Hill-Scott
a85ee2a8e9 Merge pull request #2890 from alphagov/lancaster.gov.uk
Mark agreement signed by Lancaster County Council
2019-04-03 11:38:51 +01:00
Chris Hill-Scott
7d680ba37f Mark agreement signed by Lancaster County Council 2019-04-03 11:27:38 +01:00
Chris Hill-Scott
7436a568dd Merge pull request #2884 from alphagov/team-members-not-users
Say ‘team members’ not ‘users’ for permissions
2019-04-02 15:52:49 +01:00
Chris Hill-Scott
70d2b709ce Merge pull request #2887 from alphagov/fix-alignment-sticky-links
Fix alignment of links in sticky footer
2019-04-02 15:52:33 +01:00
Pea (Malgorzata Tyczynska)
3e251783de Merge pull request #2888 from alphagov/folder-user-permissions-2
Only show user permissions section for a folder to users with manage_users permission
2019-04-02 15:34:54 +01:00