Added improvements

This commit is contained in:
ricardo
2020-03-27 15:17:10 -04:00
parent 9320d415d6
commit 1050f13d54
6 changed files with 1096 additions and 523 deletions

View File

@@ -1,4 +1,6 @@
import { INodeProperties } from "n8n-workflow";
import {
INodeProperties,
} from "n8n-workflow";
export const boardOperations = [
{
@@ -13,11 +15,6 @@ export const boardOperations = [
},
},
options: [
{
name: 'Add Column',
value: 'addColumn',
description: 'Add column to a board',
},
{
name: 'Archive',
value: 'archive',
@@ -28,16 +25,6 @@ export const boardOperations = [
value: 'create',
description: 'Create a new board',
},
{
name: 'Create Group',
value: 'createGroup',
description: 'Create a group in a board',
},
{
name: 'Create Item',
value: 'createItem',
description: `Create a item in a board's group`,
},
{
name: 'Get',
value: 'get',
@@ -48,16 +35,6 @@ export const boardOperations = [
value: 'getAll',
description: 'Get all boards',
},
{
name: 'Get Columns',
value: 'getColumns',
description: `Get board's columns`,
},
{
name: 'Get Groups',
value: 'getGroups',
description: `Get board's groups`,
},
],
default: 'create',
description: 'The operation to perform.',
@@ -65,175 +42,7 @@ export const boardOperations = [
] as INodeProperties[];
export const boardFields = [
/* -------------------------------------------------------------------------- */
/* board:addColumn */
/* -------------------------------------------------------------------------- */
{
displayName: 'Board ID',
name: 'boardId',
type: 'options',
typeOptions: {
loadOptionsMethod: 'getBoards',
},
required: true,
displayOptions: {
show: {
resource: [
'board',
],
operation: [
'addColumn',
],
},
},
},
{
displayName: 'Title',
name: 'title',
type: 'string',
required: true,
displayOptions: {
show: {
resource: [
'board',
],
operation: [
'addColumn',
],
},
},
},
{
displayName: 'Column Type',
name: 'columnType',
type: 'options',
options: [
{
name: 'Country',
value: 'country',
},
{
name: 'Checkbox',
value: 'checkbox',
},
{
name: 'Date',
value: 'date',
},
{
name: 'Dropdown',
value: 'dropdown',
},
{
name: 'Email',
value: 'email',
},
{
name: 'Hour',
value: 'hour',
},
{
name: 'Link',
value: 'Link',
},
{
name: 'Long Text',
value: 'longText',
},
{
name: 'Numbers',
value: 'numbers',
},
{
name: 'People',
value: 'people',
},
{
name: 'Person',
value: 'person',
},
{
name: 'Phone',
value: 'phone',
},
{
name: 'Rating',
value: 'rating',
},
{
name: 'Status',
value: 'status',
},
{
name: 'Tags',
value: 'tags',
},
{
name: 'Team',
value: 'team',
},
{
name: 'Text',
value: 'text',
},
{
name: 'Timeline',
value: 'timeline',
},
{
name: 'Timezone',
value: 'timezone',
},
{
name: 'Week',
value: 'week',
},
{
name: 'World Clock',
value: 'worldClock',
},
],
required: true,
displayOptions: {
show: {
resource: [
'board',
],
operation: [
'addColumn',
],
},
},
},
{
displayName: 'Additional Fields',
name: 'additionalFields',
type: 'collection',
placeholder: 'Add Field',
displayOptions: {
show: {
operation: [
'addColumn',
],
resource: [
'board',
],
},
},
default: {},
options: [
{
displayName: 'Defauls',
name: 'defaults',
type: 'json',
typeOptions: {
alwaysOpenEditWindow: true,
},
default: '',
description: `The new column's defaults.`,
},
],
},
/* -------------------------------------------------------------------------- */
/* board:archive */
/* -------------------------------------------------------------------------- */
@@ -241,6 +50,7 @@ export const boardFields = [
displayName: 'Board ID',
name: 'boardId',
type: 'options',
default: '',
typeOptions: {
loadOptionsMethod: 'getBoards',
},
@@ -255,6 +65,7 @@ export const boardFields = [
],
},
},
description: 'Board unique identifiers.',
},
/* -------------------------------------------------------------------------- */
/* board:create */
@@ -339,183 +150,13 @@ export const boardFields = [
],
},
/* -------------------------------------------------------------------------- */
/* board:createGroup */
/* -------------------------------------------------------------------------- */
{
displayName: 'Board ID',
name: 'boardId',
type: 'options',
typeOptions: {
loadOptionsMethod: 'getBoards',
},
required: true,
displayOptions: {
show: {
resource: [
'board',
],
operation: [
'createGroup',
],
},
},
},
{
displayName: 'Name',
name: 'name',
type: 'string',
required: true,
displayOptions: {
show: {
operation: [
'createGroup',
],
resource: [
'board',
],
},
},
default: '',
description: `The group name`,
},
/* -------------------------------------------------------------------------- */
/* board:createItem */
/* -------------------------------------------------------------------------- */
{
displayName: 'Board ID',
name: 'boardId',
type: 'options',
typeOptions: {
loadOptionsMethod: 'getBoards',
},
required: true,
displayOptions: {
show: {
resource: [
'board',
],
operation: [
'createItem',
],
},
},
},
{
displayName: 'Group ID',
name: 'groupId',
type: 'options',
typeOptions: {
loadOptionsMethod: 'getGroups',
loadOptionsDependsOn: 'boardId',
},
required: true,
displayOptions: {
show: {
resource: [
'board',
],
operation: [
'createItem',
],
},
},
},
{
displayName: 'Name',
name: 'name',
type: 'string',
required: true,
displayOptions: {
show: {
operation: [
'createItem',
],
resource: [
'board',
],
},
},
default: '',
description: `The new item's name.`,
},
{
displayName: 'Additional Fields',
name: 'additionalFields',
type: 'collection',
placeholder: 'Add Field',
displayOptions: {
show: {
operation: [
'createItem',
],
resource: [
'board',
],
},
},
default: {},
options: [
{
displayName: 'Column Values',
name: 'columnValues',
type: 'json',
typeOptions: {
alwaysOpenEditWindow: true,
},
default: '',
description: 'The column values of the new item',
},
],
},
/* -------------------------------------------------------------------------- */
/* board:deleteGroup */
/* -------------------------------------------------------------------------- */
{
displayName: 'Board ID',
name: 'boardId',
type: 'options',
typeOptions: {
loadOptionsMethod: 'getBoards',
},
required: true,
displayOptions: {
show: {
resource: [
'board',
],
operation: [
'deleteGroup',
],
},
},
},
{
displayName: 'Group ID',
name: 'groupId',
type: 'options',
typeOptions: {
loadOptionsMethod: 'getGroups',
loadOptionsDependsOn: 'boardId',
},
required: true,
displayOptions: {
show: {
resource: [
'board',
],
operation: [
'deleteGroup',
],
},
},
},
/* -------------------------------------------------------------------------- */
/* board:get */
/* -------------------------------------------------------------------------- */
{
displayName: 'Board ID',
name: 'boardId',
type: 'string',
default: '',
required: true,
displayOptions: {
show: {
@@ -527,6 +168,7 @@ export const boardFields = [
],
},
},
description: 'Board unique identifiers.',
},
/* -------------------------------------------------------------------------- */
/* board:getAll */
@@ -572,48 +214,4 @@ export const boardFields = [
default: 50,
description: 'How many results to return.',
},
/* -------------------------------------------------------------------------- */
/* board:getColumns */
/* -------------------------------------------------------------------------- */
{
displayName: 'Board ID',
name: 'boardId',
type: 'options',
typeOptions: {
loadOptionsMethod: 'getBoards',
},
required: true,
displayOptions: {
show: {
resource: [
'board',
],
operation: [
'getColumns',
],
},
},
},
/* -------------------------------------------------------------------------- */
/* board:getGroups */
/* -------------------------------------------------------------------------- */
{
displayName: 'Board ID',
name: 'boardId',
type: 'options',
typeOptions: {
loadOptionsMethod: 'getBoards',
},
required: true,
displayOptions: {
show: {
resource: [
'board',
],
operation: [
'getGroups',
],
},
},
},
] as INodeProperties[];