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

Commit dd04925

Browse files
committed
Drill action props
1 parent 6c4088e commit dd04925

File tree

8 files changed

+53
-11
lines changed

8 files changed

+53
-11
lines changed

lib/containers/github-tab-container.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,11 @@ export default class GitHubTabContainer extends React.Component {
1515
repository: PropTypes.object,
1616
loginModel: GithubLoginModelPropType.isRequired,
1717
rootHolder: RefHolderPropType.isRequired,
18+
19+
openCreateDialog: PropTypes.func.isRequired,
20+
openPublishDialog: PropTypes.func.isRequired,
21+
openCloneDialog: PropTypes.func.isRequired,
22+
openGitTab: PropTypes.func.isRequired,
1823
}
1924

2025
state = {};

lib/controllers/github-tab-controller.js

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,10 @@ export default class GitHubTabController extends React.Component {
2626
changeWorkingDirectory: PropTypes.func.isRequired,
2727
onDidChangeWorkDirs: PropTypes.func.isRequired,
2828
getCurrentWorkDirs: PropTypes.func.isRequired,
29+
openCreateDialog: PropTypes.func.isRequired,
30+
openPublishDialog: PropTypes.func.isRequired,
31+
openCloneDialog: PropTypes.func.isRequired,
32+
openGitTab: PropTypes.func.isRequired,
2933
}
3034

3135
render() {
@@ -63,6 +67,10 @@ export default class GitHubTabController extends React.Component {
6367
changeWorkingDirectory={this.props.changeWorkingDirectory}
6468
getCurrentWorkDirs={this.props.getCurrentWorkDirs}
6569
onDidChangeWorkDirs={this.props.onDidChangeWorkDirs}
70+
openCreateDialog={this.props.openCreateDialog}
71+
openPublishDialog={this.props.openPublishDialog}
72+
openCloneDialog={this.props.openCloneDialog}
73+
openGitTab={this.props.openGitTab}
6674
/>
6775
);
6876
}

lib/controllers/root-controller.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -312,6 +312,10 @@ export default class RootController extends React.Component {
312312
getCurrentWorkDirs={getCurrentWorkDirs}
313313
onDidChangeWorkDirs={onDidChangeWorkDirs}
314314
changeWorkingDirectory={this.props.changeWorkingDirectory}
315+
openCreateDialog={this.openCreateDialog}
316+
openPublishDialog={this.openPublishDialog}
317+
openCloneDialog={this.openCloneDialog}
318+
openGitTab={this.gitTabTracker.toggleFocus}
315319
/>
316320
)}
317321
</PaneItem>

lib/items/github-tab-item.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,11 @@ export default class GitHubTabItem extends React.Component {
1212
loginModel: GithubLoginModelPropType.isRequired,
1313

1414
documentActiveElement: PropTypes.func,
15+
16+
openCreateDialog: PropTypes.func.isRequired,
17+
openPublishDialog: PropTypes.func.isRequired,
18+
openCloneDialog: PropTypes.func.isRequired,
19+
openGitTab: PropTypes.func.isRequired,
1520
}
1621

1722
static defaultProps = {

lib/views/github-blank-nolocal.js

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,27 @@
11
import React from 'react';
2+
import PropTypes from 'prop-types';
23

3-
export default function GitHubBlankNoLocal() {
4+
export default function GitHubBlankNoLocal(props) {
45
return (
56
<div className="github-NoLocal github-Blank">
67
<div className="github-Blank-LargeIcon icon icon-mark-github" />
78
<h1 className="github-Blank-banner">Welcome</h1>
89
<p className="github-Blank-context">How would you like to get started today?</p>
910
<p className="github-Blank-option">
10-
<button
11-
className="github-Blank-actionBtn btn icon icon-repo-create">
11+
<button className="github-Blank-actionBtn btn icon icon-repo-create" onClick={props.openCreateDialog}>
1212
Create a new GitHub repository...
1313
</button>
1414
</p>
1515
<p className="github-Blank-option">
16-
<button
17-
className="github-Blank-actionBtn btn icon icon-repo-clone">
16+
<button className="github-Blank-actionBtn btn icon icon-repo-clone" onClick={props.openCloneDialog}>
1817
Clone an existing GitHub repository...
1918
</button>
2019
</p>
2120
</div>
2221
);
2322
}
23+
24+
GitHubBlankNoLocal.propTypes = {
25+
openCreateDialog: PropTypes.func.isRequired,
26+
openCloneDialog: PropTypes.func.isRequired,
27+
};

lib/views/github-blank-noremote.js

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
import React from 'react';
2+
import PropTypes from 'prop-types';
23

3-
export default function GitHubBlankNoRemote() {
4+
export default function GitHubBlankNoRemote(props) {
45
return (
56
<div className="github-Local-NoRemotes github-Blank">
67
<div className="github-Blank-LargeIcon icon icon-mark-github" />
78
<p className="github-Blank-context">This repository has no remotes on GitHub.</p>
89
<p className="github-Blank-option github-Blank-option--explained">
9-
<button
10-
className="github-Blank-actionBtn btn icon icon-globe">
10+
<button className="github-Blank-actionBtn btn icon icon-globe" onClick={props.openPublishDialog}>
1111
Publish on GitHub...
1212
</button>
1313
</p>
@@ -17,3 +17,7 @@ export default function GitHubBlankNoRemote() {
1717
</div>
1818
);
1919
}
20+
21+
GitHubBlankNoRemote.propTypes = {
22+
openPublishDialog: PropTypes.func.isRequired,
23+
};
Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,16 @@
11
import React from 'react';
2+
import PropTypes from 'prop-types';
23

34
import Octicon from '../atom/octicon';
45

5-
export default function GitHubBlankUninitialized() {
6+
export default function GitHubBlankUninitialized(props) {
67
return (
78
<div className="github-Local-Uninit github-Blank">
89
<main className="github-Blank-body">
910
<div className="github-Blank-LargeIcon icon icon-mark-github" />
1011
<p className="github-Blank-context">This repository is not yet version controlled by git.</p>
1112
<p className="github-Blank-option">
12-
<button className="github-Blank-actionBtn btn icon icon-globe">
13+
<button className="github-Blank-actionBtn btn icon icon-globe" onClick={props.openPublishDialog}>
1314
Initialize and publish on GitHub...
1415
</button>
1516
</p>
@@ -20,8 +21,15 @@ export default function GitHubBlankUninitialized() {
2021
</main>
2122
<footer className="github-Blank-footer github-Blank-explanation">
2223
To initialize this directory as a git repository without publishing it to GitHub, visit the
23-
<a className="github-Blank-tabLink" href="https://example.com/"><Octicon icon="git-commit" />Git tab.</a>
24+
<button className="github-Blank-tabLink" onClick={props.openGitTab}>
25+
<Octicon icon="git-commit" />Git tab.
26+
</button>
2427
</footer>
2528
</div>
2629
);
2730
}
31+
32+
GitHubBlankUninitialized.propTypes = {
33+
openPublishDialog: PropTypes.func.isRequired,
34+
openGitTab: PropTypes.func.isRequired,
35+
};

lib/views/github-tab-view.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,10 @@ export default class GitHubTabView extends React.Component {
3636
changeWorkingDirectory: PropTypes.func.isRequired,
3737
onDidChangeWorkDirs: PropTypes.func.isRequired,
3838
getCurrentWorkDirs: PropTypes.func.isRequired,
39+
openCreateDialog: PropTypes.func.isRequired,
40+
openPublishDialog: PropTypes.func.isRequired,
41+
openCloneDialog: PropTypes.func.isRequired,
42+
openGitTab: PropTypes.func.isRequired,
3943
}
4044

4145
render() {

0 commit comments

Comments
 (0)