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

[Data collection] Done button not showing when conditional task is final task #2394

Open
gino-m opened this issue Mar 18, 2024 · 1 comment
Labels
type: bug Something isn't working

Comments

@gino-m
Copy link
Collaborator

gino-m commented Mar 18, 2024

The button label should say "Done", instead it shows "Next".

Survey (with ACL removed)..

{
  "description": "",
  "jobs": {
    "wr7jv1ZXAAKJ50x2z21y": {
      "name": "Label a point",
      "id": "wr7jv1ZXAAKJ50x2z21y",
      "defaultStyle": {
        "color": "#F37C22"
      },
      "tasks": {
        "R3bgHzIrNZywrUrzkQJy": {
          "addLoiTask": false,
          "label": "Land cover",
          "options": {
            "iwR633IAkxzdILsByP3I": {
              "code": "",
              "label": "Forestland",
              "index": 0
            },
            "CWNRTdcdMJih8QxvjRSj": {
              "label": "Other",
              "code": "",
              "index": 5
            },
            "MSx7wqwadWxwUADyLyrm": {
              "code": "",
              "index": 3,
              "label": "Grassland"
            },
            "P1Q8Nk8mqpT0u3syCDGb": {
              "index": 4,
              "code": "",
              "label": "Wetland"
            },
            "jiEa0g8vziTuNy2BEy97": {
              "label": "Settlements",
              "code": "",
              "index": 2
            },
            "i71ttovXowWXwmyGxBCd": {
              "index": 1,
              "label": "Cropland",
              "code": ""
            }
          },
          "index": 1,
          "type": "multiple_choice",
          "cardinality": "select_one",
          "hasOtherOption": false,
          "required": false
        },
        "VVm0OjJKpNXwETo3rULk": {
          "required": true,
          "label": "Define plot boundaries",
          "type": "draw_area",
          "index": 0,
          "addLoiTask": true
        },
        "GAie6HrMvn3q2BTYu6uN": {
          "options": {
            "lvdc5KuRM2MnqgtnHoxC": {
              "index": 0,
              "label": "Palm",
              "code": ""
            },
            "wDmg0bu7aOWMtyUtrsse": {
              "index": 2,
              "code": "",
              "label": "Coffee"
            },
            "labNfMorqBAqtDSlirCS": {
              "code": "",
              "index": 1,
              "label": "Cocoa"
            },
            "1jICyjEFlLrGXBHtEemd": {
              "label": "Rubber",
              "code": "",
              "index": 5
            },
            "OZ7uGXZmi0kdPhBXX6GN": {
              "index": 4,
              "code": "",
              "label": "Beef"
            },
            "GRPbVwNbYoKAmgQzK6nI": {
              "label": "Soy",
              "code": "",
              "index": 3
            }
          },
"condition": {
    "matchType": "MATCH_ALL",
    "expressions": [
         {
            "expressionType": "ONE_OF_SELECTED",
            "taskId": "R3bgHzIrNZywrUrzkQJy",
            "optionIds": ["i71ttovXowWXwmyGxBCd"]
         }
      ]
    },
          "required": false,
          "label": "Subtypes cropland",
          "index": 2,
          "hasOtherOption": false,
          "addLoiTask": false,
          "cardinality": "select_one",
          "type": "multiple_choice"
        },
        "oHTFUT8m3Pa4wHJGb58t": {
          "label": "North facing",
          "type": "photo",
          "index": 3,
          "addLoiTask": false,
          "required": false
        }
      },
      "index": 1,
      "strategy": "MIXED"
    }
  },
  "title": "Land cover descriptors",
  "acl": {
   // ...
  }
}

@sufyanAbbasi FYI

@gino-m gino-m added the type: bug Something isn't working label Mar 18, 2024
@gino-m gino-m added this to the 3. OSS launch (21-Jul-24) milestone Mar 18, 2024
@gino-m gino-m changed the title [Data collection] Done button not showing on conditional task [Data collection] Done button not showing when conditional task is last task Mar 18, 2024
@gino-m gino-m changed the title [Data collection] Done button not showing when conditional task is last task [Data collection] Done button not showing when conditional task is final task Mar 18, 2024
@sufyanAbbasi
Copy link
Contributor

sufyanAbbasi commented Mar 22, 2024

Needed to modify your survey since a photo task was added at the end. To repro, the second to last task needs to be non-conditional, and the last task hidden due to unfulfilling the condition. In this situation, the Done button does not get rendered since it's not the actual last task in the list even though it's the last task in the sequence. I think the problem is that the "Done" button is triggered when the current view is the final view in the list of absolute views, but is not calculated dynamically.

It gets really weird when the task that triggers subsequent conditions is the last task in the sequence, then it has no way of knowing that it is or isn't the last task!

I didn't end up fixing this problem the first time since it was a bit out of my understanding, but I'm happy to tackle it after I get some P0s or P1s out of the way.

Conditional task is the final task:
Screenshot 2024-03-21 at 5 34 08 PM

Non-conditional task is the final task (the previous one is hidden):
Screenshot 2024-03-21 at 5 35 13 PM

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: bug Something isn't working
Projects
Status: Todo
Development

No branches or pull requests

2 participants