mirror of
https://github.com/n8n-io/n8n.git
synced 2025-01-12 13:27:31 -08:00
Subscriptions now front view
This commit is contained in:
parent
4ec8a2b44c
commit
bb2f1ecd00
|
@ -48,6 +48,51 @@ export const streamFields = [
|
|||
/* -------------------------------------------------------------------------- */
|
||||
/* stream:create */
|
||||
/* -------------------------------------------------------------------------- */
|
||||
{
|
||||
displayName: 'Subscriptions',
|
||||
name: 'subscriptions',
|
||||
type: 'fixedCollection',
|
||||
required: true,
|
||||
default: '',
|
||||
description: 'A list of dictionaries containing the the key name and value specifying the name of the stream to subscribe. If the stream does not exist a new stream is created.',
|
||||
displayOptions: {
|
||||
show: {
|
||||
resource: [
|
||||
'stream',
|
||||
],
|
||||
operation: [
|
||||
'create',
|
||||
],
|
||||
},
|
||||
},
|
||||
typeOptions: {
|
||||
multipleValues: true,
|
||||
},
|
||||
options: [
|
||||
{
|
||||
displayName: 'Subscription Properties',
|
||||
name: 'properties',
|
||||
values: [
|
||||
{
|
||||
displayName: 'Name',
|
||||
name: 'name',
|
||||
type: 'string',
|
||||
required: true,
|
||||
default: '',
|
||||
description: 'Name of Subscription.',
|
||||
},
|
||||
{
|
||||
displayName: 'Description',
|
||||
name: 'description',
|
||||
type: 'string',
|
||||
required: true,
|
||||
default: '',
|
||||
description: 'Description of Subscription.',
|
||||
}
|
||||
],
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
displayName: 'JSON Parameters',
|
||||
name: 'jsonParameters',
|
||||
|
@ -162,40 +207,6 @@ export const streamFields = [
|
|||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
displayName: 'Subscriptions',
|
||||
name: 'subscriptions',
|
||||
type: 'fixedCollection',
|
||||
required: true,
|
||||
description: '"A list of dictionaries containing the the key name and value specifying the name of the stream to subscribe. If the stream does not exist a new stream is created.',
|
||||
typeOptions: {
|
||||
multipleValues: true,
|
||||
},
|
||||
options: [
|
||||
{
|
||||
displayName: 'Subscription Properties',
|
||||
name: 'properties',
|
||||
values: [
|
||||
{
|
||||
displayName: 'Name',
|
||||
name: 'name',
|
||||
type: 'string',
|
||||
required: true,
|
||||
default: '',
|
||||
description: 'Name of Subscription.',
|
||||
},
|
||||
{
|
||||
displayName: 'Description',
|
||||
name: 'description',
|
||||
type: 'string',
|
||||
required: true,
|
||||
default: '',
|
||||
description: 'Description of Subscription.',
|
||||
}
|
||||
],
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
displayName: 'Stream Post Policy',
|
||||
name: 'streamPostPolicy',
|
||||
|
|
|
@ -262,7 +262,11 @@ export class Zulip implements INodeType {
|
|||
if (operation === 'create') {
|
||||
|
||||
const jsonParameters = this.getNodeParameter('jsonParameters', i) as boolean;
|
||||
const subscriptions = this.getNodeParameter('subscriptions', i) as IDataObject[];
|
||||
|
||||
//@ts-ignore
|
||||
body.subscriptions = JSON.stringify(subscriptions.properties);
|
||||
|
||||
if (jsonParameters) {
|
||||
const additionalFieldsJson = this.getNodeParameter('additionalFieldsJson', i) as string;
|
||||
|
||||
|
@ -281,10 +285,6 @@ export class Zulip implements INodeType {
|
|||
|
||||
const additionalFields = this.getNodeParameter('additionalFields', i) as IDataObject;
|
||||
|
||||
if (additionalFields.subscriptions) {
|
||||
//@ts-ignore
|
||||
body.subscriptions = JSON.stringify(additionalFields.subscriptions.properties);
|
||||
}
|
||||
if (additionalFields.inviteOnly) {
|
||||
body.invite_only = additionalFields.inviteOnly as boolean;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue