Commit Graph

2455 Commits

Author SHA1 Message Date
Tom Byers
a0ecbe473e Merge pull request #2957 from alphagov/add-js-tests-for-list-entry
Add JS tests for list entry module
2019-05-17 13:36:52 +01:00
Alexey Bezhan
cab780b549 Remove edit_folder_permissions service setting (feature flag)
This removes the edit_folder_permission checks from the code, enabling
the folder permissions for all services.

This also fixes folder-related tests to set up appropriate user
permissions.

This should only be merged right after alphagov/notifications-api#2428,
when all other permission stories are done.
2019-05-17 11:20:16 +01:00
Chris Hill-Scott
81b299428f Add tests for editing folder permissions for platform admin users 2019-05-17 11:03:41 +01:00
Alexey Bezhan
5dbd229781 Hide template folder permission editing for platform admin users
Platform admin users can access all template folders, so the folder
permissions form always displays everything as checked for them,
which makes it look like the form isn't actually working. We could
do the check based on folder data, but the field still wouldn't
have any effect on permissions. So instead, we hide it completely
for platform admin users.

Submitting the form will remove any folder permissions from the DB
for the platform admin user (which can still be created by changing
permissions on the template folder 'Manage' page), but that's only
relevant if a user stops being a platform admin but keeps their
Notify services.
2019-05-17 10:46:56 +01:00
Tom Byers
b9a2cc1ec5 Add tests for listEntry.js 2019-05-16 15:36:47 +01:00
Tom Byers
293a7c544f Merge pull request #2972 from alphagov/un-revert-progressively-enhanced-folder-permissions
Add progressively enhanced folder permissions back
2019-05-16 11:45:39 +01:00
Katie Smith
5df3148610 Merge pull request #2954 from alphagov/support-welsh-characters
Allow Welsh characters in SMS templates
2019-05-15 16:34:02 +01:00
Chris Hill-Scott
61b056e490 Merge pull request #2964 from alphagov/different-back-link-from-job
Always go back to previous page from notification
2019-05-15 16:26:34 +01:00
Chris Hill-Scott
9c21541d2e Merge pull request #2955 from alphagov/auto-nhs-org-type
Set org type to NHS if user has NHS email address
2019-05-15 16:26:23 +01:00
Chris Hill-Scott
e6d03ec6f8 Check that users have to choose an org type
If we can’t guess a user’s organisation then they have to choose what
type of organisation they work for when they add a new service. This
commit adds a test to make sure they can’t just click the green button
and proceed without picking one.
2019-05-15 16:16:23 +01:00
Tom Byers
ccd09b9fd7 Revert "Merge pull request #2969 from alphagov/revert-2956-progressively-enhance-folder-permissions"
This reverts commit 8266f3d65c, reversing
changes made to b2a38fe222.
2019-05-15 14:26:51 +01:00
Katie Smith
5be6b41195 Allow Welsh characters in SMS
- This brings in the latest version of notifications-utils which
allows Welsh characters in SMS templates.
- Updated the pricing page to show the new prices for SMS with certain
Welsh characters
2019-05-15 14:20:49 +01:00
Chris Hill-Scott
4fc7498415 Include status when linking to notifications page
Without this argument the 'sending' filter doesn’t get highlighted by
default.
2019-05-15 10:04:43 +01:00
Katie Smith
da971b2da7 Allow custom notes when service goes live
This adds an option on the organisation settings page to add
'request_to_go_live_notes'. When a service belonging to this
organisation requests to go live, any go live notes for the
organisation will be added to the Zendesk ticket in the 'Agreement
signed' section.
2019-05-14 14:24:26 +01:00
Chris Hill-Scott
e4b1759b3b Merge pull request #2965 from alphagov/no-copy-paste-in-zendesk
Remove redundant info from go live emails
2019-05-14 11:43:19 +01:00
Chris Hill-Scott
d01ed30da0 Keep email address in go live ticket
It’s useful because it’s not easy to see in the Zendesk UI.
2019-05-14 11:17:47 +01:00
Tom Byers
0e6caa7fda Revert "Progressively enhance folder permissions" 2019-05-13 16:19:24 +01:00
Tom Byers
b2a38fe222 Merge pull request #2956 from alphagov/progressively-enhance-folder-permissions
Progressively enhance folder permissions
2019-05-13 14:41:43 +01:00
Pea (Malgorzata Tyczynska)
828579ce05 Merge pull request #2958 from alphagov/precompiled_for_everyone
Remove precompiled letters permission: precompiled for everyone
2019-05-13 14:03:14 +01:00
Chris Hill-Scott
3c6598cbc2 Only link to message status if message has failed
This retores the behaviour to as it was before
https://github.com/alphagov/notifications-admin/pull/2962
which inadvertently started linking to the guidance for messages that
were delivered or in sending.
2019-05-13 13:29:47 +01:00
Tom Byers
d75c26eb83 Make done button, and its surround, sticky 2019-05-10 14:21:58 +01:00
Tom Byers
7328649537 Combine 'Change' and 'Done' buttons into one
Includes addition of classes by JS to ensure CSS
selectors don't have to reference the data
attributes.
2019-05-10 14:16:03 +01:00
Chris Hill-Scott
507b5b9933 Remove line about checklist from go live email
It’s impossible for people to go live without technically completing the
checklist now.
2019-05-10 10:46:15 +01:00
Katie Smith
f3f8f4085f Fix broken links
There were still a few links pointing to `/features/using-notify`
2019-05-10 09:05:07 +01:00
Chris Hill-Scott
d6b6f1689f Remove copy-pasteable version of go live info
We’ve automated this now so we don’t need it in a format that’s easy to
copy and paste into a spreadsheet.
2019-05-09 17:41:27 +01:00
Chris Hill-Scott
b4894e7a03 Always go back to previous page from notification
When looking at a notification you can either be coming from the page
of all notifications, or from a job. Currently the back link always
takes you to the page of all notifications.

This commit makes it a bit more sophisticated so if you’ve come from
looking at a job, you go back to the job.
2019-05-09 17:33:22 +01:00
Chris Hill-Scott
923ac7190c Add a hint when no team members are selected
This helps clarify that you will still be able to see the folder.
Follows the phrasing used for the "No folders…" message.
2019-05-09 13:43:04 +01:00
Tom Byers
1ffa8c8915 Only show the folder icon if fields are folders 2019-05-09 11:25:28 +01:00
Chris Hill-Scott
78699ac995 Merge pull request #2953 from alphagov/numbers-in-excel-reports
Don’t convert Excel reports to CSV before output
2019-05-09 11:18:07 +01:00
Pea Tyczynska
18b545af51 Remove precompiled letters permission as everyone can send precompiled now 2019-05-09 11:01:11 +01:00
Tom Byers
42a9a0cf23 Make selection summary a live region
Live regions need to be in the original HTML of
the page to work. We were generating the summary
in JS.

This changes the JS to only generate the contents
of the summary so changes to its contents are
announces by the existing live-region.
2019-05-08 17:16:06 +01:00
Tom Byers
089ebf2c7a Add tests for collapsible checkboxes 2019-05-08 17:08:20 +01:00
Tom Byers
90ad8b4ed0 Add helpers for JS tests
To help with asserting some things which were
repeated in the tests.
2019-05-08 17:08:20 +01:00
Chris Hill-Scott
1708d17e40 Set org type to NHS if user has NHS email address
We get people signing up for Notify who work for the NHS, but whose
organisation we don’t know about. For example
`name@gloshospitals.nhs.uk` will be someone working for Gloucestershire
Hospitals NHS Foundation Trust, which is not an organisation we have in
the database.

Currently we rely on knowing the specific organisation (NHS as a whole
isn’t an organisation) in order to set the organisation type for any
services they create. This commit adds a special case for anyone with an
NHS email address to set the organisation type to be NHS, even when we
don’t know which specific part of the NHS they work for.

This is the same thing we do on the API side for NHS email and letter
branding:
a4ae5a0a90/app/dao/services_dao.py (L310-L313)
2019-05-08 12:08:54 +01:00
Chris Hill-Scott
80dec99a56 Merge pull request #2946 from alphagov/use-service-organisation-for-service-agreement
Look at service’s organisation on agreement page
2019-05-07 16:10:18 +01:00
Chris Hill-Scott
55d4810c4b Don’t convert Excel reports to CSV before output
Converting Python data to CSV makes every field a string. This means
that in the report we return to the user every field will be a string,
even if it’s come from an `int` type in Python. This is because the CSV
‘standard’ doesn’t support any kind of typing.

Excel does support types for fields, so we can make our reports more
useful by preserving these types. This is particularly relevant in the
report we generate for performance platform, which needs the `count`
column to be a number type.

This commit adds extra code paths to the `Spreadsheet` class which mean
that it can be instantiated from either CSV data or a list of Python
data. Previously we were converting the Python data to CSV as an
intermediate step, before instantiating the class.
2019-05-07 16:07:23 +01:00
Katie Smith
259a82e066 Update for new format of data returned from api
- API will now send through `created_by_name` instead of `created_by`.
- API will always send through `current_month_billable_sms` but this can
now be `0` instead of `None`.
2019-05-07 08:30:34 +01:00
Katie Smith
a74da6d14e Show monthly usage by SMS provider on Providers page
This adds a '% monthly traffic' column to the SMS table on the Providers page
to let us see how much traffic is being sent to each SMS provider.
2019-05-07 08:30:34 +01:00
Pea (Malgorzata Tyczynska)
a7d8918ee0 Merge pull request #2951 from alphagov/performance-platform-xlsx
Provide Performance Platform report as Excel file
2019-05-03 15:59:06 +01:00
Pea (Malgorzata Tyczynska)
9025975d92 Merge pull request #2952 from alphagov/fix-live-services-csv
Add organisation type to live services csv report
2019-05-03 15:48:50 +01:00
Chris Hill-Scott
3c38a7be05 Provide Performance Platform report as Excel file
This is the format we need to upload it in, so this means not having to
manually re-save it as Excel.
2019-05-03 15:40:53 +01:00
Chris Hill-Scott
79b3e90a18 Merge pull request #2949 from alphagov/fix-placeholder-order-in-tour
Fix order of placeholders in the tour
2019-05-03 15:07:03 +01:00
Pea Tyczynska
a53849013a Add organisation type to live services csv report 2019-05-03 14:38:33 +01:00
Chris Hill-Scott
ac46be5606 Fix adding a service when organisation is unknown
An ‘unknown’ organisation can either be:
- one where we know it exists but don’t know much about it (in which
  case the API returns some JSON with the info we do know)
- one we’ve never come across (in which case the API will return `None`)

This commit fixes a bug where we were trying to access the organisation
type in the latter case.
2019-05-03 13:40:22 +01:00
Chris Hill-Scott
34171f3038 Fix order of placeholders in the tour
Doing a lookup with `step_index - 1` means that on step `0` we were
looking up `placeholders[-1]`, ie we were making people fill in the last
placeholder first.

Fixing this reintroduces the bug fixed by this pull request:
https://github.com/alphagov/notifications-admin/pull/2551

So this commit also re-fixes that bug but in a different way.
2019-05-03 13:29:23 +01:00
Chris Hill-Scott
4cb08eb8ff Look at service’s organisation on agreement page
Usually the service’s organisation and the user’s current organisation
will be the same. But this won’t be the case when:
- someone with a non-government email address is looking at the page
- someone from our team, as a platform admin user, is looking at the
  page (it will show Cabinet Office instead)

This commit fixes these problems by explicitly looking at the service’s
organisation. We couldn’t do this previously because when this page
wasn’t service-specific `current_service` was not guaranteed to be set.
2019-05-02 09:21:44 +01:00
Pea Tyczynska
0755e81c09 Allow for empty live_date field in live services csv reports
Earlier the report broke if there were services with an empty
live date
2019-05-01 18:30:01 +01:00
Chris Hill-Scott
8c1f2298a8 Merge pull request #2943 from alphagov/service-agreement
Add service-specific versions of agreement page
2019-05-01 17:07:45 +01:00
Pea (Malgorzata Tyczynska)
338de3dd67 Merge pull request #2934 from alphagov/live-services-csv
Add Live services and Performance platform csv reports
2019-05-01 16:20:53 +01:00
Pea Tyczynska
46e8a52f2b Add performance platform csv report and format live dates
Drop redundant Response wrapper
2019-05-01 16:00:09 +01:00