|
|
@@ -219,24 +219,8 @@ class BoltService {
|
|
|
{
|
|
|
type: 'actions',
|
|
|
elements: [
|
|
|
- {
|
|
|
- type: 'button',
|
|
|
- text: {
|
|
|
- type: 'plain_text',
|
|
|
- text: 'Next',
|
|
|
- },
|
|
|
- action_id: 'showNextResults',
|
|
|
- },
|
|
|
- {
|
|
|
- type: 'button',
|
|
|
- text: {
|
|
|
- type: 'plain_text',
|
|
|
- text: 'Share',
|
|
|
- },
|
|
|
- style: 'primary',
|
|
|
- action_id: 'shareSearchResults',
|
|
|
- value: `${keywordsAndDesc} \n\n ${urls.join('\n')}`,
|
|
|
- },
|
|
|
+ this.generateButtonBlock('Next', 'showNextResults'),
|
|
|
+ this.generateButtonBlock('Share', 'shareSearchResults', 'primary', `${keywordsAndDesc} \n\n ${urls.join('\n')}`),
|
|
|
],
|
|
|
},
|
|
|
],
|
|
|
@@ -341,6 +325,19 @@ class BoltService {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+ generateButtonBlock(text, actionId, style, value) {
|
|
|
+ return {
|
|
|
+ type: 'button',
|
|
|
+ text: {
|
|
|
+ type: 'plain_text',
|
|
|
+ text,
|
|
|
+ },
|
|
|
+ style,
|
|
|
+ action_id: actionId,
|
|
|
+ value,
|
|
|
+ };
|
|
|
+ }
|
|
|
+
|
|
|
generateMarkdownSectionBlock(blocks) {
|
|
|
return {
|
|
|
type: 'section',
|