sparcs-kaist / biseo Goto Github PK
View Code? Open in Web Editor NEWRealtime voting tool for meetings @ KAIST
Home Page: https://biseo.sparcs.org
License: MIT License
Realtime voting tool for meetings @ KAIST
Home Page: https://biseo.sparcs.org
License: MIT License
모달 바깥의 배경을 눌러도 닫히게 해야함.
현재는 모달 내부의 x 버튼을 눌렀을 때만 닫힘.
클라이언트의 zustand
내부에서 발생하는 에러를 zustand middleware를 사용하여 전역적으로 처리합니다
chat.send
에서 빈 스트링이 보내집니다
별도 로직 말고 z.string().min(...)
으로 zod 단에서 막으면 될듯 합니다
이참에 max도 정하는것도 좋을 듯 합니다
피그마랑 다른 디자인 수정
현재의 agenda.voted
, admin.agenda.voted
api는 voters
오브젝트를 넘겨주는데 불필요하다는 생각을 했습니다. 이를 넘겨주기 위해 db에서 많은 정보에 접근해야하고 쿼리가 (최적화는 안했지만)복잡해지는 문제점이 있습니다.
select: {
choice: {
select: {
agenda: {
select: {
choices: {
select: {
users: {
select: {
user: {
select: {
id: true,
username: true,
displayName: true,
},
},
},
},
},
},
voters: {
select: {
user: {
select: {
id: true,
username: true,
displayName: true,
},
},
},
},
},
},
},
},
},
db 접근을 통해 전부 넘겨주는 형식이 아닌 변동사항(투표)만 넘겨주고, 로직 파트에서 업데이트 할 수 있도록 하면 어떤지 궁금합니다.
ex) agendaId, choiceId(, userId)만 넘겨주고, 프론트에서 이를 이용해 incremental 하게 업데이트 하기
컨테이너, 종료 아젠다 비활성, 종료 아젠다 활성(제목, 투표 결과, 선택지 리스트, 상세)
admin 페이지의 대기 중인 투표 display card 만들겁니다
현재 typography는 <Text />
컴포넌트에서 관리되고 있지만, <Input />
이나 <TextArea />
처럼 다른 컴포넌트에서 쓰여할 상황도 종종 있음
이에 <Text />
컴포넌트는 유지하면서 스타일 자체만으로 쓸 수 있도록 SerializedStyles
으로 theme
에 분리하면 좋을 것 같습니다.
<Input />
, <TextArea />
)전체적으로 폰트와 UI 사이즈가 너무 작아서 키워야 할것 같아요
cursor: pointer
같은 것
참고) #63 (comment)
chat
에서 적용한 방식으로 service
디렉토리 안의 로직들을 정리합니다.
(정리 내용 적을 예정)
처음에 피그마의 auto-layout과의 1:1 대응을 생각하고 만든 컴포넌트인데 시간이 지남에 따라 prop이 점점 많아지고 사용되는 역할이 많아짐에 따라 역할에 따른 분리를 하는게 좋을 것 같아요.
Flex
? Row
, Column
Paper
? border 같은 prop을 받도록 해서 기존의 BorderedBox
같은 컴포넌트를 이 컴포넌트로 가져가는게 좋을듯일괄적으로 작업하기엔 시간이 너무 오래걸릴거같고 관련 이슈 작업할때마다 incrementally 작업하면 될듯합니다
현재 createdAt
등 시간을 쓰는 interface field에서 Date
객체를 쓰고 있는데, socket.io
를 통해 보내지는 과정에서 string으로 바뀌게 됩니다.
관련 socket.io
이슈
이에 클라이언트 및 서버 양단에서 type은 Date
라고 뜸에도 실제 타입은 string
이어서 getTime()
등의 method를 호출했을 때 에러가 뜨는 현상이 발생합니다.
사실 JSON을 통해 Date object를 보낼 수 없으니 당연한 일이기도 한데, 이를 해결하기 위한 두 가지 옵션이 있어 보입니다.
zod
의 validation은 이와 같은 type coercion을 자동으로 진행해 주는 기능을 제공하기 때문에, 각 요청에서(클라이언트에서도) zod validation을 수행하도록 합니다. (일종의 미들웨어? 인터셉터? 처럼)Date
필드들을 timestamp number
를 사용하도록 변경합니다.기존의 Button
형태가 아니더라도 clickable 한 element는 모두 transparent
varient를 적용한 Button
컴포넌트로 감쌉니다.
cursor: pointer;
효과hover
, active
시 darken 효과를 적용하기 위함입니다.
아래 링크의 Text button 느낌을 생각하시면 될것 같습니다
https://mui.com/material-ui/react-button/#text-button
적용할 컴포넌트
헤더, 컨테이너, 오버레이, 투표 내용 입력창, 투표 대상 선택 창, 드롭다운 리스트
TBD
현재 commitlint만 작동하고 있어 추가가 필요합니다.
ChatSection
컴포넌트 내부 및 관련 UI 컴포넌트를 개발하고, 이를 현재 구현되어 있는 로직 hook과 연결하는 작업입니다.
투표 생성, 수정 등에 사용되는 컴포넌트
admin.agenda
쪽에서 Agenda를 start 했을 때 admin 쪽 이벤트만 트리거되고 agenda 쪽은 핸들링하지 않고 있는 문제입니다.
Biseo의 인터페이스에 저장된 타입은 보통 아래와 같은 형태로 정의되었는데,
interface OngoingAgenda {
type: "ongoing";
...
}
interface TerminatedAgenda {
type: "terminated";
...
}
type Agenda = OngoingAgenda | TerminatedAgenda;
Agenda
타입을 가진 변수의 type
필드의 type check을 진행해 주어도 agenda에 대한 type inference가 이루어지지 않으므로 type predicate를 이용한 type guard를 정의하여 이를 통해 타입 검사를 진행해야 함
@kjy2844 님이 진행해준 부분에 이와 같은 식으로 정의되어 있는데, 비서 전반적으로 이와 같은 타입 체킹을 도와줄 type guard를 utils
폴더에 정리해두면 좋을 것 같아요
biseo/client/src/components/organisms/AgendaSection.tsx
Lines 7 to 9 in 2baee97
현재 우상단의 닉네임 버튼을 클릭한 후 새로고침을 하면 로그아웃이 되지만, 클릭한 즉시 /login 페이지로 이동하지는 않습니다.
#114 PR을 Pull 하면 버튼이 생깁니다
Admin user page 만드는 중
뚝딱뚝딱
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.