Commit Graph

2887 Commits

Author SHA1 Message Date
Chris Hill-Scott
268929a093 Allow platform admins to change daily message limit
One less thing we have to go into the database to do, and remember to
manually clear the cache for after.
2020-10-19 17:44:32 +01:00
Chris Hill-Scott
43a27676cb Remove the styleguide
The idea was that this would be a place to document all the design
patterns used in Notify. However it hasn’t been kept up to date, and,
looking at the `git blame`[1] no new patterns have been added for 5
years.

I think it’s better to get rid of it than have to keep maintaining
something which is inaccurate.

1. 64aa0d359c/app/templates/views/styleguide.html
2020-10-16 10:14:23 +01:00
Chris Hill-Scott
0cd08a94ff Rename dashboard to ‘current alerts’
The dashboard for normal services is quite general, because it tells
you a bit about channels, templates and spend.

What is now the dashboard for broadcast services is much more specific,
therefore less like a dashboard. We can reflect this by giving it a more
specific name. This should reduce the amount of navigation surfing
people need to do in order to find the thing they’re looking for.
2020-10-13 14:47:27 +01:00
Chris Hill-Scott
698f98389c Remove previous broadcasts from the dashboard
Since they have their own page now they don’t need to also appear on the
dashboard.
2020-10-13 14:47:10 +01:00
Chris Hill-Scott
f0220fa9fb Make a separate page for previous alerts
Previous alerts are much less important than ones that are live or
waiting for approval.

Therefore we can make the dashboard more focused by moving previous
alerts to their own page.
2020-10-13 14:45:08 +01:00
Chris Hill-Scott
3eb97f76b8 Merge pull request #3676 from alphagov/broadcast-includes-content
Add content property to broadcast message model
2020-10-12 15:29:48 +01:00
David McDonald
895b6bcc9e Merge pull request #3674 from alphagov/remove-test-routes
Remove `test/step-` routes
2020-10-12 14:25:31 +01:00
Pea M. Tyczynska
b60d25da67 Merge pull request #3670 from alphagov/show-broadcast-tour-when-password-reset
Take user to page they are meant to visit in various sign-in flow scenarios
2020-10-12 12:27:37 +01:00
David McDonald
7d3a4e6085 Remove test/step- routes
We don't need these anymore as all users will use the `one-off/step`
routes.

This has mostly involved tidying up the tests which are still a little
disorganised and not as good as I'd like but it's a step in the right
direction.

More refactoring is still possible to the routes, it may come in a later
PR if I have time.
2020-10-09 17:36:09 +01:00
David McDonald
99880fd672 Merge pull request #3668 from alphagov/use-one-off-route
When sending to yourself use 'one-off' rather than 'test' routes
2020-10-09 16:02:01 +01:00
Chris Hill-Scott
54d4fb2a6c Allow platform admins to clear cached broadcasts
When we add a new property to the broadcast model, we need to delete any
cached broadcasts from Redis that are missing the new property. So this
adds an option to do this to the cache page in platform admin.

I’ve also tried to make it more obvious what the magic numbers in the
test fixture are doing.
2020-10-09 15:41:48 +01:00
Pea Tyczynska
2203fae195 Turn on redirects revalidate_email_sent
This is part of the work to make sure user is redirected
to the page they initially were meant to visit after
they sign in.
2020-10-09 12:39:23 +01:00
Pea Tyczynska
44ddee23ac Turn on redirects two_factor
This is part of the work to make sure user is redirected
to the page they initially were meant to visit after
they sign in.
2020-10-09 12:39:23 +01:00
Pea Tyczynska
a531c888ba Turn on redirects two_factor_email
This is part of the work to make sure user is redirected
to the page they initially were meant to visit after
they sign in.
2020-10-09 12:39:22 +01:00
Pea Tyczynska
5dd010ece8 Turn on redirects for two_factor_email_sent
This is part of the work to make sure user is redirected
to the page they initially were meant to visit after
they sign in.
2020-10-09 12:39:22 +01:00
Pea Tyczynska
a6543c6e57 Turn on redirects for sign_in
This is part of the work to make sure user is redirected
to the page they initially were meant to visit after
they sign in.
2020-10-09 12:39:22 +01:00
Pea Tyczynska
1fc2bee42d Turn on redirects for new_password
This is part of the work to make sure user is redirected
to the page they initially were meant to visit after
they sign in.
2020-10-09 12:39:21 +01:00
Pea Tyczynska
b0db60e417 Turn on redirects for email_not_received
This is part of the work to make sure user is redirected
to the page they initially were meant to visit after
they sign in.
2020-10-09 11:52:19 +01:00
Pea Tyczynska
1dd8b08042 Turn on redirects for check_and_resend_verification_code
This is part of the work to make sure user is redirected
to the page they initially were meant to visit after
they sign in.
2020-10-09 11:51:15 +01:00
Pea Tyczynska
c3b7481e11 Turn on redirects for check_and_resend_text_code
This is part of the work to make sure user is redirected
to the page they initially were meant to visit after
they sign in.
2020-10-09 11:49:48 +01:00
Chris Hill-Scott
0f5c0a251c Merge pull request #3672 from alphagov/no-personalisation-broadcast
Don’t allow or highlight personalisation in broadcast templates
2020-10-08 15:45:51 +01:00
Chris Hill-Scott
54a5306399 Merge pull request #3660 from alphagov/fix-incorrect-processing-started-time-jobs
Fix incorrect processing started time on jobs
2020-10-06 12:00:30 +01:00
Chris Hill-Scott
c8e85efd54 Don’t allow personalisation in broadcast templates
Since we don’t have a way of filling in the personalisation at the
moment we shouldn’t allow people to make templates that require it.
2020-10-05 17:17:21 +01:00
Pea Tyczynska
d089424501 Forgot password sends redirect link
with reset password email.

This is so when users reset their password they are still
redirected to pages they were meant to visit.

This change was done specifically so everyone who is meant to see
broadcast tour sees it, but it will improve lives of all users
who wanted to visit a page on Notify but then had to reset
their password in the process.
2020-10-05 16:58:43 +01:00
Leo Hemsted
6eccc66115 delete template keys properly from platform admin page 2020-10-05 16:52:48 +01:00
David McDonald
4aaf47aaa1 When sending to yourself use 'one-off' rather than 'test' routes
There is no real reason to have to support both 'one-off' steps and also
'test' steps when sending a one off notification. It's a lot of complex
code, just to now set the one of the placeholders in the session.

We make our code much simpler but no longer using the 'test' routes but
instead adding a new endpoint to set the notification recipient when
sending to yourself before continuing on with the rest of the 'one-off'
flow.

After this is deployed for a day then we can completely remove the
'test' routes and this will help remove a lot of code complexity.
2020-10-05 16:20:04 +01:00
Pea Tyczynska
ab10009e4d Redirect link included in links for password reset
on sign-in page.
2020-10-05 15:38:34 +01:00
David McDonald
389638244c Remove old tour and help arguments from sending flow
We no longer need the `start_tour` page as this has been replaced with
the new `begin_tour` page.

We also no longer need to handle the `help` argument in the
`send_test_step` or `send_one_off_step` as these no longer are
responsible for the tour and don't need to show the help text.

Worth pointing out, the new tour joins into the send one off flow. When
doing a GET `check_tour_notification`, and submitting the form shown on
this page you are POSTed to `send_notification` with `help=3`. Also for
general sending of one off notifications, the POST to
`send_notification` is done with `help=0` which is a bit of a hack to
make sure that we don't show a back link on the `view_notification` page
for when someone gets there having just sent a one off notification.
This use of `help=0` may be a candidate for a refactor in the future as
it feels like a bit of a hacky way of doing things and is therefore not
as clear to developers what is going on.

Also removes the help argument from the csv routes used here. There is
no reason that we need to ever show help for CSVs and this is leftover
code from when we used to do the tour that way.
2020-10-05 12:44:19 +01:00
David McDonald
1b310a0f8a Merge pull request #3663 from alphagov/separate-tour
Move intro to Notify tour into separate views to reduce code complexity
2020-10-05 09:53:33 +01:00
David McDonald
c1f67514a2 404 for step-0 2020-10-02 14:44:17 +01:00
David McDonald
1f900e74a9 Fix error case where the tour start page is skipped
This was causing us to key error for 'placeholders' being missing in the
session dictionary. This fixes it and sends you back to the start
2020-10-02 12:46:02 +01:00
David McDonald
6f8a2721d9 Tighten restrictions of which templates a user can tour with
We don't want them being able to tour with a template they don't have
folder permissions to see.

Also, when a new user creates a service they will always have full
permissions so this won't affect new services at all, it's just to stop
people 'hacking' the urls to enable them to see templates they maybe
shouldn't see if they knew the template ID
2020-10-02 12:46:02 +01:00
David McDonald
ec0af6b151 Redirect user to new tour after creating a service
We leave the existing tour routes available for the moment so we don't
break the flow for anyone whilst this deploys
2020-10-02 12:46:02 +01:00
David McDonald
f0a8c97eeb Add check tour notification page
On submit of form on this page, will continue to normal sending flow
which can be shared code as there is no longer previous context needed
of where they have come from
2020-10-02 12:46:02 +01:00
David McDonald
9347c9a979 Redirect to the new check tour notification page
After the steps have been completed, redirect them to the new check tour
notification page to review their message
2020-10-02 12:46:02 +01:00
David McDonald
c2a691e6d9 Add view for filling in steps of the tour
Note, we choose to start our urls at step-1 rather than step-0 as this
is consistent when you would enter the first placeholder (excluding the
recipient) for the one off tour.

Also note, we expect a service to allow international sms by default
when it is first created but we keep the check for if the service does
just in case they visit this tour later on.
2020-10-02 12:46:02 +01:00
David McDonald
2ba7224a42 Add view for new tour start page
This will replace the current tour start page
2020-10-02 12:46:02 +01:00
Chris Hill-Scott
a98e3534b2 Give email preview page a sensible page title
It’s derived from the subject line of the email now as of
https://github.com/alphagov/notifications-utils/pull/793
2020-09-30 11:29:13 +01:00
Chris Hill-Scott
5c2469b24e Refactor to use shared date comparison function
This means we don’t have to repeatedly do timezone conversions or string
to datetime conversions in our business logic.
2020-09-29 13:38:00 +01:00
Chris Hill-Scott
9becb2b817 Merge pull request #3641 from alphagov/area-suggestions
Suggest previously-used areas when adding new area
2020-09-23 15:00:21 +01:00
Tom Byers
cbb435b013 Merge pull request #3644 from alphagov/add-accessibility-statement
Add accessibility statement
2020-09-23 14:02:27 +01:00
Chris Hill-Scott
dcd48f99dd Merge pull request #3632 from alphagov/training-broadcast-approved
Add a tour screen once a broadcast is approved
2020-09-23 11:07:03 +01:00
Chris Hill-Scott
f50ef84c0d Suggest previously-used areas when adding new area
If you’re adding another area to your broadcast it’s likely to be close
to one of the areas you’ve already added.

But we make you start by choosing a library, then you have to find the
local authority again from the long list. This is clunky, and it
interrupts the task the user is trying to complete.

We thought about redirecting you somewhere deep into the hierarchy,
perhaps by sending you to either:
- the parent of the last area you’d chosen
- the common ancestor of all the areas you’d chosen

This approach would however mean you’d need a way to navigate back up
the hierarchy if we’d dropped you in the wrong place. And we don’t have
a pattern for that at the moment.

So instead this commit adds some ‘shortcuts’ to the chose library page,
giving you a choice of all the parents of the areas you’ve currently
selected. In most cases this will be one (unitary authority) or two
(county and district) choices, but it will scale to adding areas from
multiple different authorities.

It does mean an extra click compared to the redirect approach, but this
is still fewer, easier clicks compared to now.

This meant a couple of under-the-hood changes:
- making `BroadcastArea`s hashable so it’s possible to do
  `set([BroadcastArea(…), BroadcastArea(…), BroadcastArea(…)])`
- making `BroadcastArea`s aware of which library they live in, so we can
  link to the correct _Choose area_ page
2020-09-22 17:33:04 +01:00
Tom Byers
a75cde039f Merge pull request #3624 from alphagov/add-accessible-letter-specification
Add accessible letter specification
2020-09-22 16:36:15 +01:00
Chris Hill-Scott
2d64306e88 Link to specification page, not PDF directly 2020-09-22 15:49:38 +01:00
Chris Hill-Scott
a384f4cace Add route for letter specification page 2020-09-22 15:36:20 +01:00
Tom Byers
5241ea3ef0 Add basic page for accessibility statement 2020-09-22 11:46:57 +01:00
Leo Hemsted
a6b25b5991 add back links
previously the back link went to choosing a library.

Now, if you view a district from a county, go back to the county page.
Otherwise, go back to the top level of the library.
2020-09-21 11:24:05 +01:00
Chris Hill-Scott
5c22bd56ce Add a tour screen once a broadcast is approved
For a training broadcast the user doesn’t get that immediate feedback
that something has happened, like they would with a real alert, or even
sending themselves a text message.

This commit adds another tour-style page which will interrupt their
journey and hopefully reinforce the message we’ve given them earlier in
the tour.

We’re adding this because we’ve found in research that users don’t have
a good grasp of the consequences and severity of emergency alerts,
versus regular text messages.
2020-09-21 09:41:19 +01:00
Chris Hill-Scott
f824b3a5eb Give specific error if international letters off
If a service doesn’t have permission to send international letters but
someone tries to upload a letter with a valid international address we
just tell them that the last line must be a UK postcode.

This is a bit opaque and:
- suggests that we’re not recognising at all that it’s not a UK letter
- doesn’t explain why it must be a UK postcode

This commit adds a new, error message which tells users why their letter
can’t be sent. And hopefully will give them a better idea of how to
resolve the problem, if they really do need to be able to send
international letters.
2020-09-10 11:25:17 +01:00