Просмотр исходного кода

added descriptions of response_urls

kaori 4 лет назад
Родитель
Сommit
98a9c65bb3

+ 1 - 0
packages/slackbot-proxy/src/controllers/slack.ts

@@ -153,6 +153,7 @@ export class SlackCtrl {
     const { type } = payload;
 
     // register
+    // response_urls is an array but the element included is only one.
     if (type === 'view_submission' && payload.response_urls[0].action_id === 'submit_growi_url_and_access_tokens') {
       await this.registerService.upsertOrderRecord(this.orderRepository, installation, payload);
       await this.registerService.notifyServerUriToSlack(authorizeResult, payload);

+ 2 - 0
packages/slackbot-proxy/src/services/RegisterService.ts

@@ -36,6 +36,8 @@ export class RegisterService implements GrowiCommandProcessor {
           generateInputSectionBlock('growiDomain', 'GROWI domain', 'contents_input', false, 'https://example.com'),
           generateInputSectionBlock('growiAccessToken', 'GROWI ACCESS_TOKEN', 'contents_input', false, 'jBMZvpk.....'),
           generateInputSectionBlock('proxyToken', 'PROXY ACCESS_TOKEN', 'contents_input', false, 'jBMZvpk.....'),
+          // added an input block to make response_url enabled and get info (block_id, action_id, channel_id, response_url)
+          // refer to https://api.slack.com/surfaces/modals/using#modal_response_url
           {
             block_id: 'channel_to_post_proxy_url',
             type: 'input',