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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Conditional branch not being recognised as a distinct flow #409

Open
jonodjlee opened this issue Aug 17, 2020 · 1 comment
Open

Conditional branch not being recognised as a distinct flow #409

jonodjlee opened this issue Aug 17, 2020 · 1 comment
Assignees
Labels

Comments

@jonodjlee
Copy link

jonodjlee commented Aug 17, 2020

@jenssogaard this is a fantastic plugin! I am just unsure why it doesn't recognise the cf-conditional-remote="no", instead going back into the "yes" flow 馃. I have discovered that removing the regex condition on the inputs in the "yes" flow help, but I need the regex to continue the flow with any input. Is there a workaround?

Screen Shot 2020-08-17 at 10 47 48 pm

`

    <cf-robot-message cf-questions="Hello my friend &#x1F44B;&amp;&amp;Let's begin..."></cf-robot-message>
    <input type="text" name="firstname" id="firstname" placeholder="firstname" cf-questions="What's your first name?" />
    <input type="text" name="lastname" id="lastname" placeholder="lastname" cf-questions="Hi {firstname}, what's your last name?" />
    <!--<input cf-questions="{firstname} {lastname}, what a solid name!&amp;&amp;Do you currently work remotely?" cf-label="Yes" type="radio" name="remote" value="yes">
    <input cf-label="No" type="radio" name="remote" value="no">-->
    
    <fieldset cf-questions="{firstname} {lastname}, what a solid name!&amp;&amp;Do you currently work remotely?">
        <input required type="radio" name="remote" id="remotetrue" value="yes" cf-conditional-lastname="[\w\W]*">
        <label for="remotetrue">Yes</label>

        <input required type="radio" name="remote" id="remotefalse" value="no" cf-conditional-lastname="[\w\W]*">
        <label for="remotefalse">No</label>
    </fieldset>
    
    

    <fieldset cf-questions="Ok! Have you worked remotely in the past?">
        <input required type="radio" name="yesremotepast" id="currentremotepasttrue" value="yes" cf-conditional-remote="yes">
        <label for="currentremotepasttrue">Yes</label>

        <input required type="radio" name="yesremotepast" id="currentremotepastfalse" value="no" cf-conditional-remote="yes">
        <label for="currentremotepastfalse">No</label>
    </fieldset>
    
    <input type="text" name="findingwfh" id="findingwfh" cf-questions="How are you finding working from home?" cf-conditional-yesremotepast="no">
    
    <fieldset cf-questions="Alright! Are you comfortable working from home?">
        <input required type="radio" name="yesremotepastcomfortable" id="currentremotepasttruecomforttrue" value="yes" cf-conditional-findingwfh="[\w\W]*" cf-conditional-yesremotepast="yes">
        <label for="currentremotepasttruecomforttrue">Yes</label>

        <input required type="radio" name="yesremotepastcomfortable" id="currentremotepastfalsecomfortfalse" value="no" cf-conditional-findingwfh="[\w\W]*" cf-conditional-findingwfh="yes">
        <label for="currentremotepastfalsecomfortfalse">No</label>
    </fieldset>
    
    <input type="text" name="yesremotepastnocomfortexp" id="yesremotepastnocomfortexp" cf-questions="Could you please explain why?" cf-conditional-yesremotepastcomfortable="no">
    
    <fieldset cf-questions="Next one... Has working from home affected the quality of your work?">
        <input required type="radio" name="yesremotepastquality" id="currentremotepastqualitytrue" value="yes" cf-conditional-yesremotepastnocomfortexp="[\w\W]*">
        <label for="currentremotepastqualitytrue">Yes</label>

        <input required type="radio" name="yesremotepastquality" id="currentremotepastqualityfalse" value="no" cf-conditional-yesremotepastnocomfortexp="[\w\W]*">
        <label for="currentremotepastqualityfalse">No</label>
    </fieldset>
    
    <input type="text" name="yesremotepastqualityexp" id="yesremotepastqualityexp" cf-questions="Could you please elaborate?" cf-conditional-yesremotepastquality="yes">
    
    <fieldset cf-questions="Sweet... Do you currently have adequate infrastructure or appropriate furniture to work from home?">
        <input required type="radio" name="yesremotepastinfra" id="currentremotepastinfratrue" value="yes" cf-conditional-yesremotepastqualityexp="[\w\W]*">
        <label for="currentremotepastinfratrue">Yes</label>

        <input required type="radio" name="yesremotepastinfra" id="currentremotepastinfrafalse" value="no" cf-conditional-yesremotepastqualityexp="[\w\W]*">
        <label for="currentremotepastinfrafalse">No</label>
    </fieldset>
    
    <input type="text" name="yesremotepastinfraexp" id="yesremotepastinfraexp" cf-questions="Could you please explain further?" cf-conditional-yesremotepastinfra="no">
    
    <input type="text" name="yesremotepastchange" id="yesremotepastchange" cf-questions="Would you change anything about how you work remotely?" cf-conditional-yesremotepastinfraexp="[\w\W]*">

    <fieldset cf-questions="Nice! Have you worked remotely in the past?">
        <input required type="radio" name="noremotepast" id="pastremotepasttrue" value="yes" cf-conditional-remote="no">
        <label for="pastremotepasttrue">Yes</label>

        <input required type="radio" name="noremotepast" id="pastremotepastfalse" value="no" cf-conditional-remote="no">
        <label for="pastremotepastfalse">No</label>
    </fieldset>
    
    <input type="text" name="noremotepastchange" id="noremotepastchange" cf-questions="How has your working environment evolved since the start of 2020?" cf-conditional-noremotepast="yes||no">
    
    <fieldset cf-questions="Okie dokie... Would you be willing to purchase an online course designed to increase your productivity while working from home?">
        <input required type="radio" name="course" id="coursetrue" value="yes" cf-conditional-noremotepastchange="[\w\W]*" cf-conditional-yesremotepastchange="[\w\W]*">
        <label for="coursetrue">Yes</label>

        <input required type="radio" name="course" id="coursefalse" value="no" cf-conditional-noremotepastchange="[\w\W]*" cf-conditional-yesremotepastchange="[\w\W]*">
        <label for="coursefalse">No</label>
    </fieldset>
    
</form>`
@jonodjlee
Copy link
Author

jonodjlee commented Aug 17, 2020

I removed all the regex and added an extra boolean condition to every input and it works better, but it still skips a few steps 馃槗. @jenssogaard any solutions?

cf-conditional-yesremotepastnocomfortexp="" cf-conditional-remote="yes"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants