Skip to content
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

Roadmap bug #3163 - Fix for bug "Conditional question causing plans … #3164

Merged

Conversation

johnpinto1
Copy link
Contributor

@johnpinto1 johnpinto1 commented Apr 27, 2022

…to disappear."

Cause is commit bb5941e
"Added toggleable guidance/comments section" the following changes were made
to file app/javascript/src/utils/sectionUpdate.js:
the question containers classes were changed as follows .row -> .question-body & .col-md-8 -> .question-section:

-                <div class="row">
-                  <div class="col-md-8">
+                <div class="question-body">
+                  <div class="question-section">

This broke the function getQuestionDiv() in app/javascript/src/utils/sectionUpdate.js.
Fix for issue #3163.

Changes:

  • in app/javascript/src/utils/sectionUpdate.js the function was updated
    as follows:
-export const getQuestionDiv = (id) => $(`#answer-form-${id}`).closest('.row');
+export const getQuestionDiv = (id) => $(`#answer-form-${id}`).closest('.question-body');

I used an example we had for issue to debug and fix.

Before:

  • Write Plan tab displayed:
    Selection_004
    The whole Plan panel container was hidden because it was the closest div with class .row.

Selection_005

After
The plan container is visible with the removed question with id 6177 (as required with style="display:none").

Selection_009
Selection_010

Section removed would have displayed
Selection_007

…o disappear."

Cause is commit bb5941e
"Added toggleable guidance/comments section"  the following changes were made
to file  app/javascript/src/utils/sectionUpdate.js:
the question containers classes were changed as follows .row -> .question-body & .col-md-8 -> .question-section:

-                <div class="row">
-                  <div class="col-md-8">
+                <div class="question-body">
+                  <div class="question-section">

This broke the function getQuestionDiv() in app/javascript/src/utils/sectionUpdate.js.
Fix for issue #3163.

Changes:
- in  app/javascript/src/utils/sectionUpdate.js the function was updated
as follows:
-export const getQuestionDiv = (id) => $(`#answer-form-${id}`).closest('.row');
+export const getQuestionDiv = (id) => $(`#answer-form-${id}`).closest('.question-body');
@johnpinto1 johnpinto1 force-pushed the big_3163_conditional_questions_causing_plans_display_none branch from ae527f1 to e7a6d4a Compare April 27, 2022 15:14
Copy link
Contributor

@briri briri left a comment

Choose a reason for hiding this comment

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

thanks for digging into this one @johnpinto1

@briri briri merged commit 974b589 into development Apr 28, 2022
@briri briri deleted the big_3163_conditional_questions_causing_plans_display_none branch April 28, 2022 14:43
@johnpinto1
Copy link
Contributor Author

@briri You put me on the right track, by asking to look at the javascript. I was thinking it would have been worse.

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.

2 participants