2
0
Эх сурвалжийг харах

Merge pull request #3471 from weseek/imprv/gw5259-show-help-search

Imprv/gw5259 show help search
Yuki Takei 5 жил өмнө
parent
commit
31515b47b0

+ 24 - 1
src/server/service/bolt.js

@@ -169,7 +169,24 @@ class BoltService {
       this.client.chat.postEphemeral({
         channel: command.channel_id,
         user: command.user_id,
-        blocks: [this.generateMarkdownSectionBlock(`*No page that matches your keyword(s) "${args}".*`)],
+        blocks: [
+          this.generateMarkdownSectionBlock(`*No page that matches your keyword(s) "${args}".*`),
+          this.generateMarkdownSectionBlock(':mag: *Help: Searching*'),
+          this.divider(),
+          this.generateMarkdownSectionBlock('`word1` `word2` (divide with space) \n Search pages that include both word1, word2 in the title or body'),
+          this.divider(),
+          this.generateMarkdownSectionBlock('`"This is GROWI"` (surround with double quotes) \n Search pages that include the phrase "This is GROWI"'),
+          this.divider(),
+          this.generateMarkdownSectionBlock('`-keyword` \n Exclude pages that include keyword in the title or body'),
+          this.divider(),
+          this.generateMarkdownSectionBlock('`prefix:/user/` \n Search only the pages that the title start with /user/'),
+          this.divider(),
+          this.generateMarkdownSectionBlock('`-prefix:/user/` \n Exclude the pages that the title start with /user/'),
+          this.divider(),
+          this.generateMarkdownSectionBlock('`tag:wiki` \n Search for pages with wiki tag'),
+          this.divider(),
+          this.generateMarkdownSectionBlock('`-tag:wiki` \n Exclude pages with wiki tag'),
+        ],
       });
       return;
     }
@@ -343,6 +360,12 @@ class BoltService {
     };
   }
 
+  divider() {
+    return {
+      type: 'divider',
+    };
+  }
+
   generateInputSectionBlock(blockId, labelText, actionId, isMultiline, placeholder) {
     return {
       type: 'input',