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

Validate twin ID input in transfer TFT page #3501

Merged
merged 4 commits into from
Oct 8, 2024

Conversation

samaradel
Copy link
Contributor

@samaradel samaradel commented Oct 3, 2024

Description

Add validation on twin ID input as it should accept only integers.

Changes

image

Related Issues

Tested Scenarios

The twin ID input should accept integers only.

Checklist

  • Tests included
  • Build pass
  • Documentation
  • Code format and docstrings
  • Screenshots/Video attached (needed for UI changes)

@@ -21,6 +21,7 @@
validators.isNotEmpty('Invalid Twin ID'),
validators.isNumeric('Twin ID should be a number'),
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

do we need isNumeric after having isInt?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

good catch :) validator removed.

validators.min('Twin ID should be more than 0', 1),
validators.isInt('Twin ID should be a valid integer.'),
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please move isInt above min

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

agree this will prevent this case
image

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

@samaradel samaradel requested a review from xmonader October 7, 2024 10:15
@AhmedHanafy725 AhmedHanafy725 merged commit 6db65c4 into development Oct 8, 2024
10 checks passed
@AhmedHanafy725 AhmedHanafy725 deleted the development_transfer_tft branch October 8, 2024 06:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants