[GEN-2181]: enhance samplers input-validation with isEmpty function #2161
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This pull request introduces the
isEmpty
utility function and integrates it across various components to improve the handling of empty values. The most important changes include the addition of theisEmpty
function, its use in form validation, and updates to theErrorSampler
andProbabilisticSampler
components to handle empty values more effectively.Introduction of
isEmpty
utility function:frontend/webapp/utils/functions/resolvers/is-emtpy/index.ts
: Added a newisEmpty
function to strictly check for empty values, allowing values like0
andfalse
.frontend/webapp/utils/functions/resolvers/index.ts
: Exported the newisEmpty
function.Integration of
isEmpty
in form components:frontend/webapp/containers/main/actions/action-form-body/custom-fields/error-sampler.tsx
: Updated to useisEmpty
for checking empty values and addeduseEffect
to handle initial empty state. [1] [2]frontend/webapp/containers/main/actions/action-form-body/custom-fields/probabilistic-sampler.tsx
: Updated to useisEmpty
for checking empty values and addeduseEffect
to handle initial empty state. [1] [2]Form validation improvements:
frontend/webapp/hooks/actions/useActionFormData.ts
: IntegratedisEmpty
for form validation and added a console log for debugging. [1] [2] [3]Updates to reusable components:
frontend/webapp/reuseable-components/input-table/index.tsx
: UsedisEmpty
to filter valid rows and handle empty values in theInputTable
component. [1] [2] [3]