Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[#345] 인증제 입력 페이지 추가 #346

Merged
merged 41 commits into from
Jul 11, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
41 commits
Select commit Hold shift + click to select a range
6b6669e
feat: add authenticationForm list fetch api
chanwoo00106 Jun 11, 2024
d916aa4
feat: add authentication form layout
chanwoo00106 Jun 15, 2024
9b53577
Merge branch 'develop' of https://github.com/GSM-MSG/SMS-FrontEnd int…
chanwoo00106 Jun 15, 2024
a5e5264
Merge branch 'develop' of https://github.com/GSM-MSG/SMS-FrontEnd int…
chanwoo00106 Jun 15, 2024
e228856
Merge branch 'develop' of https://github.com/GSM-MSG/SMS-FrontEnd int…
chanwoo00106 Jun 16, 2024
b8f5f2f
feat: add authentication form ui
chanwoo00106 Jun 16, 2024
39aeb01
Merge branch 'develop' of https://github.com/GSM-MSG/SMS-FrontEnd int…
chanwoo00106 Jun 16, 2024
9118491
Merge branch 'develop' of https://github.com/GSM-MSG/SMS-FrontEnd int…
chanwoo00106 Jun 17, 2024
cc4405c
fix: update select value connect
chanwoo00106 Jun 17, 2024
c5db8f8
feat: connect api on file input
chanwoo00106 Jun 17, 2024
6ec960d
feat: add data converter
chanwoo00106 Jun 17, 2024
1b84591
feat: add form submit api
chanwoo00106 Jun 17, 2024
27a80d4
fix: update array controller
chanwoo00106 Jun 18, 2024
81fea8a
fix: update authentication form validation
chanwoo00106 Jun 18, 2024
999558b
feat: add authentication redirect button on tab bar
chanwoo00106 Jun 18, 2024
548bea7
fix: add authentication form hook
chanwoo00106 Jun 19, 2024
0343446
Merge branch 'develop' of https://github.com/GSM-MSG/SMS-FrontEnd int…
chanwoo00106 Jun 19, 2024
3a5b9f6
fix: resolved file input problem
chanwoo00106 Jun 19, 2024
ec21450
Merge branch 'develop' of https://github.com/GSM-MSG/SMS-FrontEnd int…
chanwoo00106 Jun 21, 2024
dfbd378
feat: add error message
chanwoo00106 Jun 21, 2024
c1784a0
fix: remove gsminfo page
chanwoo00106 Jun 22, 2024
0fa9400
fix: update authentication form query logic
chanwoo00106 Jun 25, 2024
806f7c0
fix: add responsive field component
chanwoo00106 Jun 27, 2024
6a23092
fix: update authentication style
chanwoo00106 Jun 27, 2024
75009db
fix: change form structure
chanwoo00106 Jun 28, 2024
97ab3af
build: resolved build error
chanwoo00106 Jun 28, 2024
03010d6
fix: update form type to req type formatter
chanwoo00106 Jun 29, 2024
ea24ea0
fix: update request api
chanwoo00106 Jun 30, 2024
8f313be
fix: update single field name
chanwoo00106 Jul 2, 2024
37a8baf
fix: update fetch form api
chanwoo00106 Jul 8, 2024
f490f6d
feat: add field description
chanwoo00106 Jul 8, 2024
214c2bb
Merge branch 'develop' of https://github.com/GSM-MSG/SMS-FrontEnd int…
chanwoo00106 Jul 8, 2024
6313111
fix: add conditional dropdown
chanwoo00106 Jul 8, 2024
b28787c
Merge branch 'develop' of https://github.com/GSM-MSG/SMS-FrontEnd int…
chanwoo00106 Jul 10, 2024
eea86b3
fix: update authentication submit api
chanwoo00106 Jul 10, 2024
18383d9
fix: remove uuid on authentication request api
chanwoo00106 Jul 11, 2024
890d04d
feat: add authentication result ui
chanwoo00106 Jul 11, 2024
56d27c4
feat: connect server api
chanwoo00106 Jul 11, 2024
b767f0a
fix: add pending design
chanwoo00106 Jul 11, 2024
1b884b9
Merge branch 'develop' into feature/authentication-form-ui
chanwoo00106 Jul 11, 2024
2a969c0
Merge branch 'develop' into feature/authentication-form-ui
chanwoo00106 Jul 11, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions packages/app/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
"dependencies": {
"@emotion/react": "^11.10.6",
"@emotion/styled": "^11.10.6",
"@hookform/error-message": "^2.0.1",
"@hookform/resolvers": "^3.4.2",
"@reduxjs/toolkit": "^1.9.3",
"@sms/shared": "workspace:*",
Expand Down
19 changes: 13 additions & 6 deletions packages/app/src/features/global/Header/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@ import useLogout from '@features/auth/hook/useLogout'
import useMyPage from '@features/student/hooks/useMyPage'
import useProfileImgQuery from '@features/auth/queries/useProfileImgQuery'
import useLoggedInQuery from '@features/auth/queries/useLoggedInQuery'
// import useGSMInfo from '@features/student/hooks/useGSMInfo'
import useAuthenticationRedirect from '@features/student/hooks/useAuthenticationRedirect'
import Role from 'types/Role'

import * as S from './style'

Expand All @@ -18,7 +19,7 @@ interface Props {
const Header = ({ onFilter }: Props) => {
const { onLogout } = useLogout()
const { redirectMyPage } = useMyPage()
// const { redirectGSMInfo } = useGSMInfo()
const { redirectAuthentication } = useAuthenticationRedirect()
const [isShow, setIsShow] = useState<boolean>(false)
const { data: loggedInData } = useLoggedInQuery()
const { data } = useProfileImgQuery()
Expand Down Expand Up @@ -59,16 +60,22 @@ const Header = ({ onFilter }: Props) => {
</S.UserCircle>

<S.DropdownMenu isShow={isShow} onClose={() => setIsShow(false)}>
{/* <S.DropdownItem onClick={redirectGSMInfo}>
<Icon.Document color='var(--N50)' /> 인증제
</S.DropdownItem> */}

<S.DropdownItem onClick={redirectMyPage}>
<Icon.Person color='var(--N50)' /> 마이페이지
</S.DropdownItem>

<S.Line />

{loggedInData.role === Role.ROLE_STUDENT && (
<>
<S.DropdownItem onClick={redirectAuthentication}>
<Icon.Bag color='var(--N50)' /> 인증제
</S.DropdownItem>

<S.Line />
</>
)}

<S.DropdownItem onClick={onLogout}>
<Icon.Out color='var(--N50)' /> 로그아웃
</S.DropdownItem>
Expand Down

This file was deleted.

This file was deleted.

1 change: 0 additions & 1 deletion packages/app/src/features/register/molecules/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,3 @@ export { default as CertificateInputs } from './CertificateInputs'
export { default as LanguageInputs } from './LanguageInputs'
export { default as ProjectsInput } from './ProjectsInput'
export { default as PrizeInputs } from './PrizeInputs'
export { default as AuthenticationInputs } from './AuthenticationInputs'
21 changes: 21 additions & 0 deletions packages/app/src/features/register/queries/usePostFileMutation.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
import { UseMutationOptions, useMutation } from '@tanstack/react-query'
import { PostFileService } from '@features/register/services'

interface Param {
file: File
isImage?: boolean
}

interface Props
extends UseMutationOptions<string | undefined, Error, Param, unknown> {}

const usePostFileMutation = ({ ...props }: Props) => {
return useMutation({
mutationKey: ['post-file'],
mutationFn: ({ file, isImage }: Param) =>
PostFileService(file, isImage ?? false),
...props,
})
}

export default usePostFileMutation
Original file line number Diff line number Diff line change
Expand Up @@ -5,19 +5,15 @@ const PostFileService = async (file: File, isImage: boolean) => {
const formData = new FormData()
formData.append('file', file)

try {
const { data } = await axiosApi.post<Response>(
`/api/server/file${isImage ? '/image' : ''}`,
formData,
{
headers: { 'Content-Type': 'multipart/form-data' },
}
)
const { data } = await axiosApi.post<Response>(
`/api/server/file${isImage ? '/image' : ''}`,
formData,
{
headers: { 'Content-Type': 'multipart/form-data' },
}
)

return data.fileUrl
} catch (e) {
return
}
return data.fileUrl
}

export default PostFileService
25 changes: 25 additions & 0 deletions packages/app/src/features/student/atoms/ArrayController/index.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
import { Chip, DeleteButton } from '@sms/shared'
import * as S from './style'

interface Props {
onAddClick?: () => void
onRemoveClick?: () => void
disableAdd?: boolean
}

const ArrayController = ({ onAddClick, onRemoveClick, disableAdd }: Props) => {
return (
<S.Wrapper>
<Chip
disabled={disableAdd}
style={{ opacity: disableAdd ? 0 : undefined }}
onClick={onAddClick}
>
추가
</Chip>
<DeleteButton type='button' onClick={onRemoveClick} />
</S.Wrapper>
)
}

export default ArrayController
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
import styled from '@emotion/styled'

export const Wrapper = styled.div`
display: flex;
justify-content: space-between;
align-items: center;
`
36 changes: 36 additions & 0 deletions packages/app/src/features/student/atoms/BooleanInput/index.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
import { SegmentedControl } from '@sms/shared'
import { useFormContext } from 'react-hook-form'
import ErrorWrapper from '@sms/shared/src/atoms/ErrorWrapper'
import { ErrorMessage } from '@hookform/error-message'
import type { Field } from '@features/student/dtos/res/AuthenticationFromResDto'

interface Props {
field: Field
name: string
}

const BooleanInput = ({ field, name }: Props) => {
const {
register,
formState: { errors },
} = useFormContext()

return (
<ErrorWrapper error={<ErrorMessage name={name} errors={errors} />}>
<SegmentedControl.Root {...register(name)}>
{
field.values?.map((value) => (
<SegmentedControl.Option
key={value.selectId}
value={value.selectId}
>
{value.value}
</SegmentedControl.Option>
)) as []
}
</SegmentedControl.Root>
</ErrorWrapper>
)
}

export default BooleanInput
Loading
Loading