|
@@ -7,6 +7,7 @@ import api from "shared/api";
|
|
|
import { Context } from "shared/Context";
|
|
import { Context } from "shared/Context";
|
|
|
import { ActionButton } from "../components/ActionButton";
|
|
import { ActionButton } from "../components/ActionButton";
|
|
|
import Loading from "components/Loading";
|
|
import Loading from "components/Loading";
|
|
|
|
|
+import DynamicLink from "components/DynamicLink";
|
|
|
|
|
|
|
|
const PullRequestCard = ({
|
|
const PullRequestCard = ({
|
|
|
pullRequest,
|
|
pullRequest,
|
|
@@ -19,6 +20,7 @@ const PullRequestCard = ({
|
|
|
Context
|
|
Context
|
|
|
);
|
|
);
|
|
|
const [showRepoTooltip, setShowRepoTooltip] = useState(false);
|
|
const [showRepoTooltip, setShowRepoTooltip] = useState(false);
|
|
|
|
|
+ const [showMergeInfoTooltip, setShowMergeInfoTooltip] = useState(false);
|
|
|
const [isLoading, setIsLoading] = useState(false);
|
|
const [isLoading, setIsLoading] = useState(false);
|
|
|
const [hasError, setHasError] = useState(false);
|
|
const [hasError, setHasError] = useState(false);
|
|
|
|
|
|
|
@@ -48,13 +50,32 @@ const PullRequestCard = ({
|
|
|
<DataContainer>
|
|
<DataContainer>
|
|
|
<PRName>
|
|
<PRName>
|
|
|
<PRIcon src={pr_icon} alt="pull request icon" />
|
|
<PRIcon src={pr_icon} alt="pull request icon" />
|
|
|
- {pullRequest.pr_title}
|
|
|
|
|
|
|
+ <DynamicLink
|
|
|
|
|
+ to={`https://github.com/${pullRequest.repo_owner}/${pullRequest.repo_name}/pull/${pullRequest.pr_number}`}
|
|
|
|
|
+ target="_blank"
|
|
|
|
|
+ >
|
|
|
|
|
+ {pullRequest.pr_title}
|
|
|
|
|
+ </DynamicLink>
|
|
|
|
|
+
|
|
|
|
|
+ <InfoWrapper>
|
|
|
|
|
+ <MergeInfo
|
|
|
|
|
+ onMouseOver={() => setShowMergeInfoTooltip(true)}
|
|
|
|
|
+ onMouseOut={() => setShowMergeInfoTooltip(false)}
|
|
|
|
|
+ >
|
|
|
|
|
+ From: {pullRequest.branch_from} Into: {pullRequest.branch_into}
|
|
|
|
|
+ </MergeInfo>
|
|
|
|
|
+ {showMergeInfoTooltip && (
|
|
|
|
|
+ <Tooltip>
|
|
|
|
|
+ From: {pullRequest.branch_from} Into: {pullRequest.branch_into}
|
|
|
|
|
+ </Tooltip>
|
|
|
|
|
+ )}
|
|
|
|
|
+ </InfoWrapper>
|
|
|
</PRName>
|
|
</PRName>
|
|
|
|
|
|
|
|
<Flex>
|
|
<Flex>
|
|
|
<StatusContainer>
|
|
<StatusContainer>
|
|
|
<Status>
|
|
<Status>
|
|
|
- <StatusDot status="" />
|
|
|
|
|
|
|
+ <StatusDot />
|
|
|
Not deployed
|
|
Not deployed
|
|
|
</Status>
|
|
</Status>
|
|
|
</StatusContainer>
|
|
</StatusContainer>
|
|
@@ -71,11 +92,6 @@ const PullRequestCard = ({
|
|
|
{repository}
|
|
{repository}
|
|
|
</RepositoryName>
|
|
</RepositoryName>
|
|
|
{showRepoTooltip && <Tooltip>{repository}</Tooltip>}
|
|
{showRepoTooltip && <Tooltip>{repository}</Tooltip>}
|
|
|
- <InfoWrapper>
|
|
|
|
|
- <LastDeployed>
|
|
|
|
|
- From: {pullRequest.branch_from} Into: {pullRequest.branch_into}
|
|
|
|
|
- </LastDeployed>
|
|
|
|
|
- </InfoWrapper>
|
|
|
|
|
</DeploymentImageContainer>
|
|
</DeploymentImageContainer>
|
|
|
</Flex>
|
|
</Flex>
|
|
|
</DataContainer>
|
|
</DataContainer>
|
|
@@ -124,7 +140,6 @@ const DeploymentCardWrapper = styled.div`
|
|
|
margin-bottom: 5px;
|
|
margin-bottom: 5px;
|
|
|
border-radius: 10px;
|
|
border-radius: 10px;
|
|
|
padding: 14px;
|
|
padding: 14px;
|
|
|
- overflow: hidden;
|
|
|
|
|
height: 80px;
|
|
height: 80px;
|
|
|
font-size: 13px;
|
|
font-size: 13px;
|
|
|
animation: fadeIn 0.5s;
|
|
animation: fadeIn 0.5s;
|
|
@@ -170,15 +185,8 @@ const Status = styled.span`
|
|
|
const StatusDot = styled.div`
|
|
const StatusDot = styled.div`
|
|
|
width: 8px;
|
|
width: 8px;
|
|
|
height: 8px;
|
|
height: 8px;
|
|
|
- margin-right: 15px;
|
|
|
|
|
- background: ${(props: { status: string }) =>
|
|
|
|
|
- props.status === "created"
|
|
|
|
|
- ? "#4797ff"
|
|
|
|
|
- : props.status === "failed"
|
|
|
|
|
- ? "#ed5f85"
|
|
|
|
|
- : props.status === "completed"
|
|
|
|
|
- ? "#00d12a"
|
|
|
|
|
- : "#f5cb42"};
|
|
|
|
|
|
|
+ margin-right: 10px;
|
|
|
|
|
+ background: #ffffff88;
|
|
|
border-radius: 20px;
|
|
border-radius: 20px;
|
|
|
margin-left: 3px;
|
|
margin-left: 3px;
|
|
|
`;
|
|
`;
|
|
@@ -216,8 +224,8 @@ const RepositoryName = styled.div`
|
|
|
|
|
|
|
|
const Tooltip = styled.div`
|
|
const Tooltip = styled.div`
|
|
|
position: absolute;
|
|
position: absolute;
|
|
|
- left: -20px;
|
|
|
|
|
- top: 10px;
|
|
|
|
|
|
|
+ left: 14px;
|
|
|
|
|
+ top: 20px;
|
|
|
min-height: 18px;
|
|
min-height: 18px;
|
|
|
max-width: calc(700px);
|
|
max-width: calc(700px);
|
|
|
padding: 5px 7px;
|
|
padding: 5px 7px;
|
|
@@ -243,17 +251,18 @@ const Tooltip = styled.div`
|
|
|
const InfoWrapper = styled.div`
|
|
const InfoWrapper = styled.div`
|
|
|
display: flex;
|
|
display: flex;
|
|
|
align-items: center;
|
|
align-items: center;
|
|
|
- white-space: nowrap;
|
|
|
|
|
- overflow: hidden;
|
|
|
|
|
- text-overflow: ellipsis;
|
|
|
|
|
margin-right: 8px;
|
|
margin-right: 8px;
|
|
|
|
|
+ position: relative;
|
|
|
`;
|
|
`;
|
|
|
|
|
|
|
|
-const LastDeployed = styled.div`
|
|
|
|
|
|
|
+const MergeInfo = styled.div`
|
|
|
font-size: 13px;
|
|
font-size: 13px;
|
|
|
margin-left: 14px;
|
|
margin-left: 14px;
|
|
|
margin-top: -1px;
|
|
margin-top: -1px;
|
|
|
- display: flex;
|
|
|
|
|
align-items: center;
|
|
align-items: center;
|
|
|
color: #aaaabb66;
|
|
color: #aaaabb66;
|
|
|
|
|
+ white-space: nowrap;
|
|
|
|
|
+ text-overflow: ellipsis;
|
|
|
|
|
+ overflow: hidden;
|
|
|
|
|
+ max-width: 300px;
|
|
|
`;
|
|
`;
|