-
Notifications
You must be signed in to change notification settings - Fork 739
Display linked issue(s) from the PR Overview #5824 #6835
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
df87f4d
d817cc8
d171a17
eab2b35
827c847
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -224,6 +224,15 @@ fragment PullRequestFragment on PullRequest { | |
| mergeCommitMessage | ||
| mergeCommitTitle | ||
| } | ||
| closingIssuesReferences(first: 50) { | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Also needs to be added in |
||
| nodes { | ||
| id | ||
| number | ||
| title | ||
| state | ||
| url | ||
| } | ||
| } | ||
| merged | ||
| mergeable | ||
| mergeQueueEntry { | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -53,6 +53,8 @@ export const outputIcon = <Icon src={require('../../resources/icons/codicons/out | |
| export const skipIcon = <Icon src={require('../../resources/icons/codicons/skip.svg')} className='skip' />; | ||
|
|
||
| // Other icons | ||
| export const issueIcon = <Icon src={require('../../resources/icons/issue_webview.svg')} />; | ||
| export const issueClosedIcon = <Icon src={require('../../resources/icons/codicons/pass.svg')} />; | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. No need to add another export here, pass is already exported above. |
||
| export const copilotErrorIcon = <Icon className='copilot-icon' src={require('../../resources/icons/copilot-error.svg')} />; | ||
| export const copilotInProgressIcon = <Icon className='copilot-icon' src={require('../../resources/icons/copilot-in-progress.svg')} />; | ||
| export const copilotSuccessIcon = <Icon className='copilot-icon' src={require('../../resources/icons/copilot-success.svg')} />; | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -4,12 +4,12 @@ | |
| *--------------------------------------------------------------------------------------------*/ | ||
|
|
||
| import React, { useContext, useEffect, useRef, useState } from 'react'; | ||
| import { closeIcon, copilotIcon, settingsIcon } from './icon'; | ||
| import { closeIcon, copilotIcon, issueClosedIcon, issueIcon, settingsIcon } from './icon'; | ||
| import { Reviewer } from './reviewer'; | ||
| import { COPILOT_LOGINS } from '../../src/common/copilot'; | ||
| import { gitHubLabelColor } from '../../src/common/utils'; | ||
| import { IAccount, IMilestone, IProjectItem, isITeam, reviewerId, reviewerLabel, ReviewState } from '../../src/github/interface'; | ||
| import { ChangeReviewersReply, PullRequest } from '../../src/github/views'; | ||
| import { GithubItemStateEnum, IAccount, IMilestone, IProjectItem, isITeam, reviewerId, reviewerLabel, ReviewState } from '../../src/github/interface'; | ||
| import { ChangeReviewersReply, IssueReference, PullRequest } from '../../src/github/views'; | ||
| import PullRequestContext from '../common/context'; | ||
| import { Label } from '../common/label'; | ||
| import { AuthorLink, Avatar } from '../components/user'; | ||
|
|
@@ -53,7 +53,7 @@ function Section({ | |
| ); | ||
| } | ||
|
|
||
| export default function Sidebar({ reviewers, labels, hasWritePermission, isIssue, projectItems: projects, milestone, assignees, canAssignCopilot, canRequestCopilotReview }: PullRequest) { | ||
| export default function Sidebar({ reviewers, labels, closingIssues, hasWritePermission, isIssue, projectItems: projects, milestone, assignees, canAssignCopilot, canRequestCopilotReview }: PullRequest) { | ||
| const { | ||
| addReviewers, | ||
| addReviewerCopilot, | ||
|
|
@@ -268,6 +268,22 @@ export default function Sidebar({ reviewers, labels, hasWritePermission, isIssue | |
| <div className="section-placeholder">No milestone</div> | ||
| )} | ||
| </Section> | ||
|
|
||
| <Section | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. If there are no closing issues, let's just not show this section. It's not actionable when there's nothing in it. |
||
| id="closingIssues" | ||
| title="Linked Issues" | ||
| hasWritePermission={false} | ||
| > | ||
| {closingIssues.length ? ( | ||
| closingIssues.map(issue => ( | ||
| <div key={issue.number} className="section-item"> | ||
| <IssueItem issue={issue} /> | ||
| </div> | ||
| )) | ||
| ) : ( | ||
| <div className="section-placeholder">None yet</div> | ||
| )} | ||
| </Section> | ||
| </div> | ||
| ); | ||
| } | ||
|
|
@@ -577,3 +593,16 @@ function ConvertToDraft() { | |
| </div> | ||
| ); | ||
| } | ||
|
|
||
| function IssueItem({ issue }: { issue: IssueReference }) { | ||
| const isOpen = issue.state === GithubItemStateEnum.Open; | ||
| return ( | ||
| <div className="avatar-with-author"> | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This seems like a weird class to use here, as there's no avatar with author in the div. |
||
| <span className={`section-icon ${isOpen ? 'issue-open' : 'issue-closed'}`}> | ||
| {isOpen ? issueIcon : issueClosedIcon} | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Should use |
||
| </span> | ||
| <a href={issue.url} title={issue.url}>#{issue.number} {issue.title}</a> | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Can the styling of this be improved?
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Also, when it's clicked it should open the issue webview, rather than issue in your browser. |
||
| </div> | ||
| ); | ||
| } | ||
|
|
||

Uh oh!
There was an error while loading. Please reload this page.