mirror of
https://github.com/n8n-io/n8n.git
synced 2024-12-25 04:34:06 -08:00
⚡ Minor improvements to ClickUp-Node
This commit is contained in:
parent
15c0eae56d
commit
edd2d39fb1
|
@ -79,13 +79,13 @@ import {
|
||||||
|
|
||||||
import {
|
import {
|
||||||
ITask,
|
ITask,
|
||||||
} from './TaskInterface';
|
} from './TaskInterface';
|
||||||
|
|
||||||
import {
|
import {
|
||||||
IList,
|
IList,
|
||||||
} from './ListInterface';
|
} from './ListInterface';
|
||||||
|
|
||||||
import * as moment from 'moment-timezone';
|
import * as moment from 'moment-timezone';
|
||||||
|
|
||||||
export class ClickUp implements INodeType {
|
export class ClickUp implements INodeType {
|
||||||
description: INodeTypeDescription = {
|
description: INodeTypeDescription = {
|
||||||
|
@ -688,7 +688,7 @@ export class ClickUp implements INodeType {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (type === 'number' || type === 'percentaje'
|
if (type === 'number' || type === 'percentaje'
|
||||||
|| type === 'automatic' || type === 'currency' ) {
|
|| type === 'automatic' || type === 'currency') {
|
||||||
if (additionalFields.stepsStart === undefined
|
if (additionalFields.stepsStart === undefined
|
||||||
|| !additionalFields.stepsEnd === undefined) {
|
|| !additionalFields.stepsEnd === undefined) {
|
||||||
throw new Error('Steps start and steps end fields must be set');
|
throw new Error('Steps start and steps end fields must be set');
|
||||||
|
@ -1140,7 +1140,12 @@ export class ClickUp implements INodeType {
|
||||||
if (operation === 'stop') {
|
if (operation === 'stop') {
|
||||||
const teamId = this.getNodeParameter('team', i) as string;
|
const teamId = this.getNodeParameter('team', i) as string;
|
||||||
responseData = await clickupApiRequest.call(this, 'POST', `/team/${teamId}/time_entries/stop`);
|
responseData = await clickupApiRequest.call(this, 'POST', `/team/${teamId}/time_entries/stop`);
|
||||||
|
|
||||||
|
if (responseData.data) {
|
||||||
responseData = responseData.data;
|
responseData = responseData.data;
|
||||||
|
} else {
|
||||||
|
throw new Error('There seems to be nothing to stop.');
|
||||||
|
}
|
||||||
}
|
}
|
||||||
if (operation === 'delete') {
|
if (operation === 'delete') {
|
||||||
const teamId = this.getNodeParameter('team', i) as string;
|
const teamId = this.getNodeParameter('team', i) as string;
|
||||||
|
@ -1185,7 +1190,7 @@ export class ClickUp implements INodeType {
|
||||||
const tagNames = this.getNodeParameter('tagNames', i) as string[];
|
const tagNames = this.getNodeParameter('tagNames', i) as string[];
|
||||||
const body: IDataObject = {};
|
const body: IDataObject = {};
|
||||||
body.time_entry_ids = timeEntryIds.split(',');
|
body.time_entry_ids = timeEntryIds.split(',');
|
||||||
body.tags = tagNames.map((tag) => ( JSON.parse(tag).name ));
|
body.tags = tagNames.map((tag) => (JSON.parse(tag).name));
|
||||||
responseData = await clickupApiRequest.call(this, 'DELETE', `/team/${teamId}/time_entries/tags`, body);
|
responseData = await clickupApiRequest.call(this, 'DELETE', `/team/${teamId}/time_entries/tags`, body);
|
||||||
responseData = { success: true };
|
responseData = { success: true };
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
import {
|
import {
|
||||||
INodeProperties,
|
INodeProperties,
|
||||||
} from 'n8n-workflow';
|
} from 'n8n-workflow';
|
||||||
|
|
||||||
export const timeEntryOperations = [
|
export const timeEntryOperations = [
|
||||||
{
|
{
|
||||||
|
@ -23,12 +23,12 @@ export const timeEntryOperations = [
|
||||||
{
|
{
|
||||||
name: 'Delete',
|
name: 'Delete',
|
||||||
value: 'delete',
|
value: 'delete',
|
||||||
description:'Delete a time entry',
|
description: 'Delete a time entry',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: 'Get',
|
name: 'Get',
|
||||||
value: 'get',
|
value: 'get',
|
||||||
description:'Get a time entry',
|
description: 'Get a time entry',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: 'Get All',
|
name: 'Get All',
|
||||||
|
@ -38,17 +38,17 @@ export const timeEntryOperations = [
|
||||||
{
|
{
|
||||||
name: 'Start',
|
name: 'Start',
|
||||||
value: 'start',
|
value: 'start',
|
||||||
description:'Start a time entry',
|
description: 'Start a time entry',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: 'Stop',
|
name: 'Stop',
|
||||||
value: 'stop',
|
value: 'stop',
|
||||||
description:'Stop the current running timer',
|
description: 'Stop the current running timer',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: 'Update',
|
name: 'Update',
|
||||||
value: 'update',
|
value: 'update',
|
||||||
description:'Update a time Entry',
|
description: 'Update a time Entry',
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
default: 'create',
|
default: 'create',
|
||||||
|
@ -58,9 +58,9 @@ export const timeEntryOperations = [
|
||||||
|
|
||||||
export const timeEntryFields = [
|
export const timeEntryFields = [
|
||||||
|
|
||||||
/* -------------------------------------------------------------------------- */
|
/* -------------------------------------------------------------------------- */
|
||||||
/* timeEntry:getAll */
|
/* timeEntry:getAll */
|
||||||
/* -------------------------------------------------------------------------- */
|
/* -------------------------------------------------------------------------- */
|
||||||
{
|
{
|
||||||
displayName: 'Team ID',
|
displayName: 'Team ID',
|
||||||
name: 'team',
|
name: 'team',
|
||||||
|
@ -153,9 +153,10 @@ export const timeEntryFields = [
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
/* -------------------------------------------------------------------------- */
|
|
||||||
/* timeEntry:get */
|
/* -------------------------------------------------------------------------- */
|
||||||
/* -------------------------------------------------------------------------- */
|
/* timeEntry:get */
|
||||||
|
/* -------------------------------------------------------------------------- */
|
||||||
{
|
{
|
||||||
displayName: 'Team ID',
|
displayName: 'Team ID',
|
||||||
name: 'team',
|
name: 'team',
|
||||||
|
@ -213,9 +214,10 @@ export const timeEntryFields = [
|
||||||
},
|
},
|
||||||
required: true,
|
required: true,
|
||||||
},
|
},
|
||||||
/* -------------------------------------------------------------------------- */
|
|
||||||
/* timeEntry:create */
|
/* -------------------------------------------------------------------------- */
|
||||||
/* -------------------------------------------------------------------------- */
|
/* timeEntry:create */
|
||||||
|
/* -------------------------------------------------------------------------- */
|
||||||
{
|
{
|
||||||
displayName: 'Team ID',
|
displayName: 'Team ID',
|
||||||
name: 'team',
|
name: 'team',
|
||||||
|
@ -467,9 +469,10 @@ export const timeEntryFields = [
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
/* -------------------------------------------------------------------------- */
|
|
||||||
/* timeEntry:start */
|
/* -------------------------------------------------------------------------- */
|
||||||
/* -------------------------------------------------------------------------- */
|
/* timeEntry:start */
|
||||||
|
/* -------------------------------------------------------------------------- */
|
||||||
{
|
{
|
||||||
displayName: 'Team ID',
|
displayName: 'Team ID',
|
||||||
name: 'team',
|
name: 'team',
|
||||||
|
@ -539,9 +542,10 @@ export const timeEntryFields = [
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
/* -------------------------------------------------------------------------- */
|
|
||||||
/* timeEntry:stop */
|
/* -------------------------------------------------------------------------- */
|
||||||
/* -------------------------------------------------------------------------- */
|
/* timeEntry:stop */
|
||||||
|
/* -------------------------------------------------------------------------- */
|
||||||
{
|
{
|
||||||
displayName: 'Team ID',
|
displayName: 'Team ID',
|
||||||
name: 'team',
|
name: 'team',
|
||||||
|
@ -562,9 +566,10 @@ export const timeEntryFields = [
|
||||||
},
|
},
|
||||||
required: true,
|
required: true,
|
||||||
},
|
},
|
||||||
/* -------------------------------------------------------------------------- */
|
|
||||||
/* timeEntry:delete */
|
/* -------------------------------------------------------------------------- */
|
||||||
/* -------------------------------------------------------------------------- */
|
/* timeEntry:delete */
|
||||||
|
/* -------------------------------------------------------------------------- */
|
||||||
{
|
{
|
||||||
displayName: 'Team ID',
|
displayName: 'Team ID',
|
||||||
name: 'team',
|
name: 'team',
|
||||||
|
@ -602,9 +607,10 @@ export const timeEntryFields = [
|
||||||
},
|
},
|
||||||
required: true,
|
required: true,
|
||||||
},
|
},
|
||||||
/* -------------------------------------------------------------------------- */
|
|
||||||
/* timeEntry:update */
|
/* -------------------------------------------------------------------------- */
|
||||||
/* -------------------------------------------------------------------------- */
|
/* timeEntry:update */
|
||||||
|
/* -------------------------------------------------------------------------- */
|
||||||
{
|
{
|
||||||
displayName: 'Team ID',
|
displayName: 'Team ID',
|
||||||
name: 'team',
|
name: 'team',
|
||||||
|
|
Loading…
Reference in a new issue