Commit Graph

7485 Commits

Author SHA1 Message Date
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
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
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
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
Pea Tyczynska
bd66cc220b User permissions section for a folder noy visible if service only has one user
If no manage users permission then don't pass user folder permissions to api
2019-04-02 15:03:41 +01:00
Pea Tyczynska
9d44c45e90 Only users who can manage team members see folder permissions 2019-04-02 12:07:11 +01:00
Alexey Bezhan
8ab859138b Merge pull request #2865 from alphagov/check-folder-permissions
Check folder permissions
2019-04-02 10:33:01 +01:00
Katie Smith
3ae1f30ac9 Merge pull request #2885 from alphagov/phone-number
Pass API correct attribute to search inbound SMS
2019-04-02 09:59:40 +01:00
Chris Hill-Scott
a1a4b7f3d4 Fix alignment of links in sticky footer
The delete link was inheriting 1px of extra top padding meant to align
it when displayed alongside a button. In this case it’s not being
displayed alongside a button, so doesn’t need the extra padding.
2019-04-02 09:59:18 +01:00
Chris Hill-Scott
e7abebebf3 Pass API correct attribute to search inbound SMS
It’s `phone_number` here:
1250e47cc7/app/inbound_sms/rest.py (L33)
2019-04-02 09:17:13 +01:00
Chris Hill-Scott
f1126c8cbb Say ‘team members’ not ‘users’ for permissions
This is consistent with the language we use elsewhere.

Also removes the colon (it’s considered implicit in a form label).
2019-04-01 17:23:16 +01:00
Alexey Bezhan
2478c6b608 Add a temporary check for service folder permission
Since we're calling `User.has_template_folder_permission` directly
in a few places (notably the `folder_path` template macro), we need
to check that the service has the feature flag enabled first. This is
usually done by the caller, but template macro doesn't have access to
`current_service`. To avoid passing it in each time the macro is called
we're adding a temporary check inside the method itself.

This commit can be reverted completely when we remove the service
feature flag.
2019-04-01 10:50:39 +01:00
Alexey Bezhan
e6d4c7aaa8 Don't link folders in the folder path if user doesn't have permission
This updates folder_path macro to not link to any folders that
the user doesn't have permission for.
2019-04-01 10:50:39 +01:00
Alexey Bezhan
172f6b303f Fix missing New template / folder buttons on Templates root page
User folder permission check should recognize both `None` folder and
folder with a `None` id as template root.
2019-04-01 10:50:39 +01:00
Alexey Bezhan
7e0529b600 Fix missing space in current_user context processor 2019-04-01 10:50:39 +01:00
Alexey Bezhan
364ed7d4c6 Add tests that user folder permission check is being called 2019-04-01 10:50:39 +01:00