Skip to content

Commit

Permalink
Merge branch 'main' into BE
Browse files Browse the repository at this point in the history
  • Loading branch information
capDoYeonLee authored Jul 24, 2024
2 parents 0c75c35 + 5b9c459 commit e1cc271
Show file tree
Hide file tree
Showing 33 changed files with 505 additions and 212 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -120,8 +120,6 @@ private AllPrivateCalendarResponse toPrivateCalendarResponse(ScheduleModel model
.filterColor(model.getFilter() != null ? model.getFilter().getFilterColor() : null)
.build();
}




public List<MonthCalendarResponse> toMonthModel(List<ScheduleModel> models) {
Expand Down
Binary file added FE/error/public/Profile.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added FE/error/public/seed0011.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added FE/error/public/seed0014.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added FE/error/public/seed0065.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added FE/error/public/seed0141.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added FE/error/public/seed0154.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added FE/error/public/seed0182.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added FE/error/public/seed0256.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added FE/error/public/seed0291.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added FE/error/public/seed0298.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added FE/error/public/seed0301.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added FE/error/public/seed0365.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added FE/error/public/seed0419.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added FE/error/public/seed0460.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added FE/error/public/seed0461.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added FE/error/public/seed0877.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added FE/error/public/seed0882.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
74 changes: 0 additions & 74 deletions FE/error/src/axiosConfig.js
Original file line number Diff line number Diff line change
@@ -1,80 +1,6 @@
import axios from "axios";
import { useNavigate } from "react-router-dom";

// Axios 기본 설정
axios.defaults.baseURL = import.meta.env.VITE_ERROR_API;
axios.defaults.headers.common["Content-Type"] = "application/json";
axios.defaults.withCredentials = true;

let isRefreshing = false;
let refreshSubscribers = [];

const onRefreshed = (token) => {
refreshSubscribers.map((cb) => cb(token));
};

const addRefreshSubscriber = (cb) => {
refreshSubscribers.push(cb);
};

axios.interceptors.request.use(
(config) => {
const token = localStorage.getItem("slackToken");
if (token) {
config.headers["Authorization"] = `Bearer ${token}`;
}
return config;
},
(error) => {
return Promise.reject(error);
}
);

axios.interceptors.response.use(
(response) => {
return response;
},
async (error) => {
const originalRequest = error.config;
if (error.response.status === 401 && !originalRequest._retry) {
if (isRefreshing) {
return new Promise((resolve) => {
addRefreshSubscriber((token) => {
originalRequest.headers["Authorization"] = "Bearer " + token;
resolve(axios(originalRequest));
});
});
}

originalRequest._retry = true;
isRefreshing = true;

const refreshToken = localStorage.getItem("refreshToken");

return new Promise((resolve, reject) => {
axios
.post("/auth/reissue", { refreshToken: refreshToken })
.then(({ data }) => {
const newToken = data.data.accessToken;
localStorage.setItem("slackToken", newToken);
axios.defaults.headers.common["Authorization"] =
"Bearer " + newToken;
originalRequest.headers["Authorization"] = "Bearer " + newToken;
onRefreshed(newToken);
resolve(axios(originalRequest));
})
.catch((err) => {
reject(err);
useNavigate().push("/login");
})
.finally(() => {
isRefreshing = false;
refreshSubscribers = [];
});
});
}
return Promise.reject(error);
}
);

export default axios;
8 changes: 7 additions & 1 deletion FE/error/src/components/DeleteEvent.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,15 @@ const DeleteEvent = ({
onRequestClose,
handleUpdateDeleteData,
}) => {
const storedToken = localStorage.getItem("slackToken");

const calendarDelete = () => {
axios
.delete("/api/calendar/" + selectID)
.delete(`/api/calendar/${selectID}`, {
headers: {
Authorization: `Bearer ${storedToken}`,
},
})
.then(() => {
handleUpdateDeleteData(selectID);
handleDelete();
Expand Down
12 changes: 6 additions & 6 deletions FE/error/src/components/EconoCalendar.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -25,13 +25,10 @@ const EconoCalendar = ({ isLoggedIn, setIsLoggedIn }) => {

const uri = isUserLoggedIn
? "/api/calendar/all"
: "/api/calendar/public/all";
const config = isUserLoggedIn
? { headers: { Authorization: `Bearer ${storedToken}` } }
: {};
: "/api/calendar/all/public";

axios
.get(uri, config)
.get(uri, { headers: { Authorization: `Bearer ${storedToken}` } })
.then((res) => {
const fetchedEvents = res.data.data.map((event) => ({
title: event.eventName,
Expand Down Expand Up @@ -292,7 +289,7 @@ const CalendarContainer = styled.div`
background-color: #fff;
border-color: #cbcbcb;
color: #595959;
margin-right: 0.7rem;
margin-right: 1rem;
}
.fc-event-title-container {
height: 1.3rem;
Expand All @@ -301,4 +298,7 @@ const CalendarContainer = styled.div`
font-size: 0.95rem;
margin-left: 0.3rem;
}
.fc-direction-ltr .fc-toolbar > * > :not(:first-child) {
margin-left: 0.5rem;
}
`;
70 changes: 67 additions & 3 deletions FE/error/src/components/SideBar/ProfileBar.jsx
Original file line number Diff line number Diff line change
@@ -1,12 +1,76 @@
import styled from "styled-components";
import { useState, useEffect } from "react";
import { HiPencil } from "react-icons/hi2";
import { useNavigate } from "react-router-dom";

const ProfileBar = () => {
return <StyledProfileFrame></StyledProfileFrame>;
const [isHovered, setIsHovered] = useState(false);
const [profileImage, setProfileImage] = useState("Profile.png");
const navigate = useNavigate();

useEffect(() => {
const savedImage = localStorage.getItem("profileImage");
if (savedImage) {
setProfileImage(savedImage);
}
}, []);

const handleProfileClick = () => {
navigate("/profile");
};

return (
<StyledProfileFrame>
<ProfileImageContainer
onMouseEnter={() => setIsHovered(true)}
onMouseLeave={() => setIsHovered(false)}
onClick={handleProfileClick}
>
<ProfileImage src={`/${profileImage}`} alt="Profile" />
{/* <ProfileImage src={`/Profile.png`} alt="Profile" /> */}
{isHovered && (
<EditIconOverlay>
<HiPencil />
</EditIconOverlay>
)}
</ProfileImageContainer>
</StyledProfileFrame>
);
};

export default ProfileBar;

const StyledProfileFrame = styled.div`
width: 20rem;
height: 18.4375rem;
width: 15.625rem;
height: 15rem;
align-items: center;
display: flex;
flex-direction: column;
margin-bottom: 0.6rem;
`;

const ProfileImageContainer = styled.div`
position: relative;
cursor: pointer;
`;

const ProfileImage = styled.img`
margin-top: 1.25rem;
width: 13rem;
height: 13rem;
`;

const EditIconOverlay = styled.div`
position: absolute;
top: 1.5rem;
left: 0;
right: 0;
bottom: 0;
border-radius: 50%;
background-color: rgba(0, 0, 0, 0.5);
display: flex;
justify-content: center;
align-items: center;
color: white;
font-size: 2rem;
`;
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,11 @@ import styled from "styled-components";
import FilterCreateModal from "../../../utils/filterUtils/FilterCreateModal";
import FilterList from "../../../utils/filterUtils/FilterList";

const IndividualFilter = ({ filterLists, addNewFilter }) => {
const IndividualFilter = ({
filterLists,
addNewFilter,
updateDeleteFilter,
}) => {
const [individualFilterIsOpen, setindividualFilterIsOpen] = useState(false);
const [filterListsIsOpen, setFilterListsIsOpen] = useState(true);
const createIndividualFilter = () => {
Expand All @@ -16,6 +20,7 @@ const IndividualFilter = ({ filterLists, addNewFilter }) => {
const handleArrowDown = () => {
setFilterListsIsOpen(!filterListsIsOpen);
};

return (
<>
<StyledIndividualFilterFrame>
Expand Down Expand Up @@ -60,7 +65,12 @@ const IndividualFilter = ({ filterLists, addNewFilter }) => {
/>
</StyledDetailIcon>
</StyledIndividualFilterFrame>
{filterListsIsOpen && <FilterList filterLists={filterLists} />}
{filterListsIsOpen && (
<FilterList
filterLists={filterLists}
updateDeleteFilter={updateDeleteFilter}
/>
)}
</>
);
};
Expand Down
27 changes: 16 additions & 11 deletions FE/error/src/components/scheduleCheck/CheckCalendar.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ const CheckCalendar = ({
handleUpdateDeleteData,
}) => {
const [event, setEvent] = useState({});
const storedToken = localStorage.getItem("slackToken");

function createDate(title, startDate, endDate, place, info, type, color) {
const specificEvent = {
Expand All @@ -42,17 +43,21 @@ const CheckCalendar = ({
return;
}

axios.get("/api/calendar/" + selectID).then((res) => {
createDate(
res.data.data.eventName,
res.data.data.eventStartDate,
res.data.data.eventEndDate,
res.data.data.eventPlace,
res.data.data.eventInfo,
res.data.data.eventType,
res.data.data.filterColor
);
});
axios
.get("/api/calendar/" + selectID, {
headers: { Authorization: `Bearer ${storedToken}` },
})
.then((res) => {
createDate(
res.data.data.eventName,
res.data.data.eventStartDate,
res.data.data.eventEndDate,
res.data.data.eventPlace,
res.data.data.eventInfo,
res.data.data.eventType,
res.data.data.filterColor
);
});
}, [selectID]);

function date(startDate, endDate) {
Expand Down
Loading

0 comments on commit e1cc271

Please sign in to comment.