Repository navigation
Conditional Logic - #3123
Conditional Logic#3123mickenordin wants to merge 30 commits into
Conversation
c7ff7a9 to
7887848
Compare
Codecov Report❌ Patch coverage is 📢 Thoughts on this report? Let us know! |
2d5f073 to
50a1acd
Compare
Updated with more tests so threshold is well exceeded |
50a1acd to
2250d5f
Compare
2250d5f to
3aea864
Compare
|
Hello there, We hope that the review process is going smooth and is helpful for you. We want to ensure your pull request is reviewed to your satisfaction. If you have a moment, our community management team would very much appreciate your feedback on your experience with this PR review process. Your feedback is valuable to us as we continuously strive to improve our community developer experience. Please take a moment to complete our short survey by clicking on the following link: https://cloud.nextcloud.com/apps/forms/s/i9Ago4EQRZ7TWxjfmeEpPkf6 Thank you for contributing to Nextcloud and we hope to hear from you soon! (If you believe you should not receive this message, you can add yourself to the blocklist.) |
5c7d036 to
d02bdbc
Compare
d02bdbc to
78643a6
Compare
|
Thank you! Will test further. It seems a bit sluggish sometimes it throws an This is the missing feature i need to convince my non-profit to stop using google forms 🙏 |
|
Hi @mickenordin , as this was stale for 3 Months i started fixing some bugs by myself. I cant push on this branch, should i just post my .patch diffs here? Problems noticed/fixed:
Further ideas for this (should be new PR):
|
|
Yes
Yes, please do. I don't know of a better way since I don't have access to any access settings in the Nextcloud org, even though I was given the ability to branch in their repos myself. I'll make sure to credit you on the diffs of course. |
|
Hey @mickenordin |
78643a6 to
532bee6
Compare
I did, please make sure to sign-off your commits, and perhaps squash them to fewer logical units. You can take a look at the failing tests and see how to fix them. |
|
I rebased this branch on Split into a stackFollowing @Chartman123's suggestion (#3123 (comment)), the same code is now split into six stacked PRs, each based on the one before - I didn't rework this PR on purpose to keep the/an original copy :
#3833 contains all commits of this PR, unchanged, plus the review fixes. Its last commit takes out the trigger types that #3834–#3838 add back. Together, the six PRs have the scope of this PR. The base PR #3833 also:
#3834 also fixes the label of checkbox branches. @timedin-de's list (#3123 (comment))Checked on a dev instance:
#3123 (comment)
Regression from #3123 (comment)Confirmed fixed. File answers, in subquestions too, are checked against the upload token of the same form. An upload with a wrong token is rejected with 400. Found on the way, not caused by this PR
|
|
To give a bit of an explanation about the PR move and split. Given the discussion around what conditions/types to support. I've split it into the baseline (that seems generally agreed on in terms of supported types - like Google offers) and PRs per extra set, so we can discuss them after have the foundation in and see if there are use cases that justify adding them in addition. |
A text trigger activates a branch when the answer equals (short text only) or contains a text, or matches a regular expression. Regular expressions use the same /pattern/modifiers format as validationRegex, are checked when saving, and an invalid one is not saved by the editor. Matching is limited in subject length and backtracking. The code comes from the original pull request #3123 by Micke Nordin and TimedIn, with the review fixes applied. Assisted-by: Claude Code:claude-opus-5-5 Signed-off-by: Andy Scherzinger <info@andy-scherzinger.de>
A text trigger activates a branch when the answer equals (short text only) or contains a text, or matches a regular expression. Regular expressions use the same /pattern/modifiers format as validationRegex, are checked when saving, and an invalid one is not saved by the editor. Matching is limited in subject length and backtracking. The code comes from the original pull request #3123 by Micke Nordin and TimedIn, with the review fixes applied. Assisted-by: Claude Code:claude-opus-5-5 Signed-off-by: Andy Scherzinger <info@andy-scherzinger.de>
A text trigger activates a branch when the answer equals (short text only) or contains a text, or matches a regular expression. Regular expressions use the same /pattern/modifiers format as validationRegex, are checked when saving, and an invalid one is not saved by the editor. Matching is limited in subject length and backtracking. The code comes from the original pull request #3123 by Micke Nordin and TimedIn, with the review fixes applied. Assisted-by: Claude Code:claude-opus-5-5 Signed-off-by: Andy Scherzinger <info@andy-scherzinger.de>
A text trigger activates a branch when the answer equals (short text only) or contains a text, or matches a regular expression. Regular expressions use the same /pattern/modifiers format as validationRegex, are checked when saving, and an invalid one is not saved by the editor. Matching is limited in subject length and backtracking. The code comes from the original pull request #3123 by Micke Nordin and TimedIn, with the review fixes applied. Assisted-by: Claude Code:claude-opus-5-5 Signed-off-by: Andy Scherzinger <info@andy-scherzinger.de>
|
cc @Chartman123 as a heads-up before the stacked PRs change again. Following Christian's review question on #3833 ("would it be easier to not have a new question type What changes
What stays
Why The wrapper type is special-cased in about 15 places on the server and in 5 frontend files, and most issues from the last review round came from exactly those special cases (editing responses, export/import, analytics, a duplicated answer-type registry). Doing this before the first merge means no data migration and no API deprecation later. Not part of this Google-style sections with "go to section" navigation are a separate feature (#357, #624) and not required for conditionals. They can follow later on their own. The commits in #3833 → #3838 will be rewritten again; the commit hashes in my earlier replies here will no longer match. |
A text question opens a branch when the answer equals (short text only) or contains a text, or matches a regular expression. Regular expressions use the same /pattern/modifiers format as validationRegex, are checked when saving, and an invalid one is not saved by the editor. Matching is limited in subject length and backtracking. The code comes from the original pull request #3123 by Micke Nordin and TimedIn, with the review fixes applied. Assisted-by: Claude Code:claude-opus-5-5 Signed-off-by: Andy Scherzinger <info@andy-scherzinger.de>
A text question opens a branch when the answer equals (short text only) or contains a text, or matches a regular expression. Regular expressions use the same /pattern/modifiers format as validationRegex, are checked when saving, and an invalid one is not saved by the editor. Matching is limited in subject length and backtracking. The code comes from the original pull request #3123 by Micke Nordin and TimedIn, with the review fixes applied. Assisted-by: Claude Code:claude-opus-5-5 Signed-off-by: Andy Scherzinger <info@andy-scherzinger.de>
A text question opens a branch when the answer equals (short text only) or contains a text, or matches a regular expression. Regular expressions use the same /pattern/modifiers format as validationRegex, are checked when saving, and an invalid one is not saved by the editor. Matching is limited in subject length and backtracking. The code comes from the original pull request #3123 by Micke Nordin and TimedIn, with the review fixes applied. Assisted-by: Claude Code:claude-opus-5-5 Signed-off-by: Andy Scherzinger <info@andy-scherzinger.de>
A text question opens a branch when the answer equals (short text only) or contains a text, or matches a regular expression. Regular expressions use the same /pattern/modifiers format as validationRegex, are checked when saving, and an invalid one is not saved by the editor. Matching is limited in subject length and backtracking. The code comes from the original pull request #3123 by Micke Nordin and TimedIn, with the review fixes applied. Assisted-by: Claude Code:claude-opus-5-5 Signed-off-by: Andy Scherzinger <info@andy-scherzinger.de>
A text question opens a branch when the answer equals (short text only) or contains a text, or matches a regular expression. Regular expressions use the same /pattern/modifiers format as validationRegex, are checked when saving, and an invalid one is not saved by the editor. Matching is limited in subject length and backtracking. The code comes from the original pull request #3123 by Micke Nordin and TimedIn, with the review fixes applied. Assisted-by: Claude Code:claude-opus-5-5 Signed-off-by: Andy Scherzinger <info@andy-scherzinger.de>
Each value of a linear scale gets a row with the same select as on
options, the values at the ends with their labels, e.g. "1 - Strongly
disagree". The jumps are stored in extraSettings.goTo as
{value, target}. A value is matched as a whole number, so "04" counts
as 4 as it does for the answer itself. Values outside the scale never
match, so changing the bounds needs no cleanup.
Based on the linear scale support of #3123 by TimedIn.
Co-Authored-By: TimedIn <git@timedin.net>
Assisted-by: Claude Code:claude-opus-5-5
Signed-off-by: Andy Scherzinger <info@andy-scherzinger.de>
Each value of a linear scale gets a row with the same select as on
options, the values at the ends with their labels, e.g. "1 - Strongly
disagree". The jumps are stored in extraSettings.goTo as
{value, target}. A value is matched as a whole number, so "04" counts
as 4 as it does for the answer itself. Values outside the scale never
match, so changing the bounds needs no cleanup.
Based on the linear scale support of #3123 by TimedIn.
Co-Authored-By: TimedIn <git@timedin.net>
Assisted-by: Claude Code:claude-opus-5-5
Signed-off-by: Andy Scherzinger <info@andy-scherzinger.de>
Each value of a linear scale gets a row with the same select as on
options, the values at the ends with their labels, e.g. "1 - Strongly
disagree". The jumps are stored in extraSettings.goTo as
{value, target}. A value is matched as a whole number, so "04" counts
as 4 as it does for the answer itself. Values outside the scale never
match, so changing the bounds needs no cleanup.
Based on the linear scale support of #3123 by TimedIn.
Co-Authored-By: TimedIn <git@timedin.net>
Assisted-by: Claude Code:claude-opus-5-5
Signed-off-by: Andy Scherzinger <info@andy-scherzinger.de>
Each value of a linear scale gets a row with the same select as on
options, the values at the ends with their labels, e.g. "1 - Strongly
disagree". The jumps are stored in extraSettings.goTo as
{value, target}. A value is matched as a whole number, so "04" counts
as 4 as it does for the answer itself. Values outside the scale never
match, so changing the bounds needs no cleanup.
Based on the linear scale support of #3123 by TimedIn.
Co-Authored-By: TimedIn <git@timedin.net>
Assisted-by: Claude Code:claude-opus-5-5
Signed-off-by: Andy Scherzinger <info@andy-scherzinger.de>
Each value of a linear scale gets a row with the same select as on
options, the values at the ends with their labels, e.g. "1 - Strongly
disagree". The jumps are stored in extraSettings.goTo as
{value, target}. A value is matched as a whole number, so "04" counts
as 4 as it does for the answer itself. Values outside the scale never
match, so changing the bounds needs no cleanup.
Based on the linear scale support of #3123 by TimedIn.
Co-Authored-By: TimedIn <git@timedin.net>
Assisted-by: Claude Code:claude-opus-5-5
Signed-off-by: Andy Scherzinger <info@andy-scherzinger.de>
Each value of a linear scale gets a row with the same select as on
options, the values at the ends with their labels, e.g. "1 - Strongly
disagree". The jumps are stored in extraSettings.goTo as
{value, target}. A value is matched as a whole number, so "04" counts
as 4 as it does for the answer itself. Values outside the scale never
match, so changing the bounds needs no cleanup.
Based on the linear scale support of #3123 by TimedIn.
Co-Authored-By: TimedIn <git@timedin.net>
Assisted-by: Claude Code:claude-opus-5-5
Signed-off-by: Andy Scherzinger <info@andy-scherzinger.de>
Each value of a linear scale gets a row with the same select as on
options, the values at the ends with their labels, e.g. "1 - Strongly
disagree". The jumps are stored in extraSettings.goTo as
{value, target}. A value is matched as a whole number, so "04" counts
as 4 as it does for the answer itself. Values outside the scale never
match, so changing the bounds needs no cleanup.
Based on the linear scale support of #3123 by TimedIn.
Co-Authored-By: TimedIn <git@timedin.net>
Assisted-by: Claude Code:claude-opus-5-5
Signed-off-by: Andy Scherzinger <info@andy-scherzinger.de>
Each value of a linear scale gets a row with the same select as on
options, the values at the ends with their labels, e.g. "1 - Strongly
disagree". The jumps are stored in extraSettings.goTo as
{value, target}. A value is matched as a whole number, so "04" counts
as 4 as it does for the answer itself. Values outside the scale never
match, so changing the bounds needs no cleanup.
Based on the linear scale support of #3123 by TimedIn.
Co-Authored-By: TimedIn <git@timedin.net>
Assisted-by: Claude Code:claude-opus-5-5
Signed-off-by: Andy Scherzinger <info@andy-scherzinger.de>
Each value of a linear scale gets a row with the same select as on
options, the values at the ends with their labels, e.g. "1 - Strongly
disagree". The jumps are stored in extraSettings.goTo as
{value, target}. A value is matched as a whole number, so "04" counts
as 4 as it does for the answer itself. Values outside the scale never
match, so changing the bounds needs no cleanup.
Based on the linear scale support of #3123 by TimedIn.
Co-Authored-By: TimedIn <git@timedin.net>
Assisted-by: Claude Code:claude-opus-5-5
Signed-off-by: Andy Scherzinger <info@andy-scherzinger.de>
Each value of a linear scale gets a row with the same select as on
options, the values at the ends with their labels, e.g. "1 - Strongly
disagree". The jumps are stored in extraSettings.goTo as
{value, target}. A value is matched as a whole number, so "04" counts
as 4 as it does for the answer itself. Values outside the scale never
match, so changing the bounds needs no cleanup.
Based on the linear scale support of #3123 by TimedIn.
Co-Authored-By: TimedIn <git@timedin.net>
Assisted-by: Claude Code:claude-opus-5-5
Signed-off-by: Andy Scherzinger <info@andy-scherzinger.de>
Closed in favor of #3833
This is an implementation of Conditional Logic. It is not well tested, and I would appreciate review and testing by others to see if it works as intended. I have created a few forms and clicked around to the best of my abilities, but I have implemented the fix for the benefit of others that need it and have no real use case myself to test with.
🖼️ Screenshoots