Commit Graph

67 Commits

Author SHA1 Message Date
Pea Tyczynska
5158377b2e Add a get view and template that enable changing team members email 2019-02-21 10:53:23 +00:00
Chris Hill-Scott
afdc749e36 Make ‘Add new’ buttons sticky on more pages
For consistency with the template management page.
2019-02-01 14:25:35 +00:00
Chris Hill-Scott
29830da5e6 Scope live search on team page to name and email
It’s not useful for the search to also be picking up ‘Send messages’ or
‘Signs in with an email link’.
2018-12-03 11:05:10 +00:00
Chris Hill-Scott
8b84bf27e3 Don’t wrap users onto multiple lines
It looks cleaner to truncate instead. You can always see the full email
address by clicking into ‘edit’.
2018-11-22 10:44:09 +00:00
Chris Hill-Scott
901b924e35 Remove redundant variable definition
This unused variable is a hangover from when the permissions
were displayed horizontally in a table.
2018-09-25 17:00:54 +01:00
Tom Byers
47798b218c Make live-search into a component 2018-08-22 17:42:04 +01:00
Chris Hill-Scott
347912876c Relabel existing permissions
Since we have added a new, 5th permission the existing permissions
should be relabelled so that the five make sense as a coherent set.

We especially want to make sure that:
- the labels work against the checkboxes and against the tick/crosses on
  the manage users page (a long time ago this page was layed out
  differently so didn’t have space for full labels)
- there is no confusion between usage and reports

This commit also:
- re-adds a line about what all users can see (‘sent messages’) but
  continues to omit the additional bullet points about templates and
  team members (because we think this is clear enough from reading the
  permissions)
- refactors the `Form` subclass so that the content and order of the
  permissions only have to be defined once
- brings back the ‘permissions’ legend on the `fieldset`
2018-08-09 13:49:06 +01:00
Chris Hill-Scott
646ba6e8c3 Add a ‘See dashboard’ permission
Our research and prototyping around ‘basic view’ found that:
- a lot of users who send messages rarely or never look at the dashboard
  (yet it’s the first page they see when they sign in)
- team managers like the idea of taking away things that users don’t
  need in order to make the interface simpler

We’ve disentangled the simpler way of sending messages from being part
of ‘basic view’. This means we can give managers the option of taking
away the dashboard as an independent choice, not something that’s
wrapped up in a separate ‘view’.

I think that this checkbox is a more straightforward proposition than
‘basic view’ ever was (despite all the work we did to explain it and
develop the nested checkbox pattern). In research users would often
explain the feature back to us as being about hiding the dashboard – we
should try to make Notify operate in terms of concepts that come
naturally to people wherever possible.
2018-08-09 13:49:06 +01:00
Chris Hill-Scott
036923c382 Make a service model and use for permissions
Having the service floating about as JSON is a bit flakey. Could easily
introduce a mistake where you mistype the name of a key and silently
get `None`.

Also means doing awkward things like `if 'permission' in
current_service['permissions']`, whereas for users we can do the
much cleaner `user.has_permission()`.

So this commit:
- introduces a model
- adds a `.has_permission` method similar to the one we have for users
2018-07-30 14:56:36 +01:00
Chris Hill-Scott
bc13ab6bdb Untick ‘basic view’ if invite is cancelled
If an invite is cancelled then the user no longer has permission to do
anything, so we shouldn’t show the green tick. We already do this for
other permissions; this makes the ‘basic view’ row consistent.
2018-07-11 16:19:59 +01:00
Chris Hill-Scott
0008d7cda7 Rename ‘caseworker’ to basic view on team members
Missed this in https://github.com/alphagov/notifications-admin/pull/2146
2018-07-10 12:17:22 +01:00
Chris Hill-Scott
f4d2958d58 Allow setting of caseworking on a user
This commit changes the form that the user sees when inviting or editing
another user, if the service has the ‘caseworking’ permission set.

This will allow creating a new type of user, one who only has the
`send_messages` permission, without the `view_activity` permission.

We are doing this because we think there are a number of services with a
lot of users who don’t need to see the dashboard, or the other team
members, and that we can make a simpler interface for these users.
2018-07-05 11:47:30 +01:00
Leo Hemsted
4a08cf81e7 remove admin_override from all has_permissions usage
as previously pointed out, it's not used anywhere.
2018-03-06 13:08:07 +00:00
Leo Hemsted
3ae815528c add restrict_admin_usage arg to admin_override
rather than allow admins to do everything specifically, we should
only block them from things we conciously don't want them to do.
This is "Don't let platform admins send letters from services they're
not in". Everything else the platform admins can do.

This is step one, adding a restrict_admin_usage flag, and setting that
for those restricted endpoints around creating api keys, uploading CSVs
and sending one-off messages.

Also, this commit separates the two use cases for permissions:
* user.has_permission for access control
* user.has_permission_for_service for user info - this is used for
  showing checkboxes on the manage-users page for example

With this, we can remove the admin_override flag from the permission
decorator.
2018-03-06 13:08:06 +00:00
Leo Hemsted
09824078dd remove all instances of db style permissions
lots of renaming of send_texts/emails/letters to send_messages, and
manage_settings/users to manage_service
2018-03-06 13:08:06 +00:00
Chris Hill-Scott
2221a8ca48 Change display of cancelled users, fix edit link
It’s confusing showing green ticks for cancelled invites. This commit
changes the appearance so that only pending or active users (ie those
that could actually do some damage) get green ticks.

Also fixes missing edit links caused by instances of `User` having
`.state` but instances of `InvitedUser` having `.status`.

Right now these are two separate lists. Which makes it harder to add
improvements that will make large numbers of users easier to manage.
2018-01-29 15:23:54 +00:00
Chris Hill-Scott
eaaca9dd96 Add search bar to team member list
Another thing we did for templates, when they started to get
unmanageable, was add a find-as-you type search. We’ve observed real
users interacting with this to great effect, so I think it makes sense
for users too.

Like for templates, it only shows up when there are more than 7, so that
it’s not clutter for teams who don’t have a lot of members.
2018-01-27 09:42:28 +00:00
Chris Hill-Scott
c20884003f Rename pending to invited
Pending is a bit of a technical word. Pending what? Invited is clear
enough, and doesn’t introduce a new concept.
2018-01-27 09:36:32 +00:00
Chris Hill-Scott
79ddf657bf Combine invited and active team members
Right now these are two separate lists. Which makes it harder to add
improvements that will make large numbers of users easier to manage.
2018-01-27 09:35:13 +00:00
Chris Hill-Scott
d9a63c07a9 Refactor user permissions to use args, not list
This makes the interface a bit cleaner and less verbose.
2018-01-16 11:22:57 +00:00
chrisw
c6ea90a7d8 Email auth for inviting members and editing permissions 2017-11-02 12:38:01 +00:00
Chris Hill-Scott
d7370c1816 Rename manage templates permission
‘Add and edit’ is the language we use next to the checkbox.

Also helps disambiguate it from the ‘manage service’ permission.
2017-09-15 11:36:00 +01:00
Chris Hill-Scott
0092c8bb33 Change manage team layout to fit extra option
We’ve moved from three to four permissions. Four permissions don’t fit
in the exiting horizontal layout.

This commit makes the permissions stack vertically instead.

This approach has some downsides:
- makes the permissions less easy to scan vertically
- makes them take up a lot more space (and at lives services, most of
  them have somewhere around 15 team members)

But I think for now it’s better than any horizontal alternative that I
tried.
2017-08-17 17:53:12 +01:00
Chris Hill-Scott
d591b9aeb9 Add a fourth, ‘manage templates’ permission
We’ve seen from research (a long time ago) that the ‘manage service’
permission is too broad, and gives too much control to someone who only
needs the ability to edit templates. In other words, editing content
should be its own, separate permission, rather than being rolled up
into manage service.

Since this is already disaggregated on the API side, making this change
just means changing the mapping on the admin side and adding an extra
checkbox on the invite/edit page. Which is what this commit does.

So for now, an existing user who has the manage service permission gets
both manage service and manage templates (ie no change to what they can
do). Newly invited users will get to choose if they have both, either,
or neither.
2017-08-17 17:47:30 +01:00
Chris Hill-Scott
726e91bebb Make existing tests use ``client_request fixture
This commit makes the existing tests around user permissions less
verbose by using the new `client_request` fixture.

This fixture takes care of:
- setting up a service
- asserting that the response is `200`

It also tests that the page titles, some of which didn’t match with the
`<h1>`s, so this commit also fixes that mismatch.
2017-08-17 17:42:40 +01:00
Chris Hill-Scott
f150e2be12 Refactor on/off table fields into component
There’s a lot of repeated code in our Jinja templates for the settings
page.

We already have a `boolean_field` component, but it’s not used anywhere
(it was just lifted from Digital Marketplace).

So this commit changes the `boolean_field` component to be useful for
our on/off use case, and wires it into the settings page.
2017-06-07 15:07:20 +01:00
Chris Hill-Scott
135ff1ee77 Include service name in page <title>
In pages specific to a service (e.g. dashboard and sub pages) the title
needs to distinguish which service it applies to. This is mainly to give
context to screen reader users who could be managing multiple services.

Implementing this uses template inheritance:

`page_title` includes `per_page_title` includes `service_page_title`

‘GOV.UK Notify’ is inserted into every page title.

Pages that set `service_page_title` get the service name inserted too.
2017-02-14 11:53:53 +00:00
Rebecca Law
5a50c945c7 Allow platform admin to edit users. 2016-09-30 11:48:16 +01:00
Chris Hill-Scott
93a1f194e9 Remove ‘active’ title on team page
This section of the page is covered by the ‘Team members’ `<h1>`.

Only the invited users is a special case that needs its own title.
2016-09-07 15:16:02 +01:00
Chris Hill-Scott
7edff47410 Put email address on team page
Right now, a user can change their name and masquerade as someone else
and the service manager has no way of telling who is who.

This is also true for platform admins, where they can see the users of
a service but can’t identify which department they are from.

This commit adds a user’s email address next to their name to remedy
this.
2016-07-07 12:43:37 +01:00
Chris Hill-Scott
f9ebb337e3 Tidy layout of team page
The team page was a bit of a mess:

- invited and active tables didn’t line up
- lots of things were wrapping onto two lines
- the empty fields for when a user didn’t have permissions looked broken

This commit splits each row of the table (not actually a table any more)
onto two lines. First line has the user’s info, second has their
permissions and any associated actions.
2016-07-07 12:43:35 +01:00
Martyn Inglis
29fd69258c Added invite user button for platform admins on any service 2016-06-03 11:10:38 +01:00
Chris Hill-Scott
8a68b4aa80 Indicate which user is you on manage team 2016-04-06 13:46:55 +01:00
Chris Hill-Scott
39e94ac8ec Add row numbers to tables
When a table is showing the contents of a CSV file, it should look
something like a spreadsheet.

The minimally skeuomorphic way to do this is by adding row numbers.

This commit doesn’t
- make the row numbers monospace (it’s barely noticeable and doesn’t
  reflect what actual spreadsheets do)
- make the first column heading ‘Row’ (again, doesn’t reflect how actual
  spreadsheets work, and takes up more valuable space)
2016-04-06 11:31:37 +01:00
Nicholas Staples
c31c55666b Added current_service to flask context and template context.
Fix all tests and conflicts.

Removed comment line.
2016-04-04 17:01:20 +01:00
Chris Hill-Scott
42cb4b0d99 Remove the verbs from the navigation
Because ‘Send text messages’ isn’t very helpful if you’re looking to
edit a template.

It also helps front-load the navigation, ie ‘Team’ is the first word,
rather than the more generic ‘Manage’.
2016-04-04 09:33:29 +01:00
Rebecca Law
99bd94799e Remove access_developer_docs permission, it doesn't make sense to need it.
Add view_activity permission when the permissions are being editted.
2016-03-29 17:33:12 +01:00
Rebecca Law
b79901fe28 With the addition of has_permissions on the dashboard, jobs, and manage_users pages a platform admin user or a users with no permissions on the service could no longer see the page.
A new permission has been added, view_activity, to resolve this issue.
Another pull request in notifications-admin will be required to update all users with a default permission of view_activity.
2016-03-29 13:23:36 +01:00
Nicholas Staples
f3689cc113 Functionality added and all tests working.
Update correct use of permissions form.
2016-03-23 10:56:14 +00:00
Chris Hill-Scott
0435015211 Merge pull request #332 from alphagov/make-permissions-checkboxes
Set permissions with checkboxes, not yes/no inputs
2016-03-22 17:42:34 +00:00
Chris Hill-Scott
c138a4a5e0 Set permissions with checkboxes, not yes/no inputs
The yes/no pattern didn’t work too well, because:
- it didn’t read naturally as a question and answer
- often users left them completely unclicked if they didn’t want to set
  the permission (rather than clicking no)

This commit changes both the invite and edit user pages to use
checkboxes to set permissions. If also rewords these pages to read more
naturally, and explain what the permissions mean.

This meant changing some of the view logic around invites and
persmissions, and I ended up refactoring a bunch of it because I found
it hard to understand what was going on.
2016-03-22 17:18:43 +00:00
Nicholas Staples
42eac5c359 Merge with master. 2016-03-21 16:48:40 +00:00
Nicholas Staples
47786fa8e1 Pete request update. 2016-03-21 15:39:01 +00:00
Nicholas Staples
a482fac02a Manage team, now has a view only version of the page which requires no permissions. 2016-03-21 15:25:19 +00:00
Rebecca Law
13d9acf7dd Completion of the platform admin user story. 2016-03-18 16:20:37 +00:00
Chris Hill-Scott
eea8ae5be4 Move ‘new thing’ buttons alongside heading
On the send messages and manage team pages we have big green buttons for
adding/inviting a new template or team member.

On the add template page it was at the bottom, and often got missed.

On the manage team page it was at the top, but maybe too prominent because it’s
big and green.

This commit tries putting it in the top right of the page instead (except when
the template page is empty, in which case it’s unchanged).
2016-03-14 10:39:53 +00:00
Nicholas Staples
b3249831cf Fix up front end so you can navigate to the edit page. 2016-03-03 15:43:53 +00:00
Nicholas Staples
9e710711cb Updated form and fixed existing tests. 2016-03-03 13:00:12 +00:00
Rebecca Law
65f4506028 Show status of invited user on manage team page. 2016-03-02 09:28:33 +00:00
Rebecca Law
bfea4a42bc Merge branch 'master' into cancel-invited-user
Conflicts:
	app/notify_client/invite_api_client.py
	tests/app/main/views/test_manage_users.py
2016-03-01 18:01:20 +00:00