From f8c74ff3f1573e32508d7ffea49a9276d1933845 Mon Sep 17 00:00:00 2001 From: samaradel Date: Wed, 27 Mar 2024 23:44:45 +0200 Subject: [PATCH 1/2] Add validation to calculator input --- packages/playground/src/utils/pricing_calculator.ts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/packages/playground/src/utils/pricing_calculator.ts b/packages/playground/src/utils/pricing_calculator.ts index c515dccb9e..651a745322 100644 --- a/packages/playground/src/utils/pricing_calculator.ts +++ b/packages/playground/src/utils/pricing_calculator.ts @@ -23,12 +23,14 @@ export const mruRules = _applyRules([ required("Memory is required."), isInt("Memory must be a valid integer."), max("Maximum allowed memory is 1024 GB.", 1024), + min("Minimum allowed memory storage size is 1 GB.", 1), ]); export const sruRules = _applyRules([ required("SSD Storage size is required."), isInt("SSD Storage size must be a valid integer."), max("Maximum allowed ssd storage size is 1000000 GB.", 1000000), + min("Minimum allowed ssd storage size is 1 GB.", 1), ]); export const hruRules = _applyRules([ From e79c5762a81823dd7f2dea84388e1509134211d7 Mon Sep 17 00:00:00 2001 From: samaradel Date: Mon, 1 Apr 2024 13:55:00 +0200 Subject: [PATCH 2/2] Add required to HDD storage field --- packages/playground/src/utils/pricing_calculator.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/packages/playground/src/utils/pricing_calculator.ts b/packages/playground/src/utils/pricing_calculator.ts index 651a745322..bd3fcd6e13 100644 --- a/packages/playground/src/utils/pricing_calculator.ts +++ b/packages/playground/src/utils/pricing_calculator.ts @@ -34,6 +34,7 @@ export const sruRules = _applyRules([ ]); export const hruRules = _applyRules([ + required("HDD Storage size is required."), isInt("HDD Storage size must be a valid integer."), max("Maximum allowed hdd storage size is 1000000 GB.", 1000000), min("Minimum allowed hdd storage size is 0 GB.", 0),