Commit Graph

154 Commits

Author SHA1 Message Date
Leo Hemsted
d5446774fa letter branding text fields should be optional 2019-02-07 11:38:20 +00:00
Leo Hemsted
a1caf77b0e use new letter branding instead of dvla organisation id
new code is copied stylistically from the email branding patterns.
Instead of `service.dvla_organisation`, there's now
`service.letter_branding` and `service.letter_branding_id`. However,
unlike email branding we're not currently showing a preview of the
logo. That can come later when we work out how we want to do it.
2019-02-07 11:30:18 +00:00
Pea Tyczynska
fe6b73b8dc Remove service postage setting and choose_postage switch 2019-02-04 14:55:16 +00:00
Chris Hill-Scott
33f318afec Remove platform admin toggles for email/SMS
Users can do this themselves now.
2019-02-01 18:33:32 +00:00
Chris Hill-Scott
7905b29d64 Remove button to toggle folders on/off
We don’t need it now that everyone has folders.
2019-02-01 18:33:31 +00:00
Chris Hill-Scott
94ce9a76fe Merge pull request #2692 from alphagov/self-serve-channels
Let users switch channels on and off by themselves
2019-01-30 13:46:39 +00:00
Chris Hill-Scott
d867ee73a7 Grey-out ‘Not set’ for email reply-to address
The `default_reply_to_email_address` variable was not set anywhere so
the conditional was having no effect.
2019-01-29 16:40:44 +00:00
Chris Hill-Scott
3b15b04fc2 Let users switch channels on and off by themselves
We let people do this for letters already. We should let them do it for
emails and texts too, rather than have to email us.
2019-01-29 16:05:32 +00:00
Chris Hill-Scott
309de074c3 Don’t give postage choice on service and template
We are moving from the postage being set on the service to being set on
the template. Once a service has been migrated to have the new
permission they should no longer be able to set the postage at a service
level, only at the template level.
2019-01-15 12:06:56 +00:00
Pea Tyczynska
97058d3c5b Add service setting switch to choose postage per template 2018-12-27 18:05:30 +00:00
Chris Hill-Scott
d2d22cc425 Make message limit dynamic
Because we sometimes bump it in exceptional circumstances.
2018-12-17 15:37:42 +00:00
Chris Hill-Scott
84a3c80eb4 Launch first class postage feature
This commit makes it available to everyone. Available just means they
can select 1st class for all their letters, if they want it.
2018-11-26 15:53:14 +00:00
Chris Hill-Scott
1e2608d2e0 Refactor settings page to use service model
There’s a lot of code in service settings which:
- talks to the API directly through the clients
- passes that information through to the Jinja template

By encapsulating this logic in the service model:
- the Jinja template can access the data directly
- the logic can be reused across multiple methods
2018-10-30 15:07:52 +00:00
Chris Hill-Scott
b48305c50d Don’t have service model inherit from dict
Inheriting from `dict` has some unexpected side effects that don’t
happen with plain object. The one we want to avoid right now is that
a dict doesn’t seem to implement `__dict__` in a normal way, which
is required by `werkzeug.utils.cached_property`.
2018-10-30 14:55:00 +00:00
Katie Smith
ae79a3ac75 Add platform admin button for edit_folders permission
Added a platform admin button to allow / remove the edit_folders
permission for a service.
2018-10-25 12:09:26 +01:00
Katie Smith
fee47aa348 Hide Postage setting when letters are not enabled for service
We don't show the sender addresses and letter branding on the settings page
if a service doesn't have letters enabled, so we should also hide the
postage for services that can't send letters.

(Postage can only be seen by Platform Admin users at the moment, but this will
change later).
2018-09-20 15:46:32 +01:00
Katie Smith
9660f372f3 Change naming in code to use 'postage'
Renamed everything that was previously called 'letter class' or 'postage
class' to 'postage', which is the new name we have decided to use.
2018-09-19 09:20:09 +01:00
karlchillmaid
02ad9ed0a3 Updated postage labels
Updated postage labels
2018-09-18 11:13:32 +01:00
Katie Smith
de9759b99a Add letter class row to settings page, visible to platform admin
Added a new row to the settings table, 'Post class', which shows the
default letter class of a service and is only visible to Platform Admin.

Also added a new page to enable Platform Admin users to change the
default letter class for a service - this only has two options at the
moment, 1st class only and 2nd class only.
2018-09-18 10:31:01 +01:00
Chris Hill-Scott
896072f169 Remove reference to service branding on settings
This attribute is deprecated in favour of an attribute on the
`email_branding` itself.
2018-08-30 09:20:44 +01:00
Chris Hill-Scott
d7f42a868c Merge pull request #2244 from alphagov/request-letter-branding
Tell people they can have their logo on letters
2018-08-29 15:52:58 +01:00
Chris Hill-Scott
0b86a12fdd Tell people they can have their logo on letters
At the moment there’s nothing in Notify that says the logo on letter
templates can be changed from ‘HM Government’. While some people guess
that it’s possible, or are motivated enough to enquire, others might be
assuming that the branding can’t be changed (and thus deciding Notify
letters aren’t for them).

In the future we should make this process slicker (eg with a file
upload) but the easiest, quickest improvement to make for now is:
- let people know that the branding can be changed
- direct them to support if they do want to change it
2018-08-21 09:56:20 +01:00
karlchillmaid
e18f1727d1 'Email reply-to addresses' updated
Updated 'reply-to address' to include a hyphen
2018-08-20 16:48:21 +01:00
Katie Smith
979fd9bbe4 Allow service contact details to be phone number, email or url
Service contact details are needed if the upload document permission is
enabled - this used to be a link but services can now choose to use a
link, email address or phone number. The form to add or change service
contact details now gives these options and validates the data according
to the type of contact details provided.

When validating phone numbers we can't use the existing validation
because we want to allow landlines too, so there is a basic check that
the phone number is the right length and doesn't include certain
characters.
2018-08-13 10:33:39 +01:00
Chris Hill-Scott
fdf3670661 Remove basic view setting and preview 2018-08-09 17:51:34 +01:00
Chris Hill-Scott
4256c56b7a Merge pull request #2202 from alphagov/hide-branding-request-api-permission
Hide email branding change link if the user doesn’t have the manage service permission
2018-08-09 09:36:54 +01:00
Chris Hill-Scott
cecfe86e73 Hide email branding change if not manage service
If you have the API keys permission you can see the settings page. But you 
can’t change or request stuff, like email branding. So we shouldn’t show the 
link that suggests you can.
2018-08-06 11:25:19 +01:00
Rebecca Law
be51a668cf Fix capitalisation on Data Retention 2018-07-17 15:56:28 +01:00
Rebecca Law
4b8b571a87 Adding views to view, add and edit service data retention policies.
Only visible to a platform admin.
A service can have a custom number of days to retain the notification data for each notification type.
2018-07-17 14:39:04 +01:00
Rebecca Law
13d05c5461 Allow a platform admin user to set flexible data retention for a service for a specified notification type.
Still a work in progress
2018-07-13 16:47:26 +01:00
Chris Hill-Scott
2f40ddae20 Remove platform admin toggle for basic view
Since platform admins can use the new settings page, this commit:
- links to that page
- removes the platform-admin-only endpoint that switches basic view on
  and off
2018-07-10 11:45:50 +01:00
Chris Hill-Scott
a6662b3f59 Add basic view to the settings page
This commit adds:
- a row to the settings page…
- …which links to a page explaining what basic view is

The new row (and link) will only appear for services who already have
the feature switched on. This is because we are not launching the
feature yet, so it shouldn’t be available to just anyone.
2018-07-10 11:44:40 +01:00
Chris Hill-Scott
a35ce8eb89 Add Jinja macro for a row on the settings page
Often we show/hide these rows based on what permissions a service has.
This commits refactors that check into a reusable macro, rather than
having to write the same `if` statements all the time.
2018-07-10 11:44:40 +01:00
Chris Hill-Scott
5794a54385 Rename ‘caseworker’ to ‘basic view’
‘Caseworker’ was a bad name because it:
- suggested that Notify might be expanding into case management
- may or may not map to someone’s actual role, in a confusing way (this
  is why ‘manager’ is also a bad name)

‘Basic view’ is the best name we could come up with because:
- it describes the purpose of feature, not the user
- a ‘view’ changes what you can _see_ as much as it changes what you can
  do

Admin remains a good word – in research users self-describe their use
of Notify in using it. This commit makes the name ‘admin view’ to match
‘basic view’.

This also means we can hide the legend for this fieldset because the
choices are self-explanatory.
2018-07-09 10:39:09 +01:00
Chris Hill-Scott
650f4cc3d8 Add platform admin button to enable caseworking
Eventually the ability to have the caseworking view for your service
will be self-service. But while we’re still building it only we should
be able to enable it, for our own testing purposes.

So this commit adds platform admin functionality to switch the feature
on and off for our services.
2018-07-05 11:47:29 +01:00
Katie Smith
0633af4e4a Truncate contact link text on settings page
The contact link on the settings page should be truncated instead of the
text being wrapped and overflowing on to multiple lines. This adds in an
option to the text_field macro to truncate long text fields. This
setting has been used to truncate the API callback URLs too on the
services/<service_id>/api/callbacks page.
2018-06-12 10:21:24 +01:00
Katie Smith
8a559aceb5 Display contact link on service settings page
The contact link for the service now gets displayed on the service
settings page if the service has the 'upload_document' permission. There
are no changes to the appearance of the service settings page if a
service does not have the 'upload_document' permission.
2018-06-12 10:21:24 +01:00
Chris Hill-Scott
79314de817 Add page where users can say they want branding
At the moment branding is an undocumented feature. We get a bunch of
support tickets from teams asking its possible.

This commit:
- lets people know it’s possible, and what the options are
- is the first step towards making this process as self-service as
  possible

In some cases we will be able to infer a user’s organisation from there
email address, and Google image search their logo. So the experience for
them is that they press a button and government just sorts it out for
you (also known as "the dream").

In other cases we will have to get back to people asking for a copy of
their logo, or to find out about their service, but this is what we have
to do at the moment anyway.
2018-05-18 16:24:20 +01:00
Alexey Bezhan
f663092cf4 Add a button for switching 'upload_document' permission
Adds a platform admin button to the service settings to turn on/off
'upload_document' service permission. The permission allows uploading
documents to document-download-api through the post notification API
endpoint.
2018-05-01 16:53:21 +01:00
Leo Hemsted
023c4121b3 separate urgent and p1 concepts in feedback.
p1 == "should notify team be alerted of this (via pagerduty)"
urgent == "should the user be told we'll look at it"

* If it's in office hours, it's always urgent. It's never a P1 because
  we'll notice it anyway
* If it's outside of office hours, it's urgent and P1 if it's severe,
  otherwise it's neither
2018-04-27 14:20:15 +01:00
Leo Hemsted
b37613cbc6 show organisations on the choose-service page (name TBD)
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.
2018-03-14 15:39:55 +00: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
Leo Hemsted
7ddad7c99e dont use has_permissions to check for platform admins
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.
2018-03-06 13:08:06 +00:00
Chris Hill-Scott
103a36a5da Hide ‘request to go live’ from API only users
Users who have the ‘manage API keys’ permission can see the settings
page. But they don’t have permission to request to go live.

At the moment they can still see the link, though clicking it gives them
a 403 error. This commit changes it so that they can’t see the link, and
tells them who they should speak to about going live (their manager).
2018-02-26 08:53:45 +00:00
kentsanggds
b7b25c7d16 Merge pull request #1894 from alphagov/ken-add-precompiled-letter-button
Add button to toggle precompiled letters on/off
2018-02-22 11:40:43 +00:00
Ken Tsang
df41fcfdd0 Add button to toggle precompiled letters on/off 2018-02-21 17:41:19 +00:00
Chris Hill-Scott
4e2b4b5ac7 Rename endpoint
Every endpoint in this file is to do with a service. Putting service in
the name is redundant.
2018-02-20 12:27:53 +00:00
chrisw
14b80622b7 link-service-to-organisations-tweaks 2018-02-20 11:30:46 +00:00