Skip to content

Commit

Permalink
fix(core): WF| Able to enter negative value in 'n' interval of "Every…
Browse files Browse the repository at this point in the history
… 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
  • Loading branch information
Deepika516 authored Feb 29, 2024
1 parent 4a74954 commit 6a4dad7
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -197,6 +197,7 @@
(mousedown)="handleMouseDown($event)"
(mouseup)="handleMouseUp()"
(mouseleave)="handleMouseLeave($event)"
(keydown)="handleKeyPress($event)"
/>
</div>
</ng-template>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -590,6 +590,16 @@ export class GroupComponent<E> implements OnInit, AfterViewInit {
}
}

handleKeyPress(event: any) {
const keyCode = event.which || event.keyCode;
const isDigit = keyCode >= 48 && keyCode <= 57;
const isBackspaceOrDelete = [8, 46].includes(keyCode);
const inputValue = event.target.value;
const isValidInput = /^-?\d*\.?\d*$/.test(inputValue);
if (!(isDigit || isBackspaceOrDelete) || !isValidInput) {
event.preventDefault();
}
}
handleEnterEvent(
callback: any,
node: BpmnNode,
Expand Down
3 changes: 1 addition & 2 deletions projects/workflows-element/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,5 @@
"access": "public",
"directory": "dist"
},
"hash": "9988584e9ffd1d689dd06b27f41fd5e70ef726e0510b1ba55b78437c3be6f14c"

"hash": "e633c5b62116521580e1a5d3b744b4c25c8f4b74c6b54d008cb5a5a601dd1d92"
}

0 comments on commit 6a4dad7

Please sign in to comment.