From b967bf1f1cdef5cba9635d9708493ad27ccb4845 Mon Sep 17 00:00:00 2001 From: Piyush Kumar <52462496+nxtCoder19@users.noreply.github.com> Date: Wed, 9 Oct 2024 11:30:33 +0530 Subject: [PATCH] minor name refactoring inside infra (#316) --- .../_main+/$account+/infra+/_layout.tsx | 2 +- .../byok-cluster/handle-byok-cluster.tsx | 178 ++++++++++-------- .../$account+/infra+/clusters/route.tsx | 10 +- .../settings+/user-management/handle-user.tsx | 7 +- 4 files changed, 106 insertions(+), 91 deletions(-) diff --git a/src/apps/console/routes/_main+/$account+/infra+/_layout.tsx b/src/apps/console/routes/_main+/$account+/infra+/_layout.tsx index 81ba4a5ab..aff27aa76 100644 --- a/src/apps/console/routes/_main+/$account+/infra+/_layout.tsx +++ b/src/apps/console/routes/_main+/$account+/infra+/_layout.tsx @@ -13,7 +13,7 @@ const Infra = () => { return ( >; @@ -21,22 +23,23 @@ const Root = (props: IDialog) => { const api = useConsoleApi(); const reloadPage = useReload(); + const [show, setShow] = useState(false); const { values, errors, handleChange, handleSubmit, resetValues, isLoading } = useForm({ initialValues: isUpdate ? { - displayName: props.data.displayName, - name: parseName(props.data), - visibilityMode: false, - isNameError: false, - } + displayName: props.data.displayName, + name: parseName(props.data), + visibilityMode: false, + isNameError: false, + } : { - name: '', - displayName: '', - visibilityMode: false, - isNameError: false, - }, + name: '', + displayName: '', + visibilityMode: false, + isNameError: false, + }, validationSchema: Yup.object({ name: Yup.string().required('id is required'), displayName: Yup.string().required('name is required'), @@ -70,7 +73,7 @@ const Root = (props: IDialog) => { reloadPage(); resetValues(); toast.success( - `compute ${isUpdate ? 'updated' : 'created'} successfully` + `cluster ${isUpdate ? 'updated' : 'created'} successfully` ); setVisible(false); } catch (err) { @@ -80,78 +83,89 @@ const Root = (props: IDialog) => { }); return ( - { - if (!values.isNameError) { - handleSubmit(e); - } else { - e.preventDefault(); - } - }} - > - -
- - {!isUpdate && ( - <> - { - handleChange('visibilityMode')(dummyEvent(val)); - }} - /> - - - Private clusters are those who are hosted behind a NAT. - - - Ex: Cluster running on your local machine + <> + { + if (!values.isNameError) { + handleSubmit(e); + } else { + e.preventDefault(); + } + }} + > + +
+ + {!isUpdate && ( + <> + { + handleChange('visibilityMode')(dummyEvent(val)); + }} + /> + + + Private clusters are those who are hosted behind a NAT. + + + Ex: Cluster running on your local machine + +
+ } + /> +
- } - /> -