Commit Graph

4954 Commits

Author SHA1 Message Date
Chris Hill-Scott
cff009bc0d Run isort 2019-03-25 11:23:58 +00:00
Chris Hill-Scott
9e27e4e510 Merge pull request #2869 from alphagov/update-dependencies
Update pyexcel, pyexcel-io and werkzeug
2019-03-25 11:16:45 +00:00
Chris Hill-Scott
db3cee63ba Update call to proxy fix to use new method signature
Old method:

```python
ProxyFix(app, num_proxies=1)
```
https://werkzeug.palletsprojects.com/en/0.14.x/contrib/fixers/#werkzeug.contrib.fixers.ProxyFix

This uses forwarded values for `REMOTE_ADDR` and `HTTP_HOST`.

New method:
```python
ProxyFix(app, num_proxies=None, x_for=1, x_proto=0, x_host=0, x_port=0, x_prefix=0)
```
https://werkzeug.palletsprojects.com/en/0.15.x/middleware/proxy_fix/#module-werkzeug.middleware.proxy_fix

Setting `x_for=1` preserves the same behaviour as `num_proxies=1`.
Setting  `x_proto=1` and `x_host=1` will cause `REMOTE_ADDR`,
`HTTP_HOST`, `SERVER_NAME` and `SERVER_PORT` to be forwarded.

So we will be forwarding `SERVER_NAME` and `SERVER_PORT` which we
weren’t before, but we think this is OK.
2019-03-25 11:03:48 +00:00
Chris Hill-Scott
50bb20ad32 Allow up to 20 domains per organisation
The most we have in the spreadsheet is 18
2019-03-22 16:27:30 +00:00
Chris Hill-Scott
8b81d3594a Prevent duplicate domains 2019-03-22 16:10:34 +00:00
Chris Hill-Scott
de68d720c7 Make all services for an organisation available to platform admin users 2019-03-22 14:23:25 +00:00
Chris Hill-Scott
eaa7af8692 Make navigating organisations a bit easier 2019-03-22 14:23:25 +00:00
Chris Hill-Scott
936883bf7b Allow editing of an organisation’s details
Adds a user interface for updating all the columns added in
https://github.com/alphagov/notifications-api/pull/2368

Sorry for the mega commit 😓
2019-03-22 14:23:24 +00:00
Katie Smith
c675925fd1 Upgrade pyexcel-io, which also upgrades Werkzeug
Upgraded pyexcel-io from 0.5.14 to 0.5.16. This change causes Werkzeug
to be upgraded from 0.14.1 to 0.15.1 which requires some changes:

* ProxyFix now needs to be imported from a different location
* The status code of RequestRedirect has changed from 301 to 308. Since
status code 308 is not currently supported on Internet Explorer with
Windows 7 and 8.1, this subclasses RequestRedirect to keep the status
code of 301.

changelog: https://werkzeug.palletsprojects.com/en/0.15.x/changes/#version-0-15-0
2019-03-22 14:18:44 +00:00
Pea (Malgorzata Tyczynska)
307e959fd6 Merge pull request #2862 from alphagov/show-templates-across-user-folders
When replying to inbound sms show templates in all user's folders
2019-03-22 14:15:13 +00:00
Katie Smith
fe86833549 Merge pull request #2850 from alphagov/add-folder-permissions-when-inviting-user
Set folder permissions when creating and accepting invites
2019-03-22 13:37:27 +00:00
Katie Smith
7654d3c5fd Send folders if inviting user for service without edit folder permissions
If a new user is being invited for a service which doesn't have edit
folder permissions turned on, we want to send all folders for that
service to api.
2019-03-22 13:29:13 +00:00
Pea Tyczynska
0743a68e09 Reflect template folder structure on inbound conversation reply page 2019-03-21 16:06:47 +00:00
Pea Tyczynska
3fc4f6866c When replying to inbound sms show templates in all user's folders 2019-03-21 16:06:47 +00:00
karlchillmaid
358b5054ad Correct typo and remove sub-heading
Correct typo in line 39

Remove sub-heading because it's probably not needed on the Letter validation preview page
2019-03-21 10:28:18 +00:00
Katie Smith
3fb752a009 Delete cached template-folders when adding user to service
The api endpoint to get all template folders also returns the users who
can see each folder.

We need to clear the template-folder cache when adding a user to a service so
that we are not using out of date data about who can see each folder.
2019-03-21 10:17:05 +00:00
Katie Smith
c39f6d49ea Set folder permissions when creating and accepting invites to services
Added a folder permissions form to the page to invite users to services.
This only shows if the service has 'edit_folder_permissions' enabled,
and all folder checkboxes are checked by default. This change means that
InviteApiClient.create_invite now sends folder_permissions through to
notifications_api (so invites get created with folder permissions).

Started passing the folder_permissions through to notifications-api when
accepting an invite. This changes UserApiClient.add_user_to_service to
send folder_permissions to notifications_api so that new users get folder
permissions when they are added to the service.
2019-03-21 10:17:05 +00:00
Katie Smith
782bd34394 Use folder_permissions in the InvitedUser model
We were already invitializing InvitedUser with folder_permissions
(defaulting to None), but this removes the default and adds
folder_permissions to the serialize method. Folder permissions should
now always be returned from api, either as an empty list or a list of
UUIDs.
2019-03-21 10:17:05 +00:00
Rebecca Law
15b74a74fb Merge pull request #2864 from alphagov/fix-delete-folder-with-permissions
Delete folder bug fix
2019-03-21 09:17:06 +00:00
Rebecca Law
980f75029f This is a fix for delete folder when the service has permission to edit folder permissions. 2019-03-20 17:04:44 +00:00
Chris Hill-Scott
0cc566a796 Mark agreement signed by Horsham Council 2019-03-20 16:20:58 +00:00
Chris Hill-Scott
e32f6a92c1 Merge pull request #2860 from fidejoseph/patch-8
Update email_domains.yml
2019-03-20 13:48:44 +00:00
Rebecca Law
42e63667f7 Updated copy on the page.
Added unit tests.
Added error when file is too big.
2019-03-20 11:31:29 +00:00
Pea Tyczynska
6925b36b27 Get templates from all folders a user can see 2019-03-19 17:54:44 +00:00
fidejoseph
118b6981f2 Update email_domains.yml
Onevoice Wales has been added
2019-03-19 16:34:15 +00:00
Rebecca Law
8fd5fa90ff Make the letter-validation-preview url public.
In the short term I have created a duplicate version of the letter-validation-preview so that people from a service can upload a pdf and see why the letter isnot validating.

It's hard to get a precompiled letter to validate when starting to integrate with Notify. This will return the overlay of the letter validation and is now available to the services.
At the moment they send us a PDF to upload.
This is temporary because there is a story to create a one-off flow to get this overlay, that will replace this page.

There is no navigation to this on purpose.
2019-03-19 16:00:15 +00:00
Pea (Malgorzata Tyczynska)
c994552fc2 Merge pull request #2856 from alphagov/edit-members-who-see-folder
Edit members who see folder
2019-03-19 14:11:59 +00:00
Pea Tyczynska
86d8464fa2 Show all users in folder viewing permissions, correct users checked 2019-03-18 17:58:53 +00:00
Pea Tyczynska
e85969f6fa Change folder viewing permissions from manage folder page 2019-03-18 17:52:02 +00:00
Tom Byers
4e7e934e25 Revert "Prevent sticky controls overlapping focus" 2019-03-18 16:38:49 +00:00
Tom Byers
1bdf79bd22 Merge pull request #2843 from alphagov/stop-sticky-overlapping-focus
Prevent sticky controls overlapping focus
2019-03-18 13:31:26 +00:00
Chris Hill-Scott
3b6af41660 Merge pull request #2830 from alphagov/put-current-branding-in-branding-request
Put current email branding in new branding request
2019-03-18 12:05:59 +00:00
Tom Byers
3b0fd4a92c Make controls re-render only when state changed
Adds a guard around all calls to `.render()` after
the first one (which sets the initial state) to
prevent DOM manipulation when not needed.

The original behaviour meant the action buttons
were re-rendered when items from the list of
templates/folders were selected/deselected, even
if the state hadn't changed. This meant, in some
cases, focus was shifted to the buttons when you
were still selecting/deselecting.
2019-03-18 11:25:26 +00:00
Tom Byers
b8c5ab5e38 Handle overlaps in scroll areas on focus events
When focus changes in scroll areas, check the
current focused element isn't overlapped by sticky
elements in the area.

If there are overlaps, mimic what browsers do if
focus moves outside the viewport and scroll to
move the focused element into view.
2019-03-18 11:25:26 +00:00
Tom Byers
b13bc158ac Add object to manage scroll areas for stickys 2019-03-18 11:25:26 +00:00
Tom Byers
d0aee7887b Allow setting of scroll area explicitly
Defaults to scroll area being the parent element
of the sticky element, if not set.
2019-03-18 11:25:25 +00:00
Chris Hill-Scott
37042be763 Mark agreement signed by Wolverhampton Council 2019-03-18 10:59:10 +00:00
Chris Hill-Scott
ce1adce97a Put current email branding in new branding request
When we get a request for new branding it’s helpful to quickly see what
the service’s current branding is, so we can get a better sense of why
they want to change it.
2019-03-18 10:50:49 +00:00
Katie Smith
03c1f27947 Merge pull request #2846 from alphagov/change-permissions-data-format
Change permissions data format
2019-03-18 10:49:47 +00:00
Chris Hill-Scott
906d0cbef8 Merge pull request #2852 from alphagov/camden.gov.uk
Mark agreement signed by Camden Council
2019-03-18 10:43:56 +00:00
Chris Hill-Scott
c034858340 Mark agreement signed by Camden Council 2019-03-18 10:24:25 +00:00
Pete Herlihy
dcc8e3c5d2 Added Gedling Council to signed domains list 2019-03-15 15:12:24 +00:00
Pete Herlihy
6d8a70da51 Updating Warrington with contract signed 2019-03-15 14:59:46 +00:00
Pea Tyczynska
1ab36dd026 Show checkboxes for users with permission to view the managed folder 2019-03-15 14:13:27 +00:00
Rebecca Law
cbc854ff9d Add caa.co.uk 2019-03-15 11:52:24 +00:00
Pea Tyczynska
077a533d81 Subheader for edit users who can see a folder 2019-03-14 17:21:18 +00:00
Katie Smith
d3c256e80a Change format of data sent to api when adding user to service
The endpoint for adding a user to a service in api will now deal with
both user permissions and a user's folder permissions, so this changes
the format of the data we pass through.
2019-03-14 13:36:14 +00:00
Katie Smith
9fbe64bbd7 Allow InvitedUser to be initialised with folder_permissions
The `folder_permissions` property has no effect and is not used yet, but
it needs to be added before we add a `folder_permissions` column to the
`InvitedUser` model in notifications-api. This is because we initialize
the InvitedUser class with the response from notifications-api.
2019-03-14 13:36:00 +00:00
Pea Tyczynska
5aa72daf9b Fix bug 2019-03-12 11:41:52 +00:00
Pea (Malgorzata Tyczynska)
2bc6792c5a Merge pull request #2823 from alphagov/hide-folders-when-no-permissions
Only show folders that user has permission to see
2019-03-11 16:26:56 +00:00