Skip to content
This repository was archived by the owner on Jun 21, 2023. It is now read-only.

Refactored Clone Dialog #1787

Merged
merged 22 commits into from
Sep 11, 2018
Merged

Refactored Clone Dialog #1787

merged 22 commits into from
Sep 11, 2018

Conversation

grokys
Copy link
Contributor

@grokys grokys commented Jul 19, 2018

Refactored the clone dialog, basing it initially on the clone dialog from desktop:

Features

  • Now uses GraphQL to load the list of repositories. This improves the load time of the list.
  • Separate GitHub and Enterprise tabs
  • A new "Clone from URL" tab

Screenshots

Particularly the URL clone view needs some input from @donokuda.

image

image

Scopes

GraphQL requires the read:org scope the access the user's repositories. This means that the user will have to log out and back in again to use the clone dialog. The following message will be shown in this case (needs input from @donokuda):

image

Caveats

Depends on #1761

Closes #1757

- Uses GraphQL
- Has a page for cloning from URL
@donokuda donokuda self-assigned this Jul 19, 2018
Previously were just returning repositories that belong to orgs. Now return the user's owned repositories as well, and group by owner in the list.

Currently returning only first 100 org repositories because of octokit/octokit.graphql.net#132 .
@grokys grokys added the WIP label Jul 20, 2018
@meaghanlewis meaghanlewis added this to the 2.5.5 milestone Jul 30, 2018
@donokuda
Copy link
Contributor

You currently need to log out and back in because the GraphQL query needs the read:org scope which your previous login won't have. Need to implement a "You need to log out and back in again" flow in the dialog for this.

In case it hasn't been considered yet, a potentially "quick & dirty" flow for this is to pop up a modal dialog on top of the clone dialog that give the individual the option to log out.

I'd imagine the flow to break down like this:

  1. I click on "Clone" from the GitHub section of Team Explorer's connect page
  2. A dialog appears explaining that I need to log out in order to proceed with two options: [Cancel] [Log out]
  3. I click "Log out," the extension attempts to log me out.
  • On success ✅: the login modal appears and I step through that flow. (Ideally: After logging in, I'm presented with the clone dialog since that's the action I've been meaning to do in the first place.)
  • On failure ❌: Another dialog appears with the error and two options: [Cancel] [Try again]
    • Selecting "Try again" attempts logging out again.

@meaghanlewis meaghanlewis modified the milestones: 2.5.5, 2.5.6 Aug 13, 2018
@meaghanlewis
Copy link
Contributor

This looks great to me @grokys !

One thing that I ran into was when I wanted to enter the username and repo to clone - ex github/quality. I wasn't signed into my GitHub account at the time - only GitHub Enterprise. This login dialog appeared:

screen shot 2018-09-06 at 2 29 11 pm

I authenticated with it, but it didn't actually sign me in and I got an error like this Error encountered while cloning the remote repository: Git failed with a fatal error. unable to access 'https://github.com/github/quality/': The requested URL returned error: 403.

Is it possible to show our Sign in dialog here instead to avoid this from possibly confusing users?

@grokys
Copy link
Contributor Author

grokys commented Sep 10, 2018

@meaghanlewis hmm yes, I'm not quite sure how to deal with that. If the repository is publicly visible then this clone should actually work. We could make a check to see if we have a connection to the server that the clone is being requested from, but again, the clone may actually work.

I notice desktop does the same thing in this situation and shows a login dialog. I'm tempted to say that this is expected behavior.

Copy link
Collaborator

@jcansdale jcansdale left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry, wrong PR. 😊

Copy link
Collaborator

@jcansdale jcansdale left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changing Approve to Comment.

@meaghanlewis
Copy link
Contributor

hey @grokys im okay to leave the behavior the same when trying to clone a private repo while signed out of a GitHub account. This might just be an edge case and there is a workaround anyway to sign into the account first and then clone.

@meaghanlewis
Copy link
Contributor

One more question - could you add a message for when someone tries to clone a repo they already have?

Currently, the clone button is disabled when trying to clone an existing repo but it might not be clear why.
screen shot 2018-09-10 at 8 01 53 am

In the old (current) clone dialog we at least showed an icon in the path to indicate it can't be cloned to that location.
screen shot 2018-09-10 at 8 10 06 am

And in desktop, they have an explicit message saying the destination already exists. Could we also show a message similar to this?
screen shot 2018-09-10 at 8 01 39 am

To make error messages appear in clone dialog.
@grokys grokys changed the title WIP: Refactored Clone Dialog Refactored Clone Dialog Sep 11, 2018
@grokys grokys merged commit 0e64838 into master Sep 11, 2018
@meaghanlewis meaghanlewis removed the WIP label Sep 26, 2018
grokys added a commit that referenced this pull request Jan 10, 2019
#1787 refactored `InfoPanel` but didn't update `GitHubPaneView` with its new behavior. So:

- Don't initialy set `infoPanel.Visibility` to `Collapsed`: `InfoPanel` will handle this itself
- Set `ShowCloseButton` to show the `x` button to close the error

Fixes #2172
Fixes #2058
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Using a slash in the clone dialog
4 participants