Commit Graph

7170 Commits

Author SHA1 Message Date
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
f47215ddc7 Merge pull request #2499 from alphagov/redirect-signed-in-users-to-their-service
Redirect signed-in users to their service
2018-11-15 16:22:48 +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
karlchillmaid
dd72a9d333 Merge pull request #2498 from alphagov/update-roadmap
Update roadmap – remove Q2
2018-11-15 15:21:27 +00:00
Pea (Malgorzata Tyczynska)
1dc63bbe63 Merge pull request #2493 from alphagov/delete_folder
Add delete folder flow
2018-11-15 14:44:39 +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
b5c78dc552 Add delete_folder method to template folder 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
karlchillmaid
e4106ef547 Update roadmap – remove Q2
Update roadmap to remove Q2 (July-September 2018)
2018-11-15 10:23:28 +00:00
Tom Byers
d1805e7fc0 Merge pull request #2469 from alphagov/make-current-sticky-js-generic
Allow our sticky navs to stick to bottom as well as top
2018-11-15 09:59:37 +00:00
Tom Byers
eeb096aa62 Add missed .stopped method to Sticky Element 2018-11-14 16:42:52 +00:00
Leo Hemsted
3551d36f32 bump reqs 2018-11-14 13:35:24 +00:00
Tom Byers
8411598390 Remove transition if element is stuck onload
Fade-in and out for sticky elements should only be
when they move from being in-page to stuck from a
user interaction.
2018-11-14 10:25:08 +00:00
Chris Hill-Scott
9e4abbc511 Refactor duplicative methods
These methods were both doing the exact same thing. There may well be
others in the future that also need to do this thing.
2018-11-14 10:16:55 +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
ca56561da1 Merge pull request #2489 from alphagov/pre-populate-folder-rename
Pre-populate rename folder form with current name
2018-11-14 10:13:22 +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
Chris Hill-Scott
ce798a02e4 Merge pull request #2487 from alphagov/fix-folders-ie10
Fix templates page in IE10
2018-11-13 15:26:13 +00:00
Chris Hill-Scott
0888bdf5d4 Put ‘copy’ at end of new template name
In multiple user research sessions we’ve noticed people edit the
auto-generated template name to put something at the end of it.

This is fiddly because of the quotes we put around the name:
> Copy of ‘Exiting template’

It also means that if they keep our prefix then the template doesn’t
sort alongside the one it’s replacing.

This commit changes the name of copied templates to better match the
behaviour our users are showing.

Also adds a bit of auto numbering, just as a nice detail.
2018-11-13 15:25:02 +00:00
Chris Hill-Scott
872b3f9c94 Make existing_keys a required argument
Because we should always expect its presence, even it’s an empty list.
And because having mutable default arguments can have nasty side
effects.
2018-11-13 14:27:01 +00:00
Chris Hill-Scott
807396f8b9 Add comment to explain combining of flex and float
Just so no-one thinks it’s redundant and removes it.
2018-11-13 14:22:48 +00:00
Chris Hill-Scott
66cf12ba65 Run folder-blue.svg through SVGOMG
Does the same optimisations we’ve done for the other SVGs.

https://jakearchibald.github.io/svgomg/
2018-11-13 14:15:38 +00:00
Chris Hill-Scott
32c64c11e3 Merge pull request #2461 from fidejoseph/patch-3
Update using-notify.html
2018-11-13 14:10:18 +00:00
Chris Hill-Scott
538e090170 Merge pull request #2481 from alphagov/label-folders
Label and filter folders depending on their contents
2018-11-13 14:10:00 +00:00
Chris Hill-Scott
a82ce7de1f Fix folder navigation in IE 10
IE10 doesn’t support flexbox. We can work around this using floats.

I think the flexbox will override it, so will be ignored by newer
browsers.
2018-11-13 14:01:19 +00:00
Chris Hill-Scott
e0ecc95ac6 Fix folder icon in IE 10
IE 10 supports using SVG[1] but has some buggy behaviour when they’re
used as background images.

Without an explicit width/height it stretches the viewBox of the SVG to
fill the containing element. This causes the content of the file to
display centered within the viewBox.

Explicitly setting the width and height seems to be the thing that fixes
this. Out of the suggested fixes on Stackoverflow[2] this one seems to
be the most straightforward.

1. https://caniuse.com/#feat=svg
2. https://stackoverflow.com/questions/17944354/svg-background-image-position-is-always-centered-in-internet-explorer-despite-b
2018-11-13 13:57:03 +00:00
Chris Hill-Scott
63060d926f Rename method
Starting with `is` helps indicate that it’s going to return a boolean,
not perform an action (which is what a verb like `show` implies).
2018-11-13 12:31:31 +00:00
Chris Hill-Scott
045a4bb7f1 Swap order of arguments to get_template_folders
So that the order is the same as the arguments passed to `get_templates`
2018-11-13 12:29:57 +00:00
Pea (Malgorzata Tyczynska)
ec58e9baa6 Merge pull request #2486 from alphagov/bust_cache
Add decorator deleting cache for template folder client update method
2018-11-13 11:55:27 +00:00
Pea Tyczynska
c27b97380d Add decorator deleting cache for template folder client update method 2018-11-13 11:43:59 +00:00
Chris Hill-Scott
6c4b6774aa Label folders to show what’s in them
It feels like a solid reckon that knowing what’s in a folder before you
click on it will help you navigate around.

However, what do you show in a folder if you’re filtering by template
type? We think that:
- if you’re not filtering you should see all folders, even empty ones
- if you’re filtering you should only see folders that will get you to
  relevant templates

This matches what happens when you filter templates, we don’t ‘grey out’
the non-email templates, we hide them completely.

The logic then extends to how we describe the contents of a folder, ie
we won’t count its subfolders if they don’t contain templates of the
type we’re looking for. This means that however you see the folder
described (eg ‘3 templates, 1 folder’) will match what you see when you
click into it.
2018-11-13 11:10:21 +00:00
Chris Hill-Scott
7fc5bf41b7 Add a grandchild folder to the test cases
This will make it easier to generate all the necessary permutations we
need to test.
2018-11-13 11:10:20 +00:00
Chris Hill-Scott
012b560673 Make a helper function for generating templates
Having this stuff split across various points in `conftest.py` was
making my brain melt.

This way I feel like it’s easier to see the input/output of the test.
2018-11-13 11:10:20 +00:00
Chris Hill-Scott
10fe78bb31 Only show relevant folders
A folder is relevant if it, or any of its descents contain a template of
the kind you’re looking for.

If you’re not filtering by template type then you should see all
folders.
2018-11-13 11:10:20 +00:00
Chris Hill-Scott
084c020d0c Test for template hints
This commit extends the tests to not only look at the name of the
displayed templates and folders, but also the hint text underneath.

Because there are going to be more variations of this hint text in the
future we need to make sure it’s tested.

Doing this in its own commit so only the meaningful changes show up in
the commits that actually change stuff.
2018-11-13 11:10:20 +00:00
Chris Hill-Scott
5db7025e12 Make line breaks consistent
Putting each item on its own line makes the diff cleaner in subsequent
commits, and makes each pytest param consistent.
2018-11-13 11:10:20 +00:00
Chris Hill-Scott
66f66b95bf Make a helper function for testing folders
Splitting this out into a function makes it easier to see what’s going
on in the tests.
2018-11-13 11:10:19 +00:00
Pea (Malgorzata Tyczynska)
0a4b6dbb33 Merge pull request #2482 from alphagov/update_folder
Add a new endpoint for managing a folder, use it to rename folder
2018-11-13 10:49:08 +00:00
Pea Tyczynska
565d29ed43 Add a new endpoint for managing a folder, use it to rename folder
- Add a GET / POST view: manage template folder
- Add a template for that view, where a user can rename their
folder
- Add an API client method for updating a folder

- Test the new feature, including the test that service without
permissions cannot manage a folder
2018-11-13 10:38:56 +00:00
Chris Hill-Scott
8bedcb5af8 Move data transformation into the form
Follows what we’re doing with the folders stuff. Avoids having too many
very straightforward methods on the model. Especially when the data they
need is only used by the form. So it’s better to encapsulate the logic
in the form.
2018-11-13 09:57:17 +00:00
Chris Hill-Scott
5cc2f3c589 Merge pull request #2480 from alphagov/networkrail.co.uk
Add Network Rail to allowed domains
2018-11-13 09:46:23 +00:00
Chris Hill-Scott
2639e2c46f Sort API keys alphabetically
Currently the order of API keys seems to be non-deterministic:
d46caa184e/app/dao/api_key_dao.py (L32-L39)

Generally we sort things alphabetically, unless there’s a good reason to
do otherwise.

This commit sorts the API keys alphabetically.
2018-11-12 16:11:13 +00:00
Chris Hill-Scott
591bbe9a49 Don’t do multiple get API calls when revoking
It’s redundant to make two API calls here, one to get all keys and one
to get a single key. Since the API calls are sequential we can speed
things up by getting the one key from the list of all keys.
2018-11-12 16:11:13 +00:00
Chris Hill-Scott
d1c9dcfb1d Put API keys on service model
Similar to how we put templates on the service model, it means less
logic needs to happen in the view code.
2018-11-12 16:11:13 +00:00
Rebecca Law
302078ac28 Merge pull request #2475 from alphagov/add-folder-icons-to-list
Add folder icons to list
2018-11-12 15:26:44 +00:00
Chris Hill-Scott
7ac4369eb5 Add Network Rail to allowed domains 2018-11-12 13:58:45 +00:00