diff --git a/src/pages/Team/deploy/Container/History.tsx b/src/pages/Team/deploy/Container/History.tsx index d8bfc79..a70f0a9 100644 --- a/src/pages/Team/deploy/Container/History.tsx +++ b/src/pages/Team/deploy/Container/History.tsx @@ -1,31 +1,66 @@ +import React from 'react'; import { Tag } from '@/components/Team/Tag'; import { theme } from '@/style/theme'; import { getDetailContainer } from '@/utils/apis/container'; import { getHistory } from '@/utils/apis/history'; import { ContainerDetailType } from '@/utils/types/containerType'; +import { HistoryType, StageType } from '@/utils/types/historyType'; import styled from '@emotion/styled'; import { useState, useEffect } from 'react'; import { useParams } from 'react-router-dom'; +import LongArrowImg from '@/assets/LongArrow.svg'; +import { UnknownIcon } from '@/assets/UnknownIcon'; +import { PassedIcon } from '@/assets/PassedIcon'; +import { FailedIcon } from '@/assets/FailedIcon'; +import { BuildingIcon } from '@/assets/BuildingIcon'; + +const Stage = ({ name, status }: StageType) => { + const onIcon = () => { + switch (status) { + case 'Building': + return ; + case 'Failed': + return ; + case 'Passed': + return ; + case 'Unknown': + default: + return ; + } + }; + + return ( + + {onIcon()} + {name} + + ); +}; export const TeamDeployContainerHistory = () => { const { deployUUID, env } = useParams(); const [data, setData] = useState(); + const [history, setHistory] = useState([]); useEffect(() => { if (deployUUID && env) { getDetailContainer(deployUUID, env).then((res) => { setData(res.data); }); - } - }, []); - - useEffect(() => { - if (deployUUID && env) { getHistory(deployUUID, env).then((res) => { - setData(res.data); + setHistory(res.data.histories); }); } - }, []); + }, [deployUUID, env]); + + if (!data?.is_v2) + return ( + +
+ 배포 내역을 조회할 수 없습니다 +
+
+ ); return ( @@ -33,23 +68,32 @@ export const TeamDeployContainerHistory = () => { 배포내역 컨테이너 {data?.deploy_name} - <Tag tag={'AVAILABLE'} /> + <Tag tag="AVAILABLE" /> - - -
-
HyunSu1768
-
- {'<'}azxcv1768@gmail.com{'>'} -
-
feat :: 몰라
-
-
2024년 7월 29일 11시 02분
-
- Hello -
+ {history && + history.length > 0 && + history.map((item, index) => ( + + +
+
{item.name}
+
{item.email}
+
{item.commit_message}
+
+
{new Date(item.scheduled_date).toLocaleString()}
+
+ + {item.stages.map((stage, stageIndex) => ( + + + {stageIndex < item.stages.length - 1 && } + + ))} + +
+ ))}
); @@ -89,8 +133,10 @@ const Title = styled.div` const DeployContainerWrapper = styled.div` display: flex; flex-direction: column; + gap: 50px; max-width: 1120px; width: 100%; + padding-bottom: 200px; `; const DeployContainer = styled.div` @@ -127,3 +173,18 @@ const DeployBox = styled.div` justify-content: center; align-items: center; `; + +const StageBox = styled.div` + width: 150px; + height: 50px; + border-radius: 8px; + background-color: ${theme.color.gray2}; + border: 1px solid ${theme.color.gray4}; + display: flex; + justify-content: center; + align-items: center; + font-size: 20px; + font-weight: 600; + color: ${theme.color.gray8}; + gap: 24px; +`;