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

Change the pending icon with Antd icon #301

Merged
merged 4 commits into from
Jan 8, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
11 changes: 7 additions & 4 deletions internal/pkg/github/mapper.go
Original file line number Diff line number Diff line change
Expand Up @@ -99,13 +99,16 @@ func mapGithubStatusToStatus(s *github.RepoStatus) *extent.Status {
state = extent.StatusStatePending
}

return &extent.Status{
Context: *s.Context,
// TODO: fix
status := &extent.Status{
Context: *s.Context,
AvatarURL: "",
TargetURL: *s.TargetURL,
State: state,
}
if s.TargetURL != nil {
status.TargetURL = *s.TargetURL
}
Comment on lines +107 to +109
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fix to check the TargetURL field is nil.


return status
}

func mapGithubCheckRunToStatus(c *github.CheckRun) *extent.Status {
Expand Down
8 changes: 0 additions & 8 deletions ui/src/App.less
Original file line number Diff line number Diff line change
Expand Up @@ -30,12 +30,4 @@
border-left: 4px solid rgba(100,100,100,.2);
opacity: .85;
}

&-pending-icon {
height: 6px;
width: 6px;
background-color: #bf8700;
border-radius: 50%;
display: inline-block;
}
}
8 changes: 4 additions & 4 deletions ui/src/components/ReviewerList.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { List, Avatar, Popover, Button } from "antd"
import { CheckOutlined, CloseOutlined, CommentOutlined } from "@ant-design/icons"
import { CheckOutlined, CloseOutlined, CommentOutlined, SyncOutlined } from "@ant-design/icons"

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

Expand All @@ -26,13 +26,13 @@ function ReviewItem(props: {review: Review}): JSX.Element {
const status = (status: ReviewStatusEnum) => {
switch (status) {
case ReviewStatusEnum.Pending:
return <><span className="gitploy-pending-icon" />&nbsp;&nbsp;</>
return <SyncOutlined spin/>
case ReviewStatusEnum.Approved:
return <CheckOutlined style={{color: "green"}} />
case ReviewStatusEnum.Rejected:
return <CloseOutlined style={{color: "red"}} />
default:
return <><span className="gitploy-pending-icon" />&nbsp;&nbsp;</>
return <SyncOutlined spin/>
}
}

Expand Down Expand Up @@ -82,5 +82,5 @@ export function ReviewStatus(props: {reviews: Review[]}): JSX.Element {
}
}

return <span><span className="gitploy-pending-icon" />&nbsp;&nbsp;Pending</span>
return <span><SyncOutlined spin/>&nbsp;&nbsp;Pending</span>
}
14 changes: 3 additions & 11 deletions ui/src/components/StatusStateIcon.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { Popover, Avatar, Typography, Row, Col, Divider, Space } from "antd"
import { CheckOutlined, CloseOutlined, StopOutlined, ExclamationCircleOutlined } from "@ant-design/icons"
import { CheckOutlined, CloseOutlined, StopOutlined, SyncOutlined, ExclamationCircleOutlined } from "@ant-design/icons"

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

Expand Down Expand Up @@ -66,11 +66,7 @@ function mapStateToIcon(state: StatusState): JSX.Element {
case StatusState.Null:
return <></>
case StatusState.Pending:
return (
<span>
<span className="gitploy-pending-icon" />&nbsp;&nbsp;
</span>
)
return <SyncOutlined spin/>
case StatusState.Success:
return <CheckOutlined style={{color: colorSuccess}}/>
case StatusState.Failure:
Expand All @@ -80,11 +76,7 @@ function mapStateToIcon(state: StatusState): JSX.Element {
case StatusState.Skipped:
return <StopOutlined />
default:
return (
<span>
<span className="gitploy-pending-icon" />&nbsp;&nbsp;
</span>
)
return <SyncOutlined spin/>
}
}

Expand Down