This repository has been archived by the owner on Dec 15, 2022. It is now read-only.
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
76 changed files
with
5,632 additions
and
2,526 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
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
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,41 @@ | ||
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 CommitPreviewController from '../controllers/commit-preview-controller'; | ||
|
||
export default class CommitPreviewContainer extends React.Component { | ||
static propTypes = { | ||
repository: PropTypes.object.isRequired, | ||
} | ||
|
||
fetchData = repository => { | ||
return yubikiri({ | ||
multiFilePatch: repository.getStagedChangesPatch(), | ||
}); | ||
} | ||
|
||
render() { | ||
return ( | ||
<ObserveModel model={this.props.repository} fetchData={this.fetchData}> | ||
{this.renderResult} | ||
</ObserveModel> | ||
); | ||
} | ||
|
||
renderResult = data => { | ||
if (this.props.repository.isLoading() || data === null) { | ||
return <LoadingView />; | ||
} | ||
|
||
return ( | ||
<CommitPreviewController | ||
stagingStatus={'staged'} | ||
{...data} | ||
{...this.props} | ||
/> | ||
); | ||
} | ||
} |
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,33 @@ | ||
import React from 'react'; | ||
import PropTypes from 'prop-types'; | ||
|
||
import MultiFilePatchController from './multi-file-patch-controller'; | ||
|
||
export default class ChangedFileController extends React.Component { | ||
static propTypes = { | ||
repository: PropTypes.object.isRequired, | ||
stagingStatus: PropTypes.oneOf(['staged', 'unstaged']), | ||
relPath: PropTypes.string.isRequired, | ||
|
||
workspace: PropTypes.object.isRequired, | ||
commands: PropTypes.object.isRequired, | ||
keymaps: PropTypes.object.isRequired, | ||
tooltips: PropTypes.object.isRequired, | ||
config: PropTypes.object.isRequired, | ||
|
||
destroy: PropTypes.func.isRequired, | ||
undoLastDiscard: PropTypes.func.isRequired, | ||
surfaceFileAtPath: PropTypes.func.isRequired, | ||
} | ||
|
||
render() { | ||
return ( | ||
<MultiFilePatchController | ||
surface={this.surface} | ||
{...this.props} | ||
/> | ||
); | ||
} | ||
|
||
surface = () => this.props.surfaceFileAtPath(this.props.relPath, this.props.stagingStatus) | ||
} |
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,30 @@ | ||
import React from 'react'; | ||
import PropTypes from 'prop-types'; | ||
|
||
import MultiFilePatchController from './multi-file-patch-controller'; | ||
|
||
export default class CommitPreviewController extends React.Component { | ||
static propTypes = { | ||
repository: PropTypes.object.isRequired, | ||
stagingStatus: PropTypes.oneOf(['staged', 'unstaged']), | ||
|
||
workspace: PropTypes.object.isRequired, | ||
commands: PropTypes.object.isRequired, | ||
keymaps: PropTypes.object.isRequired, | ||
tooltips: PropTypes.object.isRequired, | ||
config: PropTypes.object.isRequired, | ||
|
||
destroy: PropTypes.func.isRequired, | ||
undoLastDiscard: PropTypes.func.isRequired, | ||
surfaceToCommitPreviewButton: PropTypes.func.isRequired, | ||
} | ||
|
||
render() { | ||
return ( | ||
<MultiFilePatchController | ||
surface={this.props.surfaceToCommitPreviewButton} | ||
{...this.props} | ||
/> | ||
); | ||
} | ||
} |
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
Oops, something went wrong.