Skip to content

Commit

Permalink
Fix font size for spoiler, remove unnecessary code
Browse files Browse the repository at this point in the history
  • Loading branch information
airelawaleria committed Jun 29, 2023
1 parent 528fed9 commit 82fcacb
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 62 deletions.
35 changes: 3 additions & 32 deletions client/src/forms/CoachApplicationForm.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import {
Loader,
Spoiler,
Stack,
Text,
Textarea,
Title,
} from '@mantine/core'
Expand All @@ -20,7 +21,6 @@ import { useEffect, useState } from 'react'
import { fetchCourseIterationsWithOpenApplicationPeriod } from '../redux/courseIterationSlice/thunks/fetchAllCourseIterations'
import { useDispatch } from 'react-redux'
import { useAppSelector, type AppDispatch } from '../redux/store'
import { type Patch } from '../service/configService'
import { createCoachApplication } from '../service/applicationsService'
import { ApplicationSuccessfulSubmission } from '../student/StudentApplicationSubmissionPage/ApplicationSuccessfulSubmission'
import { DeclarationOfDataConsent } from './DeclarationOfDataConsent'
Expand Down Expand Up @@ -186,8 +186,8 @@ export const CoachApplicationForm = ({
/>
<Spoiler
maxHeight={0}
showLabel='View Data Consent Agreement'
hideLabel='Hide'
showLabel={<Text fz='sm'>Show Data Consent Agreement</Text>}
hideLabel={<Text fz='sm'>Hide</Text>}
>
<DeclarationOfDataConsent />
</Spoiler>
Expand Down Expand Up @@ -227,35 +227,6 @@ export const CoachApplicationForm = ({
})
.catch(() => {})
onSuccess()
} else if (
defaultForm.isValid() &&
coachForm.isValid() &&
coachApplication
) {
// TODO: differentiate between assessment and student application changes
if (defaultForm.values.assessment) {
const studentApplicationAssessmentPatchObjectArray: Patch[] = []
Object.keys(defaultForm.values.assessment).forEach((key) => {
if (defaultForm.isTouched('assessment.' + key)) {
const studentApplicationPatchObject = new Map()
studentApplicationPatchObject.set('op', 'replace')
studentApplicationPatchObject.set('path', '/' + key)
studentApplicationPatchObject.set(
'value',
defaultForm.getInputProps('assessment.' + key).value,
)
const obj = Object.fromEntries(studentApplicationPatchObject)
studentApplicationAssessmentPatchObjectArray.push(obj)
}
})
/* void dispatch(
updateDeveloperApplicationAssessment({
applicationId: developerApplication.id,
applicationAssessmentPatch: studentApplicationAssessmentPatchObjectArray,
}),
) */
onSuccess()
}
}
}}
>
Expand Down
4 changes: 2 additions & 2 deletions client/src/forms/DeveloperApplicationForm.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -176,8 +176,8 @@ export const DeveloperApplicationForm = ({
/>
<Spoiler
maxHeight={0}
showLabel='View Data Consent Agreement'
hideLabel='Hide'
showLabel={<Text fz='sm'>Show Data Consent Agreement</Text>}
hideLabel={<Text fz='sm'>Hide</Text>}
>
<DeclarationOfDataConsent />
</Spoiler>
Expand Down
30 changes: 2 additions & 28 deletions client/src/forms/TutorApplicationForm.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ import { useEffect, useState } from 'react'
import { fetchCourseIterationsWithOpenApplicationPeriod } from '../redux/courseIterationSlice/thunks/fetchAllCourseIterations'
import { useDispatch } from 'react-redux'
import { useAppSelector, type AppDispatch } from '../redux/store'
import { type Patch } from '../service/configService'
import { createTutorApplication } from '../service/applicationsService'
import { ApplicationSuccessfulSubmission } from '../student/StudentApplicationSubmissionPage/ApplicationSuccessfulSubmission'
import { DeclarationOfDataConsent } from './DeclarationOfDataConsent'
Expand Down Expand Up @@ -188,8 +187,8 @@ export const TutorApplicationForm = ({
/>
<Spoiler
maxHeight={0}
showLabel='View Data Consent Agreement'
hideLabel='Hide'
showLabel={<Text fz='sm'>Show Data Consent Agreement</Text>}
hideLabel={<Text fz='sm'>Hide</Text>}
>
<DeclarationOfDataConsent />
</Spoiler>
Expand Down Expand Up @@ -241,31 +240,6 @@ export const TutorApplicationForm = ({
})
.catch(() => {})
onSuccess()
} else if (defaultForm.isValid() && tutorApplication) {
const studentApplicationAssessmentPatchObjectArray: Patch[] = []
if (defaultForm.values.assessment) {
Object.keys(defaultForm.values.assessment).forEach((key) => {
if (defaultForm.isTouched('assessment.' + key)) {
const studentApplicationPatchObject = new Map()
studentApplicationPatchObject.set('op', 'replace')
studentApplicationPatchObject.set('path', '/' + key)
studentApplicationPatchObject.set(
'value',
defaultForm.getInputProps('assessment.' + key).value,
)
const obj = Object.fromEntries(studentApplicationPatchObject)
studentApplicationAssessmentPatchObjectArray.push(obj)
}
})

/* void dispatch(
updateDeveloperApplicationAssessment({
applicationId: developerApplication.id,
applicationAssessmentPatch: studentApplicationAssessmentPatchObjectArray,
}),
) */
onSuccess()
}
}
}}
>
Expand Down

0 comments on commit 82fcacb

Please sign in to comment.