From e646e50b6b8461359963d37327bee21f1c322b6a Mon Sep 17 00:00:00 2001 From: Kaosiso Ezealigo Date: Mon, 22 Jan 2024 13:33:24 +0100 Subject: [PATCH] fix: rate limit config validations --- .../evaluationResults/NewEvaluationModal.tsx | 36 ++++++++++++++++--- 1 file changed, 32 insertions(+), 4 deletions(-) diff --git a/agenta-web/src/components/pages/evaluations/evaluationResults/NewEvaluationModal.tsx b/agenta-web/src/components/pages/evaluations/evaluationResults/NewEvaluationModal.tsx index c376d6f5e3..55cc01f8be 100644 --- a/agenta-web/src/components/pages/evaluations/evaluationResults/NewEvaluationModal.tsx +++ b/agenta-web/src/components/pages/evaluations/evaluationResults/NewEvaluationModal.tsx @@ -261,7 +261,14 @@ const NewEvaluationModal: React.FC = ({onSuccess, ...props}) => { name="batch_size" style={{marginBottom: "0"}} rules={[ - {required: true, message: "This field is required"}, + { + validator: (_, value) => { + if (value !== null) { + return Promise.resolve() + } + return Promise.reject("This field is required") + }, + }, ]} > = ({onSuccess, ...props}) => { } name="max_retries" rules={[ - {required: true, message: "This field is required"}, + { + validator: (_, value) => { + if (value !== null) { + return Promise.resolve() + } + return Promise.reject("This field is required") + }, + }, ]} > = ({onSuccess, ...props}) => { style={{marginBottom: "0"}} name="retry_delay" rules={[ - {required: true, message: "This field is required"}, + { + validator: (_, value) => { + if (value !== null) { + return Promise.resolve() + } + return Promise.reject("This field is required") + }, + }, ]} > = ({onSuccess, ...props}) => { name="delay_between_batches" style={{marginBottom: "0"}} rules={[ - {required: true, message: "This field is required"}, + { + validator: (_, value) => { + if (value !== null) { + return Promise.resolve() + } + return Promise.reject("This field is required") + }, + }, ]} >