🔀 Merge branch 'RicardoE105-feature/clickup-node'

This commit is contained in:
Jan Oberhauser 2020-01-26 19:51:00 -08:00
commit 0c3514926d
2 changed files with 68 additions and 1 deletions

View file

@ -125,6 +125,22 @@ export class ClickUp implements INodeType {
}
return returnData;
},
// Get all the available lists without a folder to display them to user so that he can
// select them easily
async getFolderlessLists(this: ILoadOptionsFunctions): Promise<INodePropertyOptions[]> {
const spaceId = this.getCurrentNodeParameter('space') as string;
const returnData: INodePropertyOptions[] = [];
const { lists } = await clickupApiRequest.call(this, 'GET', `/space/${spaceId}/list`);
for (const list of lists) {
const listName = list.name;
const listId = list.id;
returnData.push({
name: listName,
value: listId,
});
}
return returnData;
},
// Get all the available assignees to display them to user so that he can
// select them easily
async getAssignees(this: ILoadOptionsFunctions): Promise<INodePropertyOptions[]> {

View file

@ -87,6 +87,23 @@ export const taskFields = [
},
required: true,
},
{
displayName: 'Folderless List',
name: 'folderless',
type: 'boolean',
default: false,
displayOptions: {
show: {
resource: [
'task',
],
operation: [
'create',
],
},
},
required: true,
},
{
displayName: 'Folder',
name: 'folder',
@ -100,13 +117,16 @@ export const taskFields = [
operation: [
'create',
],
folderless: [
false,
],
},
},
typeOptions: {
loadOptionsMethod: 'getFolders',
loadOptionsDependsOn: [
'space',
]
],
},
required: true,
},
@ -123,6 +143,35 @@ export const taskFields = [
operation: [
'create',
],
folderless: [
true,
],
},
},
typeOptions: {
loadOptionsMethod: 'getFolderlessLists',
loadOptionsDependsOn: [
'space',
],
},
required: true,
},
{
displayName: 'List',
name: 'list',
type: 'options',
default: '',
displayOptions: {
show: {
resource: [
'task',
],
operation: [
'create',
],
folderless: [
false,
],
},
},
typeOptions: {
@ -225,6 +274,7 @@ export const taskFields = [
name: 'priority',
type: 'number',
typeOptions: {
minValue: 1,
maxValue: 4,
},
description: 'Integer mapping as 1 : Urgent, 2 : High, 3 : Normal, 4 : Low',
@ -358,6 +408,7 @@ export const taskFields = [
name: 'priority',
type: 'number',
typeOptions: {
minValue: 1,
maxValue: 4,
},
description: 'Integer mapping as 1 : Urgent, 2 : High, 3 : Normal, 4 : Low',