-
Notifications
You must be signed in to change notification settings - Fork 0
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
Use info logic/#82 #90
Closed
Closed
Changes from all commits
Commits
Show all changes
14 commits
Select commit
Hold shift + click to select a range
0f60da0
[web] feat: Update middleware.ts to improve guest path handling
seonghunYang ae40793
feat: Add signOut function and redirect to sign-in page
seonghunYang 944399f
feat: Add SignOutButton component to UserInfoNavigator
seonghunYang 4e06500
feat: Add USER_DEELETE dialog key
seonghunYang f6a2f42
feat: Add UserDeleteButton component to UserInfoNavigator
seonghunYang 1ccb7b3
feat: Add UserDeleteModal component
seonghunYang 5863c3b
feat: Add FloatingComponentContainer to MyPage
seonghunYang f125a64
feat: Add user delete dialog and handle toggle
seonghunYang 804fa95
refactor: Refactor user-handler.mock.ts to add devModeAuthGuard function
seonghunYang d4e50cc
feat: Add unit tests for UserInfoNavigator component and update mock โฆ
seonghunYang eca405f
feat: Update UserDeleteModal component to improve UI and add user delโฆ
seonghunYang 8bbc2f5
feat: add UserDeleteRequestBody interface
seonghunYang 259ed10
feat: Add deleteUser function to mockDatabase and update user-handlerโฆ
seonghunYang 364e312
feat: add deleteUser function and update UserDeleteModal component
seonghunYang 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 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 |
---|---|---|
@@ -0,0 +1,9 @@ | ||
import UserDeleteModal from '@/app/ui/user/user-info-navigator/user-delete-modal'; | ||
|
||
export default function FloatingComponentContainer() { | ||
return ( | ||
<> | ||
<UserDeleteModal /> | ||
</> | ||
); | ||
} |
This file contains 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 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 |
---|---|---|
@@ -0,0 +1,21 @@ | ||
import '@testing-library/jest-dom'; | ||
import UserInfoNavigator from '@/app/ui/user/user-info-navigator/user-info-navigator'; | ||
import { render, screen } from '@testing-library/react'; | ||
|
||
jest.mock('next/headers', () => ({ | ||
cookies: jest.fn().mockReturnValue({ | ||
get: jest.fn().mockReturnValue({ | ||
value: 'fake-access-token', | ||
}), | ||
}), | ||
})); | ||
|
||
describe('UserInfoNavigator', () => { | ||
it('UserInfoNavigator๋ฅผ ๋ ๋๋งํ๋ค.', async () => { | ||
render(await UserInfoNavigator()); | ||
|
||
expect(await screen.findByText(/๋ชจํน์ด/i)).toBeInTheDocument(); | ||
expect(await screen.findByText(/์ตํฉ์ํํธ์จ์ด/i)).toBeInTheDocument(); | ||
expect(await screen.findByText(/60000000/i)).toBeInTheDocument(); | ||
}); | ||
}); |
This file contains 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 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 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 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 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 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 |
---|---|---|
@@ -0,0 +1,11 @@ | ||
'use client'; | ||
import { signOut } from '@/app/business/user/user.command'; | ||
import Button from '../../view/atom/button/button'; | ||
|
||
export default function SignOutButton() { | ||
const handleSignOut = async () => { | ||
await signOut(); | ||
}; | ||
|
||
return <Button onClick={handleSignOut} size="sm" variant="secondary" label="๋ก๊ทธ์์" />; | ||
} |
This file contains 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 |
---|---|---|
@@ -0,0 +1,14 @@ | ||
'use client'; | ||
import Button from '../../view/atom/button/button'; | ||
import { DIALOG_KEY } from '@/app/utils/key/dialog.key'; | ||
import useDialog from '@/app/hooks/useDialog'; | ||
|
||
export default function UserDeleteButton() { | ||
const { toggle } = useDialog(DIALOG_KEY.USER_DEELETE); | ||
|
||
const handleModalToggle = () => { | ||
toggle(); | ||
}; | ||
|
||
return <Button onClick={handleModalToggle} size="sm" variant="text" label="ํ์ํํดํ๊ธฐ" />; | ||
} |
This file contains 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 |
---|---|---|
@@ -0,0 +1,26 @@ | ||
'use client'; | ||
import { DIALOG_KEY } from '@/app/utils/key/dialog.key'; | ||
import Modal from '../../view/molecule/modal/modal'; | ||
import Form from '../../view/molecule/form'; | ||
import { deleteUser } from '@/app/business/user/user.command'; | ||
|
||
export default function UserDeleteModal() { | ||
return ( | ||
<Modal modalKey={DIALOG_KEY.USER_DEELETE}> | ||
<div className="max-w-sm mx-auto my-12 p-6 border rounded-lg shadow-md bg-white"> | ||
<h2 className="text-xl font-bold text-center">ํ์ ํํด</h2> | ||
<div className="h-1 w-10 bg-blue-600 mx-auto my-3" /> | ||
<p className="text-sm text-center my-4"> | ||
ํ์ํํด๋ฅผ ์งํํ์๊ฒ ์ต๋๊น? ํํด๋ฅผ ์งํํ๋ฉด๋ ๋น๋ฐ๋ฒํธ ์ ๋ ฅ์ด ํ์ํฉ๋๋ค. | ||
</p> | ||
<div className="my-4"> | ||
<Form failMessageControl={'toast'} action={deleteUser} id={'user-delete'}> | ||
<Form.PasswordInput label="๋น๋ฐ๋ฒํธ" id="password" placeholder="๋น๋ฐ๋ฒํธ๋ฅผ ์ ๋ ฅํ์ธ์" required={true} /> | ||
<Form.SubmitButton label="ํํดํ๊ธฐ" position="center" variant="primary" /> | ||
</Form> | ||
</div> | ||
<p className="text-xs text-center my-4">์ ๋ณด๋ฅผ ๋๋ฝํ์ฌ ์๋น์ค๋ฅผ ์ด์ฉํด ์ฃผ์ ์ ๊ฐ์ฌํฉ๋๋ค.</p> | ||
</div> | ||
</Modal> | ||
); | ||
} |
This file contains 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 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 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
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.
๊ฐ๋ฐ ๋ชจ๋๊ฐ ์๋๋๋
์ ๋ฐํํด์ผํ๋ ๊ฒ ์๋๊ฐ์?
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.