diff --git a/ui/src/components/Secrets/ExternalSecrets/ListSecretsStore.tsx b/ui/src/components/Secrets/ExternalSecrets/ListSecretsStore.tsx index f98de9ce84..3ffb470fc4 100644 --- a/ui/src/components/Secrets/ExternalSecrets/ListSecretsStore.tsx +++ b/ui/src/components/Secrets/ExternalSecrets/ListSecretsStore.tsx @@ -6,27 +6,31 @@ import { Select } from '../../../utils/form'; const ListSecretsStore = ({ value, - validateForm, + hasError, handleFormData, clusterName, }: { value: string; - validateForm: boolean; + hasError: boolean; handleFormData: (value: any) => void; clusterName: string; }) => { - const { data, isLoading, error } = useListExternalSecretStores({ + const { + data, + isLoading, + error: listError, + } = useListExternalSecretStores({ clusterName, }); return ( - + {!!formData.clusterName && ( handleFormData(val, 'kustomization') } clusterName={formData.clusterName} + hasError={ + formError === 'kustomization' && !formData.kustomization + } /> )}

Secret Data

@@ -198,7 +198,7 @@ const CreateSOPS = () => { void; }) => { - const { isLoading, data, error } = useListCluster(); + const { isLoading, data, error: listError } = useListCluster(); return ( - + handleFormData(event.target.value)} value={value} - error={validateForm && !value} + error={hasError} > {data?.kustomizations?.length ? ( data?.kustomizations?.map((k, index: number) => { diff --git a/ui/src/utils/form.tsx b/ui/src/utils/form.tsx index 96ab012ad4..51aa0f24a5 100644 --- a/ui/src/utils/form.tsx +++ b/ui/src/utils/form.tsx @@ -226,15 +226,17 @@ export const validateFormData = ( interface InputDebounceProps extends InputProps { value?: string; + formError?: string; handleFormData: (value: any) => void; } export const InputDebounced: FC = ({ value, - error, + formError, handleFormData, ...rest }) => { + const error = formError === rest.name && !value; const [data, setData] = useState(value || ''); const [inputError, setInputError] = useState(error || false); @@ -263,6 +265,7 @@ export const InputDebounced: FC = ({ return (