diff --git a/striker-ui/components/StrikerConfig/AddPeerDialog.tsx b/striker-ui/components/StrikerConfig/AddPeerDialog.tsx index 9781f97c..3e879f90 100644 --- a/striker-ui/components/StrikerConfig/AddPeerDialog.tsx +++ b/striker-ui/components/StrikerConfig/AddPeerDialog.tsx @@ -11,7 +11,6 @@ import INPUT_TYPES from '../../lib/consts/INPUT_TYPES'; import api from '../../lib/api'; import buildMapToMessageSetter from '../../lib/buildMapToMessageSetter'; -import buildNumberTestBatch from '../../lib/test_input/buildNumberTestBatch'; import buildObjectStateSetterCallback from '../../lib/buildObjectStateSetterCallback'; import CheckboxWithLabel from '../CheckboxWithLabel'; import ConfirmDialog from '../ConfirmDialog'; @@ -27,8 +26,7 @@ import { buildIPAddressTestBatch, buildPeacefulStringTestBatch, } from '../../lib/test_input'; -import { BodyText, HeaderText } from '../Text'; -import useProtect from '../../hooks/useProtect'; +import { HeaderText } from '../Text'; import useProtectedState from '../../hooks/useProtectedState'; const IT_IDS = { @@ -51,8 +49,6 @@ const AddPeerDialog = forwardRef< ConfirmDialogForwardedRefContent, AddPeerDialogProps >(({ formGridColumns = 2 }, ref) => { - const { protect } = useProtect(); - const inputPeerDBPortRef = useRef>({}); const inputPeerIPAddressRef = useRef>({}); const inputPeerPasswordRef = useRef>({}); @@ -65,7 +61,7 @@ const AddPeerDialog = forwardRef< }>({}); const [isEnablePingTest, setIsEnablePingTest] = useState(false); const [isSubmittingAddPeer, setIsSubmittingAddPeer] = - useProtectedState(false, protect); + useProtectedState(false); const buildInputFirstRenderFunction = useCallback( (key: string) => @@ -100,38 +96,9 @@ const AddPeerDialog = forwardRef< - - } - inputTestBatch={buildPeacefulStringTestBatch( - LABEL.user, - () => { - msgSetters.user(); - }, - { - onFinishBatch: buildFinishInputTestBatchFunction( - IT_IDS.user, - ), - }, - (message) => { - msgSetters.user({ children: message }); - }, - )} - onFirstRender={buildInputFirstRenderFunction(IT_IDS.user)} - ref={inputPeerUserRef} - /> - @ ), }, - 'add-peer-db-and-ssh-port': { - children: ( - - - } - inputTestBatch={buildNumberTestBatch( - LABEL.dbPort, - () => { - msgSetters.dbPort(); - }, - { - onFinishBatch: buildFinishInputTestBatchFunction( - IT_IDS.dbPort, - ), - }, - (message) => { - msgSetters.dbPort({ children: message }); - }, - )} - onFirstRender={buildInputFirstRenderFunction(IT_IDS.dbPort)} - ref={inputPeerDBPortRef} - /> - - } - inputTestBatch={buildNumberTestBatch( - LABEL.sshPort, - () => { - msgSetters.sshPort(); - }, - { - onFinishBatch: buildFinishInputTestBatchFunction( - IT_IDS.sshPort, - ), - }, - (message) => { - msgSetters.sshPort({ children: message }); - }, - )} - onFirstRender={buildInputFirstRenderFunction( - IT_IDS.sshPort, - )} - ref={inputPeerSSHPortRef} - /> - - ), - }, 'add-peer-is-ping': { children: (