-
Notifications
You must be signed in to change notification settings - Fork 19
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conditional logic - Voting #209
Merged
Merged
Changes from all commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
bd6b181
First pass, added the question to the location page.
LindsayYoung 79dce59
got the basics of the contitional logic going, need to update the pro…
LindsayYoung 293fe39
add back meta class to location
LindsayYoung a2a019d
The dynamic location page or election/location page is working, styli…
LindsayYoung 7645b25
Update pa11y test to account for new form step
LindsayYoung 1a2de3b
Merge branch 'develop' into voting-follow-up
LindsayYoung 466c011
Update migration dependencies
LindsayYoung 392b4ed
Add basic documentation on how to add an optional form page
LindsayYoung File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
18 changes: 18 additions & 0 deletions
18
crt_portal/cts_forms/migrations/0028_add_election_details.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
# Generated by Django 2.2.4 on 2019-12-16 19:08 | ||
|
||
from django.db import migrations, models | ||
|
||
|
||
class Migration(migrations.Migration): | ||
|
||
dependencies = [ | ||
('cts_forms', '0027_merge_20191218_1749'), | ||
] | ||
|
||
operations = [ | ||
migrations.AddField( | ||
model_name='report', | ||
name='election_details', | ||
field=models.CharField(blank=True, choices=[('federal', 'Federal- presidential, or congressional'), ('state_local', 'State or local- Governor, state legislation, city position (mayor, council, local board)'), ('both', 'Both Federal & State/local'), ('unknown', 'I don’t know')], max_length=225, null=True), | ||
), | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I was under the impression that the default
location
question set was always displayed during the 'where' step. If that is the case, do we need to check the negative condition here?Based on the mocks I see both appearing, so it feels like just the check to explicitly show the
election
section of the form is needed.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For Django form wizard, I think of the forms as pages and the fields as questions.
We wanted the election information to be on the location pages, so the approach is to have two versions of the location page. Based on your primary issue response, you will either will get the Location form page which only has the location questions or the ElectionLocation form page, which has the location questions and the election question.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Absolutely, I totally get that they are distinct pages. I guess I was just hoping that we could eliminate one of the choices in the dict in
urls.py
, e.g. just have a condition for2
, since 3 would be the default in all other cases. Seems that is not the case, or might not be useful even if it is. Thanks!