Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(Wait Node): Change default wait period to 5 seconds #8783

Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading