Commit Graph

26 Commits

Author SHA1 Message Date
Chris Hill-Scott
bd9e127e57 Sum up usage for an whole organisation
We invoice on a per organisation basis, so it’s useful to know the per
organisation figures without needing to do any spreadsheet-fu.
2020-02-28 12:17:49 +00:00
Rebecca Law
4b11d776ee Add usage stats to organisation page. 2020-02-26 13:24:18 +00:00
Katie Smith
e4134072d9 Reduce the errors related to user fixtures
We were using user fixtures in a lot of parameterized tests, but this is
no longer allowed in Pytest 5. To avoid having to split up the parametrized
tests (which would make the test files a lot longer and slightly more
difficult to read) this commit creates functions which return various types
of user json so that we can use these as the test parameters instead.
2019-12-19 16:59:07 +00:00
Katie Smith
aec3ccff3a Fix navigation tests to not call app_() directly 2019-12-19 14:24:25 +00:00
Tom Byers
2ded09a8b9 Fix tests broken by GOV.UK Frontend template
Fix test broken by removal of GOV.UK logo image
- tests/app/main/views/test_notifications.py

Fix tests that ref GOV.UK template CSS files
- tests/app/main/views/test_index.py

Fix test broken by govuk-visually-hidden
- tests/app/main/views/test_send.py

Fix tests broken by header menu link -> button
- tests/app/main/views/test_service_settings.py
- tests/app/main/views/test_template_folders.py

Fix tests broken by removing div#content
- tests/app/main/views/accounts/test_choose_accounts.py
- tests/app/test_navigation.py

Remove references to GOV.UK CSS
- tests/app/main/views/test_index.py

Fix tests querying the header navigation
- tests/app/test_navigation.py
2019-11-27 14:15:32 +00:00
Tom Byers
e09d510ab8 Revert "Replace govuk template with govuk frontend components - rewrite" 2019-11-26 12:14:09 +00:00
Tom Byers
9ac9c6d7d6 Fix tests broken by GOV.UK Frontend template
Fix test broken by removal of GOV.UK logo image
- tests/app/main/views/test_notifications.py

Fix tests that ref GOV.UK template CSS files
- tests/app/main/views/test_index.py

Fix test broken by govuk-visually-hidden
- tests/app/main/views/test_send.py

Fix tests broken by header menu link -> button
- tests/app/main/views/test_service_settings.py
- tests/app/main/views/test_template_folders.py

Fix tests broken by removing div#content
- tests/app/main/views/accounts/test_choose_accounts.py
- tests/app/test_navigation.py

Remove references to GOV.UK CSS
- tests/app/main/views/test_index.py

Fix tests querying the header navigation
- tests/app/test_navigation.py
2019-11-25 11:43:30 +00:00
Tom Byers
e02f94f238 Revert "Replace govuk template with govuk frontend components" 2019-11-25 10:37:35 +00:00
Tom Byers
73f7292840 Fix tests broken by GOV.UK Frontend template
Fix test broken by removal of GOV.UK logo image
- tests/app/main/views/test_notifications.py

Fix tests that ref GOV.UK template CSS files
- tests/app/main/views/test_index.py

Fix test broken by govuk-visually-hidden
- tests/app/main/views/test_send.py

Fix tests broken by header menu link -> button
- tests/app/main/views/test_service_settings.py
- tests/app/main/views/test_template_folders.py

Fix tests broken by removing div#content
- tests/app/main/views/accounts/test_choose_accounts.py
- tests/app/test_navigation.py

Remove references to GOV.UK CSS
- tests/app/main/views/test_index.py

Fix tests querying the header navigation
- tests/app/test_navigation.py
2019-11-22 17:45:45 +00:00
Chris Hill-Scott
37f0c4459b Prefer shorter URL
Flask will pick the first route that matches. Decorators get applied
from innermost to outermost.

So if the same endpoint is served at `/abc` and `/123` the one used
when `url_for` is generating a URL is whichever decorator is lowest
(in terms of line number).

It doesn’t functionally make a difference, but it’s causing the
functional tests to fail at the moment. And shorter URLs are nicer, so
I think it makes sense to change here, rather than change the tests.
2019-11-13 15:13:57 +00:00
Chris Hill-Scott
f9094cb98b Rename uploaded files to uploads
Uploads is the name that we’ve been using in the prototype.
2019-10-25 12:48:30 +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
eaa7af8692 Make navigating organisations a bit easier 2019-03-22 14:23:25 +00:00
Leo Hemsted
078595da9d show list of template folders on the choose templates page
Not linking anywhere yet. Also not sorted, and not filtered by
parent_id.
2018-11-06 13:13:13 +00: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
c551ce9a42 Show jobs in basic view
There are some teams who send jobs on a daily/weekly basis. They have
team members who only use Notify for this purpose. So they would
probably benefit from basic view, because they don’t need to see the
dashboard.

This commit:
- adds a new item (uploaded files) to the basic view navigation for
  teams that have sent at least one job
- makes the job pages visible to basic view users

I think we should do this now, rather than as a later enhancement to
basic view. We only have one chance to announce the feature, so teams
who do send jobs may otherwise discount it as not useful for them and
the opportunity to have them use it is lost.
2018-08-01 10:45:02 +01:00
Chris Hill-Scott
ca9fe6c8f6 Rename ‘Send a message’ to ‘Templates’ in basic view
From Karl:

> Templates – this should be consistent with Admin view. Users may
> switch from Basic to Admin view (or vice versa), they will also
> interact with users who have a different view or permissions to them.
> Neither should have to learn new interfaces and language if possible.

> ‘Send a message’ was a nice, active label – but Notify options aren’t
> usually actions. If we’re going to change this we should be consistent
> across both Admin and Basic views.

> For the same reason, I have rejected ‘see’, ‘search’ and ‘view sent
> messages’. It will be interesting to see in user testing whether users
> read ‘sent messages’ as ‘send messages’.
2018-07-13 17:02:27 +01:00
Chris Hill-Scott
b0cb9ff58e Add sent notifications page for caseworkers
The other task that caseworkers have to do (much less often than sending
messages) is look at the messages which they’ve sent. The reason for
doing this is usually to find a specific message which someone has
complained about.

This commit adds:
- a page where they can do that
- a navigation item so they can get to that page

We reckon that because this is about finding specific messages, not
reporting that it’s fine to mush all the channels (email, text, letter)
into one table.
2018-07-05 11:53:42 +01:00
Chris Hill-Scott
84de1c5625 Let caseworkers send one off messages
The main task that we think ‘caseworker’ users do is send one off
messages.

So this commit:
- makes sure users who don’t have the `view_activity` permission (ie
  not ‘admin’ users) can still send messages
- adds navigation so that these users have a place to go from which to
  start the process of sending a one off message
2018-07-05 11:53:42 +01:00
Rebecca Law
6bdb8b7210 Rename the method for usage and update the tests. 2018-05-29 15:31:40 +01:00
Rebecca Law
c721c40ec7 Ignore temporary endpoint in navigation test 2018-05-16 13:23:49 +01:00
Chris Hill-Scott
4cc8f39231 Remove reference to removed endpoints 2018-04-27 16:50:09 +01:00
Chris Hill-Scott
9f5d42a788 Add selected navigation for organisations page
To match how the navigation works for a single service.
2018-04-25 13:17:47 +01:00
Chris Hill-Scott
8a7525a809 Highlight selected item in proposition navigation
It is standard practice when using GOV.UK template to highlight the
selected navigation item in the propositional navigation (black bar) by
colouring it blue.

This commit adds a new subclass of `Navigation` with the mapping needed
to decide which pages belong to which item in the navigation (or none
at all).
2018-04-25 11:30:39 +01:00
Chris Hill-Scott
e1fd63e184 Rewrite navigation as a class
Because we have multiple navigations, which will share the same methods
(by subclassing) but different mappings of navigation items to endpoints
by overriding the `.mapping` and `.exclude` attributes.
2018-04-25 11:15:13 +01:00
Chris Hill-Scott
1fba5d186d Highlight selected navigation item
In research I’ve sometimes seen people click the wrong nav item. I
reckon that people’s concept of which pages live behind which navigation
items isn’t very strong.

We can reinforce this relationship by showing, for every page, which is
the corresponding nav item. The conventional way of doing this is either
with some kind of emphasis, typically colour or bold. I’ve gone for bold
because colour would be weird.

---

The implementation of this is quite loosely coupled to our application
code because:
- our application code is not well structured (eg we don’t make any use
  of blueprints)
- spreading this change across lots of files in our application would
  make it harder to test without actually hitting each endpoints; such
  tests would be slow and verbose

So I’ve gone for more of a meta approach. Rather than testing that each
endpoint has a specific navigation item selected, I’ve gone for
validating that:
- all endpoints being mapped to are real
- all endpoints have _a_ selected navigation item (or are specifically
  excluded)

This means that it’s impossible to add, change or remove an endpoint
without also updating which navigation item should be selected. And the
actual mapping is so declarative that it testing it would be redundant.
2018-04-25 09:37:35 +01:00