From 1bb7e98722aef02dd048939a10e05cea7cc9744c Mon Sep 17 00:00:00 2001 From: Leo Hemsted Date: Tue, 27 Nov 2018 14:33:50 +0000 Subject: [PATCH] add fieldsets to template/folder form and update docstrings also remove erroneous pytest.ini cfg and reset button --- app/main/forms.py | 15 +++++++++++++++ app/templates/views/templates/_move_to.html | 15 ++++++++++----- pytest.ini | 4 +--- 3 files changed, 26 insertions(+), 8 deletions(-) diff --git a/app/main/forms.py b/app/main/forms.py index 29e3813ae..2a1b5b66f 100644 --- a/app/main/forms.py +++ b/app/main/forms.py @@ -1148,6 +1148,21 @@ def required_for_ops(*operations): class TemplateAndFoldersSelectionForm(Form): + """ + This form also expects the form data to include an operation, based on which submit button is clicked. + If enter is pressed, unknown will be sent by a hidden submit button at the top of the form. + The value of this operation affects which fields are required, expected to be empty, or optional. + + * unknown + currently not implemented, but in the future will try and work out if there are any obvious commands that can be + assumed based on which fields are empty vs populated. + * move_to_existing_folder + must have data for templates_and_folders checkboxes, and move_to radios + * move_to_new_folder + must have data for move_to_new_folder_name, cannot have data for move_to_existing_folder_name + * add_new_folder + must have data for move_to_existing_folder_name, cannot have data for move_to_new_folder_name + """ ALL_TEMPLATES_FOLDER = { 'name': 'All templates', diff --git a/app/templates/views/templates/_move_to.html b/app/templates/views/templates/_move_to.html index 871e26364..10c6b7341 100644 --- a/app/templates/views/templates/_move_to.html +++ b/app/templates/views/templates/_move_to.html @@ -8,12 +8,17 @@ {{ page_footer('Move', button_name='operation', button_value='move_to_existing_folder') }}
- {{ textbox(templates_and_folders_form.move_to_new_folder_name) }} - {{ page_footer('Move to a new folder', button_name='operation', button_value='move_to_new_folder') }} +
+ Move to a new folder + {{ textbox(templates_and_folders_form.move_to_new_folder_name) }} + {{ page_footer('Move to a new folder', button_name='operation', button_value='move_to_new_folder') }} +
- {{ textbox(templates_and_folders_form.add_new_folder_name) }} - {{ page_footer('New folder', button_name='operation', button_value='add_new_folder') }} +
+ Add a new folder + {{ textbox(templates_and_folders_form.add_new_folder_name) }} + {{ page_footer('New folder', button_name='operation', button_value='add_new_folder') }} +
- {% endif %} diff --git a/pytest.ini b/pytest.ini index 2b0a34ba8..cbc831544 100644 --- a/pytest.ini +++ b/pytest.ini @@ -1,4 +1,5 @@ [pytest] +xfail_strict=true testpaths = tests log_level = 999 env = @@ -10,6 +11,3 @@ env = ZENDESK_API_KEY=test STATSD_PREFIX=stats-prefix REDIS_ENABLED=0 -# :thinking_face: -filterwarnings = - ignore::pytest.RemovedInPytest4Warning