Как остановить пост-запрос из секции ввода модала в slack? - PullRequest
0 голосов
/ 29 января 2020

Я создал модал в слабом состоянии, который вызывается по определенной команде. Когда я отправляю модальное сообщение, HTTP-запрос отправляется на указанный URL-адрес в интерактивных компонентах, но HTTP-запрос отправляется также каждый раз, когда я редактирую входной столбец assetname . Как это остановить? Ниже JSON, который я создал, а также запрос не отправляется при внесении изменений в любое другое поле модального поля.

{
  "type": "modal",
  "title": {
    "type": "plain_text",
    "text": "Asset Details",
    "emoji": true
  },
  "submit": {
    "type": "plain_text",
    "text": "Create Record",
    "emoji": true
  },
  "close": {
    "type": "plain_text",
    "text": "Cancel",
    "emoji": true
  },
  "blocks": [
    {
      "type": "divider"
    },
    {
      "block_id": "assetname",
      "type": "input",
      "element": {
        "type": "plain_text_input",
        "action_id": "asset_name"
      },
      "label": {
        "type": "plain_text",
        "text": "Asset Name",
        "emoji": true
      }
    },
    {
      "type": "input",
      "block_id": "relatedguild",
      "element": {
        "type": "static_select",
        "action_id": "guild",
        "placeholder": {
          "type": "plain_text",
          "text": "Select an item",
          "emoji": true
        },
        "options": [
          {
            "text": {
              "type": "plain_text",
              "text": "B2B Marketing Automation",
              "emoji": true
            },
            "value": "B2B Marketing Automation"
          },
          {
            "text": {
              "type": "plain_text",
              "text": "B2C Marketing Automation",
              "emoji": true
            },
            "value": "B2C Marketing Automation"
          },
          {
            "text": {
              "type": "plain_text",
              "text": "Community Cloud",
              "emoji": true
            },
            "value": "Community Cloud"
          },
          {
            "text": {
              "type": "plain_text",
              "text": "CPQ",
              "emoji": true
            },
            "value": "CPQ"
          },
          {
            "text": {
              "type": "plain_text",
              "text": "Data Analytics",
              "emoji": true
            },
            "value": "Data Analytics"
          },
          {
            "text": {
              "type": "plain_text",
              "text": "Data Core",
              "emoji": true
            },
            "value": "Data Core"
          },
          {
            "text": {
              "type": "plain_text",
              "text": "Declarative Core",
              "emoji": true
            },
            "value": "Declarative Core"
          },
          {
            "text": {
              "type": "plain_text",
              "text": "Development Process",
              "emoji": true
            },
            "value": "Development Process"
          },
          {
            "text": {
              "type": "plain_text",
              "text": "Full Stack",
              "emoji": true
            },
            "value": "Full Stack"
          },
          {
            "text": {
              "type": "plain_text",
              "text": "Non-Profit Industry",
              "emoji": true
            },
            "value": "Non-Profit Industry"
          },
          {
            "text": {
              "type": "plain_text",
              "text": "Project Management",
              "emoji": true
            },
            "value": "Project Management"
          },
          {
            "text": {
              "type": "plain_text",
              "text": "Service Cloud",
              "emoji": true
            },
            "value": "Service Cloud"
          }
        ]
      },
      "label": {
        "type": "plain_text",
        "text": "Related Guild",
        "emoji": true
      }
    },
    {
      "type": "input",
      "block_id": "cloudsImpacted",
      "element": {
        "type": "static_select",
        "action_id": "clouds",
        "placeholder": {
          "type": "plain_text",
          "text": "Select an item",
          "emoji": true
        },
        "options": [
          {
            "text": {
              "type": "plain_text",
              "text": "None",
              "emoji": true
            },
            "value": "None"
          },
          {
            "text": {
              "type": "plain_text",
              "text": "Sales",
              "emoji": true
            },
            "value": "Sales"
          },
          {
            "text": {
              "type": "plain_text",
              "text": "Service",
              "emoji": true
            },
            "value": "Service"
          },
          {
            "text": {
              "type": "plain_text",
              "text": "Community",
              "emoji": true
            },
            "value": "Community"
          },
          {
            "text": {
              "type": "plain_text",
              "text": "Marketing",
              "emoji": true
            },
            "value": "Marketing"
          },
          {
            "text": {
              "type": "plain_text",
              "text": "Field Service",
              "emoji": true
            },
            "value": "Field Service"
          }
        ]
      },
      "label": {
        "type": "plain_text",
        "text": "Clouds Impacted",
        "emoji": true
      }
    },
    {
      "block_id": "description",
      "type": "input",
      "element": {
        "action_id": "descact",
        "type": "plain_text_input",
        "multiline": true
      },
      "label": {
        "type": "plain_text",
        "text": "Description",
        "emoji": true
      }
    }
  ]
}
...