From 3d925dfad53c68370e0fd0fd6c076eb12758a4b8 Mon Sep 17 00:00:00 2001 From: tulakann Date: Mon, 4 Oct 2021 21:00:57 +0700 Subject: [PATCH] fix: remove unused fields --- frontend/src/components/RegisterForm/index.js | 22 +++++++-------- frontend/src/pages/submission.js | 27 ++++++++++++------- 2 files changed, 29 insertions(+), 20 deletions(-) diff --git a/frontend/src/components/RegisterForm/index.js b/frontend/src/components/RegisterForm/index.js index 90e4e7b..d4690c2 100644 --- a/frontend/src/components/RegisterForm/index.js +++ b/frontend/src/components/RegisterForm/index.js @@ -91,7 +91,7 @@ const RegisterForm = ({ prevUserData, origin }) => { institution: "institutionSelect", gender_status: "genderStatusSelect", academic_status: "academicStatusSelect", - meeting_platform: "meetingPlatformSelect", + // meeting_platform: "meetingPlatformSelect", } const datetimeFields = { @@ -143,9 +143,9 @@ const RegisterForm = ({ prevUserData, origin }) => { institutionSelect, genderStatusSelect, academicStatusSelect, - meetingPlatformSelect, - abstracts, availableDatetimePicker, + // meetingPlatformSelect, + // abstracts, ...rest } = data @@ -181,17 +181,17 @@ const RegisterForm = ({ prevUserData, origin }) => { academic_status: !isPublic ? reactSelectHelpers.optionsToSaveFormat(academicStatusSelect) : "", - meeting_platform: !isPublic - ? reactSelectHelpers.optionsToSaveFormat(meetingPlatformSelect) - : [], - abstracts: !isPublic - ? abstracts.every(x => x === "") - ? [] - : abstracts - : [], available_dt: !isPublic ? timePickerHelpers.serializeSelectedDatetime(availableDatetimePicker) : "", + // meeting_platform: !isPublic + // ? reactSelectHelpers.optionsToSaveFormat(meetingPlatformSelect) + // : [], + // abstracts: !isPublic + // ? abstracts.every(x => x === "") + // ? [] + // : abstracts + // : [], } const readyData = { diff --git a/frontend/src/pages/submission.js b/frontend/src/pages/submission.js index 002468a..fc78445 100644 --- a/frontend/src/pages/submission.js +++ b/frontend/src/pages/submission.js @@ -26,7 +26,12 @@ import useSiteMetadata from "../hooks/useSiteMetadata" import useAPI from "../hooks/useAPI" import useFirebaseWrapper from "../hooks/useFirebaseWrapper" import useValidateRegistration from "../hooks/useValidateRegistration" -import { common, Fa, reactSelectHelpers, timePickerHelpers } from "../utils" +import { + common, + Fa, + timePickerHelpers, + // reactSelectHelpers, +} from "../utils" // -- CONSTANTS // const talkFormatOptions = ["Traditional talk", "Flash talk"] @@ -166,11 +171,11 @@ export default () => { useEffect(() => { if (currentSubmission && !isLoadingCurrentData) { setValue([ - { - talkFormatSelect: reactSelectHelpers.saveFormatToOptions( - currentSubmission?.talk_format - ), - }, + // { + // talkFormatSelect: reactSelectHelpers.saveFormatToOptions( + // currentSubmission?.talk_format + // ), + // }, { availableDatetimePicker: timePickerHelpers.deserializeSelectedDatetime( currentSubmission?.available_dt @@ -187,7 +192,11 @@ export default () => { const onSubmit = data => { setIsSending(true) - const { talkFormatSelect, availableDatetimePicker, ...restData } = data + const { + // talkFormatSelect, + availableDatetimePicker, + ...restData + } = data const numberOfSlots = 5 const pickNotEnoughAvailableTime = @@ -199,7 +208,7 @@ export default () => { setError( "availableDatetimePicker", "isRequired", - `Available Watching Time is required at least ${numberOfSlots} slots.` + `Available Presentation Time is required at least ${numberOfSlots} slots.` ) setIsSending(false) return @@ -209,7 +218,7 @@ export default () => { fullname: prevUserData.fullname, email: prevUserData.email, institution: prevUserData.institution, - talk_format: reactSelectHelpers.optionsToSaveFormat(talkFormatSelect), + // talk_format: reactSelectHelpers.optionsToSaveFormat(talkFormatSelect), available_dt: timePickerHelpers.serializeSelectedDatetime( availableDatetimePicker ),