Skip to content

fix(validation): correctly validate empty not required data#1606

Merged
soleksy-splunk merged 7 commits intodevelopfrom
fix/number-validation-undefined
Mar 4, 2025
Merged

fix(validation): correctly validate empty not required data#1606
soleksy-splunk merged 7 commits intodevelopfrom
fix/number-validation-undefined

Conversation

@soleksy-splunk
Copy link
Copy Markdown
Contributor

@soleksy-splunk soleksy-splunk commented Feb 28, 2025

Issue number:
https://splunk.atlassian.net/browse/ADDON-78393

PR Type

What kind of change does this PR introduce?

  • Feature
  • Bug Fix
  • Refactoring (no functional or API changes)
  • Documentation Update
  • Maintenance (dependency updates, CI, etc.)

Summary

Changes

N/A do not throw error if number undefined and not required.

User experience

When copying entity right now correctly verify number value.

Checklist

If an item doesn't apply to your changes, leave it unchecked.

@soleksy-splunk soleksy-splunk requested a review from a team as a code owner February 28, 2025 11:54
@soleksy-splunk soleksy-splunk changed the title fix: number validation undefined fix(validation): correctly validate empty not required data Feb 28, 2025
@vtsvetkov-splunk
Copy link
Copy Markdown
Contributor

should we link this?
https://splunk.atlassian.net/browse/ADDON-78393

@soleksy-splunk
Copy link
Copy Markdown
Contributor Author

should we link this? https://splunk.atlassian.net/browse/ADDON-78393

yea lets link it.

Comment thread ui/src/util/tests/validators.test.ts Outdated
expect(result).toBe(false);
});

it.each([undefined, null])(
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

is it possible that data === ''?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

for the number no. But i actually created a test for it just in case in a separate PR

Comment thread ui/src/util/tests/validators.test.ts Outdated
Co-authored-by: Viktor Tsvetkov <142901247+vtsvetkov-splunk@users.noreply.github.com>
@pull-request-size pull-request-size bot added size/S and removed size/M labels Feb 28, 2025
Comment thread ui/src/util/tests/validators.test.ts Outdated
Comment thread ui/src/util/tests/validators.test.ts Outdated
@soleksy-splunk soleksy-splunk mentioned this pull request Feb 28, 2025
9 tasks
@soleksy-splunk soleksy-splunk merged commit 7f8c08a into develop Mar 4, 2025
@soleksy-splunk soleksy-splunk deleted the fix/number-validation-undefined branch March 4, 2025 09:40
@github-actions github-actions bot locked and limited conversation to collaborators Mar 4, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants