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

Commit

Permalink
Merge 8a27e4d into 0bf8106
Browse files Browse the repository at this point in the history
  • Loading branch information
kuychaco committed Dec 3, 2018
2 parents 0bf8106 + 8a27e4d commit de145bf
Show file tree
Hide file tree
Showing 74 changed files with 3,505 additions and 635 deletions.
12 changes: 12 additions & 0 deletions keymaps/git.cson
Expand Up @@ -39,13 +39,25 @@
'.github-CommitView-editor atom-text-editor:not([mini])':
'cmd-enter': 'github:commit'
'ctrl-enter': 'github:commit'
'tab': 'core:focus-next'
'shift-tab': 'core:focus-previous'

'.github-CommitView-commitPreview':
'cmd-left': 'github:dive'
'ctrl-left': 'github:dive'
'enter': 'native!'

'.github-RecentCommits':
'enter': 'github:dive'
'cmd-left': 'github:dive'
'ctrl-left': 'github:dive'
'tab': 'core:focus-next'
'shift-tab': 'core:focus-previous'

'.github-CommitDetailView':
'cmd-right': 'github:surface'
'ctrl-right': 'github:surface'

'.github-FilePatchView atom-text-editor:not([mini])':
'cmd-/': 'github:toggle-patch-selection-mode'
'ctrl-/': 'github:toggle-patch-selection-mode'
Expand Down

Large diffs are not rendered by default.

45 changes: 45 additions & 0 deletions lib/containers/commit-detail-container.js
@@ -0,0 +1,45 @@
import React from 'react';
import PropTypes from 'prop-types';
import yubikiri from 'yubikiri';

import ObserveModel from '../views/observe-model';
import LoadingView from '../views/loading-view';
import CommitDetailController from '../controllers/commit-detail-controller';

export default class CommitDetailContainer extends React.Component {
static propTypes = {
repository: PropTypes.object.isRequired,
sha: PropTypes.string.isRequired,
itemType: PropTypes.func.isRequired,
}

fetchData = repository => {
return yubikiri({
commit: repository.getCommit(this.props.sha),
currentBranch: repository.getCurrentBranch(),
currentRemote: async query => repository.getRemoteForBranch((await query.currentBranch).getName()),
isCommitPushed: repository.isCommitPushed(this.props.sha),
});
}

render() {
return (
<ObserveModel model={this.props.repository} fetchData={this.fetchData}>
{this.renderResult}
</ObserveModel>
);
}

renderResult = data => {
if (this.props.repository.isLoading() || data === null || !data.commit.isPresent()) {
return <LoadingView />;
}

return (
<CommitDetailController
{...data}
{...this.props}
/>
);
}
}
4 changes: 4 additions & 0 deletions lib/containers/issueish-detail-container.js
Expand Up @@ -26,6 +26,8 @@ export default class IssueishDetailContainer extends React.Component {

switchToIssueish: PropTypes.func.isRequired,
onTitleChange: PropTypes.func.isRequired,

workspace: PropTypes.object.isRequired,
}

constructor(props) {
Expand Down Expand Up @@ -169,6 +171,8 @@ export default class IssueishDetailContainer extends React.Component {
addRemote={repository.addRemote.bind(repository)}
onTitleChange={this.props.onTitleChange}
switchToIssueish={this.props.switchToIssueish}
workdirPath={repository.getWorkingDirectoryPath()}
workspace={this.props.workspace}
/>
);
}
Expand Down

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

0 comments on commit de145bf

Please sign in to comment.