-
-
Notifications
You must be signed in to change notification settings - Fork 18
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Introduce PullRequestStatus to customise the notification and PR list…
… to indicate new commits and replies (#175)
- Loading branch information
Showing
17 changed files
with
317 additions
and
407 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
import styled from "@emotion/styled"; | ||
import { observer } from "mobx-react-lite"; | ||
import React from "react"; | ||
import { Badge } from "react-bootstrap"; | ||
import { PullRequestStatus as Status } from "../filtering/status"; | ||
|
||
const StatusBox = styled.div` | ||
padding: 0 8px; | ||
`; | ||
|
||
const UNREVIEWED = ( | ||
<Badge pill variant="danger"> | ||
Unreviewed | ||
</Badge> | ||
); | ||
|
||
const AUTHOR_REPLIED = ( | ||
<Badge pill variant="secondary"> | ||
Author replied | ||
</Badge> | ||
); | ||
|
||
const NEW_COMMIT = ( | ||
<Badge pill variant="success"> | ||
New commit | ||
</Badge> | ||
); | ||
|
||
export const PullRequestStatus = observer((props: { status: Status }) => { | ||
switch (props.status) { | ||
case Status.INCOMING_NEW_REVIEW_REQUESTED: | ||
return <StatusBox>{UNREVIEWED}</StatusBox>; | ||
case Status.INCOMING_REVIEWED_NEW_COMMENT_BY_AUTHOR: | ||
return <StatusBox>{AUTHOR_REPLIED}</StatusBox>; | ||
case Status.INCOMING_REVIEWED_NEW_COMMIT: | ||
return <StatusBox>{NEW_COMMIT}</StatusBox>; | ||
case Status.INCOMING_REVIEWED_NEW_COMMIT_AND_NEW_COMMENT_BY_AUTHOR: | ||
return ( | ||
<StatusBox> | ||
{AUTHOR_REPLIED} {NEW_COMMIT} | ||
</StatusBox> | ||
); | ||
default: | ||
return <></>; | ||
} | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
import { PullRequest } from "../storage/loaded-state"; | ||
import { PullRequestStatus } from "./status"; | ||
|
||
export interface EnrichedPullRequest extends PullRequest { | ||
status: PullRequestStatus; | ||
} |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.