Skip to content
This repository has been archived by the owner on Dec 15, 2022. It is now read-only.

Commit

Permalink
Merge 245bc05 into cc13510
Browse files Browse the repository at this point in the history
  • Loading branch information
Tilde Ann Thurium committed Nov 21, 2018
2 parents cc13510 + 245bc05 commit 871caf2
Show file tree
Hide file tree
Showing 12 changed files with 2,417 additions and 523 deletions.

Large diffs are not rendered by default.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

42 changes: 29 additions & 13 deletions lib/controllers/issueish-detail-controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@ import PropTypes from 'prop-types';
import {BranchSetPropType, RemoteSetPropType} from '../prop-types';
import {GitError} from '../git-shell-out-strategy';
import EnableableOperation from '../models/enableable-operation';
import IssueishDetailView, {checkoutStates} from '../views/issueish-detail-view';
import PullRequestDetailView, {checkoutStates} from '../views/pr-detail-view';
import IssueDetailView from '../views/issue-detail-view';
import {incrementCounter} from '../reporter-proxy';

export class BareIssueishDetailController extends React.Component {
Expand Down Expand Up @@ -78,15 +79,25 @@ export class BareIssueishDetailController extends React.Component {
}

this.checkoutOp = this.nextCheckoutOp();

return (
<IssueishDetailView
repository={repository}
issueish={repository.issueish}
checkoutOp={this.checkoutOp}
switchToIssueish={this.props.switchToIssueish}
/>
);
const isPr = repository.issueish.__typename === 'PullRequest';
if (isPr) {
return (
<PullRequestDetailView
repository={repository}
issueish={repository.issueish}
checkoutOp={this.checkoutOp}
switchToIssueish={this.props.switchToIssueish}
/>
);
} else {
return (
<IssueDetailView
repository={repository}
issueish={repository.issueish}
switchToIssueish={this.props.switchToIssueish}
/>
);
}
}

nextCheckoutOp() {
Expand Down Expand Up @@ -213,7 +224,12 @@ export default createFragmentContainer(BareIssueishDetailController, {
commitCount: {type: "Int!"},
commitCursor: {type: "String"},
) {
...issueishDetailView_repository
...issueDetailView_repository
name
owner {
login
}
...prDetailView_repository
name
owner {
login
Expand All @@ -223,7 +239,7 @@ export default createFragmentContainer(BareIssueishDetailController, {
... on Issue {
title
number
...issueishDetailView_issueish @arguments(
...issueDetailView_issueish @arguments(
timelineCount: $timelineCount,
timelineCursor: $timelineCursor,
commitCount: $commitCount,
Expand All @@ -242,7 +258,7 @@ export default createFragmentContainer(BareIssueishDetailController, {
url
sshUrl
}
...issueishDetailView_issueish @arguments(
...prDetailView_issueish @arguments(
timelineCount: $timelineCount,
timelineCursor: $timelineCursor,
commitCount: $commitCount,
Expand Down

0 comments on commit 871caf2

Please sign in to comment.