Skip to content

Fixes #3380 - Makes Wizard Form the default (python)#3384

Merged
miketaylr merged 4 commits intowebcompat:masterfrom
karlcow:3380/1
Jul 15, 2020
Merged

Fixes #3380 - Makes Wizard Form the default (python)#3384
miketaylr merged 4 commits intowebcompat:masterfrom
karlcow:3380/1

Conversation

@karlcow
Copy link
Copy Markdown
Member

@karlcow karlcow commented Jul 14, 2020

This PR fixes issue #3380

Proposed PR background

(env) ~/code/webcompat.com-karlcow % git log 23f2665a..73dcff1f                                
commit 73dcff1fb95acf013328de6461a4ac911070c9ce (HEAD -> 3380/1, origin/3380/1)
Author: Karl Dubost <karl+github@la-grange.net>
Date:   Tue Jul 14 11:37:29 2020 +0900

    Issue #3380 - Makes WizardForm the default form
    
    So this is doing a couple of things.
    
    - It removes the duplicate problem_choices list of 2 items tuples.
    - it removes the IssueForm class
    - it transfers the IssueForm attributes into FormWizard
    - it reorders in some broad categories the fields  for the form
    - it switches getform to FormWizard. (it was not the case!)
    - it adjusts the tests

commit 304d11a7c23ac845ef192cb3d00671ec81ee888b
Author: Karl Dubost <karl+github@la-grange.net>
Date:   Tue Jul 14 11:32:58 2020 +0900

    Issue #3380 - accepts list with 3 and 2 items tuples
    
    Originally the list of tuples were 2 items long.
    but the wizard is using in some cases 3 items long list (because of icons) for radio fields.
    
    This leds to the duplication of the list of problem_choices with 2 items and 3 items. So instead of duplicating code, let's handle it in the function itself. There might be something more elegant to do. We can discover that later.

commit 09853fb7abf48f77866840c70d4a3a928b53ae7c
Author: Karl Dubost <karl+github@la-grange.net>
Date:   Tue Jul 14 11:28:52 2020 +0900

    Issue #3380 - simplifies PrefixedRadioField
    
    This optimizes a bit the code to make it easier to read. It doesn't change the global logic

commit 23f2665af5333ade44833f9c9a71b115f2d9ed52
Author: Karl Dubost <karl+github@la-grange.net>
Date:   Tue Jul 14 11:25:59 2020 +0900

    issue #3380 - Cleans up code
    
    These are breadcrumbs of dead code and useless redirection of variables.
    
    Let's remove them before modifying the Form.

karlcow added 2 commits July 14, 2020 11:25
These are breadcrumbs of dead code and useless redirection of variables.

Let's remove them before modifying the Form.
This optimizes a bit the code to make it easier to read. It doesn't change the global logic
@karlcow karlcow requested review from ksy36 and miketaylr July 14, 2020 02:43
@karlcow karlcow linked an issue Jul 14, 2020 that may be closed by this pull request
3 tasks
karlcow added 2 commits July 15, 2020 07:52
Originally the list of tuples were 2 items long.
but the wizard is using in some cases 3 items long list (because of icons) for radio fields.

This leds to the duplication of the list of problem_choices with 2 items and 3 items. So instead of duplicating code, let's handle it in the function itself. There might be something more elegant to do. We can discover that later.
So this is doing a couple of things.

- It removes the duplicate problem_choices list of 2 items tuples.
- it removes the IssueForm class
- it transfers the IssueForm attributes into FormWizard
- it reorders in some broad categories the fields  for the form
- it switches getform to FormWizard. (it was not the case!)
- it adjusts the tests
Copy link
Copy Markdown
Member

@miketaylr miketaylr left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks Karl.

@miketaylr
Copy link
Copy Markdown
Member

(we should be sure to test carefully on staging here, just to make sure we don't break reporting :))

@karlcow
Copy link
Copy Markdown
Member Author

karlcow commented Jul 15, 2020

(we should be sure to test carefully on staging here, just to make sure we don't break reporting :))

Definitely.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Remove Python Code legacy which was used for the old form

3 participants