Skip to content
This repository was archived by the owner on Dec 15, 2022. It is now read-only.
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
68 commits
Select commit Hold shift + click to select a range
d426011
FR template beginnings
wadethestealth Oct 8, 2019
d57cf00
rename variable
wadethestealth Oct 8, 2019
bd5c9ee
create and pass exit remote function
wadethestealth Oct 8, 2019
5ae8141
pass down the exit function
wadethestealth Oct 8, 2019
0404281
catch invalid endpoint error when exiting
wadethestealth Oct 8, 2019
40b6713
Add a temp visual header with working functionality
wadethestealth Oct 8, 2019
15318e1
fix lints
wadethestealth Oct 8, 2019
258d409
Add Git + GitHub context headers
simurai Feb 12, 2019
ac2bc16
undo my ui visuals
wadethestealth Oct 10, 2019
39e6355
create remote selector
wadethestealth Oct 10, 2019
127c968
use remote selector
wadethestealth Oct 10, 2019
8b5adca
finish undo of temp UI
wadethestealth Oct 10, 2019
108c577
remove proto header from git tab
wadethestealth Oct 10, 2019
6c08bb2
fix lint
wadethestealth Oct 10, 2019
5174e88
remove no longer needed error catch
wadethestealth Oct 10, 2019
7768c40
add beginnings of avatar components and more ecapsulation
wadethestealth Oct 10, 2019
77c792a
fix lint
wadethestealth Oct 10, 2019
39a47bb
properly handling loading dom
wadethestealth Oct 10, 2019
883f3a3
fix typo on remote selector causing it to break
wadethestealth Oct 10, 2019
cfee43f
Add Git + GitHub context headers
simurai Feb 12, 2019
8d867b0
add project repo change ability
wadethestealth Oct 15, 2019
73b1ff8
update project context ui for github tab
wadethestealth Oct 15, 2019
d4ce922
rename to header-view
wadethestealth Oct 15, 2019
1f3cfc6
add header view to git tab
wadethestealth Oct 15, 2019
0ceb2ff
remove avatar and refresh button for mvp
wadethestealth Oct 16, 2019
1d8cef8
fix lint
wadethestealth Oct 16, 2019
5e3414a
remove padding
wadethestealth Oct 16, 2019
691ca1d
fix 'CurrentPullRequestContainer' test warnings
wadethestealth Oct 16, 2019
0dc2505
fix 'GitTabContainer' test warnings
wadethestealth Oct 16, 2019
61a39e3
fix 'GitHubTabContainer' test warnings
wadethestealth Oct 16, 2019
c22dc33
create generic Error Boundary
wadethestealth Oct 16, 2019
59db453
fix 'Decoration' test warnings
wadethestealth Oct 16, 2019
1323ea4
fix 'Marker' test warnings
wadethestealth Oct 16, 2019
f8df70e
fix 'IssueDetailContainer' test warnings
wadethestealth Oct 16, 2019
ecac2bd
fix 'IssueishSearchContainer' test warnings
wadethestealth Oct 16, 2019
ad45fe4
fix 'ReviewsContainer' test warnings
wadethestealth Oct 16, 2019
3e7fd43
fix 'ChangedFileController' test warnings
wadethestealth Oct 16, 2019
719effc
Merge remote-tracking branch 'upstream/master' into remote-management
wadethestealth Oct 16, 2019
924807c
fix 'CommentDecorationsController' test warnings
wadethestealth Oct 16, 2019
7a9d05c
fix 'CommentDecorationsContainer' test warnings
wadethestealth Oct 16, 2019
0162fc9
correctly consume Relay Query error on 'IssueishSearchContainer' test
wadethestealth Oct 16, 2019
004d5b4
fix async test error
wadethestealth Oct 17, 2019
32f0360
update test props for github tab view
wadethestealth Oct 17, 2019
52ef584
remove active pane context guessing
wadethestealth Oct 17, 2019
9cbd126
LINT MEH BABHEH :baby:
wadethestealth Oct 17, 2019
413cd2d
Merge remote-tracking branch 'upstream/master' into project-management
wadethestealth Oct 17, 2019
98adefc
update to not prefer absent context from preferred/saved state work dir
wadethestealth Oct 17, 2019
083f650
update some test for github-package
wadethestealth Oct 17, 2019
5a0fd75
remove unapplicable tests
wadethestealth Oct 17, 2019
35e0df5
remove unnecessary test case step
wadethestealth Oct 17, 2019
e7f5ec8
simplify rendering header
wadethestealth Oct 17, 2019
d64c079
clean up header render
wadethestealth Oct 17, 2019
e1e7795
undo test nesting
wadethestealth Oct 18, 2019
63cd27e
remove only
wadethestealth Oct 18, 2019
61cdf7c
Merge branch 'master' into project-management
wadethestealth Oct 22, 2019
571a095
revert globals
wadethestealth Oct 22, 2019
73de350
replace context with describe
wadethestealth Oct 22, 2019
52c70d9
update error catching
wadethestealth Oct 22, 2019
21e025b
remove only
wadethestealth Oct 22, 2019
8d6870b
remove unapplicable
wadethestealth Oct 22, 2019
558c9a0
remove active pane listener
wadethestealth Oct 23, 2019
f03e06a
update all tests
wadethestealth Oct 23, 2019
34adef2
lints
wadethestealth Oct 23, 2019
72eb56c
lints
wadethestealth Oct 23, 2019
aa2edc9
add test cases
wadethestealth Oct 23, 2019
265072c
add integration tests
wadethestealth Oct 23, 2019
40df468
lint
wadethestealth Oct 23, 2019
f8ae762
Merge branch 'project-management' into remote-management
wadethestealth Oct 24, 2019
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
63 changes: 63 additions & 0 deletions docs/feature-requests/007-remote-management.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
<!---
For community contributors -- Please fill out Part 1 of the following template. This will help our team collaborate with you and give us an opportunity to provide valuable feedback that could inform your development process. Sections in Part 2 are not mandatory to get the conversation started, but will help our team understand your vision better and allow us to give better feedback.
--->

**_Part 1 - Required information_**

# Remote Management

## :memo: Summary

This feature should allow users to manage git remotes within Atom.

## :checkered_flag: Motivation

For full support, the minimum features should be as follows.
- Be able to add or delete git remotes. (High Priority)
- Be able to choose a remote to view GitHub PR's from. (High Priority)

This supports many use cases where people view, commit, pull, or push across multiple forks. It also supports viewing all pull request reviews where their are multiple remotes. Currently, it is only support to see PR's from one remote.

The expected outcome is to move a lot of remote management from the terminal to Atom.

## 🤯 Explanation

Explain the proposal as if it was already implemented in the GitHub package and you were describing it to an Atom user. That generally means:

- Introducing new named concepts.
- Explaining the feature largely in terms of examples.
- Explaining any changes to existing workflows.
- Design mock-ups or diagrams depicting any new UI that will be introduced.


**_Part 2 - Additional information_**

## :anchor: Drawbacks

Why should we *not* do this?

## :thinking: Rationale and alternatives

- Why is this approach the best in the space of possible approaches?
- What other approaches have been considered and what is the rationale for not choosing them?
- What is the impact of not doing this?

## :question: Unresolved questions

- What unresolved questions do you expect to resolve through the Feature Request process before this gets merged?
- What unresolved questions do you expect to resolve through the implementation of this feature before it is released in a new version of the package?

## :warning: Out of Scope

- What related issues do you consider out of scope for this Feature Request that could be addressed in the future independently of the solution that comes out of this Feature Request?

## :construction: Implementation phases

- Can this functionality be introduced in multiple, distinct, self-contained pull requests?
- A specification for when the feature is considered "done."

## :white_check_mark: Feature description for Atom release blog post

- When this feature is shipped, what would we like to say or show in our Atom release blog post (example: http://blog.atom.io/2018/07/31/atom-1-29.html)
- Feel free to drop ideas and gifs here during development
- Once development is complete, write a blurb for the release coordinator to copy/paste into the Atom release blog
2 changes: 1 addition & 1 deletion lib/atom/marker.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ export const DecorableContext = React.createContext();
class BareMarker extends React.Component {
static propTypes = {
...markerProps,
id: PropTypes.string,
id: PropTypes.number,
bufferRange: RangePropType,
markableHolder: RefHolderPropType,
children: PropTypes.node,
Expand Down
102 changes: 102 additions & 0 deletions lib/containers/__generated__/githubHeaderContainerQuery.graphql.js

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

3 changes: 0 additions & 3 deletions lib/containers/current-pull-request-container.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,6 @@ export default class CurrentPullRequestContainer extends React.Component {
aheadCount: PropTypes.number,
pushInProgress: PropTypes.bool.isRequired,

workspace: PropTypes.object.isRequired,

// Actions
onOpenIssueish: PropTypes.func.isRequired,
onOpenReviews: PropTypes.func.isRequired,
Expand Down Expand Up @@ -164,7 +162,6 @@ export default class CurrentPullRequestContainer extends React.Component {
total={associatedPullRequests.totalCount}
results={associatedPullRequests.nodes}
isLoading={false}
workspace={this.props.workspace}
endpoint={this.props.endpoint}
resultFilter={issueish => issueish.getHeadRepositoryID() === this.props.repository.id}
{...this.controllerProps()}
Expand Down
104 changes: 104 additions & 0 deletions lib/containers/github-header-container.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,104 @@
import React from 'react';
import PropTypes from 'prop-types';
import {QueryRenderer, graphql} from 'react-relay';

import {incrementCounter} from '../reporter-proxy';
import {EndpointPropType, RemoteSetPropType} from '../prop-types';
import RelayNetworkLayerManager from '../relay-network-layer-manager';
import {UNAUTHENTICATED, INSUFFICIENT} from '../shared/keytar-strategy';
import ObserveModel from '../views/observe-model';
import QueryErrorView from '../views/query-error-view';
import GithubHeaderView from '../views/github-header-view';

export default class GithubHeaderContainer extends React.Component {
static propTypes = {
// Connection
loginModel: PropTypes.object.isRequired,
endpoint: EndpointPropType.isRequired,

avatarUrl: PropTypes.string,
remotes: RemoteSetPropType.isRequired,
currentRemoteName: PropTypes.string.isRequired,

handleRemoteSelect: PropTypes.func.isRequired,
}

fetchToken = loginModel => {
return loginModel.getToken(this.props.endpoint.getLoginAccount());
}

render() {
return (
<ObserveModel model={this.props.loginModel} fetchData={this.fetchToken}>
{this.renderWithToken}
</ObserveModel>
);
}

renderWithToken = token => {
if (token === null) {
return this.renderWithBlankAvatar();
}

if (token instanceof Error) {
return (
<QueryErrorView
error={token}
retry={this.handleTokenRetry}
login={this.handleLogin}
logout={this.handleLogout}
/>
);
}

if (token === UNAUTHENTICATED || token === INSUFFICIENT) {
return this.renderWithBlankAvatar();
}

const environment = RelayNetworkLayerManager.getEnvironmentForHost(this.props.endpoint, token);
const query = graphql`
query githubHeaderContainerQuery {
viewer {
avatarUrl
}
}
`;

return (
<QueryRenderer
environment={environment}
variables={{}}
query={query}
render={result => this.renderWithResult(result, token)}
/>
);
}

renderWithResult({error, props, retry}, token) {
const avatarUrl = !error && props !== null ? props.viewer.avatarUrl : null;

return (
<GithubHeaderView
avatarUrl={avatarUrl}
remotes={this.props.remotes}
currentRemoteName={this.props.currentRemoteName}

handleRemoteSelect={e => this.props.handleRemoteSelect(e, this.props.remotes.withName(e.target.value))}
/>
);
}

renderWithBlankAvatar = () => this.renderWithResult({props: null});

handleLogin = token => {
incrementCounter('github-login');
this.props.loginModel.setToken(this.props.endpoint.getLoginAccount(), token);
}

handleLogout = () => {
incrementCounter('github-logout');
this.props.loginModel.removeToken(this.props.endpoint.getLoginAccount());
}

handleTokenRetry = () => this.props.loginModel.didUpdate();
}
5 changes: 4 additions & 1 deletion lib/controllers/editor-comment-decorations-controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,10 @@ export default class EditorCommentDecorationsController extends React.Component
workspace: PropTypes.object.isRequired,
editor: PropTypes.object.isRequired,
threadsForPath: PropTypes.arrayOf(PropTypes.shape({
rootCommentID: PropTypes.string.isRequired,
rootCommentID: PropTypes.oneOfType([
PropTypes.string,
PropTypes.number,
]).isRequired,
position: PropTypes.number,
threadID: PropTypes.string.isRequired,
})).isRequired,
Expand Down
2 changes: 2 additions & 0 deletions lib/controllers/git-tab-controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ export default class GitTabController extends React.Component {
openFiles: PropTypes.func.isRequired,
openInitializeDialog: PropTypes.func.isRequired,
controllerRef: RefHolderPropType,
changeProjectWorkingDirectory: PropTypes.func.isRequired,
};

constructor(props, context) {
Expand Down Expand Up @@ -119,6 +120,7 @@ export default class GitTabController extends React.Component {
openFiles={this.props.openFiles}
discardWorkDirChangesForPaths={this.props.discardWorkDirChangesForPaths}
undoLastDiscard={this.props.undoLastDiscard}
changeProjectWorkingDirectory={this.props.changeProjectWorkingDirectory}

attemptFileStageOperation={this.attemptFileStageOperation}
attemptStageAllOperation={this.attemptStageAllOperation}
Expand Down
11 changes: 8 additions & 3 deletions lib/controllers/github-tab-controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import GitHubTabView from '../views/github-tab-view';

export default class GitHubTabController extends React.Component {
static propTypes = {
project: PropTypes.object.isRequired,
workspace: PropTypes.object.isRequired,
repository: PropTypes.object.isRequired,
remoteOperationObserver: OperationStateObserverPropType.isRequired,
Expand All @@ -21,22 +22,25 @@ export default class GitHubTabController extends React.Component {
aheadCount: PropTypes.number,
pushInProgress: PropTypes.bool.isRequired,
isLoading: PropTypes.bool.isRequired,

changeProjectWorkingDirectory: PropTypes.func.isRequired,
}

render() {
const gitHubRemotes = this.props.allRemotes.filter(remote => remote.isGithubRepo());
const currentBranch = this.props.branches.getHeadBranch();

let currentRemote = gitHubRemotes.withName(this.props.selectedRemoteName);
let manyRemotesAvailable = false;
let isSelectingRemote = false;
if (!currentRemote.isPresent() && gitHubRemotes.size() === 1) {
currentRemote = Array.from(gitHubRemotes)[0];
} else if (!currentRemote.isPresent() && gitHubRemotes.size() > 1) {
manyRemotesAvailable = true;
isSelectingRemote = true;
}

return (
<GitHubTabView
project={this.props.project}
workspace={this.props.workspace}
remoteOperationObserver={this.props.remoteOperationObserver}
loginModel={this.props.loginModel}
Expand All @@ -47,13 +51,14 @@ export default class GitHubTabController extends React.Component {
currentBranch={currentBranch}
remotes={gitHubRemotes}
currentRemote={currentRemote}
manyRemotesAvailable={manyRemotesAvailable}
isSelectingRemote={isSelectingRemote}
aheadCount={this.props.aheadCount}
pushInProgress={this.props.pushInProgress}
isLoading={this.props.isLoading}

handlePushBranch={this.handlePushBranch}
handleRemoteSelect={this.handleRemoteSelect}
changeProjectWorkingDirectory={this.props.changeProjectWorkingDirectory}
/>
);
}
Expand Down
1 change: 0 additions & 1 deletion lib/controllers/issueish-list-controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,6 @@ export class BareIssueishListController extends React.Component {
onOpenMore: PropTypes.func,

emptyComponent: PropTypes.func,
workspace: PropTypes.object,
endpoint: EndpointPropType,
needReviewsButton: PropTypes.bool,
};
Expand Down
Loading