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

Conditions don't work in preview mode when not starting on the start page #1126

Open
ziggy-cyb opened this issue Oct 5, 2023 · 0 comments
Open
Labels
bug Something isn't working

Comments

@ziggy-cyb
Copy link
Collaborator

Describe the bug
When testing a form in preview mode, if you start on a route that isn't in the main flow of the form, conditions won't fire the way they're supposed to.

To Reproduce
Steps to reproduce the behavior:

  1. Create a new form
  2. Import the attached form json
  3. Preview page 2
  4. Click "Yes"
  5. form should route to page 3, but instead routes to page 4

Expected behavior
The form should route to page 3

Repository

  • runner

Desktop (please complete the following information):

  • OS: MacOS 13.4.1
  • Browser: Chrome
  • Version: 117.0.5938.132

Additional context
Here is the form JSON:

{
  "metadata": {},
  "startPage": "/first-page",
  "pages": [
    {
      "title": "First page",
      "path": "/first-page",
      "components": [],
      "next": []
    },
    {
      "title": "Summary",
      "path": "/summary",
      "controller": "./pages/summary.js",
      "components": []
    },
    {
      "path": "/page-2",
      "title": "Page 2",
      "components": [
        {
          "name": "jwjcCz",
          "options": {},
          "type": "YesNoField",
          "title": "Yes or no"
        }
      ],
      "next": [
        { "path": "/page-3", "condition": "fNIvrP" },
        { "path": "/page-4" }
      ]
    },
    { "path": "/page-3", "title": "Page 3", "components": [], "next": [] },
    { "path": "/page-4", "title": "Page 4", "components": [], "next": [] }
  ],
  "lists": [],
  "sections": [],
  "conditions": [
    {
      "displayName": "Yes or no is yes",
      "name": "fNIvrP",
      "value": {
        "name": "Yes or no is yes",
        "conditions": [
          {
            "field": {
              "name": "jwjcCz",
              "type": "YesNoField",
              "display": "Yes or no"
            },
            "operator": "is",
            "value": { "type": "Value", "value": "true", "display": "true" }
          }
        ]
      }
    }
  ],
  "fees": [],
  "outputs": [],
  "version": 2,
  "skipSummary": false
}
@ziggy-cyb ziggy-cyb moved this from 🆕 New to 📋 Backlog in XGovFormBuilder kanban Oct 5, 2023
@ziggy-cyb ziggy-cyb added the bug Something isn't working label Oct 5, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
Status: 📋 Backlog
Development

No branches or pull requests

1 participant