Skip to content

Commit

Permalink
fix: remove unused fields
Browse files Browse the repository at this point in the history
  • Loading branch information
bluenex committed Oct 4, 2021
1 parent 1cb1b8e commit 3d925df
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 20 deletions.
22 changes: 11 additions & 11 deletions frontend/src/components/RegisterForm/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ const RegisterForm = ({ prevUserData, origin }) => {
institution: "institutionSelect",
gender_status: "genderStatusSelect",
academic_status: "academicStatusSelect",
meeting_platform: "meetingPlatformSelect",
// meeting_platform: "meetingPlatformSelect",
}

const datetimeFields = {
Expand Down Expand Up @@ -143,9 +143,9 @@ const RegisterForm = ({ prevUserData, origin }) => {
institutionSelect,
genderStatusSelect,
academicStatusSelect,
meetingPlatformSelect,
abstracts,
availableDatetimePicker,
// meetingPlatformSelect,
// abstracts,
...rest
} = data

Expand Down Expand Up @@ -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 = {
Expand Down
27 changes: 18 additions & 9 deletions frontend/src/pages/submission.js
Original file line number Diff line number Diff line change
Expand Up @@ -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"]
Expand Down Expand Up @@ -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
Expand All @@ -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 =
Expand All @@ -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
Expand All @@ -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
),
Expand Down

0 comments on commit 3d925df

Please sign in to comment.