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

feat-fe: 사전 질문 필수 입력 필드 표시 #560

Merged
merged 5 commits into from
Aug 21, 2024

Conversation

github-actions[bot]
Copy link
Contributor

@github-actions github-actions bot commented Aug 20, 2024

목적

지원서 폼에 전달되는 사전 질문에 필수 입력 여부가 표시되도록 기능을 추가합니다.

기능

  • 필수 필드에 표시(*) 추가
  • applyForn 응답의 인터페이스와 mock data 변경
  • 필수 필드가 입력되지 않으면 제출하지 않도록 처리

참고사항

  • Radio 컴포넌트도 Checkbox와 동일하게 HiddenInput을 추가해줬습니다.
  • eslint의 함수가 value만 return되게 할 필요가 없어서 consistent-return 에러를 껐습니다.

아래의 별표줄 밑에 요구사항 ID만 작성해주세요. Prefix 금지!


FIX_APP_02

closes #559

@github-actions github-actions bot added feature 새로운 기능 frontend 프론트엔드 labels Aug 20, 2024
@github-actions github-actions bot added this to the 스프린트 3.0 milestone Aug 20, 2024
Copy link
Contributor Author

1724205890.136769

Copy link
Contributor Author

1724205892.245359

@llqqssttyy llqqssttyy marked this pull request as ready for review August 21, 2024 02:05
Copy link
Contributor Author

1724205923.216699

Copy link
Contributor

@lurgi lurgi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

잘 처리해주셨네요!! 감사감사

Comment on lines -44 to +45
if (Object.values(answers).some((answer) => answer.length === 0)) {
if (!window.confirm('작성하지 않은 질문이 있습니다. 제출하시겠습니까?')) {
return;
}
if (isRequiredFieldsIncomplete()) {
return window.alert('모든 필수 항목에 응답해 주세요.');
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

훨씬 깔끔하네용~

Comment on lines +21 to +29
<S.RadioContainer onClick={() => onToggle(!isChecked)}>
<S.HiddenRadio
type="radio"
checked={isChecked}
onChange={(e: React.ChangeEvent<HTMLInputElement>) => onToggle(e.target.checked)}
disabled={isDisabled}
name={name}
required={required}
/>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

input 추가 좋아용~

Copy link
Contributor

@seongjinme seongjinme left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

변경사항 코드, 화면 모두 확인했습니다. 고생하셨습니다 렛서 🙏

Comment on lines +47 to +59
const HiddenRadio = styled.input`
border: 0;
clip: rect(0 0 0 0);
clip-path: inset(50%);
height: 1px;
margin: -1px;
overflow: hidden;
padding: 0;
position: absolute;
white-space: nowrap;
width: 1px;
`;

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

HiddenRadio 추가 좋네요 👍

Comment on lines +39 to +40
const isRequiredFieldsIncomplete = () =>
questions.some((question) => question.required && answers[question.questionId]?.length === 0);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

@llqqssttyy llqqssttyy merged commit 8f8c669 into fe/develop Aug 21, 2024
28 checks passed
@llqqssttyy llqqssttyy deleted the fe-559-FIX_APP_02 branch August 21, 2024 08:35
seongjinme pushed a commit that referenced this pull request Aug 23, 2024
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: Kim Da Eun <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature 새로운 기능 frontend 프론트엔드
Projects
Status: 완료
Development

Successfully merging this pull request may close these issues.

3 participants