Commit Graph

2259 Commits

Author SHA1 Message Date
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
88ad982bf7 Improve display of folder path when deeply nested
It’s a bit rudimentary to only show the current place in the hierarchy
and the parent. You lose a sense of how deep you are.

But we can’t just show the full path, because it can be arbitrarily
long. So what this commit does is show the full path, but truncates the
display of any items. Further-up than the current folder or its parent.

This also helps disambiguate between folders and templates, because
folders are always shown with the folder icon.

This probably won’t affect many teams, because we don’t anticipate a lot
of deep nesting.
2019-02-01 10:28:29 +00:00
Chris Hill-Scott
7c59d7323b Merge pull request #2690 from alphagov/client-init-refactor
Refactor API client code to be less duplicative/repetitive
2019-01-30 14:06:38 +00:00
Chris Hill-Scott
2fae31a1ee Use 301 to redirect old URL
301 is a `permanent redirect`, which is semantically more accurate.
2019-01-30 13:36:01 +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
1d3a4e5043 Inherit don’t duplicate API client constructor
This removes some code which is duplicative and obscure (ie it’s not
very clear why we do `"a" * 73` even though there is a Very Good Reason
for doing so).
2019-01-29 12:11:27 +00:00
Katie Smith
5b77329e63 Validate name field on ServiceUpdateEmailBranding form
This introduces a validator to validate that the name field is not empty
on the ServiceUpdateEmailBranding form, but only if the form details are
being submitted. If a file is being uploaded, the name is allowed to be
empty.
2019-01-29 11:37:27 +00:00
Katie Smith
52acf890dd Stop persisting email branding logos if saving to db fails
We were previously persisting the logo for the email branding and
deleting the temp files that get created before trying to update the
database with the new email branding. This meant that if there was an
error when saving (e.g. the domain used was a duplicate) the final logo
was already in S3 and trying to go 'back' in the browser would give an
error since the temp files needed to display the create branding page
had already been deleted.

This changes the order we do things in, so that we try persisting the
email branding to the database first.
2019-01-29 11:37:27 +00:00
Katie Smith
0bf3a4b16d Refactor to add separate letter branding client
We were getting all letter logos from a method in the email branding
client. Since we will be adding more client methods to deal with
letters, it makes things clearer to separate the email and letter
branding clients.
2019-01-29 11:37:27 +00:00
Chris Hill-Scott
0d3dec1058 Merge pull request #2661 from alphagov/cant-choose-postage-if-can-choose-template
Don’t give postage choice on service and template
2019-01-29 09:48:39 +00:00
Chris Hill-Scott
44ebf1485d Merge pull request #2681 from alphagov/show-domains-against-brands
Show domains, not owners against brands
2019-01-29 09:48:27 +00:00
Chris Hill-Scott
88f868c57d Show domains, not owners against brands
The owner is often repetetive, eg

> *Hackney Council*
> Default for Hackney Council

Instead it’s more useful to reflect what the person setting up the brand
has entered – the domain.

This also adds an empty hint for non-default brands so that the page is
evenly spaced and nothing overlaps.
2019-01-23 14:16:44 +00:00
Katie Smith
c30d94bf5c Stop automatically resending email verification links
This commit stops a new email verification link from being sent to a
user if they click on an email link which has expired or which has
already been used. Instead, they will be see an error message with a
link to the sign in page. This stops the situation where someone could
log in indefinitely (without the needing to enter their password) by
trying to use a used / expired email verification link and receiving a
valid link automatically.
2019-01-22 13:59:16 +00:00
Chris Hill-Scott
a9effaa82e Merge pull request #2669 from alphagov/test-key-letters
Show if letters are sent using a test key
2019-01-22 11:36:13 +00:00
Chris Hill-Scott
085856e062 Revised wording to avoid negative contraction 2019-01-22 10:38:40 +00:00
Chris Hill-Scott
cfcdfcc38c Show if letters are sent using a test key
It’s inaccurate to have an estimated delivery date for letters sent
using a test key. We shouldn’t reassure people that:
- the letter won’t be printed
- (in the case of precompiled letters) that the letter has passed
  validation
2019-01-22 09:54:40 +00:00
Katie Smith
bbc7b173f0 Ensure non-gov invited users get added to services
We were adding invited users to services in the `main.add_service` view
function as the last step in the process of inviting users. Since this
view function is decorated with `@user_is_gov_user`, invited users with
non-governmental email addresses would never reach this point and would
be able to register an account but would not get linked to a service.

To fix this, we now add the invited user to the service at the point at
which the user gets activated and also ensure that non-gov users don't
get redirected to a page which they don't have permission to view.
2019-01-22 09:52:55 +00:00
Katie Smith
398aef6d4c Revert "Stop automatically resending email verification links" 2019-01-21 15:44:15 +00:00
Katie Smith
9095893e03 Stop automatically resending email verification links
This commit stops a new email verification link from being sent to a
user if they click on an email link which has expired or which has
already been used. Instead, they will be see an error message with a
link to the sign in page. This stops the situation where someone could
log in indefinitely (without the needing to enter their password) by
trying to use a used / expired email verification link and receiving a
valid link automatically.
2019-01-21 14:29:22 +00:00
Alexey Bezhan
ec0575009b Merge pull request #2667 from alphagov/template-and-notification-stats-use-one-api-call
Use single api call for service notification stats and template usage stats
2019-01-17 15:35:00 +00:00
Alexey Bezhan
20d5cdf6c3 Merge pull request #2663 from alphagov/adding_support_for_new_api_template_statistics_response
Add support for new template statistics API response
2019-01-17 13:42:43 +00:00
Pea Tyczynska
52526f2b9f Test aggregate_notifications_stats 2019-01-16 11:24:24 +00:00
Chris Hill-Scott
558ae87baa Hide ‘back to …’ link if it’s not your service
This can happen if you click a link for a service you don’t have access
to. We shouldn’t show the back to service link in this case because:
- you shouldn’t be able to find out the service’s name from just knowing
  the link
- if you click the link you only get a `403` anyway
2019-01-15 17:31:55 +00:00
Pea Tyczynska
e5647703b3 Remove support for old template statistics api response 2019-01-15 16:44:37 +00:00
Pea Tyczynska
4fe239abb2 Add support for new template statistics API response
The new API response for template statistics returns separate
count for each status. We get rid of template stats for cancelled
notifications and group the rest of the statuses together.
2019-01-15 16:22:27 +00:00
Chris Hill-Scott
feabcbc7bf Fix display of perm. failure on notifications page
It had too much whitespace because it was accidentally being given the
wrong class.

This commit undoes the change that caused it (which was while working on
letters) and beefs up our tests for email and text messages (so if this
happened again the tests would catch it).
2019-01-15 13:51: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
Chris Hill-Scott
5c4ff09d48 Treat permanent failure for letters the same as cancelled 2019-01-14 10:16:01 +00:00
Chris Hill-Scott
c1158d7d70 Explain technical failure on the notification page 2019-01-11 16:56:09 +00:00
Chris Hill-Scott
989875294b Make technical failure letters show up on the activity page 2019-01-11 16:55:37 +00:00
Pea Tyczynska
bb1e9d2a0f Add validation-failed status to FAILURE_STATUSES in admin utils 2019-01-10 15:54:31 +00:00
Pea Tyczynska
2dec697dc9 Fix a test after merge conflict mixup 2019-01-10 15:43:38 +00:00
Pea Tyczynska
dcc590ec96 Cancelled notifications do not show as failures on dashboard stats
Also update tests after we no longer show cancelled letters
2019-01-10 15:27:04 +00:00
Katie Smith
1c6a71700d Update error messages for validation-failed precompiled letters 2019-01-09 13:10:36 +00:00
Katie Smith
da50f77538 Show error message if precompiled PDF cannot be opened
If PDF files have a validation error which means that they can't be
opened by PyPDF2 we would previously show the 500 status error page. We
now catch PyPDF2.utils.PdfReadErrors so that we can display a custom
error message on the notification page instead.
2019-01-09 13:10:36 +00:00
Katie Smith
bb7e9726d3 Stop showing validation-failed letters as cancelled in table
Changed the table for displaying all notifications to show letters which
have the status of 'validation-failed' as 'Validation failed' instead of
'Cancelled'.

The individual notification page for a letter which has failed
validation has not been changed since this already has a description
(letter has content outside the printable area).
2019-01-09 13:10:36 +00:00
Chris Hill-Scott
8b39bc14d1 Merge pull request #2643 from alphagov/dont-count-pages-api-message-log
Don't request pagination links for API Message log page
2019-01-09 12:27:35 +00:00
Chris Hill-Scott
a34e1ea1f0 Merge pull request #2638 from alphagov/copy-template-from-folders
Allow users to navigate folders when copying
2019-01-09 12:26:29 +00:00
Chris Hill-Scott
30886c3cdb Merge pull request #2626 from alphagov/empty-service-state-folders
Use grey buttons to add templates when service is new
2019-01-09 10:26:43 +00:00
Alexey Bezhan
6cd18f87de Don't request pagination links for API Message log page
Counting pages for API notifications takes a long time for services
with a lot of sent messages (since it issues a `count(*)` query for
the given filter). Since API message log doesn't have a "Next page"
link we can skip the count by setting a flag on the API request.
2019-01-08 15:35:44 +00:00
Chris Hill-Scott
a093b8d976 Use Babergh as the example in tests
Because Aberdeenshire have signed the agreement.
2019-01-08 15:12:52 +00:00
Chris Hill-Scott
206a7806d4 Allow users to navigate folders when copying
We already have a pattern for navigation folders and searching for
templates – let’s use it for the copy page too. And I reckon we can
represent services as folders if the user has multiple services they
could copy a template from.
2019-01-08 12:21:32 +00:00
Pea (Malgorzata Tyczynska)
0b22fff751 Merge pull request #2639 from alphagov/quick_fix_letter_status
Format letter statuses so they make more sense to our users
2019-01-08 11:06:35 +00:00
Pea Tyczynska
b8318c491b Format letter statuses so they make more sense to our users 2019-01-07 15:17:09 +00:00
Tom Byers
1685e492ca Merge pull request #2630 from alphagov/nest-destination-folders
Nest destination folders
2019-01-07 10:31:41 +00:00
Tom Byers
bdc4a1056d Add a test to ensure move_to has no default folder
As requested in:

https://github.com/alphagov/notifications-admin/pull/2630#pullrequestreview-189414780
2019-01-04 17:21:54 +00:00
Chris Hill-Scott
d907fc9ce6 Update tests/app/main/views/test_template_folders.py
Remove quotes around variable. Were added by mistake.

Co-Authored-By: tombye <tombaromba@gmail.com>
2019-01-04 15:40:34 +00:00
Chris Hill-Scott
39506c4794 Rename ‘All templates’ 2019-01-04 15:15:58 +00:00
Chris Hill-Scott
c1b61a3658 Merge pull request #2617 from alphagov/pytest4
Pytest 4: don't call pytest.mark directly
2019-01-04 11:48:16 +00:00