Skip to content

Commit

Permalink
Merge pull request #119 from PLADI-ALM/refactor/PDW-67-refactoring
Browse files Browse the repository at this point in the history
[PDW-67/fix] 메뉴 이름 수정
  • Loading branch information
psyeon1120 authored Nov 2, 2023
2 parents 6b6196d + 7777079 commit 6dcc037
Show file tree
Hide file tree
Showing 30 changed files with 453 additions and 357 deletions.
55 changes: 28 additions & 27 deletions src/App.js
Original file line number Diff line number Diff line change
@@ -1,22 +1,22 @@
import 'App.css';
import {Outlet, Route, Routes} from 'react-router-dom';
import Sidebar from 'components/sidebar/Sidebar';
import Login from 'pages/user/Login';
import SelectOffice from 'pages/booking/selectOffice/SelectOffice';
import BookedList from 'pages/booking/bookedList/BookedList';
import OfficeBooking from 'pages/booking/officeBooking/OfficeBooking';
import SelectResource from 'pages/booking/selectResource/SelectResource';
import ResourceBooking from 'pages/booking/resourceBooking/ResourceBooking';
import OfficeManage from 'pages/manager/officeManage/OfficeManage';
import OfficeBookingCheck from 'pages/booking/officeBooking/OfficeBookingCheck';
import ResourceBookingManage from 'pages/manager/resourceBookingManage/ResourceBookingManage';
import ResourceBookingCheck from 'pages/booking/resourceBooking/ResourceBookingCheck'
import OfficeBookingManage from 'pages/manager/officeBookingManage/OfficeBookingManage';
import UserManage from 'pages/manager/userManage/UserManage';
import ResourceManage from 'pages/manager/resourceManage/ResourceManage';
import ResourceManageAdd from "./pages/manager/resourceManage/ResourceManageAdd";
import ResourceManageDetail from 'pages/manager/resourceManage/ResourceManageDetail';
import OfficeManageDetail from 'pages/manager/officeManage/OfficeBookingManageDetail';
import Login from 'pages/basic/user/Login';
import SelectOffice from 'pages/basic/booking/office/SelectOffice';
import BookedList from 'pages/basic/myBookings/BookedList';
import OfficeBooking from 'pages/basic/booking/office/OfficeBooking';
import SelectResource from 'pages/basic/booking/resource/SelectResource';
import ResourceBooking from 'pages/basic/booking/resource/ResourceBooking';
import OfficeManage from 'pages/admin/office/OfficeManage';
import OfficeBookingCheck from 'pages/basic/booking/office/OfficeBookingCheck';
import ResourceBookingManage from 'pages/admin/resourceBookings/ResourceBookingManage';
import ResourceBookingCheck from 'pages/basic/booking/resource/ResourceBookingCheck'
import OfficeBookingManage from 'pages/admin/officeBookings/OfficeBookingManage';
import UserManage from 'pages/admin/user/UserManage';
import ResourceManage from 'pages/admin/resource/ResourceManage';
import ResourceManageAdd from "./pages/admin/resource/ResourceManageAdd";
import ResourceManageDetail from 'pages/admin/resource/ResourceManageDetail';
import OfficeManageDetail from 'pages/admin/office/OfficeBookingManageDetail';

function App() {

Expand All @@ -36,20 +36,21 @@ function App() {
<Route path="/officeBooking/:officeId" element={<OfficeBooking isCheck='false' />} />
<Route path="/my/bookings/offices" element={<BookedList title="회의실 예약 내역" />} />
<Route path="/my/bookings/offices/:bookingId" element={<OfficeBookingCheck isAdmin={false} />} />
<Route path="/my/bookings/resources" element={<BookedList title="장비 예약 내역" />} />
<Route path='/my/bookings/resources/:bookingId' element={<ResourceBookingCheck />} />
<Route path='/resourceBooking' element={<SelectResource title="장비 예약" />} />
<Route path='/resourceBooking/:resourceId' element={<ResourceBooking />} />
<Route path='/manage/offices' element={<OfficeManage title="회의실 관리" />} />
<Route path='/manage/offices/:officeId' element={<OfficeManageDetail />} />
<Route path='/manage/officeBooking' element={<OfficeBookingManage title="회의실 예약 내역" />} />
<Route path='/manage/officeBooking/:bookingId' element={<OfficeBookingCheck isAdmin={true} />} />
<Route path='/manage/resources' element={<ResourceManage title="장비 관리" />} />
<Route path='/manage/resources/add' element={<ResourceManageAdd title="장비 관리" />} />
<Route path='/manage/resources/edit/:resourceId' element={<ResourceManageAdd title="장비 관리" />} />
<Route path='/manage/resources/:resourceId' element={<ResourceManageDetail/>} />
<Route path='/manage/resourceBooking' element={<ResourceBookingManage title="장비 예약 관리" />} />
<Route path='/manage/resourceBooking/:bookingId' element={<ResourceBookingCheck isAdmin={true} />} />
<Route path='/manage/users' element={<UserManage title="직원 관리" />} />
<Route path='/admin/offices' element={<OfficeManage title="회의실 관리" />} />
<Route path='/admin/offices/:officeId' element={<OfficeManageDetail />} />
<Route path='/admin/officeBooking' element={<OfficeBookingManage title="회의실 예약 내역" />} />
<Route path='/admin/officeBooking/:bookingId' element={<OfficeBookingCheck isAdmin={true} />} />
<Route path='/admin/resources' element={<ResourceManage title="장비 관리" />} />
<Route path='/admin/resources/add' element={<ResourceManageAdd title="장비 관리" />} />
<Route path='/admin/resources/edit/:resourceId' element={<ResourceManageAdd title="장비 관리" />} />
<Route path='/admin/resources/:resourceId' element={<ResourceManageDetail/>} />
<Route path='/admin/resourceBooking' element={<ResourceBookingManage title="장비 예약 관리" />} />
<Route path='/admin/resourceBooking/:bookingId' element={<ResourceBookingCheck isAdmin={true} />} />
<Route path='/admin/users' element={<UserManage title="직원 관리" />} />
</Route>
</Routes>
</div>
Expand Down
16 changes: 12 additions & 4 deletions src/api/AxiosApi.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,16 @@ export const ResourcesAxios = axios.create({
baseURL: `${host}/resources`,
});

export const CarsAxios = axios.create({
baseURL: `${host}/cars`,
});

export const EquipmentsAxios = axios.create({
baseURL: `${host}/equipments`,
});

export const ArchivingssAxios = axios.create({
baseURL: `${host}/archivings`,
export const ArchivingAxios = axios.create({
baseURL: `${host}/archives`,
});

export const AdminUsersAxios = axios.create({
Expand All @@ -35,11 +39,15 @@ export const AdminBookingAxios = axios.create({
baseURL: `${host}/admin/bookings`,
});

export const AdminBookingResourceAxios = axios.create({
export const AdminCarsAxios = axios.create({
baseURL: `${host}/admin/cars`,
});

export const AdminResourcesAxios = axios.create({
baseURL: `${host}/admin/resources`,
});

export const AdminBookingOfficeAxios = axios.create({
export const AdminOfficesAxios = axios.create({
baseURL: `${host}/admin/offices`,
});

Expand Down
2 changes: 1 addition & 1 deletion src/components/officeBooking/BookingTimeBar.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import React from 'react';
import { useState } from 'react'
import styled from "styled-components"
import { setStartTimeStr, setEndTimeStr } from 'pages/booking/officeBooking/OfficeBooking';
import { setStartTimeStr, setEndTimeStr } from 'pages/basic/booking/office/OfficeBooking';

var bookingState = [
false, false, false, false, false, false, false, false, false, false, false, false,
Expand Down
14 changes: 7 additions & 7 deletions src/constants/Path.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,16 +29,16 @@ export const MAIN_MENUS = [
]

export const ADMIN_MENUS = [
{ name: '직원 관리', path: '/manage/users' },
{ name: '회의실 관리', path: '/manage/offices' },
{ name: '장비 관리', path: '/manage/resources' },
{ name: '회의실예약 관리', path: '/manage/officeBooking' },
{ name: '장비 예약 관리', path: '/manage/resourceBooking' },
{ name: '차량 예약 관리', path: '/manage/carBooking' }
{ name: '직원 관리', path: '/admin/users' },
{ name: '회의실 관리', path: '/admin/offices' },
{ name: '장비 관리', path: '/admin/resources' },
{ name: '회의실 예약 관리', path: '/admin/officeBooking' },
{ name: '장비 예약 관리', path: '/admin/resourceBooking' },
{ name: '차량 예약 관리', path: '/admin/carBooking' }
]

export const ADMIN_MAIN_MENUS = [
{ name: '관리자', path: '/manage/users', subMenus: ADMIN_MENUS, icons: [AdminActiveIcon, AdminInactiveIcon] }
{ name: '관리자', path: '/admin/users', subMenus: ADMIN_MENUS, icons: [AdminActiveIcon, AdminInactiveIcon] }
]

export const MAIN_PATH = '/officeBooking'
Expand Down
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
import React from 'react';
import { OfficesAxios, AdminBookingOfficeAxios } from 'api/AxiosApi';
import { OfficesAxios, AdminOfficesAxios } from 'api/AxiosApi';
import { useState, useEffect } from "react";
import { useParams } from 'react-router-dom';
import Capsule from 'components/capsule/Capsule';
import { basicError } from 'utils/ErrorHandlerUtil';
import { Bar } from 'pages/booking/bookedList/BookedList';
import { Bar } from 'pages/basic/myBookings/BookedList';
import { RightContainer, WhiteContainer,TitleText } from 'components/rightContainer/RightContainer';
import { MainTextContainer, SubTextContainer, SelectedSubTitleText, UnselectedSubTitleText } from 'components/officeBooking/SubTitleBar';
import { getToken } from 'utils/IsLoginUtil';
import MoreButtonIcon from "../../../assets/images/button/triple_dot_icon.svg"
import { MoreButton, OptionButton, OptionsView, InfoTable, InfoTableData } from '../resourceManage/ResourceManageDetail';
import { MoreButton, OptionButton, OptionsView, InfoTable, InfoTableData } from '../resource/ResourceManageDetail';
import OfficeInfo from 'components/officeInfo/OfficeInfo';

function OfficeManageDetail() {
Expand All @@ -35,7 +35,7 @@ function OfficeManageDetail() {
}

const getOfficeBookingListInfo = () => {
AdminBookingOfficeAxios.get(`offices/${officeId}`, {
AdminOfficesAxios.get(`offices/${officeId}`, {
headers: {
Authorization: getToken()
}
Expand All @@ -53,7 +53,7 @@ function OfficeManageDetail() {

const deleteResource = () => {
if (window.confirm("회의실을 삭제하시겠습니까?")) {
AdminBookingOfficeAxios.delete(`${officeId}`, {
AdminOfficesAxios.delete(`${officeId}`, {
headers: {
Authorization: getToken()
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
import React, {useEffect, useState} from "react";
import {RightContainer, TitleText, WhiteContainer} from "components/rightContainer/RightContainer";
import {Bar, BookedTable, BookedThead, NoLineTr, TableContainer} from "../../booking/bookedList/BookedList";
import {Bar, BookedTable, BookedThead, NoLineTr, TableContainer} from "../../basic/myBookings/BookedList";
import OfficeManageTableCell from "./OfficeManageTableCell";
import ManageSearchBar from "components/searchBar/ManageSearchBar";
import {getToken} from "utils/IsLoginUtil";
import {basicError} from "utils/ErrorHandlerUtil";
import {AdminBookingOfficeAxios} from "api/AxiosApi";
import {AdminOfficesAxios} from "api/AxiosApi";

function OfficeManage(props) {

const [offices, setOffices] = useState([]);

const getOffices = (name) => {
const max = Int32Array.max;
AdminBookingOfficeAxios.get(`?facilityName=${name}&size=200`,{
AdminOfficesAxios.get(`?facilityName=${name}&size=200`,{
headers: {
Authorization: getToken()
}
Expand All @@ -31,7 +31,7 @@ function OfficeManage(props) {
}, [])

const moveToAdd = () => {
window.location.href = `/manage/offices/add`
window.location.href = `/admin/offices/add`
}


Expand Down
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
import React from 'react';
import {Link} from 'react-router-dom';
import {BookedLineTr} from '../../booking/bookedList/BookedList';
import {BookedLineTr} from '../../basic/myBookings/BookedList';
import {Toggle} from "../../../components/toggle/Toggle";
import {AdminBookingOfficeAxios} from "../../../api/AxiosApi";
import {AdminOfficesAxios} from "../../../api/AxiosApi";
import {getToken} from "../../../utils/IsLoginUtil";
import {basicError} from "../../../utils/ErrorHandlerUtil";

function OfficeManageTableCell(props) {

const changeToggle = (isEnable) => {
AdminBookingOfficeAxios.patch(`/${props.id}/activation`, null, {
AdminOfficesAxios.patch(`/${props.id}/activation`, null, {
headers: {
Authorization: getToken()
}
Expand All @@ -21,7 +21,7 @@ function OfficeManageTableCell(props) {

return (
<BookedLineTr>
<td width="20%"><Link to={`/manage/offices/${props.id}`}>{props.name}</Link></td>
<td width="20%"><Link to={`/admin/offices/${props.id}`}>{props.name}</Link></td>
<td width="20%">{props.location}</td>
<td width="10%">{props.capacity}</td>
<td width="40%">{props.description}</td>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import React from "react";
import { useState, useEffect } from "react";
import { RightContainer, TitleText, WhiteContainer } from "components/rightContainer/RightContainer";
import { Bar, BookedTable, BookedThead, TableContainer } from "../../booking/bookedList/BookedList";
import { Bar, BookedTable, BookedThead, TableContainer } from "../../basic/myBookings/BookedList";
import OfficeBookingManageCell from "./OfficeBookingManageCell";
import { AdminBookingAxios } from "api/AxiosApi";
import styled from "styled-components";
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import React from 'react';
import { BookedLineTr } from '../../booking/bookedList/BookedList';
import { StatusCircle, StatusContainer, StatusText } from 'components/booking/StatusTag';
import { USING, findStatus, BOOKED } from 'constants/BookingStatus';
import { AdminBookingAxios } from 'api/AxiosApi';
import {BookedLineTr} from '../../basic/myBookings/BookedList';
import {StatusCircle, StatusContainer, StatusText} from 'components/booking/StatusTag';
import {BOOKED, findStatus} from 'constants/BookingStatus';
import {AdminBookingAxios} from 'api/AxiosApi';
import styled from 'styled-components';
import { getToken } from 'utils/IsLoginUtil';
import { basicError } from 'utils/ErrorHandlerUtil';
import {getToken} from 'utils/IsLoginUtil';
import {basicError} from 'utils/ErrorHandlerUtil';

export const SettingButtonContainer = styled.div`
display: flex;
Expand All @@ -24,13 +24,8 @@ export const SettingButton = styled.button`
background: none;
border: none;
cursor: pointer;
`





function OfficeBookingManageCell(props) {
const rejectResource = () => {
if (window.confirm(`${props.name}의 예약을 반려하시겠습니까?`))
Expand All @@ -53,13 +48,9 @@ function OfficeBookingManageCell(props) {
};

const moveToDetail = () => {
window.location.href = `/manage/officeBooking/${props.id}`
window.location.href = `/admin/officeBooking/${props.id}`
};





var status = findStatus(props.status)
var cancelButton = (
<SettingButtonContainer><SettingButton onClick={moveToDetail}>상세보기</SettingButton></SettingButtonContainer>)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
import React from "react";
import { useState, useEffect } from "react";
import { RightContainer, TitleText, WhiteContainer } from "components/rightContainer/RightContainer";
import {Bar, BookedTable, BookedThead, NoLineTr, TableContainer} from "../../booking/bookedList/BookedList";
import {Bar, BookedTable, BookedThead, NoLineTr, TableContainer} from "../../basic/myBookings/BookedList";
import ResourceManageTableCell from "./ResourceManageTableCell";
import ManageSearchBar from "components/searchBar/ManageSearchBar";
import { getToken } from "utils/IsLoginUtil";
import { basicError } from "utils/ErrorHandlerUtil";
import { AdminBookingResourceAxios } from "api/AxiosApi";
import { AdminResourcesAxios } from "api/AxiosApi";


function ResourceManage(props) {
Expand All @@ -15,7 +15,7 @@ function ResourceManage(props) {

const getResources = (name) => {
const max = Int32Array.max;
AdminBookingResourceAxios.get(`?keyword=${name}&size=200`, {
AdminResourcesAxios.get(`?keyword=${name}&size=200`, {
headers: {
Authorization: getToken()
}
Expand All @@ -33,7 +33,7 @@ function ResourceManage(props) {
}, [])

const moveToAdd = () => {
window.location.href = `/manage/resources/add`
window.location.href = `/admin/resources/add`
}


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@ import React,{ useState, useEffect, useRef } from "react";
import styled from "styled-components";

import { RightContainer, TitleText, WhiteContainer } from "components/rightContainer/RightContainer";
import { Bar } from "../../booking/bookedList/BookedList";
import { Bar } from "../../basic/myBookings/BookedList";
import { ManageAddButton, ManageAddButtonImage, ManageAddButtonLabel } from "components/searchBar/ManageSearchBar";

import { getToken } from "utils/IsLoginUtil";
import { basicError } from "utils/ErrorHandlerUtil";
import {AdminBookingResourceAxios, ImageUrlAxios, ResourcesAxios, UsersAxios} from "api/AxiosApi";
import {AdminResourcesAxios, ImageUrlAxios, ResourcesAxios, UsersAxios} from "api/AxiosApi";

import AddImageImage from "../../../assets/images/AddImage.svg"
import SearchButtonImage from "../../../assets/images/SearchPlus.svg"
Expand Down Expand Up @@ -299,7 +299,7 @@ function ResourceManageAdd(props) {
}

const addResource = () => {
AdminBookingResourceAxios.post(``, {
AdminResourcesAxios.post(``, {
responsibility: staff.userId,
description: description,
location: place,
Expand All @@ -313,7 +313,7 @@ function ResourceManageAdd(props) {
})
.then((Response) => {
alert("장비 등록이 완료되었습니다.");
window.location.href = `/manage/resources`
window.location.href = `/admin/resources`
})
.catch((error) => {
basicError(error)
Expand All @@ -323,7 +323,7 @@ function ResourceManageAdd(props) {
const editResource = () => {


AdminBookingResourceAxios.patch(`/${resourceId}`, {
AdminResourcesAxios.patch(`/${resourceId}`, {
responsibility: staff.userId,
description: description,
location: place,
Expand All @@ -337,7 +337,7 @@ function ResourceManageAdd(props) {
})
.then((Response) => {
alert("장비 수정이 완료되었습니다.");
window.location.href = `/manage/resources/${resourceId}`
window.location.href = `/admin/resources/${resourceId}`
})
.catch((error) => {
basicError(error)
Expand Down
Loading

0 comments on commit 6dcc037

Please sign in to comment.