From 37c9feffe1ff67811257d39da08a6b98690f7867 Mon Sep 17 00:00:00 2001 From: Daria Golova Date: Mon, 25 Jul 2022 16:46:35 +0300 Subject: [PATCH] removed the verification of the updating form --- src/pages/digitalId/ProfileId.jsx | 35 ++++++++----------------------- 1 file changed, 9 insertions(+), 26 deletions(-) diff --git a/src/pages/digitalId/ProfileId.jsx b/src/pages/digitalId/ProfileId.jsx index 58a5705..6acb0b0 100644 --- a/src/pages/digitalId/ProfileId.jsx +++ b/src/pages/digitalId/ProfileId.jsx @@ -6,15 +6,15 @@ import Header from '../../partials/Header'; import ProfileTable from '../../partials/profile/ProfileTable'; import Image from '../../images/transactions-image-04.svg'; -const defaultValues = { - label: '', - value: '', - seed: String(Math.floor(Math.random() * 90000000000000000000), 10), -}; - const initialPropertyValues = ['First name', 'Second name', 'Birthdate', 'Gender', 'National doctype', 'National doc ID', 'National doc issue date', 'National doc expiry date']; const Profile = observer (() => { + const defaultValues = { + label: '', + value: '', + seed: String(Math.floor(Math.random() * 90000000000000000000), 10), + }; + const [sidebarOpen, setSidebarOpen] = useState(false); const [buttonPanelOpen, setButtonPanelOpen] = useState(true); const [removePanelOpen, setRemovePanelOpen] = useState(false); @@ -26,7 +26,6 @@ const Profile = observer (() => { const [propertyValues, setPropertyValues] = useState([]); const [updatedValues, setUpdatedValues] = useState([defaultValues]); const [addedValues, setAddedValues] = useState(defaultValues); - const [fillingUpdateForm, setFillingUpdateForm] = useState(false); const openHint = () => { if (!addedValues.label) { @@ -63,15 +62,6 @@ const Profile = observer (() => { } }; - const checkFillingUpdateForm = (eventTarget) => { - if (eventTarget && eventTarget.id === 'sendingUpdatedValues') { - const checkingCondition = updatedValues.every(item => !Object.keys(item).find(elem => !item[elem])); - if (checkingCondition) { - setFillingUpdateForm(true); - } - } - } - const handleSelectedItems = (selectedItems) => { setSelectedItems([...selectedItems]); setUpdatedValues(registrationStore.decryptedUserData.filter(({ key }) => selectedItems.includes(key)) @@ -113,12 +103,9 @@ const Profile = observer (() => { }; const sendUpdatedData = () => { - if (fillingUpdateForm) { - setUpdatePanelOpen(false); - changeDataParameters(); - setChangePanelOpen(true); - setFillingUpdateForm(false); - } + setUpdatePanelOpen(false); + changeDataParameters(); + setChangePanelOpen(true); }; const deleteDataParameters = () => { @@ -320,7 +307,6 @@ const Profile = observer (() => { @@ -351,7 +337,6 @@ const Profile = observer (() => { type="text" required onChange={(e) => changeUpdatedValues(e.target.value, 'value', item.key)} - onBlur={(e) => checkFillingUpdateForm(e.relatedTarget)} value={item.value} /> @@ -364,7 +349,6 @@ const Profile = observer (() => { type="number" required onChange={(e) => changeUpdatedValues(e.target.value, 'seed', item.key)} - onBlur={(e) => checkFillingUpdateForm(e.relatedTarget)} value={item.seed} /> @@ -395,7 +379,6 @@ const Profile = observer (() => {