it was only used by the choose service page, and then only in kludgy
ways (eg: creating a list containing one item called "add service"),
so lets rip it out and make this page bespoke. Especially now that it's
changed so much.
if there's a service in the session, go there.
if there's an org in the session, go there.
if the user has one service and no orgs, go there.
if the user has one org and no services, go there.
else go to choose service page
layout as follows
```
ORG_1
SERVICE_1
SERVICE_2
--------------------
ORG_2
--------------------
SERVICE_3
SERVICE_4
--------------------
Add a new service...
```
* org 1 and 2 are organisations that the user has access to.
* Service 1 and 2 are part of org 1, AND the user has access to them.
- There may be more services in org_1 that the user doesn't know
about.
* Service 3 and 4 are services the user has access to.
- They MAY be part of an organisation that the user does not know
about. They can't be part of org_1 or org_2 tho.
this endpoint should probably only be used for the choose-service page
also create an OrganisationBrowsableItem to aid rendering of them
in the front-end.
also, refactor the org tests into a folder to avoid megalith testing
files.
Also hardcode the org id to a variable so it can be referred to from
various places. In conftest there is now ORGANISATION_ID, which
represents an organisation that `active_user_with_permissions` has
access to
platform_admin is a separate concept to permissions, so by removing the
checks for it from the current_user.has_permissions function, we can
simplify things greatly. We already record on the user whether they're
a platform admin anyway.
We have teams who are using the dashboard every day, and being
confronted with this alarming yellow banner. There’s no action they need
to do since they’re only looking at the messages sent.
So this commit removes that banner from the dashboard. It also removes
the CSS and HTML for it from the app entirely because this is the last
remaining place we were using this style of banner.
If someone has no permissions but needs permissions the thing they’re
probably going to need is to send a message or edit a template.
The place they will probably come to is the place where the buttons
would be – users with these permissions are finding the thing they need
to do on this page.
So this commit adds a line to this page which (hopefully) makes it clear
they’re in the right place, but need to go and speak to someone.
* HM Courts and Tribunals - HM Courts & Tribunals Service
* Leicester City Council - Leicester City Council
* Divorce Service Line - HM Courts & Tribunals Service
* Jury Central Summoning Bureau - Ministry of Justice
* ISU - Pembrokeshire County Council
* ESFA pre-16 funding - Department for Education
* ONS Business Continuity Alert System - Office of National Statistics
* HMPO Business Resilience Team - Home Office
* Rugby Borough Council - Rugby Borough Council
* Common Platform - HM Courts & Tribunals Service
The get notifications endpoint needs the template_type for search. The inbox page for inbound sms messages was not passing that through, which caused a 400 response.
This resolves that by passing the template_type to the api.
The email template does this already when formatting the body of the
message. But the spreadsheet preview doesn’t, which means you get lists
like:
- thing
- thing
- None
This commit fixes that.
This was a pre-existing bug, but gonna roll it in with this PR.
as it did not need to be called for standard letters.
Changed the tests to use the mock from get_notification_letter_preview
instead of a generic NotificationApiClient.get. This will hopefully
protect any subsequent changes or calls from not being tested in future.
rendering template. Currently it uses the template from the API to
calculate this which for a precompiled template is always 1.
Gets the PDF and then uses the utils method to get the page count.
* Added logic for precompiled letters
* Added test to test the new path
* Updated existing tests now the path has changed
We were counting users who had the `manage_settings` permission. This
is the old name for it, therefore there would never be any users with
this permission, so the tick would never go green.
The new name for the permission is `manage_service`. This commit fixes
the error, and adds an extra safeguard against something like this
happening again.