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

add install-succeeded-but-has-problem.ejs

Yuki Takei 4 лет назад
Родитель
Сommit
2ccfa74de3

+ 3 - 3
packages/slackbot-proxy/src/controllers/slack.ts

@@ -349,15 +349,15 @@ export class SlackCtrl {
     await this.installerService.installer.handleCallback(req, serverRes, {
     await this.installerService.installer.handleCallback(req, serverRes, {
       success: async(installation, metadata, req, res) => {
       success: async(installation, metadata, req, res) => {
 
 
+        logger.info('Success to install', { installation, metadata });
+
         // check whether bot is not null
         // check whether bot is not null
         if (installation.bot == null) {
         if (installation.bot == null) {
-          const result = await platformRes.render('install-failed.ejs', { url: addToSlackUrl });
+          const result = await platformRes.render('install-succeeded-but-has-problem.ejs', { reason: '`installation.bot` is null' });
           res.writeHead(500, { 'Content-Type': 'text/html; charset=utf-8' });
           res.writeHead(500, { 'Content-Type': 'text/html; charset=utf-8' });
           return res.end(result);
           return res.end(result);
         }
         }
 
 
-        logger.info('Success to install', { installation, metadata });
-
         const appPageUrl = `https://slack.com/apps/${installation.appId}`;
         const appPageUrl = `https://slack.com/apps/${installation.appId}`;
         const result = await platformRes.render('install-succeeded.ejs', { appPageUrl });
         const result = await platformRes.render('install-succeeded.ejs', { appPageUrl });
         res.writeHead(200, { 'Content-Type': 'text/html; charset=utf-8' });
         res.writeHead(200, { 'Content-Type': 'text/html; charset=utf-8' });

+ 18 - 0
packages/slackbot-proxy/src/views/install-succeeded-but-has-problem.ejs

@@ -0,0 +1,18 @@
+<%- include('commons/head'); %>
+
+<body>
+  <div class="container">
+    <div class="row">
+      <div class="col text-center">
+        <h1 class="my-5">GROWI Bot installation has succeeded, but something went wrong..</h1>
+        <p>
+          Reason: <%- reason%>
+        </p>
+        <p>
+          Please contact administrators of your workspace<br>
+          Reference: <a href="https://slack.com/help/articles/222386767-Manage-app-installation-settings-for-your-workspace">Manage app installation settings for your workspace</a>
+        </p>
+      </div>
+    </div>
+  </div>
+</body>