feat(Slack Node): Add blocks to slack message update (#2182)

* Adding blocks to slack message update

* Fixing lint

* Adding blocks to slack message update

* Fixing lint

*  added toggle to display json inputs in update operation

*  Improvements

* feat(Markdown Node): Add new node to covert between Markdown <> HTML (#1728)

*  Markdown Node

* Tweaked wording

* ⬆️ Bump showdown to latest version

*  Small improvement

* 👕 Fix linting issue

*  Small improvements

* 🔨 added options, added continue on fail, some clean up

*  removed test code

*  added missing semicolumn

* 🔨 wip

* 🔨 replaced library for converting html to markdown, added options

*  lock file fix

* 🔨 clean up

Co-authored-by: sirdavidoff <1670123+sirdavidoff@users.noreply.github.com>
Co-authored-by: Michael Kret <michael.k@radency.com>

Co-authored-by: Michael Kret <michael.k@radency.com>
Co-authored-by: ricardo <ricardoespinoza105@gmail.com>
Co-authored-by: Ricardo Espinoza <ricardo@n8n.io>
Co-authored-by: sirdavidoff <1670123+sirdavidoff@users.noreply.github.com>
Co-authored-by: Jan Oberhauser <jan.oberhauser@gmail.com>
This commit is contained in:
Mike Quinlan
2022-04-19 05:36:01 -05:00
committed by GitHub
parent f566569299
commit b5b60008d6
6 changed files with 250 additions and 150 deletions

View File

@@ -171,6 +171,97 @@ export const messageFields: INodeProperties[] = [
},
},
},
{
displayName: 'Options',
name: 'otherOptions',
type: 'collection',
displayOptions: {
show: {
operation: [
'post',
'postEphemeral',
],
resource: [
'message',
],
},
},
default: {},
description: 'Other options to set',
placeholder: 'Add options',
options: [
{
displayName: 'Icon Emoji',
name: 'icon_emoji',
type: 'string',
default: '',
description: 'Emoji to use as the icon for this message. Overrides icon_url.',
},
{
displayName: 'Icon URL',
name: 'icon_url',
type: 'string',
default: '',
description: 'URL to an image to use as the icon for this message.',
},
{
displayName: 'Link Names',
name: 'link_names',
type: 'boolean',
default: false,
description: 'Find and link channel names and usernames.',
},
{
displayName: 'Make Reply',
name: 'thread_ts',
type: 'string',
default: '',
description: 'Provide another message\'s ts value to make this message a reply.',
},
{
displayName: 'Markdown',
name: 'mrkdwn',
type: 'boolean',
default: true,
description: 'Use Slack Markdown parsing.',
},
{
displayName: 'Reply Broadcast',
name: 'reply_broadcast',
type: 'boolean',
default: false,
description: 'Used in conjunction with thread_ts and indicates whether reply should be made visible to everyone in the channel or conversation.',
},
{
displayName: 'Unfurl Links',
name: 'unfurl_links',
type: 'boolean',
default: false,
description: 'Pass true to enable unfurling of primarily text-based content.',
},
{
displayName: 'Unfurl Media',
name: 'unfurl_media',
type: 'boolean',
default: true,
description: 'Pass false to disable unfurling of media content.',
},
{
displayName: 'Send as User',
name: 'sendAsUser',
type: 'string',
displayOptions: {
show: {
'/authentication': [
'accessToken',
],
},
},
default: '',
description: 'The message will be sent from this username (i.e. as if this individual sent the message).',
},
],
},
{
displayName: 'Attachments',
name: 'attachments',
@@ -367,97 +458,6 @@ export const messageFields: INodeProperties[] = [
},
],
},
{
displayName: 'Other Options',
name: 'otherOptions',
type: 'collection',
displayOptions: {
show: {
operation: [
'post',
'postEphemeral',
],
resource: [
'message',
],
},
},
default: {},
description: 'Other options to set',
placeholder: 'Add options',
options: [
{
displayName: 'Icon Emoji',
name: 'icon_emoji',
type: 'string',
default: '',
description: 'Emoji to use as the icon for this message. Overrides icon_url.',
},
{
displayName: 'Icon URL',
name: 'icon_url',
type: 'string',
default: '',
description: 'URL to an image to use as the icon for this message.',
},
{
displayName: 'Link Names',
name: 'link_names',
type: 'boolean',
default: false,
description: 'Find and link channel names and usernames.',
},
{
displayName: 'Make Reply',
name: 'thread_ts',
type: 'string',
default: '',
description: 'Provide another message\'s ts value to make this message a reply.',
},
{
displayName: 'Markdown',
name: 'mrkdwn',
type: 'boolean',
default: true,
description: 'Use Slack Markdown parsing.',
},
{
displayName: 'Reply Broadcast',
name: 'reply_broadcast',
type: 'boolean',
default: false,
description: 'Used in conjunction with thread_ts and indicates whether reply should be made visible to everyone in the channel or conversation.',
},
{
displayName: 'Unfurl Links',
name: 'unfurl_links',
type: 'boolean',
default: false,
description: 'Pass true to enable unfurling of primarily text-based content.',
},
{
displayName: 'Unfurl Media',
name: 'unfurl_media',
type: 'boolean',
default: true,
description: 'Pass false to disable unfurling of media content.',
},
{
displayName: 'Send as User',
name: 'sendAsUser',
type: 'string',
displayOptions: {
show: {
'/authentication': [
'accessToken',
],
},
},
default: '',
description: 'The message will be sent from this username (i.e. as if this individual sent the message).',
},
],
},
/* ----------------------------------------------------------------------- */
/* message:update */
@@ -487,7 +487,7 @@ export const messageFields: INodeProperties[] = [
displayName: 'Text',
name: 'text',
type: 'string',
required: true,
required: false,
default: '',
displayOptions: {
show: {
@@ -519,6 +519,22 @@ export const messageFields: INodeProperties[] = [
},
description: `Timestamp of the message to be updated.`,
},
{
displayName: 'JSON parameters',
name: 'jsonParameters',
type: 'boolean',
default: false,
displayOptions: {
show: {
operation: [
'update',
],
resource: [
'message',
],
},
},
},
{
displayName: 'Update Fields',
name: 'updateFields',
@@ -566,6 +582,54 @@ export const messageFields: INodeProperties[] = [
},
],
},
{
displayName: 'Attachments',
name: 'attachmentsJson',
type: 'json',
default: '',
required: false,
typeOptions: {
alwaysOpenEditWindow: true,
},
displayOptions: {
show: {
resource: [
'message',
],
operation: [
'update',
],
jsonParameters: [
true,
],
},
},
description: 'The attachments to add',
},
{
displayName: 'Blocks',
name: 'blocksJson',
type: 'json',
default: '',
required: false,
typeOptions: {
alwaysOpenEditWindow: true,
},
displayOptions: {
show: {
resource: [
'message',
],
operation: [
'update',
],
jsonParameters: [
true,
],
},
},
description: 'The blocks to add',
},
{
displayName: 'Blocks',
name: 'blocksUi',