Skip to content

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

Merged
briri merged 2 commits into
developmentfrom
big_3163_conditional_questions_causing_plans_display_none
Apr 28, 2022
Merged

Roadmap bug #3163 - Fix for bug "Conditional question causing plans …#3164
briri merged 2 commits into
developmentfrom
big_3163_conditional_questions_causing_plans_display_none

Conversation

@johnpinto1

@johnpinto1 johnpinto1 commented Apr 27, 2022

Copy link
Copy Markdown
Contributor

…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

@briri briri left a comment

Copy link
Copy Markdown
Contributor

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
Copy Markdown
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

2 participants