Skip to content

fix: FORMS-1451 Restrict form schedule late submission period to integers only #1700

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

Conversation

revanth-banala
Copy link
Contributor

Description

Form Submission Schedule allow decimal values for some fields
Description

The form submission schedule has a couple of places where it takes positive integers as values. However, the validation allows values with up to two decimal points.
For some reason if you enter three decimal places then the validation fails.
Expected behaviour: can only enter integer values greater than or equal to 1, and . cannot be entered.

Updated validation regex
Limits range to 1-999 previously it is 6 digits
Updated error message
Added translations
Decimal points can no longer be typed in the field

Type of Change

fix (a bug fix)

Checklist

  • I have read the CONTRIBUTING doc
  • I have checked that unit tests pass locally with my changes
  • I have run the npm script lint on the frontend and backend
  • I have added tests that prove my fix is effective or that my feature works
  • I have added necessary documentation (if appropriate)
  • I have approval from the product owner for the contribution in this pull request

Further comments

@revanth-banala revanth-banala marked this pull request as ready for review June 12, 2025 22:52
@revanth-banala
Copy link
Contributor Author

image

Copy link

t('trans.formSettings.valueMustBeNumber'),
]);
const scheduleTypedRules = ref([
(v) => !!v || t('trans.formSettings.selectAnOptions'),
]);

const handleIntegerInput = (event) => {
Copy link
Collaborator

Choose a reason for hiding this comment

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

Did you try using https://vuetifyjs.com/en/components/number-inputs/?
I think that could do what you need?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I investigated this approach and found there are compatibility concerns v-number-input is currently an experimental component in Vuetify Labs so keeping the current implementation

Copy link

@usingtechnology usingtechnology merged commit d329ddd into bcgov:main Jun 17, 2025
7 checks passed
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.

3 participants