Skip to content

Commit 6a4dad7

Browse files
authored
fix(core): WF| Able to enter negative value in 'n' interval of "Every time period" event (#69)
* fix(core): fix you can add negative value you can not add neg values in workflows GH-67 * fix(core): fix changes fix review changes GH-67
1 parent 4a74954 commit 6a4dad7

File tree

3 files changed

+12
-2
lines changed

3 files changed

+12
-2
lines changed

projects/workflows-creator/src/lib/builder/group/group.component.html

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -197,6 +197,7 @@
197197
(mousedown)="handleMouseDown($event)"
198198
(mouseup)="handleMouseUp()"
199199
(mouseleave)="handleMouseLeave($event)"
200+
(keydown)="handleKeyPress($event)"
200201
/>
201202
</div>
202203
</ng-template>

projects/workflows-creator/src/lib/builder/group/group.component.ts

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -590,6 +590,16 @@ export class GroupComponent<E> implements OnInit, AfterViewInit {
590590
}
591591
}
592592

593+
handleKeyPress(event: any) {
594+
const keyCode = event.which || event.keyCode;
595+
const isDigit = keyCode >= 48 && keyCode <= 57;
596+
const isBackspaceOrDelete = [8, 46].includes(keyCode);
597+
const inputValue = event.target.value;
598+
const isValidInput = /^-?\d*\.?\d*$/.test(inputValue);
599+
if (!(isDigit || isBackspaceOrDelete) || !isValidInput) {
600+
event.preventDefault();
601+
}
602+
}
593603
handleEnterEvent(
594604
callback: any,
595605
node: BpmnNode,

projects/workflows-element/package.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,5 @@
1717
"access": "public",
1818
"directory": "dist"
1919
},
20-
"hash": "9988584e9ffd1d689dd06b27f41fd5e70ef726e0510b1ba55b78437c3be6f14c"
21-
20+
"hash": "e633c5b62116521580e1a5d3b744b4c25c8f4b74c6b54d008cb5a5a601dd1d92"
2221
}

0 commit comments

Comments
 (0)