mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2025-12-21 11:49:59 +00:00
⚡ Further simplified ClickUp-Dependency
This commit is contained in:
@@ -885,29 +885,20 @@ export class ClickUp implements INodeType {
|
|||||||
if (resource === 'taskDependency') {
|
if (resource === 'taskDependency') {
|
||||||
if (operation === 'create') {
|
if (operation === 'create') {
|
||||||
const taskId = this.getNodeParameter('task', i) as string;
|
const taskId = this.getNodeParameter('task', i) as string;
|
||||||
const dependecyIs = this.getNodeParameter('is', i) as string;
|
const dependsOnTaskId = this.getNodeParameter('dependsOnTask', i) as string;
|
||||||
const theTaskId = this.getNodeParameter('theTaskId', i) as string;
|
|
||||||
const body: IDataObject = {};
|
const body: IDataObject = {};
|
||||||
if (dependecyIs === 'waitingOn') {
|
|
||||||
body.depends_on = theTaskId;
|
body.depends_on = dependsOnTaskId;
|
||||||
}
|
|
||||||
if (dependecyIs === 'blocking') {
|
|
||||||
body.dependency_of = theTaskId;
|
|
||||||
}
|
|
||||||
responseData = await clickupApiRequest.call(this, 'POST', `/task/${taskId}/dependency`, body);
|
responseData = await clickupApiRequest.call(this, 'POST', `/task/${taskId}/dependency`, body);
|
||||||
responseData = { success: true };
|
responseData = { success: true };
|
||||||
}
|
}
|
||||||
if (operation === 'delete') {
|
if (operation === 'delete') {
|
||||||
const taskId = this.getNodeParameter('task', i) as string;
|
const taskId = this.getNodeParameter('task', i) as string;
|
||||||
const dependecyIs = this.getNodeParameter('is', i) as string;
|
const dependsOnTaskId = this.getNodeParameter('dependsOnTask', i) as string;
|
||||||
const theTaskId = this.getNodeParameter('theTaskId', i) as string;
|
|
||||||
|
qs.depends_on = dependsOnTaskId;
|
||||||
|
|
||||||
if (dependecyIs === 'waitingOn') {
|
|
||||||
qs.depends_on = theTaskId;
|
|
||||||
}
|
|
||||||
if (dependecyIs === 'blocking') {
|
|
||||||
qs.dependency_of = theTaskId;
|
|
||||||
}
|
|
||||||
responseData = await clickupApiRequest.call(this, 'DELETE', `/task/${taskId}/dependency`, {}, qs);
|
responseData = await clickupApiRequest.call(this, 'DELETE', `/task/${taskId}/dependency`, {}, qs);
|
||||||
responseData = { success: true };
|
responseData = { success: true };
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -54,38 +54,8 @@ export const taskDependencyFields = [
|
|||||||
required: true,
|
required: true,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
displayName: 'Is',
|
displayName: 'Depends On Task ID',
|
||||||
name: 'is',
|
name: 'dependsOnTask',
|
||||||
type: 'options',
|
|
||||||
default: '',
|
|
||||||
options: [
|
|
||||||
{
|
|
||||||
name: 'Bloking',
|
|
||||||
value: 'blocking',
|
|
||||||
description: `Tasks that can't start until the task above is completed`,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: 'Waiting On',
|
|
||||||
value: 'waitingOn',
|
|
||||||
description: `Tasks that must be completed before the task above`,
|
|
||||||
},
|
|
||||||
],
|
|
||||||
displayOptions: {
|
|
||||||
show: {
|
|
||||||
resource: [
|
|
||||||
'taskDependency',
|
|
||||||
],
|
|
||||||
operation: [
|
|
||||||
'create',
|
|
||||||
],
|
|
||||||
},
|
|
||||||
},
|
|
||||||
description: 'Dependency type between the two tasks',
|
|
||||||
required: true,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
displayName: 'The Task ID',
|
|
||||||
name: 'theTaskId',
|
|
||||||
type: 'string',
|
type: 'string',
|
||||||
displayOptions: {
|
displayOptions: {
|
||||||
show: {
|
show: {
|
||||||
@@ -120,38 +90,8 @@ export const taskDependencyFields = [
|
|||||||
required: true,
|
required: true,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
displayName: 'Is',
|
displayName: 'Depends On Task ID',
|
||||||
name: 'is',
|
name: 'dependsOnTask',
|
||||||
type: 'options',
|
|
||||||
default: '',
|
|
||||||
options: [
|
|
||||||
{
|
|
||||||
name: 'Bloking',
|
|
||||||
value: 'blocking',
|
|
||||||
description: `Tasks that can't start until the task above is completed`,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: 'Waiting On',
|
|
||||||
value: 'waitingOn',
|
|
||||||
description: `Tasks that must be completed before the task above`,
|
|
||||||
},
|
|
||||||
],
|
|
||||||
displayOptions: {
|
|
||||||
show: {
|
|
||||||
resource: [
|
|
||||||
'taskDependency',
|
|
||||||
],
|
|
||||||
operation: [
|
|
||||||
'delete',
|
|
||||||
],
|
|
||||||
},
|
|
||||||
},
|
|
||||||
description: 'Dependency type between the two tasks',
|
|
||||||
required: true,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
displayName: 'The Task ID',
|
|
||||||
name: 'theTaskId',
|
|
||||||
type: 'string',
|
type: 'string',
|
||||||
displayOptions: {
|
displayOptions: {
|
||||||
show: {
|
show: {
|
||||||
|
|||||||
Reference in New Issue
Block a user