Commit Graph

8022 Commits

Author SHA1 Message Date
pyup-bot
98d0aaa5ed Update freezegun from 0.3.11 to 0.3.12 2019-06-27 12:41:08 +01:00
Chris Hill-Scott
c260816213 Merge pull request #3027 from alphagov/add-permissions-to-missing-page
Fix a bug were the user_has_permission.
2019-06-27 12:40:47 +01:00
Rebecca Law
21c23c276f Fix a bug were the user_has_permission.
This is an immediate fix to add the permission checks to the callback page.
However, we have a plan to add a unit test to check for permission introspectively for all routes that have service_id.
2019-06-27 12:20:58 +01:00
Katie Smith
149003c52c Merge pull request #3022 from alphagov/dont-show-org-🍞crumbs-in-trial-mode
Don't show org breadcrumbs for trial mode services
2019-06-26 10:22:18 +01:00
Katie Smith
458b37d0aa Merge pull request #3025 from alphagov/bump-utils
Bump utils to add alt text to email branding
2019-06-26 10:22:10 +01:00
Katie Smith
a9ff4b1d48 Bump utils to add alt text to email branding
Utils 33.0.0 adds alt text to email branding - the HTMLEmailTemplate now
initializes slightly differently as a result (with both `branding_name`
and `branding_text`).
2019-06-25 16:56:45 +01:00
Katie Smith
f3ff7ee84d Don't show org breadcrumbs for trial mode services
Platform admin users can still see the organisation breadcrumbs for
trial mode services, but others uses can only see organisation
breadcrumbs for live services.
2019-06-20 16:58:53 +01:00
Chris Hill-Scott
0dddd0f5dc Merge pull request #3020 from alphagov/org-view-of-service-pages
Allow organisation team members to see team and usage
2019-06-20 15:53:36 +01:00
Chris Hill-Scott
e6733d7e24 Link to usage, not dashboard
Organisation team members only have access to the dashboard if they’re
also a member of that service.

They always have access to the usage page, so let’s link there instead.
2019-06-20 15:38:16 +01:00
Chris Hill-Scott
873272160c Update content on invite page to reflect changes
What org team members can see has changed slightly, so we should update
the hint text accordingly.
2019-06-20 15:38:09 +01:00
Chris Hill-Scott
afedf431e0 Link to all services from organisation
Because a member of the organisation can now see some pages for any live
service they should be able to click into each one.
2019-06-20 15:38:02 +01:00
Chris Hill-Scott
3968d5b766 Allow org team members to see team and usage
Organisation team members will be ultimately interested in the detailed
usage of each service, but shouldn't necessarily have access to the
personal data of that services users.

So we should allow these organisation team members to navigate to live
services usage page from the organisation page. They may need to contact
the team so they should also be able to view the team members page.

So they'll then see just usage and team members pages.

If they are actually a team member of the service they're viewing, then
they'll see the full range of options as usual.

This commit implement the above by adding an extra flag to the
`user.has_permissions` decorator which allows certain pages to be marked
as viewable by an organisation user. The default (for all other existing
pages) is that organisation users don’t have permission.
2019-06-20 15:37:52 +01:00
Chris Hill-Scott
31afd65e71 Refactor permissions checking to use methods
It’s a bit more concise to use these methods, rather than access the
lists directly.

And because it’s easier to read it will make later refactoring less
bothersome.
2019-06-20 14:32:08 +01:00
Chris Hill-Scott
bd697462a2 Merge pull request #3021 from alphagov/breadcrumbs
Show organisation breadcrumbs
2019-06-20 14:31:30 +01:00
Katie Smith
5f2c869a1c Show organisation breadcrumbs
Added a breadcrumb link to a service's organisation to the
withnav_template. This will only show if a service has an organisation
and the current user is also a member of that org, or the current user
is a platform admin user.

Also removed a couple of unused fixtures from the client_request
fixture.
2019-06-20 12:11:13 +01:00
Chris Hill-Scott
e3e461f340 Merge pull request #3016 from alphagov/pyup-scheduled-update-2019-06-17
Scheduled weekly dependency update for week 24
2019-06-19 14:16:45 +01:00
Chris Hill-Scott
9ff33df61d Freeze requirements 2019-06-19 13:35:12 +01:00
pyup-bot
32e2abd59c Update pyexcel-io from 0.5.17 to 0.5.18 2019-06-19 13:32:57 +01:00
pyup-bot
29f56aeca9 Update pyexcel from 0.5.13 to 0.5.14 2019-06-19 13:32:56 +01:00
Chris Hill-Scott
02566c4381 Merge pull request #3018 from alphagov/fixes-for-check-spreadsheet-page
Fixes for check spreadsheet page
2019-06-19 13:32:28 +01:00
Chris Hill-Scott
e1c9464228 Merge pull request #2998 from alphagov/pyup-scheduled-update-2019-06-03
Scheduled weekly dependency update for week 22
2019-06-19 13:32:04 +01:00
Chris Hill-Scott
89cf4904fe Merge pull request #3012 from alphagov/use-new-orgs-and-services-fields
Use new organisation and services fields
2019-06-18 10:51:15 +01:00
Chris Hill-Scott
772066164c Only print the id attribute if it’s a string
If it’s something weird like an instance of a Python object let’s ignore
it (else we get invalid HTML like
`id='<notifications_utils.columns.Cell object at 0x1126f4e80>'`).
2019-06-17 17:09:45 +01:00
Chris Hill-Scott
14225027d2 Fix incorrect argument name in test
This test wasn’t checking the redirect because the argument name was
missing the leading underscore.
2019-06-17 16:53:18 +01:00
Chris Hill-Scott
c41189db22 Merge pull request #3017 from alphagov/fix-rendering-scrollable-tables
Fix rendering of scrollable tables
2019-06-17 16:35:03 +01:00
Chris Hill-Scott
1a3df7039f Fix rendering of scrollable tables
The scrollable tables code styles some of the cells in the target table
by looking for the `table-field-center-aligned` class.

This class was renamed in 0512f40ad3

This commit updates the scrollable tables code to refer to the new
classname, which means that things should line up properly when drawing
the table.
2019-06-17 16:15:34 +01:00
Chris Hill-Scott
290e111810 Stop making multiple API calls to get_organisation
The count of live services is coming back from the `/organisations`
response. We don’t need to get each organisation individually now.
2019-06-17 16:14:25 +01:00
Chris Hill-Scott
e6304fe10d Add count of live services to organisation list
This is useful information that we might as well return now we have it.
2019-06-17 16:04:48 +01:00
Chris Hill-Scott
913095fe60 Wrap a model around list of all organisations 2019-06-17 16:00:59 +01:00
Chris Hill-Scott
0aea038d51 Use new fields for getting orgs and services
Uses https://github.com/alphagov/notifications-api/pull/2539 to reduce
the number of API calls we make.
2019-06-17 15:56:59 +01:00
Chris Hill-Scott
da29d722f9 Merge pull request #2983 from alphagov/add-js-tests-for-fullscreen-table
Add js tests for fullscreen table
2019-06-17 10:00:53 +01:00
Chris Hill-Scott
cf3e9302a0 Merge pull request #3015 from alphagov/optional-platform-admin
add option to suppress platform admin temporarily
2019-06-17 10:00:45 +01:00
Chris Hill-Scott
faaa812379 Merge pull request #3013 from alphagov/org-client-refactor
Wrap get org methods in class method on model
2019-06-14 16:56:02 +01:00
Chris Hill-Scott
082349e68e Merge pull request #3014 from alphagov/cache-organisations
Cache organisations, not just domains in Redis
2019-06-14 16:55:53 +01:00
Chris Hill-Scott
08fe6865bd Merge pull request #2944 from alphagov/allow-replace-revoked-key
Allow replacing a revoked key
2019-06-14 16:55:45 +01:00
Leo Hemsted
d752a6335f make sure tests all populate the platform admin field
it's always returned by the API
2019-06-14 15:14:00 +01:00
Leo Hemsted
c724f84c23 change wording of platform admin toggle to positive rather than negative
CHS Approved Wording 👍

also rename suppress_platform_admin -> disable_platform_admin_view in
the backend, as suppress is a kinda weird word.
2019-06-14 15:13:56 +01:00
Leo Hemsted
7b02cb72c6 add option to suppress platform admin temporarily
so that platform admins (us) can view pages as regular users do easily.
Simply adds a flag in the session cookie that overrides the actual
platform admin flag on the user model if set. This way it's safe, since
this only downgrades existing functionality, so if someone managed to
alter it they could only get less permissions, not more.

You can change this value from the user profile page if either:

* you're a platform admin
* the flag is set (to any value) on the cookie.

This slightly weird check means that we don't check the underlying
`user._platform_admin` flag anywhere in the code, even when toggling
the suppression.
2019-06-14 11:59:12 +01:00
Chris Hill-Scott
8f9ade7a8b Cache organisations, not just domains in Redis
This should make the ‘All organisations’ page load a lil’ bit quicker.
Still worth caching the domains separately so the response is smaller
when we only care about domains. This is because the code that uses the
domains is part of the sign up flow, so it’s really important that it’s
snappy.
2019-06-14 11:20:19 +01:00
Chris Hill-Scott
c7325576d6 Merge pull request #3008 from alphagov/new-choose-service
Split choose service page into live services and trial mode services
2019-06-13 17:01:19 +01:00
Chris Hill-Scott
588e151d09 Merge pull request #3011 from alphagov/quis-patch-1
Remove debugging short circuit
2019-06-13 17:01:12 +01:00
Chris Hill-Scott
04f6bd8132 Wrap get org methods in class method on model
This means the service and user models have to import one fewer thing,
and matches what we’re doing with the `from_id` class method.
2019-06-13 14:23:02 +01:00
Chris Hill-Scott
edba0c7f5f Rename confusing property
It’s more about the multiple different types of things they can see, not
just that there are multiple things.
2019-06-13 13:47:29 +01:00
Chris Hill-Scott
53f5ebdd48 Add some visual differentiation for null info
We use light grey for stuff like ‘not set’ elsewhere. This knocks it
back a bit so the actual information on the page is more prominent.
2019-06-13 13:47:29 +01:00
Chris Hill-Scott
14a3420fbe Split list of user’s services into live and trial
This gives us as platform admin users a bit more context when we’re
looking at a user’s profile.
2019-06-13 13:47:29 +01:00
Chris Hill-Scott
451fadb1b3 Hide H1 for grid layout
With the `<h2>`s on this page it’s fairly explicit what the page is
listing, so user doesn’t need the context provided by the `<h1>`.
2019-06-13 13:47:29 +01:00
Chris Hill-Scott
8b6b8c6165 Add a grid layout to the choose services page
This allows us to split the page into sections without over-using bold
fonts. And it means that when the user clicks into a service from this
page the column layout stays the same 1/4 – 3/4, rather than jumping
about so much.
2019-06-13 13:47:28 +01:00
Chris Hill-Scott
e31570e93d Refactor to use .belongs_to methods
The view code shouldn’t need to know the internals of a service’s data
structure; the idea of having a service model is to abstract this kind
of thing.
2019-06-13 13:47:28 +01:00
Chris Hill-Scott
1b395c04f3 Go straight into org if no trial mode services
You might still belong to some services, but because they’re live
they’re all in your organisation.
2019-06-13 13:47:28 +01:00
Chris Hill-Scott
71dc650db6 Make user model return a service model, not JSON
This makes it:
- nicer, by having access to sensibly named things like
  `Service.trial_mode` instead of `service['restricted']`.
- less likely to write Jinja code like `service.trail_mode`, which would
  fail silently if `service` was a dictionary
2019-06-13 13:47:28 +01:00