-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'develop' of https://github.com/GU-99/grow-up-fe into fe…
…ature/#279-fix-image-upload-error
- Loading branch information
Showing
12 changed files
with
284 additions
and
103 deletions.
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,54 @@ | ||
name: deploy-workflow | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
workflow_dispatch: | ||
|
||
jobs: | ||
aws-deploy: | ||
runs-on: ubuntu-latest | ||
steps: | ||
# Github workspace 로컬 다운로드 | ||
- name: Checkout branch | ||
uses: actions/checkout@v4 | ||
|
||
# NodeJS 설치 | ||
- name: Setup Node.js environment v20 | ||
uses: actions/setup-node@v4 | ||
with: | ||
node-version: 20 | ||
|
||
# Yarn 의존성 설치 | ||
- name: Install yarn dependencies | ||
run: yarn install | ||
|
||
# 빌드용 환경 변수 .env 파일 생성 | ||
- name: Create .env file for Vite | ||
run: | | ||
echo "VITE_BASE_URL=${{ secrets.VITE_BASE_URL }}" >> .env | ||
echo "VITE_API_URL=${{ secrets.VITE_API_URL }}" >> .env | ||
shell: bash | ||
|
||
# 프로젝트 빌드 | ||
- name: Build the project | ||
run: yarn build | ||
|
||
# AWS IAM credentials 설정 | ||
- name: Configure AWS credentials | ||
uses: aws-actions/configure-aws-credentials@v4 | ||
with: | ||
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }} | ||
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }} | ||
aws-region: ${{ secrets.AWS_REGION }} | ||
|
||
# S3에 빌드 파일 배포 | ||
- name: Deploy file to S3 | ||
run: | | ||
aws s3 sync --delete --region ${{ secrets.AWS_REGION }} ./dist ${{ secrets.AWS_S3_BUCKET }} | ||
# CloudFront 캐시 무효화 | ||
- name: Invalidate CloudFront cache | ||
run: | | ||
aws cloudfront create-invalidation --distribution-id ${{ secrets.AWS_CLOUDFRONT_DISTRIBUTION_ID }} --paths "/*" |
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,8 @@ | ||
export default function EmptyProjectItemList() { | ||
return ( | ||
<div className="flex h-full items-center justify-center text-center"> | ||
진행중인 프로젝트가 없습니다! <br /> | ||
새로운 프로젝트를 생성해보세요 😄 | ||
</div> | ||
); | ||
} |
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,89 @@ | ||
import { Link } from 'react-router-dom'; | ||
import { FaRegTrashAlt } from 'react-icons/fa'; | ||
import { IoIosSettings } from 'react-icons/io'; | ||
import useModal from '@hooks/useModal'; | ||
import useToast from '@hooks/useToast'; | ||
import { useDeleteProject, useReadProjectCoworkers } from '@hooks/query/useProjectQuery'; | ||
import useStore from '@stores/useStore'; | ||
import UpdateModalProject from '@components/modal/project/UpdateModalProject'; | ||
|
||
import type { Team } from '@/types/TeamType'; | ||
import type { Project } from '@/types/ProjectType'; | ||
|
||
type ProjectItemProps = { | ||
teamId: Team['teamId']; | ||
project: Project; | ||
}; | ||
|
||
export default function ProjectItem({ teamId, project }: ProjectItemProps) { | ||
const { toastWarn } = useToast(); | ||
const { showModal: showUpdateModal, openModal: openUpdateModal, closeModal: closeUpdateModal } = useModal(); | ||
const { | ||
userInfo: { userId }, | ||
} = useStore(); | ||
|
||
const { projectCoworkers } = useReadProjectCoworkers(project.projectId); | ||
const { mutate: deleteProjectMutate } = useDeleteProject(teamId); | ||
|
||
const userProjectRole = projectCoworkers.find((coworker) => coworker.userId === userId)?.roleName; | ||
|
||
const handleOpenUpdateModal = () => { | ||
if (userProjectRole !== 'ADMIN') return toastWarn('프로젝트 수정 권한이 없습니다.'); | ||
openUpdateModal(); | ||
}; | ||
|
||
const handleDeleteClick = (projectId: Project['projectId']) => { | ||
if (userProjectRole !== 'ADMIN') return toastWarn('프로젝트 삭제 권한이 없습니다.'); | ||
deleteProjectMutate(projectId); | ||
}; | ||
|
||
return ( | ||
<> | ||
<li key={project.projectId} className="min-w-300 space-y-2 text-sm"> | ||
<Link to={`/teams/${teamId}/projects/${project.projectId}`} className="flex h-50 items-center border p-8"> | ||
<div className="flex max-h-full grow"> | ||
<div className="max-h-full w-60 shrink-0"> | ||
<small className="flex flex-col text-xs font-bold text-category">project</small> | ||
<p className="truncate">{project.projectName}</p> | ||
</div> | ||
|
||
<div className="flex max-h-full max-w-350 flex-col px-4"> | ||
<small className="text-xs font-bold text-category">desc</small> | ||
<p className="truncate">{project.content}</p> | ||
</div> | ||
</div> | ||
|
||
<div className="mr-6 flex shrink-0 space-x-10"> | ||
<button | ||
type="button" | ||
className="flex items-center text-main hover:brightness-50" | ||
aria-label="Settings" | ||
onClick={(e) => { | ||
e.preventDefault(); | ||
handleOpenUpdateModal(); | ||
}} | ||
> | ||
<IoIosSettings size={20} className="mr-2" /> | ||
setting | ||
</button> | ||
|
||
<button | ||
type="button" | ||
className="hover:brightness-200" | ||
aria-label="Delete" | ||
onClick={(e) => { | ||
e.preventDefault(); | ||
handleDeleteClick(project.projectId); | ||
}} | ||
> | ||
<FaRegTrashAlt size={20} /> | ||
</button> | ||
</div> | ||
</Link> | ||
</li> | ||
{showUpdateModal && project.projectId && ( | ||
<UpdateModalProject projectId={project.projectId} onClose={closeUpdateModal} /> | ||
)} | ||
</> | ||
); | ||
} |
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,18 @@ | ||
import ProjectItem from '@components/project/ProjectItem'; | ||
import type { Team } from '@/types/TeamType'; | ||
import type { Project } from '@/types/ProjectType'; | ||
|
||
type ProjectItemListProps = { | ||
teamId: Team['teamId']; | ||
projectList: Project[]; | ||
}; | ||
|
||
export default function ProjectItemList({ teamId, projectList }: ProjectItemListProps) { | ||
return ( | ||
<ul> | ||
{projectList.map((project) => ( | ||
<ProjectItem key={project.projectId} teamId={teamId} project={project} /> | ||
))} | ||
</ul> | ||
); | ||
} |
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
Oops, something went wrong.