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

관리자 페이지 구현 - 관리자멤버, 카테고리, 환율 관리 페이지 구현 #790

Merged
merged 30 commits into from
Feb 23, 2024
Merged
Show file tree
Hide file tree
Changes from 29 commits
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
35a5af2
feat: mock 데이터 추가
LJW25 Feb 2, 2024
68f39b4
feat: msw api 구현
LJW25 Feb 2, 2024
9922a47
feat: category api 구현
LJW25 Feb 2, 2024
f6d70c8
feat: currency api 구현
LJW25 Feb 2, 2024
a7329de
feat: adminMember api 구현
LJW25 Feb 2, 2024
25a4cc5
feat: CityPageSkeleton 구현
LJW25 Feb 2, 2024
9947233
feat: 카테고리 조회 페이지 구현
LJW25 Feb 2, 2024
5843bfe
feat: 카테고리 추가 모달 구현
LJW25 Feb 2, 2024
a81dbc9
feat: 카테고리 수정 기능 구현
LJW25 Feb 2, 2024
da417c3
feat: 카테고리 스켈레톤 페이지 구현
LJW25 Feb 2, 2024
7bdb2da
feat: 환율 api hook 구현
LJW25 Feb 2, 2024
8ba1d4f
feat: 관리자 멤버 api hook 구현
LJW25 Feb 2, 2024
c612f69
feat: 환율 조회 페이지 구현
LJW25 Feb 2, 2024
848bceb
feat: 환율 정보 추가 모달 구현
LJW25 Feb 2, 2024
4152e11
reafator: 컴포넌트 이름 변경
LJW25 Feb 2, 2024
e7c5b06
feat: 환율 정보 수정 버튼 구현
LJW25 Feb 2, 2024
483237c
feat: 환율 skeleton 페이지 구현
LJW25 Feb 3, 2024
bef31c0
feat: 관리자 멤버 조회 페이지 구현
LJW25 Feb 3, 2024
20d61f9
feat: 관리자 추가 모달 구현
LJW25 Feb 3, 2024
123cc76
feat: 비밀번호 수정 모달 구현
LJW25 Feb 3, 2024
f9c3cb7
refactor: style 수정
LJW25 Feb 3, 2024
14377d9
feat: 관리자멤버 스켈레톤 페이지 구현
LJW25 Feb 3, 2024
9a9585c
refactor: import path 변경
LJW25 Feb 10, 2024
558cc18
refactor: import 순서 리팩토링
LJW25 Feb 10, 2024
294ba78
refactor: camelCase 적용
LJW25 Feb 10, 2024
ebb0bb3
refactor: pageSkeleton 제거
LJW25 Feb 10, 2024
ed14a01
refactor: style 선언 수정
LJW25 Feb 10, 2024
20eaf08
refactor: import 수정
LJW25 Feb 10, 2024
0c5be44
refactor: 매직넘버 상수화
LJW25 Feb 10, 2024
15a47cf
refactor: error 객체로 관리
LJW25 Feb 23, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 24 additions & 0 deletions frontend-monorepo/.pnp.cjs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion frontend-monorepo/packages/hanglog-admin/.eslintrc.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"parser": "@typescript-eslint/parser",
"plugins": ["@typescript-eslint"],
"plugins": ["@typescript-eslint", "import"],
"extends": [
"eslint:recommended",
"airbnb",
Expand Down
15 changes: 12 additions & 3 deletions frontend-monorepo/packages/hanglog-admin/.prettierrc
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,22 @@
"tabWidth": 2,
"printWidth": 100,
"semi": true,
"plugins": ["@trivago/prettier-plugin-sort-imports"],
"importOrder": [
"^@utils/(.*)$",
"^@api/(.*)$",
"^@/(.*)$",
"^@components/(.*)$",
"^@type/(.*)$",
"^@hooks/(.*)$",
"^@pages/(.*)$",
"^@components/(.*)$",
"^@styles/(.*)$",
"^@constants/(.*)$",
"^@assets/(.*)$",
"^@utils/(.*)$",
"^@api/(.*)$",
"^@mocks/(.*)$",
"^@stories/(.*)$",
"^@router/(.*)$",
"^@store/(.*)$",
"^[./]"
],
"importOrderSeparation": true,
Expand Down
1 change: 1 addition & 0 deletions frontend-monorepo/packages/hanglog-admin/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@
"@storybook/react": "^7.6.10",
"@storybook/react-vite": "^7.6.10",
"@storybook/test": "^7.6.10",
"@trivago/prettier-plugin-sort-imports": "^4.3.0",
"@types/babel__core": "^7",
"@types/babel__preset-env": "^7",
"@types/react": "^18.2.43",
Expand Down
4 changes: 2 additions & 2 deletions frontend-monorepo/packages/hanglog-admin/src/App.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import { Outlet } from 'react-router-dom';

import Header from '@components/layout/Header/Header';
import Footer from '@components/layout/Footer/Footer';
import ToastContainer from '@components/common/ToastContainer/ToastContainer';
import Footer from '@components/layout/Footer/Footer';
import Header from '@components/layout/Header/Header';

const App = () => {
return (
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
import type { AdminMemberData } from '@type/adminMember';

import { END_POINTS } from '@constants/api';

import { axiosInstance } from '@api/axiosInstance';

export const getAdminMember = async () => {
const { data } = await axiosInstance.get<AdminMemberData[]>(END_POINTS.MEMBER);
return data;
};
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
import type { PasswordPatchData } from '@type/adminMember';

import { END_POINTS } from '@constants/api';

import { axiosInstance } from '../axiosInstance';

export interface PatchPasswordParams extends PasswordPatchData {
adminMemberId: number;
}

export const patchAdminMemberPassword = (
{ adminMemberId, ...passwordInformation }: PatchPasswordParams
) => {
return axiosInstance.patch<PasswordPatchData>(
END_POINTS.CHANGE_MEMBER_PASSWORD(adminMemberId),
passwordInformation
);
};
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
import type { AdminMemberPostData } from '@type/adminMember';

import { END_POINTS } from '@constants/api';

import { axiosInstance } from '@api/axiosInstance';

export const postAdminMember = async (adminMemberFormData: AdminMemberPostData) => {
const response = await axiosInstance.post(END_POINTS.MEMBER, adminMemberFormData);

const adminMemberId = response.headers.location.replace(`${END_POINTS.MEMBER}/`, '');

return adminMemberId;
};
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import axios from 'axios';

import { handleAPIError } from '@api/interceptors';

import { AXIOS_BASE_URL, NETWORK } from '@constants/api';

import { handleAPIError } from '@api/interceptors';

export const axiosInstance = axios.create({
baseURL: AXIOS_BASE_URL,
timeout: NETWORK.TIMEOUT,
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
import type { CategoryData } from '@type/category';

import { END_POINTS } from '@constants/api';

import { axiosInstance } from '@api/axiosInstance';

export const getCategory = async () => {
const { data } = await axiosInstance.get<CategoryData[]>(END_POINTS.CATEGORY);
return data;
};
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
import type { CategoryData } from '@type/category';

import { END_POINTS } from '@constants/api';

import { axiosInstance } from '@api/axiosInstance';

export const postCategory = async (categoryData: CategoryData) => {
const response = await axiosInstance.post(END_POINTS.CATEGORY, categoryData);

const categoryId = response.headers.location.replace(`${END_POINTS.CATEGORY}/`, '');

return categoryId;
};
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
import type { CategoryData } from '@type/category';

import { END_POINTS } from '@constants/api';

import { axiosInstance } from '@api/axiosInstance';

export const putCategory = (category: CategoryData) => {
return axiosInstance.put<CategoryData>(END_POINTS.CHANGE_CATEGORY(category.id), {
...category,
});
};
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import { axiosInstance } from '@api/axiosInstance';

import type { CityData } from '@type/city';

import { END_POINTS } from '@constants/api';

import { axiosInstance } from '@api/axiosInstance';

export const getCity = async () => {
const { data } = await axiosInstance.get<CityData[]>(END_POINTS.CITY);
return data;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
import { axiosInstance } from '@api/axiosInstance';

import type { CityFormData } from '@type/city';

import { END_POINTS } from '@constants/api';

import { axiosInstance } from '@api/axiosInstance';

export const postCity = async (cityFormData: CityFormData) => {
const response = await axiosInstance.post(END_POINTS.CITY, cityFormData);

const tripId = response.headers.location.replace(`${END_POINTS.CITY}/`, '');
const cityId = response.headers.location.replace(`${END_POINTS.CITY}/`, '');

return tripId;
return cityId;
};
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import { axiosInstance } from '@api/axiosInstance';

import type { CityFormData } from '@type/city';

import { END_POINTS } from '@constants/api';

import { axiosInstance } from '@api/axiosInstance';

export interface PutCityParams extends CityFormData {
cityId: number;
}
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
import type { CurrencyListData } from '@type/currency';

import { END_POINTS } from '@constants/api';

import { axiosInstance } from '@api/axiosInstance';

export const getCurrency = async (page: number, size: number) => {
const { data } = await axiosInstance.get<CurrencyListData>(END_POINTS.CURRENCY_PAGE(page, size));
return data;
};
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
import type { CurrencyFormData } from '@type/currency';

import { END_POINTS } from '@constants/api';

import { axiosInstance } from '@api/axiosInstance';

export const postCurrency = async (currencyFormData: CurrencyFormData) => {
const response = await axiosInstance.post(END_POINTS.CURRENCY, currencyFormData);

const currencyId = response.headers.location.replace(`${END_POINTS.CURRENCY}/`, '');

return currencyId;
};
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
import type { CurrencyFormData } from '@type/currency';

import { END_POINTS } from '@constants/api';

import { axiosInstance } from '@api/axiosInstance';

export interface PutCurrencyParams extends CurrencyFormData {
currencyId: number;
}

export const putCurrency = ({ currencyId, ...currencyInformation }: PutCurrencyParams) => {
return axiosInstance.put<CurrencyFormData>(END_POINTS.CHANGE_CURRENCY(currencyId), {
...currencyInformation,
});
};
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
import type { AxiosError } from 'axios';

import { HTTPError } from '@api/HTTPError';
import { HTTP_STATUS_CODE } from '@constants/api';

import { HTTPError } from '@api/HTTPError';

export interface ErrorResponseData {
statusCode?: number;
message?: string;
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
import { css } from '@emotion/react';
import { Theme } from 'hang-log-design-system';

export const wrapperStyling = css({
width: '400px',
minHeight: '528px',

'@media screen and (max-width: 600px)': {
width: `calc(100vw - ${Theme.spacer.spacing4})`,
height: `80%`,
},
});

export const formStyling = css({
display: 'flex',
flexDirection: 'column',
gap: Theme.spacer.spacing4,
width: '80%',
});

export const buttonStyling = css({
width: '100%',
});

export const closeButtonStyling = css({
position: 'absolute',
right: Theme.spacer.spacing4,
top: Theme.spacer.spacing4,
alignSelf: 'flex-end',

marginBottom: Theme.spacer.spacing1,

border: 'none',
backgroundColor: 'transparent',

cursor: 'pointer',
});

export const closeIconStyling = css({
width: '16px',
height: '16px',
});
Loading