From a65a50d60784cab819cbca28cbc1c133a32d104d Mon Sep 17 00:00:00 2001 From: noah Date: Sat, 8 Jan 2022 15:42:49 +0900 Subject: [PATCH 1/4] Fix the bug in the mapping status --- internal/pkg/github/mapper.go | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/internal/pkg/github/mapper.go b/internal/pkg/github/mapper.go index e672822f..e807f88c 100644 --- a/internal/pkg/github/mapper.go +++ b/internal/pkg/github/mapper.go @@ -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 + } + + return status } func mapGithubCheckRunToStatus(c *github.CheckRun) *extent.Status { From cd72b17e50ef0f90b0c9df2584ebba4ef8fe76dd Mon Sep 17 00:00:00 2001 From: noah Date: Sat, 8 Jan 2022 15:49:10 +0900 Subject: [PATCH 2/4] Change the pending status icon --- ui/src/components/StatusStateIcon.tsx | 14 +++----------- 1 file changed, 3 insertions(+), 11 deletions(-) diff --git a/ui/src/components/StatusStateIcon.tsx b/ui/src/components/StatusStateIcon.tsx index 33f41091..de58e110 100644 --- a/ui/src/components/StatusStateIcon.tsx +++ b/ui/src/components/StatusStateIcon.tsx @@ -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" @@ -66,11 +66,7 @@ function mapStateToIcon(state: StatusState): JSX.Element { case StatusState.Null: return <> case StatusState.Pending: - return ( - -    - - ) + return case StatusState.Success: return case StatusState.Failure: @@ -80,11 +76,7 @@ function mapStateToIcon(state: StatusState): JSX.Element { case StatusState.Skipped: return default: - return ( - -    - - ) + return } } From 6d3877dd9dc56bbd35efb8a67c587db6d3491875 Mon Sep 17 00:00:00 2001 From: noah Date: Sat, 8 Jan 2022 15:55:52 +0900 Subject: [PATCH 3/4] Add spin attr --- ui/src/components/StatusStateIcon.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ui/src/components/StatusStateIcon.tsx b/ui/src/components/StatusStateIcon.tsx index de58e110..276d3a20 100644 --- a/ui/src/components/StatusStateIcon.tsx +++ b/ui/src/components/StatusStateIcon.tsx @@ -66,7 +66,7 @@ function mapStateToIcon(state: StatusState): JSX.Element { case StatusState.Null: return <> case StatusState.Pending: - return + return case StatusState.Success: return case StatusState.Failure: @@ -76,7 +76,7 @@ function mapStateToIcon(state: StatusState): JSX.Element { case StatusState.Skipped: return default: - return + return } } From 942eae15fc71ab470c081e74e65bd48225ac584b Mon Sep 17 00:00:00 2001 From: noah Date: Sat, 8 Jan 2022 15:56:14 +0900 Subject: [PATCH 4/4] Change the pending icon for review --- ui/src/App.less | 8 -------- ui/src/components/ReviewerList.tsx | 8 ++++---- 2 files changed, 4 insertions(+), 12 deletions(-) diff --git a/ui/src/App.less b/ui/src/App.less index 642ea1a9..e69053a8 100644 --- a/ui/src/App.less +++ b/ui/src/App.less @@ -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; - } } diff --git a/ui/src/components/ReviewerList.tsx b/ui/src/components/ReviewerList.tsx index 31493c69..8bb7f81e 100644 --- a/ui/src/components/ReviewerList.tsx +++ b/ui/src/components/ReviewerList.tsx @@ -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" @@ -26,13 +26,13 @@ function ReviewItem(props: {review: Review}): JSX.Element { const status = (status: ReviewStatusEnum) => { switch (status) { case ReviewStatusEnum.Pending: - return <>   + return case ReviewStatusEnum.Approved: return case ReviewStatusEnum.Rejected: return default: - return <>   + return } } @@ -82,5 +82,5 @@ export function ReviewStatus(props: {reviews: Review[]}): JSX.Element { } } - return   Pending + return   Pending }