Uploaded image for project: 'Planet4'
  1. Planet4
  2. PLANET-3727

Implement pre-check setting for opt-ins/questions (checkbox)

XMLWordPrintable

    • Icon: Task Task
    • Resolution: Done
    • Icon: Should have Should have
    • 1.62

      Problem:
      In engaging networks an opt-in question that is of type checkbox, has the setting 'Pre-check'.
      This means the checkbox will be already checked when the engaging forms will be rendered.
      This setting is not respected/transferred to enforms currently.

      Solution
      Use that information and mimic the behavior in enforms.
      When a user selects an opt-in/question and sets it as checkbox, check if the api response contains that setting and store it as an attribute in the field.
      At form rendering in the frontend that attribute should be used to pre-check the checkbox if it is set in engaging networks

      Questions and opt-ins url
      https://www.e-activist.com/index.html#componentlist/question

      Example opt-in in international sandbox

      Example Api response for that opt-in

      [
          {
              "id": 242254,
              "questionId": 25903,
              "name": "email updates",
              "type": "OPT",
              "locale": "en-US",
              "htmlFieldType": "checkbox",
              "content": {
                  "data": [
                      {
                          "forId": "",
                          "imageUrl": "",
                          "selected": true,
                          "label": "I am happy to receive email updates from Greenpeace about important campaigns.",
                          "value": "Y"
                      }
                  ]
              }
          }
      ]
      

      Tasks:

      • Make sure to respect what EN sends in the data>selected field so that if its true it is already pre selected in form

            sdeshmuk Sagar Deshmukh
            jmarubay Julia Marubayashi
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved: