-
Notifications
You must be signed in to change notification settings - Fork 1
Feat(Client): 카테고리 수정 팝업 checkbox 추가 및 api 연결 #279
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
Open
jjangminii
wants to merge
15
commits into
develop
Choose a base branch
from
feat/#269/modal-checkbox-add
base: develop
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+274
−58
Open
Changes from all commits
Commits
Show all changes
15 commits
Select commit
Hold shift + click to select a range
a9e35bd
Feat(client): Popup 컴포넌트에 체크박스 옵션 추가 및 PopupPortal에서 공유 기능 구현
jjangminii 1b8ced5
Merge branch 'develop' of https://github.com/Pinback-Team/pinback-cli…
jjangminii e7f1541
Feat(client): Checkbox 컴포넌트에 xsmall 사이즈 추가
jjangminii f5ce499
Feat(client): 카테고리 생성 API에 공개 여부 추가
jjangminii e8c5489
Merge branch 'develop' of https://github.com/Pinback-Team/pinback-cli…
jjangminii 3bf8c23
Feat(client): 카테고리 수정 API PATCH 메서드로 변경 및 관련 훅 업데이트
jjangminii 41db846
Feat(client): 카테고리 관련 API 및 컴포넌트 수정 - 공개 여부 추가 및 관련 로직 업데이트
jjangminii 218095a
fix: 빌드 오류 해결
jjangminii 4d4eb03
Feat: 익스텐션 카테고리 API 및 컴포넌트 수정
jjangminii b389a49
Merge branch 'develop' of https://github.com/Pinback-Team/pinback-cli…
jjangminii 3b5607a
Merge branch 'develop' of https://github.com/Pinback-Team/pinback-cli…
jjangminii 894a4ea
feat: 카테고리 상세 정보 조회 기능 추가
jjangminii 947b878
fix: 사용하지 않는 categoryDetail 데이터 제거 및 api.ts에서 isPublic 필드 삭제
jjangminii 4aaa013
feat: 카테고리 편집 기능 개선 및 getCategoryDetail 호출 로직 통합
jjangminii 597a4f0
refactor: OptionsMenuPortal에서 isPublic 필드 제거 및 onEdit 함수 시그니처 수정
jjangminii File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -76,6 +76,7 @@ export function Sidebar() { | |
| handlePatchCategory, | ||
| handleDeleteCategory, | ||
| handlePopupClose, | ||
| handleEditCategory, | ||
| } = useCategoryActions({ | ||
| close, | ||
| setActiveTab, | ||
|
|
@@ -117,8 +118,15 @@ export function Sidebar() { | |
| prevAcornRef.current = acornCount; | ||
| }, [acornCount, isAcornPending]); | ||
|
|
||
| const getCategoryName = (id: number | null) => | ||
| categories?.categories.find((c) => c.id === id)?.name ?? ''; | ||
| const getCategory = (id: number | null) => { | ||
| const c = categories?.categories.find((c) => c.id === id) ?? null; | ||
| if (!c) return null; | ||
|
|
||
| return { | ||
| id: c.id, | ||
| name: c.name, | ||
| }; | ||
| }; | ||
|
Comment on lines
121
to
129
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Line 123, Line 208-210의 🔒 제안 수정안 const getCategory = (id: number | null) => {
- const c = categories?.categories.find((c) => c.id === id) ?? null;
+ const c = categories?.categories.find((category) => category.id === id);
if (!c) return null;
- return { id: c.id, name: c.name, isPublic: (c as any).isPublic ?? true };
+ return { id: c.id, name: c.name, isPublic: c.isPublic ?? false };
};
@@
- onEdit={(id, name, isPublic) =>
- openEdit(id, name, isPublic ?? true)
- }
+ onEdit={(id, name, isPublic) => openEdit(id, name, isPublic)}Also applies to: 208-210 🤖 Prompt for AI Agents |
||
|
|
||
| return ( | ||
| <aside className="bg-white-bg sticky top-0 h-screen w-[24rem] border-r border-gray-300"> | ||
|
|
@@ -197,13 +205,12 @@ export function Sidebar() { | |
| {canCreateMore && <CreateItem onClick={() => openCreate()} />} | ||
| </ul> | ||
| </AccordionItem> | ||
|
|
||
| <OptionsMenuPortal | ||
| open={menu.open} | ||
| style={style} | ||
| categoryId={menu.categoryId} | ||
| getCategoryName={getCategoryName} | ||
| onEdit={(id, name) => openEdit(id, name)} | ||
| getCategory={getCategory} | ||
| onEdit={(id) => handleEditCategory(id, openEdit, closeMenu)} | ||
| onDelete={(id, name) => openDelete(id, name)} | ||
| onClose={closeMenu} | ||
| containerRef={containerRef} | ||
|
|
@@ -265,11 +272,14 @@ export function Sidebar() { | |
|
|
||
| {/* Category Popup */} | ||
| <PopupPortal | ||
| key={popup?.kind === 'edit' ? popup.id : popup?.kind} | ||
| popup={popup} | ||
| onClose={handlePopupClose} | ||
| onChange={handleCategoryChange} | ||
| onCreateConfirm={handleCreateCategory} | ||
| onEditConfirm={(id) => handlePatchCategory(id)} | ||
| onEditConfirm={(id, name, isPublic) => | ||
| handlePatchCategory(id, name, isPublic) | ||
| } | ||
| onDeleteConfirm={(id) => handleDeleteCategory(id)} | ||
| categoryList={categories?.categories ?? []} | ||
| isToastOpen={toastIsOpen} | ||
|
|
||
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
getCategory와getCategoryName둘 다 없는 경우 처리가 누락되었습니다.현재 로직에서
getCategory도getCategoryName도 제공되지 않으면name이 빈 문자열로 남게 됩니다. 이 경우onEdit과onDelete에 빈 문자열이 전달됩니다.🛡️ 두 prop 모두 없는 경우 early return 추가 제안
if (getCategory) { const category = getCategory(categoryId); if (!category) return null; id = category.id; name = category.name; isPublic = category.isPublic; } else if (getCategoryName) { name = getCategoryName(categoryId); + } else { + return null; }🤖 Prompt for AI Agents