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

질문리스트 작업 #92

Merged
merged 17 commits into from
Dec 3, 2020
Merged

질문리스트 작업 #92

merged 17 commits into from
Dec 3, 2020

Conversation

Lavegaa
Copy link
Contributor

@Lavegaa Lavegaa commented Dec 2, 2020

작업된 사항

  1. 질문 리스트 추가
  2. 질문 추가
  3. 질문 업데이트
  4. 모달작업

모달 사용하기 편하게 만들어뒀습니다. ModalWrapper를 통해 가운데 정렬과 배경 클릭 시 꺼지는 작업 해뒀습니다.

TODO

  • redux dispatch 비동기작업
  • input bar conflict잡기
  • 질문 리스트 삭제
  • 질문 삭제
  • 이동 관련 순서 저장하기

Lavegaa and others added 6 commits November 28, 2020 17:26
로그인 시 유저 정보 세션 스토리지에 저장 후 로그인 체크
- 이미지 use-select: none;은 추가해야할 것들이 있음
- 상 하단 로고, 나가기 포지션을 고정해놓고 미디어태그로 height에 따라 사라지게 만들어둠
  - 좀 더 좋은 방법이 생각나면 수정해야 할듯
- 상태는 redux로 변경해야 함
TODO
 - redux dispatch 비동기작업
 - input bar conflict잡기
 - 질문 리스트 삭제
 - 질문 삭제
 - 이동 관련 순서 저장하기
@Lavegaa Lavegaa self-assigned this Dec 2, 2020
const authSelector = useSelector(get('auth'));
useEffect(() => {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

세션에 로그인 결과를 저장했습니다.
해당 401 시 로그아웃 처리도 추가돼야 할 것 같습니다.

Copy link
Member

Choose a reason for hiding this comment

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

네네 확인했습니다. 감사합니다! 401 상태인걸 알기위해 api 요청하는 부분이 추가되는 걸까요?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

어떤 패턴으로 갈지는 잘 감이 안잡히네요. 각자 api사용하는 부분에서 예외처리를 해야하기엔 너무 중복코드가 많아 질 것 같은데 다른 방법이 딱히 떠오르지가 않네요... repository단에서 가능하려나요...

@@ -21,10 +21,10 @@ const Wrapper = styled.input`
`;

export default function InputBar({
className,
className, placeholder, value, onchange,
Copy link
Contributor Author

Choose a reason for hiding this comment

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

이부분 필요해서 수정했었는데 용재님이 따로 수정하셨더라고요. 추후에 머지하기 전에 conflict잡곘습니다.

Copy link
Member

Choose a reason for hiding this comment

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

네네 맞습니다 협업이다보니 마스터에 PR이 반영될 때마다 머지하면 좋을 것 같아요!

Copy link
Contributor

@SkynI25 SkynI25 Dec 4, 2020

Choose a reason for hiding this comment

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

안녕하세요 @dididy 님.
마스터에 PR이 반영될 때마다 머지하면 좋을 것 같아요! 가 어떤 의미인지 제대로 이해를 하고 싶어서 질문드립니다. @Lavegaa 님이 말씀하신 것처럼 머지할때마다 conflict를 잡는 작업을 말하신 걸까요?

Copy link
Member

Choose a reason for hiding this comment

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

단순히 conflict를 잡는 것을 넘어서 마감에 가까워지고있기 때문에 마스터의 변경점을 계속 반영하면서 작업해야 서로 빠르게 대응할 수 있다고 생각했습니다.

{ isShow && modalList[modalName] }
{ isShow
&& (
<ModalWrapper modalName={modalName}>
Copy link
Contributor Author

Choose a reason for hiding this comment

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

ModalWrapper를 만들어서 가운데정렬과 배경 클릭 시 모달 꺼지는 기능을 만들었습니다.

Copy link
Member

Choose a reason for hiding this comment

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

아하 네넵 알겠습니다. 어떻게 동작하는지 이해했습니다.

Copy link
Contributor

Choose a reason for hiding this comment

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

오,,추가해주셔서 감사합니다!


const modalReducer = createSlice({
name: 'modal',
initialState: {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

모달이 기본적으로 store에서 false값을 가지고 안보이게 설정 돼있어서 가상 store를 만들어 true값을 줬습니다.
배경을 눌렀을 시 모달이 꺼져서 storybook에서 모달을 켜는 버튼을 하나 추가하겠습니다.

@@ -61,9 +64,10 @@ const AnswerBox = styled.div`
transform: translateY(-20px);
`;

const ContenText = styled.div`
const ContenText = styled.textarea`
Copy link
Contributor Author

Choose a reason for hiding this comment

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

value값을 활용하기엔 div의 contentEditable만으로 다루기가 어려워 textarea로 수정했습니다.

Copy link
Member

Choose a reason for hiding this comment

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

아하 그렇군요 나중에 비슷한 작업할때 참고하겠습니다.

<IconWrapper>
<Icon type={clicked ? 'arrow_up' : 'arrow_down'} alt="" />
<IconWrapper clicked={clicked}>
<Icon type={clicked ? 'drop_up' : 'drop_down'} alt="" />
Copy link
Contributor Author

Choose a reason for hiding this comment

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

아이콘 이름이 바뀐 부분이 있습니다. 한번씩 확인해주세요!

const dragCard = cards[dragIndex];
setCards(update(cards, {
const dragCard = questions[dragIndex];
setQuestions(update(questions, {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

해당 정렬을 활용해 추후 질문 순서를 수정할 계획입니다.

Copy link
Member

Choose a reason for hiding this comment

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

아 이부분 고민이 많으셨을 것 같은데 잘 구현해 주셨네요. 고생 많으셨습니다 ㅠㅠ

Copy link
Contributor

Choose a reason for hiding this comment

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

고생하셨습니다..immutability-helper 로 구현하셨군요!

@@ -9,7 +9,7 @@ const api = ({ url, type = 'get', param }) => Axios({
headers: {
'Content-Type': 'application/json',
'Access-Control-Allow-Origin': '*',
'Access-Control-Allow-Methods': 'GET, POST, PUT, DELETE',
'Access-Control-Allow-Methods': 'GET, POST, PUT, DELETE, PATCH',
Copy link
Contributor Author

Choose a reason for hiding this comment

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

수정부분이 put이 아니라 patch로 나와있길래 추가했습니다.

}, []);

const handleQuestionMake = () => {
// TODO: 비동기 처리 해야함. dispatch후에 아래의 과정 처리해야함.
Copy link
Contributor Author

Choose a reason for hiding this comment

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

dispatch를 비동기 작업해줘야 하는데 redux toolkit에 thunk패턴이 있어 활용해 봤으나 비동기 작업이 안됐습니다.
thunk패턴을 잘못 적용했는지, 따로 thunk를 붙여야 하는지 알아봐야 할 것 같습니다.

Copy link
Member

Choose a reason for hiding this comment

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

Copy link
Contributor Author

Choose a reason for hiding this comment

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

참고해서 다시 해보겠습니다!

Copy link
Contributor

Choose a reason for hiding this comment

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

@dididy 님이 첨부해주신 자료대로 async, await 를 사용하시면 해결할 수 있을 거 같습니다!

@Lavegaa Lavegaa requested review from dididy and SkynI25 and removed request for dididy December 2, 2020 16:00
Copy link
Member

@dididy dididy left a comment

Choose a reason for hiding this comment

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

앗 리뷰다는 도중에 코멘트를 다시는 것 같아 일단 중지합니다!

}) {
return (
<Wrapper className={className} type="text" placeholder="기업명을 입력해주세요" />
<Wrapper className={className} type="text" placeholder={placeholder} value={value} onChange={onchange} />
Copy link
Member

Choose a reason for hiding this comment

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

이부분 저도 변경점이 있는데 아마 conflict 날 것 같네요 ㅠㅠ

Copy link
Contributor Author

Choose a reason for hiding this comment

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

네네 제가 머지하기 전에 잡겠습니다.

Comment on lines +11 to +17
useEffect(() => {
const name = sessionStorage.getItem('name');
const email = sessionStorage.getItem('email');
if (name !== authSelector.name) {
dispatch(setLogin({ email, name }));
}
}, []);
Copy link
Member

Choose a reason for hiding this comment

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

로그인 유지 로직 감사합니다!

displayModal(state, { payload: { modalName } }) {
return {
...state,
[modalName]: true,
Copy link
Member

Choose a reason for hiding this comment

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

오 이렇게 작성할 수 있네요 배워갑니다!

Copy link
Member

@dididy dididy left a comment

Choose a reason for hiding this comment

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

선머지후 문제점 발견하면 그떄 리펙토링 하는 걸로 하겠습니다! 수고 많으셨습니다~!

@Lavegaa Lavegaa merged commit 10ddba1 into master Dec 3, 2020
Copy link
Contributor

@SkynI25 SkynI25 left a comment

Choose a reason for hiding this comment

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

고생하셨습니다!! 그리고 alias로 다 수정해주셨네요..감사합니다!

{ isShow && modalList[modalName] }
{ isShow
&& (
<ModalWrapper modalName={modalName}>
Copy link
Contributor

Choose a reason for hiding this comment

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

오,,추가해주셔서 감사합니다!

const dragCard = cards[dragIndex];
setCards(update(cards, {
const dragCard = questions[dragIndex];
setQuestions(update(questions, {
Copy link
Contributor

Choose a reason for hiding this comment

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

고생하셨습니다..immutability-helper 로 구현하셨군요!

}, []);

const handleQuestionMake = () => {
// TODO: 비동기 처리 해야함. dispatch후에 아래의 과정 처리해야함.
Copy link
Contributor

Choose a reason for hiding this comment

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

@dididy 님이 첨부해주신 자료대로 async, await 를 사용하시면 해결할 수 있을 거 같습니다!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants