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

Synchronize cascade choice_filter with name when saving form #2723

Merged
merged 6 commits into from
Aug 12, 2020

Conversation

duvld
Copy link
Member

@duvld duvld commented Jun 26, 2020

Utilize coffeescript model sluggify function to match "Choice Filter" value with "Data Column" value before saving form. This syncs up the name changes so that cascade questions don't break.

Future improvements (?):

  • Don't let user edit the "Data Column" and "Choice Filter" options or
  • Set up front end warnings if user changes something to potentially break this sync (changing "Data Column" value or "Choice Filter" value manually)

Description

Prevents cascade questions from breaking when "Data Column Name" is changed in the form builder

Related issues

Fixes #706

@magicznyleszek
Copy link
Member

magicznyleszek commented Jul 24, 2020

@duvld I found a problem:

  1. Import this form cascade_bug.xls.zip
  2. Open it in Form Builder
  3. Change first question's label to "What is your country?"
  4. Click SAVE and reload page
  5. Now I see that first question's name is still country, but second question has chaned choice filter: value to country=${What_is_your_country} thus braking it :(

jsapp/js/utils.es6 Outdated Show resolved Hide resolved
jsapp/js/utils.es6 Show resolved Hide resolved
@magicznyleszek magicznyleszek merged commit 0942c6c into master Aug 12, 2020
@magicznyleszek magicznyleszek deleted the 706-cascade-question-names branch August 12, 2020 07:46
@jnm jnm changed the title 706 cascade question names Synchronize cascade choice_filter with name when saving Dec 1, 2020
@jnm jnm changed the title Synchronize cascade choice_filter with name when saving Synchronize cascade choice_filter with name when saving form Dec 1, 2020
jnm added a commit that referenced this pull request Dec 22, 2020
…n-names"

This reverts commit 0942c6c, reversing
changes made to 5fd73c8.
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.

Cascades change when question name changes
2 participants