From 12a9266ac6f6b8dc9fb2f152d5d597a46e519506 Mon Sep 17 00:00:00 2001 From: vbadrina Date: Thu, 23 Jan 2025 13:57:02 +0530 Subject: [PATCH] Fix pool name check in attach storage form Signed-off-by: vbadrina --- packages/ocs/storage-pool/body.tsx | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/packages/ocs/storage-pool/body.tsx b/packages/ocs/storage-pool/body.tsx index a5fb18da8..929411e73 100644 --- a/packages/ocs/storage-pool/body.tsx +++ b/packages/ocs/storage-pool/body.tsx @@ -151,7 +151,10 @@ export const StoragePoolBody: React.FC = ({ .test( 'unique-name', translationFieldRequirements[3], - (value: string) => !existingNames.includes(value) + (value: string) => + !existingNames.includes( + usePrefix ? `${prefixName}-${value}` : value + ) ), }); @@ -159,7 +162,7 @@ export const StoragePoolBody: React.FC = ({ schema: validationSchema, fieldRequirements: translationFieldRequirements, }; - }, [existingNames, t]); + }, [prefixName, usePrefix, existingNames, t]); const resolver = useYupValidationResolver(schema); const {