Commit Graph

2056 Commits

Author SHA1 Message Date
Katie Smith
b9688f9ad3 Update banner message for CSV letters
This was always showing the text 'Your letter has been sent...' This has
now been updated to start 'Your letters have been sent...' if a job has
more than one notification in it.
2018-12-03 10:42:47 +00:00
Katie Smith
088d6ee4b0 Content changes for notification pages
This commit adds content pages for the notifications pages, particularly
the letter pages, which will make things clearer now that we will soon be allowing
letters to be cancelled.

The main changes are:
* The confirmation banner for letters sent from a CSV file now states when
printing will start.
* We state the CSV file that notifications were sent from on the
notifications page
* The notification page for letters shows when printing starts (today,
tomorrow, or that date that the letter was printed)
2018-12-03 10:42:47 +00:00
Pea Tyczynska
0b45eda53f Update tests 2018-12-03 09:56:24 +00:00
Pea Tyczynska
b9abeb91d3 Back button on one-off message preview takes user to their flow
Earlier it always took user to one-off flow, even when they came
from test flow.

Also adjust steps calculation for test flow.
2018-12-03 09:56:24 +00:00
Alexey Bezhan
ef4921d2f9 Merge pull request #2534 from alphagov/final_countdown
'Data available for {}' message on job page accounts for flexible data retention
2018-11-29 15:49:27 +00:00
Chris Hill-Scott
bc6b9c7af7 Use named arguments for clearer string formatting
Helps when the string is long.

Also helps disambiguate between the CDN domain used for the logos and
those for CSS/JS.
2018-11-29 11:56:01 +00:00
Leo Hemsted
1bb7e98722 add fieldsets to template/folder form and update docstrings
also remove erroneous pytest.ini cfg and reset button
2018-11-28 14:14:20 +00:00
Leo Hemsted
d07de58cd9 split out new folder into two separate forms
move_to_new_folder and add_new_folder are now two separate html fields
and form items - so that we can more easily manipulate them on the
front end
2018-11-28 14:14:20 +00:00
Leo Hemsted
690585c017 move add new folder and move to folder into one dialog box
this lets us combine the two actions to create "Move to a new folder".
If the user hits enter rather than clicking a button, there is a hidden
submit button that (for now) prevents them from taking any action.
A future commit will try and understand what the user might be doing
based on which fields are populated/selected.
2018-11-28 14:14:20 +00:00
Leo Hemsted
9dec9ed626 add new folder from the choose template page 2018-11-28 14:14:20 +00:00
Chris Hill-Scott
0000ca6629 Merge pull request #2535 from alphagov/launch-first-class
Launch first class postage feature
2018-11-26 16:33:21 +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
Pea Tyczynska
9d8e602ac8 time_left considers flexible data retention periods
Also update tests
2018-11-26 15:15:06 +00:00
Chris Hill-Scott
ee991d0142 Allow any sub-items to be moved from a folder
Since you can now see them when searching you should also be able to
select and move them. Which means that they needed to be included in
the `Form`’s list of possible choices of things to move.
2018-11-23 16:29:21 +00:00
Chris Hill-Scott
82d8207612 Refactor template list logic into one place
The Jinja template for the ‘choose templates’ page is now pulling in
data from a lot of diparate places in order to work out what to show. As
we add more logic about what to show (in order to make the live search
work) it’s going to get harder to have all this logic in the Jinja
template.

This commit refactors it back into Python where we have more language
features for managing complex logic.

It’s a bit weird to call this file a model, in that it’s dealing with
some presentational logic, rather than just data. Conceptually it’s more
like a view model[1].

1. https://en.wikipedia.org/wiki/Model%E2%80%93view%E2%80%93viewmodel
2018-11-23 14:00:40 +00:00
Chris Hill-Scott
0ed66828fc Merge pull request #2526 from alphagov/stick-email-status
Stick email status to bottom of screen
2018-11-22 12:31:14 +00:00
Chris Hill-Scott
c7118a80e2 Stick email status to bottom of screen
We’ve moved away from using the expand/collapse pattern on the page
where you click ‘send’. Instead we’re putting the send button in the
sticky footer.

So it’s a bit jarring to still have the expand/collapse on the page you
see after you’ve sent an email. This commit replaces it with the sticky
footer as well.

This is only relevant for emails because:

1. Text messages are generally short enough to fit on the screen
2. We don’t show the status of letters because they don’t really change
2018-11-22 10:20:39 +00:00
Chris Hill-Scott
8f2547b7a7 Merge pull request #2518 from alphagov/delete-folder-refinements
Make some refinements to the delete folder journey
2018-11-20 14:53:05 +00:00
Chris Hill-Scott
c52dc8e972 Merge pull request #2488 from alphagov/copy-template-name
Put ‘copy’ at end of new template name
2018-11-20 14:14:09 +00:00
Chris Hill-Scott
65389b0bb5 Merge pull request #2513 from alphagov/empty-folder-message
Improve the empty folder state
2018-11-20 13:50:53 +00:00
Chris Hill-Scott
a5bbabcd7b Merge pull request #2511 from alphagov/sticky-send
Use sticky footer on the check one-off page
2018-11-20 13:15:32 +00:00
Chris Hill-Scott
400c25e15f Make search box appear based on all templates
We reckon it’s jarring to have the search box appear and disappear as
you navigate through the folders.

Instead it should appear whenever your service has more things
(templates or folders) than you can easily keep in your head (let’s go
with 7 for now).

This keeps the bahviour the same for current services that don’t have
any folders.
2018-11-20 12:29:39 +00:00
Chris Hill-Scott
4bb7519d9e Refine empty folder message
If the folder is completely empty, always say ‘This folder is empty’, so
we don’t suggest that you can click around and find other things.

If the current view is filtered, but there are templates available in
other filters, say ‘There are no text message templates in this folder’
to make it clear why you can’t see anything.
2018-11-20 12:29:39 +00:00
Chris Hill-Scott
72159ff6e3 Fix search box show/hide logic
The search box should only be shown if there are too many items to
quickly scan on the page. This number is judged to be 7; see the
original PR for more context:
https://github.com/alphagov/notifications-admin/pull/1195

This commit makes that logic work in the world of folders, by explicitly
counting the templates shown on the screen, not all the templates a
service has (which may be spread across multiple folders).
2018-11-20 12:29:38 +00:00
Chris Hill-Scott
77529f4191 Redirect to parent after deleting a folder
You lose your place if, after deleting something that’s deeply nested,
you return to the root level.
2018-11-20 11:31:31 +00:00
Chris Hill-Scott
4bccce4772 Refactor how we get template folder on delete page
It’s a bit obtuse to look it up from the `template_folder_path`,
especially now that we have a specific method on the model that does
the exact thing.
2018-11-20 11:31:31 +00:00
Chris Hill-Scott
13a962b6bd Don’t hide the rename form on delete
It’s weird that this page changes when you click delete – it looks like
you’re going to a different page.

It should feel like you’re on the same page, just with the confirmation
message.

The problem we had before is that the rename form would `POST` to
`…/delete`, which would then delete the template instead of updating
its name.

We can fix this by explicitly setting the `action` attribute on the
rename form to always post to `…/manage`, even if the user is currently
looking at the `…/delete` page.
2018-11-20 11:27:19 +00:00
Leo Hemsted
fda10c81a7 Merge pull request #2494 from alphagov/bump-reqs
bump reqs
2018-11-20 11:06:08 +00:00
Rebecca Law
ad129e92dd Merge pull request #2507 from alphagov/delete-letter-job-page
Delete letter job page
2018-11-20 09:57:52 +00:00
Chris Hill-Scott
7e4ef84635 Put sticky footers on check one-off page
This page is a good use case for sticky footers because the primary
action on the page would otherwise be off the bottom of the viewport.
2018-11-19 15:26:13 +00:00
Chris Hill-Scott
65b1b142b0 Show full emails on check notifications page
Because we’re going to use a sticky footer on this page we don’t need
to show the email in its collapsed form. Showing the email is only
needed to:
- fit more things on a page
- make sure a button comes up above the fold (which the sticky footer
  will solve)
2018-11-19 15:22:34 +00:00
Pea (Malgorzata Tyczynska)
754ae743ca Merge pull request #2506 from alphagov/fix_delete_folder_button_breadcrumb
Fix breadcrumbs on manage_template_folder page
2018-11-19 10:49:28 +00:00
Pea (Malgorzata Tyczynska)
2b040afe00 Merge pull request #2501 from alphagov/update_confirm_delete_messages
Make deletion confirmation banner messages consistent across our app
2018-11-19 10:37:48 +00:00
Pea Tyczynska
87c92e093b Update confirmation messages for delete sms-sender and delete reply-to-email 2018-11-16 17:05:59 +00:00
Pea Tyczynska
69ada9a312 Hide name changing functionality when in folder deletion mode
Also add 'back' link
Also start work on additional tests for folder deletion flow
2018-11-16 15:58:18 +00:00
Rebecca Law
924e3aa6da Merge branch 'master' into delete-letter-job-page 2018-11-16 15:32:51 +00:00
Pea Tyczynska
7f4580cb82 Update content following review 2018-11-16 15:15:40 +00:00
Pea Tyczynska
4373987786 Fix breadcrumbs on manage_template_folder page 2018-11-16 11:21:27 +00:00
Pea Tyczynska
a43e6a8885 Make deletion confirmation banner messages consistent across our app
Also introduce a way to provide context to a banner / flash message
that will be displayed in plain font style.
2018-11-16 11:05:52 +00:00
Rebecca Law
f788aab998 Remove letter jobs page
When we first built letters you could only send them via a CSV upload, initially we needed a way to send those files to dvla per job.
We since stopped using this page. So let's delete it!
2018-11-15 17:17:45 +00:00
Chris Hill-Scott
f3d1dc4a9c Don’t ask for data retention unless channel is known
If the user is looking at the notifications page for all message types
(which is what we show ‘caseworkers’) then it doesn’t make sense to ask
the API for the data retention period for that message type (because
it will be `None`). Doing so causes the API to return a `404`, which
then causes the admin app to return `404`.

Passing through `None` as the value of limit days will just cause the
API to return everything in the `notifications` table, which is fine
for us.
2018-11-15 17:17:10 +00:00
Chris Hill-Scott
be9fb99247 Redirect signed-in users to their service
Some users are bookmarking the sign in page for quick access to their
Notify service.

If they’re already signed in when they used this bookmark they get
redirected. However the redirect isn’t very smart, because it just takes
them to their list of services. This isn’t great if they only have one
service.

This commit redirects them to the `show_accounts_or_dashboard` endpoint
instead, which does the work to figure out which page is most useful
to show someone when they sign in.

Also changing this for `/register`, although it’s less likely that
someone will have bookmarked this page.
2018-11-15 16:01:59 +00:00
Pea Tyczynska
f54c2c0dc7 Update content of deletion messages following review 2018-11-15 10:51:44 +00:00
Pea Tyczynska
2a1328a17e Check if folder is empty before calling the api 2018-11-15 10:51:44 +00:00
Pea Tyczynska
d61022e3e6 Add flash messages and error handling to delete folder flow 2018-11-15 10:51:44 +00:00
Pea Tyczynska
91d309816b Build delete folder endpoint that calls template_folders_api_client 2018-11-15 10:51:44 +00:00
Pea Tyczynska
4520065af4 Add a delete folder link to manage folder page and basic delete
endpoint
2018-11-15 10:51:44 +00:00
Leo Hemsted
3551d36f32 bump reqs 2018-11-14 13:35:24 +00:00
Chris Hill-Scott
7f171ba4ea Merge pull request #2462 from alphagov/api-key-sort-order
Sort API keys alphabetically
2018-11-14 10:13:36 +00:00
Chris Hill-Scott
666381e23d Pre-populate rename folder form with current name
Often people will be editing the existing name, not changing it
completely.

This matches what we do when someone wants to rename their template or
service.
2018-11-13 16:05:05 +00:00