Skip to content
This repository was archived by the owner on May 30, 2024. It is now read-only.

Commit 83bd909

Browse files
author
Noah Lee
committed
Change the pending icon with Antd icon (#301)
* Fix the bug in the mapping status * Change the pending status icon for commit and review
1 parent b882ddd commit 83bd909

File tree

4 files changed

+14
-27
lines changed

4 files changed

+14
-27
lines changed

internal/pkg/github/mapper.go

+7-4
Original file line numberDiff line numberDiff line change
@@ -99,13 +99,16 @@ func mapGithubStatusToStatus(s *github.RepoStatus) *extent.Status {
9999
state = extent.StatusStatePending
100100
}
101101

102-
return &extent.Status{
103-
Context: *s.Context,
104-
// TODO: fix
102+
status := &extent.Status{
103+
Context: *s.Context,
105104
AvatarURL: "",
106-
TargetURL: *s.TargetURL,
107105
State: state,
108106
}
107+
if s.TargetURL != nil {
108+
status.TargetURL = *s.TargetURL
109+
}
110+
111+
return status
109112
}
110113

111114
func mapGithubCheckRunToStatus(c *github.CheckRun) *extent.Status {

ui/src/App.less

-8
Original file line numberDiff line numberDiff line change
@@ -30,12 +30,4 @@
3030
border-left: 4px solid rgba(100,100,100,.2);
3131
opacity: .85;
3232
}
33-
34-
&-pending-icon {
35-
height: 6px;
36-
width: 6px;
37-
background-color: #bf8700;
38-
border-radius: 50%;
39-
display: inline-block;
40-
}
4133
}

ui/src/components/ReviewerList.tsx

+4-4
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { List, Avatar, Popover, Button } from "antd"
2-
import { CheckOutlined, CloseOutlined, CommentOutlined } from "@ant-design/icons"
2+
import { CheckOutlined, CloseOutlined, CommentOutlined, SyncOutlined } from "@ant-design/icons"
33

44
import { User, Review, ReviewStatusEnum } from "../models"
55

@@ -26,13 +26,13 @@ function ReviewItem(props: {review: Review}): JSX.Element {
2626
const status = (status: ReviewStatusEnum) => {
2727
switch (status) {
2828
case ReviewStatusEnum.Pending:
29-
return <><span className="gitploy-pending-icon" />&nbsp;&nbsp;</>
29+
return <SyncOutlined spin/>
3030
case ReviewStatusEnum.Approved:
3131
return <CheckOutlined style={{color: "green"}} />
3232
case ReviewStatusEnum.Rejected:
3333
return <CloseOutlined style={{color: "red"}} />
3434
default:
35-
return <><span className="gitploy-pending-icon" />&nbsp;&nbsp;</>
35+
return <SyncOutlined spin/>
3636
}
3737
}
3838

@@ -82,5 +82,5 @@ export function ReviewStatus(props: {reviews: Review[]}): JSX.Element {
8282
}
8383
}
8484

85-
return <span><span className="gitploy-pending-icon" />&nbsp;&nbsp;Pending</span>
85+
return <span><SyncOutlined spin/>&nbsp;&nbsp;Pending</span>
8686
}

ui/src/components/StatusStateIcon.tsx

+3-11
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { Popover, Avatar, Typography, Row, Col, Divider, Space } from "antd"
2-
import { CheckOutlined, CloseOutlined, StopOutlined, ExclamationCircleOutlined } from "@ant-design/icons"
2+
import { CheckOutlined, CloseOutlined, StopOutlined, SyncOutlined, ExclamationCircleOutlined } from "@ant-design/icons"
33

44
import { Status, StatusState } from "../models"
55

@@ -66,11 +66,7 @@ function mapStateToIcon(state: StatusState): JSX.Element {
6666
case StatusState.Null:
6767
return <></>
6868
case StatusState.Pending:
69-
return (
70-
<span>
71-
<span className="gitploy-pending-icon" />&nbsp;&nbsp;
72-
</span>
73-
)
69+
return <SyncOutlined spin/>
7470
case StatusState.Success:
7571
return <CheckOutlined style={{color: colorSuccess}}/>
7672
case StatusState.Failure:
@@ -80,11 +76,7 @@ function mapStateToIcon(state: StatusState): JSX.Element {
8076
case StatusState.Skipped:
8177
return <StopOutlined />
8278
default:
83-
return (
84-
<span>
85-
<span className="gitploy-pending-icon" />&nbsp;&nbsp;
86-
</span>
87-
)
79+
return <SyncOutlined spin/>
8880
}
8981
}
9082

0 commit comments

Comments
 (0)