Skip to content

Commit

Permalink
fix(Wait Node): Change default wait period to 5 seconds (#8783)
Browse files Browse the repository at this point in the history
  • Loading branch information
michael-radency authored and netroy committed Mar 5, 2024
1 parent 59b9b7a commit 19b69b6
Showing 1 changed file with 64 additions and 30 deletions.
94 changes: 64 additions & 30 deletions packages/nodes-base/nodes/Wait/Wait.node.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,44 @@ import { formWebhook } from '../Form/utils';
import { updateDisplayOptions } from '../../utils/utilities';
import { Webhook } from '../Webhook/Webhook.node';

const toWaitAmount: INodeProperties = {
displayName: 'Wait Amount',
name: 'amount',
type: 'number',
typeOptions: {
minValue: 0,
numberPrecision: 2,
},
default: 1,
description: 'The time to wait',
};

const unitSelector: INodeProperties = {
displayName: 'Wait Unit',
name: 'unit',
type: 'options',
options: [
{
name: 'Seconds',
value: 'seconds',
},
{
name: 'Minutes',
value: 'minutes',
},
{
name: 'Hours',
value: 'hours',
},
{
name: 'Days',
value: 'days',
},
],
default: 'hours',
description: 'The time unit of the Wait Amount value',
};

const waitTimeProperties: INodeProperties[] = [
{
displayName: 'Limit Wait Time',
Expand Down Expand Up @@ -189,7 +227,7 @@ export class Wait extends Webhook {
name: 'wait',
icon: 'fa:pause-circle',
group: ['organization'],
version: 1,
version: [1, 1.1],
description: 'Wait before continue with execution',
defaults: {
name: 'Wait',
Expand Down Expand Up @@ -282,50 +320,46 @@ export class Wait extends Webhook {
// resume:timeInterval
// ----------------------------------
{
displayName: 'Wait Amount',
name: 'amount',
type: 'number',
...toWaitAmount,
displayOptions: {
show: {
resume: ['timeInterval'],
'@version': [1],
},
},
typeOptions: {
minValue: 0,
numberPrecision: 2,
},
default: 1,
description: 'The time to wait',
},
{
displayName: 'Wait Unit',
name: 'unit',
type: 'options',
...toWaitAmount,
default: 5,
displayOptions: {
show: {
resume: ['timeInterval'],
},
},
options: [
{
name: 'Seconds',
value: 'seconds',
hide: {
'@version': [1],
},
{
name: 'Minutes',
value: 'minutes',
},
},
{
...unitSelector,
displayOptions: {
show: {
resume: ['timeInterval'],
'@version': [1],
},
{
name: 'Hours',
value: 'hours',
},
},
{
...unitSelector,
default: 'seconds',
displayOptions: {
show: {
resume: ['timeInterval'],
},
{
name: 'Days',
value: 'days',
hide: {
'@version': [1],
},
],
default: 'hours',
description: 'The time unit of the Wait Amount value',
},
},

// ----------------------------------
Expand Down

0 comments on commit 19b69b6

Please sign in to comment.