This repository was archived by the owner on Dec 15, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 407
WIP: Remote Management #2299
Closed
Closed
WIP: Remote Management #2299
Changes from all commits
Commits
Show all changes
68 commits
Select commit
Hold shift + click to select a range
d426011
FR template beginnings
wadethestealth d57cf00
rename variable
wadethestealth bd5c9ee
create and pass exit remote function
wadethestealth 5ae8141
pass down the exit function
wadethestealth 0404281
catch invalid endpoint error when exiting
wadethestealth 40b6713
Add a temp visual header with working functionality
wadethestealth 15318e1
fix lints
wadethestealth 258d409
Add Git + GitHub context headers
simurai ac2bc16
undo my ui visuals
wadethestealth 39e6355
create remote selector
wadethestealth 127c968
use remote selector
wadethestealth 8b5adca
finish undo of temp UI
wadethestealth 108c577
remove proto header from git tab
wadethestealth 6c08bb2
fix lint
wadethestealth 5174e88
remove no longer needed error catch
wadethestealth 7768c40
add beginnings of avatar components and more ecapsulation
wadethestealth 77c792a
fix lint
wadethestealth 39a47bb
properly handling loading dom
wadethestealth 883f3a3
fix typo on remote selector causing it to break
wadethestealth cfee43f
Add Git + GitHub context headers
simurai 8d867b0
add project repo change ability
wadethestealth 73b1ff8
update project context ui for github tab
wadethestealth d4ce922
rename to header-view
wadethestealth 1f3cfc6
add header view to git tab
wadethestealth 0ceb2ff
remove avatar and refresh button for mvp
wadethestealth 1d8cef8
fix lint
wadethestealth 5e3414a
remove padding
wadethestealth 691ca1d
fix 'CurrentPullRequestContainer' test warnings
wadethestealth 0dc2505
fix 'GitTabContainer' test warnings
wadethestealth 61a39e3
fix 'GitHubTabContainer' test warnings
wadethestealth c22dc33
create generic Error Boundary
wadethestealth 59db453
fix 'Decoration' test warnings
wadethestealth 1323ea4
fix 'Marker' test warnings
wadethestealth f8df70e
fix 'IssueDetailContainer' test warnings
wadethestealth ecac2bd
fix 'IssueishSearchContainer' test warnings
wadethestealth ad45fe4
fix 'ReviewsContainer' test warnings
wadethestealth 3e7fd43
fix 'ChangedFileController' test warnings
wadethestealth 719effc
Merge remote-tracking branch 'upstream/master' into remote-management
wadethestealth 924807c
fix 'CommentDecorationsController' test warnings
wadethestealth 7a9d05c
fix 'CommentDecorationsContainer' test warnings
wadethestealth 0162fc9
correctly consume Relay Query error on 'IssueishSearchContainer' test
wadethestealth 004d5b4
fix async test error
wadethestealth 32f0360
update test props for github tab view
wadethestealth 52ef584
remove active pane context guessing
wadethestealth 9cbd126
LINT MEH BABHEH :baby:
wadethestealth 413cd2d
Merge remote-tracking branch 'upstream/master' into project-management
wadethestealth 98adefc
update to not prefer absent context from preferred/saved state work dir
wadethestealth 083f650
update some test for github-package
wadethestealth 5a0fd75
remove unapplicable tests
wadethestealth 35e0df5
remove unnecessary test case step
wadethestealth e7f5ec8
simplify rendering header
wadethestealth d64c079
clean up header render
wadethestealth e1e7795
undo test nesting
wadethestealth 63cd27e
remove only
wadethestealth 61cdf7c
Merge branch 'master' into project-management
wadethestealth 571a095
revert globals
wadethestealth 73de350
replace context with describe
wadethestealth 52c70d9
update error catching
wadethestealth 21e025b
remove only
wadethestealth 8d6870b
remove unapplicable
wadethestealth 558c9a0
remove active pane listener
wadethestealth f03e06a
update all tests
wadethestealth 34adef2
lints
wadethestealth 72eb56c
lints
wadethestealth aa2edc9
add test cases
wadethestealth 265072c
add integration tests
wadethestealth 40df468
lint
wadethestealth f8ae762
Merge branch 'project-management' into remote-management
wadethestealth File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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,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 |
This file contains hidden or 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
102 changes: 102 additions & 0 deletions
102
lib/containers/__generated__/githubHeaderContainerQuery.graphql.js
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains hidden or 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 hidden or 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,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(); | ||
| } | ||
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.