Commit Graph

6416 Commits

Author SHA1 Message Date
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
5cc2f3c589 Merge pull request #2480 from alphagov/networkrail.co.uk
Add Network Rail to allowed domains
2018-11-13 09:46:23 +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
Katie Smith
6f2c4601a8 Merge pull request #2451 from alphagov/csv-upload-sender-id
Store the sender_id that should be used for a job in S3 metadata
2018-11-12 13:42:13 +00:00
Katie Smith
0f90bde958 Store the sender_id that should be used for a job in S3 metadata
Currently, a user can select a reply-to email address or text message
sender when uploading a CSV file but this is ignored and the default is
always used instead. As a first step towards changing this, this adds
the sender_id (if selected) to the S3 metadata so that this information
can be used when processing the job.
2018-11-12 13:34:33 +00:00
Chris Hill-Scott
4c9f667de3 Sort folders alphabetically
To match the order in which templates are sorted.
2018-11-12 11:53:37 +00:00
Chris Hill-Scott
07dd59f5b6 Add folder icons to template list
To make it easier to identify what is a folder.
2018-11-12 11:53:37 +00:00
Chris Hill-Scott
fb339a08a8 Refactor CSS to better use inherited naming 2018-11-12 11:53:37 +00:00
Rebecca Law
8dc7e6e5f8 Merge pull request #2470 from alphagov/move-into-existing-folders
Let users move things into folders
2018-11-12 11:40:00 +00:00
Chris Hill-Scott
3cac9ac5cc Rename method to be more explicit 2018-11-12 09:21:47 +00:00
Chris Hill-Scott
40f676d3ad Move labels of template types out of model
The model shouldn’t have to care about how things are labelled in the
UI, it should only care about the data.
2018-11-12 09:16:14 +00:00
Chris Hill-Scott
c18a38d4f1 Make handling of None values in forms clearer
If the browser posts the value of `<input value='None'>` to the server
it does so as a string.

We want to post a value of `None` (actually JSON `null`) to the API. To
do this we:
- set the value in the form class to `'None'` (ie a string)
- convert to `None` (as a type) afterwards

However seeing `x = 'None'` in code looks a bit like a mistake. So to
make sure it looks deliberate and clear what is happening this commit:
- makes a reusable constant for `'None'`
- adds a comment explaining why it’s a string
2018-11-12 09:04:39 +00:00
Chris Hill-Scott
74a4400bc7 Update URLs to match change in API 2018-11-12 08:37:46 +00:00
Chris Hill-Scott
9de4b4598f Don’t show move when there’s nothing to move 2018-11-12 08:37:46 +00:00
Chris Hill-Scott
38e8cca606 Show page if all you got is empty folders 2018-11-12 08:37:46 +00:00
Chris Hill-Scott
cdb5b47c4d Post to the API when moving folders and templates
This commit adds logic to:
- take the list of selected folders and templates
- split it into two lists (of folders and templates)
- `POST` that data to the API, to effect the movement of said folders
  and templates

I’ve tried to architect it in such a way that we can easily add more
template ‘operations’ in the future, as we add more forms to the choose
template page.
2018-11-12 08:37:46 +00:00
Chris Hill-Scott
980d66bdaa Add helper function for filtering templates by type
This code was making the view method more cluttered than it needed to
be. Moving it will help make space for the `post` request handling code.
2018-11-12 08:37:46 +00:00
Chris Hill-Scott
2743216519 Show form elements for templates and folders
This commit adds:
- checkboxes to let you select a template or folder
- radio buttons to let you select where to move those template(s) and/or
  folder(s) to

It only does the `get` part of this work; handling the `post` and
calling API will be done in a subsequent commit.
2018-11-12 08:37:46 +00:00
Chris Hill-Scott
921de47164 Refactor template navigation options into model
This has two advantages:
- less logic in the view
- lets us filer the available navigation by which channels (email, text
  letter) a service has available
2018-11-12 08:37:46 +00:00
Chris Hill-Scott
4df96f3682 Add model properties for template and folder IDs
We’re going to need a way to find out if, for a given ID:
1. its a template or a folder
2. if it belongs to a given service

To do 2., we can make a set of all the IDs, to see if a given ID is a
member of that set.

To do 1. we can make two sets, one for templates and one for folders.

The natural home for these sets is on the service model.
2018-11-12 08:37:46 +00:00
Chris Hill-Scott
d98ec79a9d Add more thorough tests for the template search
It would be quite easy to dissociate the search box from the things its
supposed to be searching.

This commit adds assertions to make sure that the things the search box
is targeting are on the page
2018-11-12 08:37:46 +00:00
Chris Hill-Scott
e4f8f4e98a Merge pull request #2379 from alphagov/add-folder-icons
Add folder icons
2018-11-09 15:05:28 +00:00
Rebecca Law
812a4f4ecc Merge pull request #2473 from alphagov/438-services
Service count to 438 and orgs to 132
2018-11-09 13:31:22 +00:00
Pete Herlihy
d9d9db2140 Service count to 438 and orgs to 132 2018-11-09 12:50:46 +00:00
Rebecca Law
73fce86b40 Merge pull request #2468 from alphagov/add-parent-folder-id-when-creating-template
Create a template in a folder.
2018-11-09 11:12:30 +00:00
Rebecca Law
9f4ef2e269 Remove service_once from method signature 2018-11-09 11:04:42 +00:00
Rebecca Law
a4d9dc4616 Added a test for create template with parent folder id 2018-11-09 10:47:21 +00:00
Rebecca Law
146c7915b2 Create a template in a folder. 2018-11-08 15:53:33 +00:00
karlchillmaid
30ed9cfaca Merge pull request #2467 from alphagov/data-protection-act-update
Updated data protection law description
2018-11-08 15:37:28 +00:00
Alexey Bezhan
622fdfedc9 Merge pull request #2452 from alphagov/create-template-folders
Create template folders
2018-11-08 11:58:39 +00:00
karlchillmaid
528a176651 Updated data protection law description
Original content: 'Notify complies with the Data Protection Act.'
This should be updated to take account of GDPR – for example, 'Notify complies with data protection law' (which covers both DPA and GDPR).
This change is consistent with the Service Manual.
2018-11-08 11:16:18 +00:00
Chris Hill-Scott
18277b9f15 Use CSS selector instead of page.find in template folders tests
Co-Authored-By: allait <al@fueledbylemons.com>
2018-11-08 11:09:00 +00:00
Chris Hill-Scott
e74819eaf8 Merge pull request #2414 from alphagov/reduce-logging-during-tests
Reduce logging noise in traceback output
2018-11-07 16:21:18 +00:00
Chris Hill-Scott
d7cf28c07e Merge pull request #2464 from alphagov/ashfield.gov.uk
Mark agreement signed by Ashfield District Council
2018-11-07 15:53:53 +00:00
Chris Hill-Scott
345f3b2d68 Mark agreement signed by Ashfield District Council 2018-11-07 15:36:25 +00:00
Chris Hill-Scott
c0c0015dc4 Merge pull request #2448 from alphagov/alphabetical-sort-letter-brandings
Make letter brandings easier to find with sorting and filtering
2018-11-07 13:50:05 +00:00
Chris Hill-Scott
a02a8efca1 Merge pull request #2460 from alphagov/hex-error-message
Make hex colour code error more helpful
2018-11-07 11:18:08 +00:00
Chris Hill-Scott
666d55e82b Merge pull request #2428 from alphagov/api-key-page-neatness
Make API key page handle multiple lines of text better
2018-11-07 11:17:53 +00:00
Chris Hill-Scott
514a98f946 Make hex colour code error more helpful
I just got stuck for like a whole minute on this.
2018-11-07 10:49:04 +00:00
Chris Hill-Scott
f8aaa34cdb Merge pull request #2457 from alphagov/remove-integration-testing
Remove integration testing
2018-11-07 10:26:30 +00:00
Chris Hill-Scott
b1832a4c43 Remove link to integration testing page
This page has ben deprecated.
2018-11-06 17:25:33 +00:00
Chris Hill-Scott
156d38499a Remove integration testing content
This is covered in the new client library documentation. All of the
client libraries now have their documentation published in the new
format.
2018-11-06 17:24:30 +00:00