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

v0.0.1 배포 #453

Merged
merged 87 commits into from
Dec 6, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
87 commits
Select commit Hold shift + click to select a range
a345af6
[FE][Feat] QA : title 작성 안되면 footer passive
leedongyull Dec 3, 2024
6ddb80f
[FE][Fix] #407 : Alert를 길게 눌렀을 때 로딩 멈추는 문제 해결
effozen Dec 4, 2024
d885f41
[FE][Fix] #410 : 로그인 -> 회원가입 후 닫기, 다시 로그인 창 올 시 회원가입 상태가 유지되는 문제 수정
effozen Dec 4, 2024
a884be0
[FE][Feat] #411 : 채널을 새로 만들면 바텀시트에 업데이트
juwon5272 Dec 4, 2024
a0a4b70
[FE][Fix] #411 : 한국 시간과 시간이 안 맞는 이슈 해결
juwon5272 Dec 4, 2024
5ce0fdc
[FE][Fix] #413 : 로그인 -> 회원가입 후 닫기, 다시 로그인 창 올 시 회원가입 상태가 유지되는 문제 수정
effozen Dec 4, 2024
c7a5180
[FE][Fix] #413 : 로그인, 회원가입 버튼 포커스 수정
effozen Dec 4, 2024
0c15083
Merge remote-tracking branch 'origin/feature/fe/#407-alert-error' int…
effozen Dec 4, 2024
f903fac
Merge pull request #412 from boostcampwm-2024/feature/fe/#411-bottoms…
juwon5272 Dec 4, 2024
34111fb
[BE][Feat] #415 : 채널 삭제 api 구현
happyhyep Dec 4, 2024
ee50e4c
Merge pull request #417 from boostcampwm-2024/feature/be/#415-deleteC…
happyhyep Dec 4, 2024
6c09ecd
Merge pull request #414 from boostcampwm-2024/feature/fe/#407-alert-e…
happyhyep Dec 4, 2024
7a8cf90
[FE][Feat] QA : 출발지, 도착지 마커 클러스터 구현
leedongyull Dec 4, 2024
68d6ea7
Merge pull request #418 from boostcampwm-2024/backend
happyhyep Dec 4, 2024
f10baa6
[FE] : Development Merge
effozen Dec 4, 2024
69b54fb
[FE][Feat] frontend merge
leedongyull Dec 4, 2024
ad7e530
[FE][Feat] #416 : 채널 삭제 로직 구현
effozen Dec 4, 2024
b01eed3
[FE][Feat] animation 대신 setInterval로 관리
leedongyull Dec 4, 2024
42889e7
[FE][Feat] frontend 머지
leedongyull Dec 4, 2024
8067ff3
[FE][Fix] vite 파일 설정 되돌리기
leedongyull Dec 4, 2024
c25dad5
Merge pull request #420 from boostcampwm-2024/feature/fe/QA
leedongyull Dec 4, 2024
d6d6dcd
[FE][Feat] QA : 검색 결과 크기 조절 및 왼쪽 정렬
leedongyull Dec 4, 2024
e097f2b
[FE][Fix] #416 : 채널 삭제 로직 재랜더링 안되는 문제 수정
effozen Dec 4, 2024
84e45c4
[FE][Feat] : zoomslider 색상 변경
juwon5272 Dec 4, 2024
94b6603
[FE][Feat] 사용자 name 입력 가능하도록 구현
leedongyull Dec 4, 2024
8a19858
[FE][Feat] Header key값 오류 해결
leedongyull Dec 4, 2024
bbfc0e6
[FE][Feat] Alert 사용자 명으로 수정
leedongyull Dec 4, 2024
b08aaea
[FE][Feat] : 경로 발자국 걷는 형태로 구현
juwon5272 Dec 4, 2024
3208330
[FE][Feat] 아이콘 변경 및 출발지 도착지 순서 변경
leedongyull Dec 4, 2024
45e7ad0
[FE][Feat] #416 : 채널 삭제 화면 구현
effozen Dec 4, 2024
86825cc
Merge branch 'frontend' into feature/fe/#411-bottomsheet-channel
juwon5272 Dec 4, 2024
3b8ecab
Merge pull request #423 from boostcampwm-2024/feature/fe/#411-bottoms…
juwon5272 Dec 4, 2024
3d7f4fe
Merge pull request #419 from boostcampwm-2024/feature/fe/#416-Channel…
effozen Dec 4, 2024
565efcf
Merge pull request #422 from boostcampwm-2024/feature/fe/QA
leedongyull Dec 4, 2024
2f5cc76
Merge pull request #424 from boostcampwm-2024/frontend
happyhyep Dec 4, 2024
a2e4573
[FE][Feat] QA : 클러스터 색상 변경
leedongyull Dec 4, 2024
33d9e66
[FE][Fix][Refactor] #416 : Confirm 모달 창 UI 중심 맞춤 및 코드 리팩토링
effozen Dec 4, 2024
b8870f0
[FE][Fix][Refactor] #416 : Confirm 모달 창 UI 버튼 색 수정
effozen Dec 4, 2024
5841d49
[FE][Fix] #430 : 지도가 주기적으로 재렌더링되는 문제 해결
happyhyep Dec 5, 2024
e9756d6
[FE][Fix] 줌 기본값 변경 및 변수화
happyhyep Dec 5, 2024
c918879
[FE][Refactor] 불필요한 주석 제거
happyhyep Dec 5, 2024
d1272e4
Merge pull request #431 from boostcampwm-2024/feature/fe/#430-mapRend…
happyhyep Dec 5, 2024
07f7f79
[FE][Feat] : 검색창에서 이벤트 버블링 방지
juwon5272 Dec 5, 2024
8dfb7fc
[FE][Feat] : zoomslider에서 이벤트 버블링 방지
juwon5272 Dec 5, 2024
d8ad24f
[FE][Delete] : 전체 이벤트 버블링 막기 코드 삭제
juwon5272 Dec 5, 2024
5f3b04b
[FE][Design] : 페이지 높이 문제가 화면 밖으로 넘어간 문제 해결
juwon5272 Dec 5, 2024
b169429
Merge pull request #432 from boostcampwm-2024/feature/fe/#258-qa
juwon5272 Dec 5, 2024
9145cc2
[FE][Fix] #433 : 일부 ios에서 터치 이벤트 제대로 동작하지 않는 문제 해결
happyhyep Dec 5, 2024
94e760f
[FE][Fix] : 비로그인시 글자가 페이지 밖으로 벗어나는 문제 해결
juwon5272 Dec 5, 2024
48b9571
[FE][Fix] #436 : 방향 맞지 않는 문제 해결
happyhyep Dec 5, 2024
3c1d47a
Merge pull request #434 from boostcampwm-2024/fix/fe/#433-preventTouc…
happyhyep Dec 5, 2024
aa5f51d
Merge pull request #437 from boostcampwm-2024/fix/fe/#436-changeDirec…
happyhyep Dec 5, 2024
feb98ff
Merge pull request #435 from boostcampwm-2024/feature/fe/#258-qa
happyhyep Dec 5, 2024
052be6c
Merge pull request #425 from boostcampwm-2024/feature/fe/QA
happyhyep Dec 5, 2024
602d616
Merge pull request #427 from boostcampwm-2024/feature/fe/#416-Channel…
happyhyep Dec 5, 2024
2f8fa86
[FE][Feat] #438 : 가이드 보기 버튼 메인에 추가
effozen Dec 5, 2024
15cf916
[FE][Feat] 현재 위치로 이동 버튼 구현 및 add-channel footer 사라지지 않도록 구현
leedongyull Dec 5, 2024
36495e8
Merge branch 'frontend' of https://github.com/boostcampwm-2024/web28-…
leedongyull Dec 5, 2024
56cc1da
[FE][Feat] 잘못 머지한 부분 수정
leedongyull Dec 5, 2024
093d5f1
[FE][Feat] build 수정
leedongyull Dec 5, 2024
43b85a0
[FE][Fix] #258 : 검색창,zoomslider에서 터치 이벤트 스크롤 문제 해결
happyhyep Dec 5, 2024
fe7f12a
Merge pull request #439 from boostcampwm-2024/feature/fe/#438-guide-b…
effozen Dec 5, 2024
5af5731
Merge pull request #442 from boostcampwm-2024/feature/fe/#258-SearchB…
happyhyep Dec 5, 2024
6e19d63
[FE][Fix] #441 : BottomSheet 이벤트 스크롤 문제 해결
happyhyep Dec 5, 2024
f1756ea
Merge pull request #443 from boostcampwm-2024/feature/fe/#258-SearchB…
happyhyep Dec 5, 2024
7b6b674
[FE][Feat] #429 : 현재 위치 버튼 바텀 시트에 맞도록 조정
leedongyull Dec 5, 2024
39b7f64
Merge branch 'frontend' of https://github.com/boostcampwm-2024/web28-…
leedongyull Dec 5, 2024
363c680
[FE][Feat] #429 : 현재 위치 버튼 아이콘 크기 증가
leedongyull Dec 5, 2024
4ea0fec
Merge pull request #444 from boostcampwm-2024/feature/fe/QA
leedongyull Dec 5, 2024
3a24a45
[FE][Fix] QA
happyhyep Dec 5, 2024
b7a06ed
Merge pull request #445 from boostcampwm-2024/frontend
happyhyep Dec 5, 2024
e172002
[FE][Fix] QA
happyhyep Dec 5, 2024
26b64ba
Merge pull request #446 from boostcampwm-2024/frontend
happyhyep Dec 5, 2024
02f0e6e
[FE][Fix] QA
happyhyep Dec 5, 2024
d9a160b
[FE][Fix] QA
happyhyep Dec 5, 2024
64fc5ec
Merge pull request #447 from boostcampwm-2024/frontend
happyhyep Dec 5, 2024
3fd85f1
[FE][Fix] QA
happyhyep Dec 5, 2024
ebc4b67
Merge pull request #448 from boostcampwm-2024/frontend
happyhyep Dec 5, 2024
651f6a0
[FE][Fix] userName 반영 안되는 오류 수정
leedongyull Dec 5, 2024
a8be79f
Merge branch 'frontend' of https://github.com/boostcampwm-2024/web28-…
leedongyull Dec 5, 2024
1ccfcfb
[FE][Fix] console.log 제거
leedongyull Dec 5, 2024
f7bb8ea
[FE][Fix] build error 처리
leedongyull Dec 5, 2024
53392f6
Merge pull request #449 from boostcampwm-2024/fix/fe/channelName
leedongyull Dec 5, 2024
06262c8
Merge pull request #450 from boostcampwm-2024/frontend
leedongyull Dec 5, 2024
c97e7c2
[FE][Feat] 사용자 마커 및 패스 위로 올림, 방향 수정
leedongyull Dec 5, 2024
5f3cd66
Merge pull request #451 from boostcampwm-2024/fix/fe/channelName
leedongyull Dec 5, 2024
8026973
Merge pull request #452 from boostcampwm-2024/frontend
leedongyull Dec 5, 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
23 changes: 23 additions & 0 deletions backend/src/controllers/channelController.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import {
addGuestService,
createChannelService,
deleteChannelService,
getChannelByIdService,
getChannelGuestInfoService,
getUserChannels,
Expand Down Expand Up @@ -109,3 +110,25 @@ export const getUserChannelsController = async (req, res) => {
return res.status(500).json(new ErrorResponseDto({ message: 'Server error occurred' }));
}
};

/**
* @description 채널 삭제 컨트롤러
*/
export const deleteChannelController = async (req, res) => {
const { id } = req.params;

try {
const result = await deleteChannelService(id);

if (!result) {
return res.status(404).json(new ErrorResponseDto({ message: 'Channel not found' }));
}

return res
.status(200)
.json(new ResponseDto({ resultMsg: 'Channel deleted successfully', data: { id } }));
} catch (err) {
console.error(err);
return res.status(500).json(new ErrorResponseDto({ message: 'Server error occurred' }));
}
};
14 changes: 14 additions & 0 deletions backend/src/repositories/channelRepository.js
Original file line number Diff line number Diff line change
Expand Up @@ -155,3 +155,17 @@ export const getChannelsByUserIdFromDB = async userId => {
throw error;
}
};

export const deleteChannelByIdFromDB = async id => {
try {
const query = 'DELETE FROM "main"."channel" WHERE id = $1 RETURNING id';
const values = [id];

const result = await pool.query(query, values);

return result.rowCount > 0;
} catch (error) {
console.error('Database error:', error);
throw error;
}
};
33 changes: 33 additions & 0 deletions backend/src/routes/channelRouter.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import { body, param } from 'express-validator';
import {
addGuestController,
createChannelController,
deleteChannelController,
getChannelGuestInfoController,
getChannelInfoController,
getUserChannelsController,
Expand Down Expand Up @@ -190,3 +191,35 @@ channelRouter.get(
validationMiddleware,
getUserChannelsController,
);

// 채널 삭제 API 경로
/**
* @swagger
* paths:
* /channel/{id}:
* delete:
* summary: '채널 삭제 API'
* description: '채널 ID를 사용하여 특정 채널을 삭제합니다.'
* tags: [Channel]
* parameters:
* - name: 'id'
* in: 'path'
* required: true
* schema:
* type: 'string'
* description: '삭제할 채널의 고유 ID'
* responses:
* 200:
* description: '채널 삭제 성공'
* 404:
* description: '채널을 찾을 수 없음'
* 500:
* description: '서버 오류'
*/
channelRouter.delete(
'/:id',
[param('id').notEmpty().withMessage('Channel ID is required')],
authenticateJWT,
validationMiddleware,
deleteChannelController,
);
14 changes: 14 additions & 0 deletions backend/src/services/channelService.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import {
createChannelInDB,
deleteChannelByIdFromDB,
getChannelInfoByIdInDB,
getChannelsByUserIdFromDB,
getChannelWithGuestsByIdFromDB,
Expand Down Expand Up @@ -105,3 +106,16 @@ export const getUserChannels = async userId => {
throw new Error('Failed to fetch channels', error);
}
};

/**
* @description 채널 삭제 서비스
* @param {string} id - 삭제할 채널의 ID
* @returns {boolean} 삭제 성공 여부
*/
export const deleteChannelService = async id => {
try {
return await deleteChannelByIdFromDB(id);
} catch (error) {
throw new Error('Failed to delete channel', error);
}
};
8 changes: 8 additions & 0 deletions frontend/src/App.css
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,14 @@
font-family: Pretendard, 'Pretendard Variable', sans-serif !important;
}

@supports (-webkit-touch-callout: none) {
#root {
touch-action: manipulation; /* Safari 호환 옵션 */
overscroll-behavior: none;
}
}


.logo {
height: 6em;
padding: 1.5em;
Expand Down
25 changes: 25 additions & 0 deletions frontend/src/api/channel.api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import {
getChannelResEntity,
getUserChannelsResEntity,
getGuestResEntity,
deleteChannelResEntity,
} from '@/api/dto/channel.dto.ts';
import { getApiClient } from '@/api/client.api.ts';

Expand Down Expand Up @@ -136,3 +137,27 @@ export const getGuestInfo = (
};
return new Promise(promiseFn);
};

export const deleteChannel = (channelId: string): Promise<ResponseDto<deleteChannelResEntity>> => {
const promiseFn = (
fnResolve: (value: ResponseDto<deleteChannelResEntity>) => void,
fnReject: (reason?: any) => void,
) => {
const apiClient = getApiClient();
apiClient
.delete(`/channel/${channelId}`)
.then(res => {
if (res.status !== 200) {
console.error(res);
fnReject(`msg.${res}`);
} else {
fnResolve(new ResponseDto<deleteChannelResEntity>(res.data));
}
})
.catch(err => {
console.error(err);
fnReject('msg.RESULT_FAILED');
});
};
return new Promise(promiseFn);
};
4 changes: 4 additions & 0 deletions frontend/src/api/dto/channel.dto.ts
Original file line number Diff line number Diff line change
Expand Up @@ -113,3 +113,7 @@ export class getGuestResEntity {

guest: guestEntity | undefined;
}

export class deleteChannelResEntity {
id: string | undefined;
}
6 changes: 5 additions & 1 deletion frontend/src/assets/footprint.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
6 changes: 5 additions & 1 deletion frontend/src/component/authmodal/AuthModal.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import React, { useState } from 'react';
import React, { useEffect, useState } from 'react';
import { Modal } from '@/component/common/modal/Modal';
import { doLogin, doRegister } from '@/api/auth.api.ts';
import { saveLocalData } from '@/utils/common/manageLocalData.ts';
Expand Down Expand Up @@ -91,6 +91,10 @@ export const AuthModal = (props: IAuthModalProps) => {
});
};

useEffect(() => {
if (!props.isOpen) switchToLogin();
}, [props.isOpen]);

return (
<Modal isOpen={props.isOpen}>
{modalType === 'login' ? (
Expand Down
99 changes: 74 additions & 25 deletions frontend/src/component/bottomsheet/BottomSheet.tsx
Original file line number Diff line number Diff line change
@@ -1,14 +1,21 @@
import React, { useState, useRef } from 'react';
import { MdClear } from 'react-icons/md';
import classNames from 'classnames';
import { SetCurrentLocationButton } from '../setCurrentLocationButton/SetCurrentLocationButton';

interface IBottomSheetProps {
map: naver.maps.Map | null;
lat: number | null;
lng: number | null;
minHeight: number;
maxHeight: number;
backgroundColor: string;
children: React.ReactNode;
}

export const BottomSheet = ({
map,
lat,
lng,
minHeight,
maxHeight,
backgroundColor,
Expand Down Expand Up @@ -52,37 +59,79 @@ export const BottomSheet = ({
window.addEventListener('mouseup', handleMouseUp);
};

const handleClose = () => {
setSheetHeight(minHeight);
const [, setScrollPosition] = useState(0);
const [touchStartY, setTouchStartY] = useState<number | null>(null);

const handleContentTouchStart = (e: React.TouchEvent<HTMLDivElement>) => {
setTouchStartY(e.touches[0].clientY);
};

const handleContentTouchMove = (e: React.TouchEvent<HTMLDivElement>) => {
if (touchStartY !== null) {
const deltaY = e.touches[0].clientY - touchStartY;

const scrollableElement = e.currentTarget; // 현재 스크롤이 가능한 요소
const newScrollPosition = scrollableElement.scrollTop - deltaY;

scrollableElement.scrollTop = newScrollPosition;

setTouchStartY(e.touches[0].clientY);

setScrollPosition(newScrollPosition);
}
};

const handleContentTouchEnd = () => {
setTouchStartY(null);
};

return (
<div
className="transition-height absolute bottom-0 left-0 right-0 rounded-t-2xl bg-white shadow-lg duration-700 ease-out"
style={{
backgroundColor: `${backgroundColor}`,
height: `${sheetHeight * 100}vh`,
}}
>
<>
<div
className="flex items-center justify-center pb-6 pt-2"
onTouchStart={handleTouchStart}
onTouchMove={handleTouchMove}
onMouseDown={handleMouseDown}
className={classNames('absolute bottom-14')}
style={{
height: `${sheetHeight * 100}vh`,
transition: 'height 0.3s ease-out',
}}
>
<div className="h-1.5 w-12 rounded-full bg-gray-300" />
<SetCurrentLocationButton map={map} lat={lat} lng={lng} isMain />
</div>

<div className="absolute right-2 top-2">
<button
onClick={handleClose}
className="flex h-[30px] w-[30px] items-center justify-center rounded-full bg-gray-200"
<div
className="transition-height absolute bottom-0 left-0 right-0 overflow-hidden rounded-t-2xl bg-white shadow-lg duration-700 ease-out"
style={{
backgroundColor: `${backgroundColor}`,
height: `${sheetHeight * 100}vh`,
}}
onTouchStart={e => e.stopPropagation()}
onTouchMove={e => e.stopPropagation()}
onTouchEnd={e => e.stopPropagation()}
>
<div
className="transition-height absolute bottom-0 left-0 right-0 overflow-hidden rounded-t-2xl bg-white shadow-lg duration-700 ease-out"
style={{
backgroundColor: `${backgroundColor}`,
height: `${sheetHeight * 100}vh`,
}}
>
<MdClear size={18} color="grayscale-850" />
</button>
</div>
<div
className="flex items-center justify-center pb-6 pt-2"
onTouchStart={handleTouchStart}
onTouchMove={handleTouchMove}
onMouseDown={handleMouseDown}
>
<div className="h-1.5 w-12 rounded-full bg-gray-300" />
</div>

<div className="h-[calc(100%-60px)] overflow-auto pb-5">{children}</div>
</div>
<div
className="h-[calc(100%-60px)] overflow-auto pb-5"
onTouchStart={handleContentTouchStart}
onTouchMove={handleContentTouchMove}
onMouseDown={handleContentTouchEnd}
>
{children}
</div>
</div>
</div>
</>
);
};
Loading
Loading