Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 365802 - use command parameter slideout to collect repo credentials
Summary: use command parameter slideout to collect repo credentials
Status: RESOLVED FIXED
Alias: None
Product: Orion
Classification: ECD
Component: Git (show other bugs)
Version: 0.3   Edit
Hardware: PC Windows 7
: P3 normal (vote)
Target Milestone: 0.4 M1   Edit
Assignee: Susan McCourt CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-12-06 15:13 EST by Susan McCourt CLA
Modified: 2011-12-06 18:12 EST (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Susan McCourt CLA 2011-12-06 15:13:37 EST
In bug 342739 comment 0 Szymon said...
--------------
My case is:

1) On the Git Remote UI there is the Fetch button in the main toolbar
2) When it is clicked I need to gather credentials (for repos cloned via ssh)

I could open a dialog but regular dialogs look heavy and non-webby. I thought a
dialog or some kind of a pane could slide out from the Fetch button. Then when
credentials are passed, it would slide away. 

I think we could even make this pop-up pane part of the command definition.
----------------
The infrastructure is there, now it's a matter of using the slideout.
Comment 1 Susan McCourt CLA 2011-12-06 15:37:38 EST
This is not something that is straightforward for me to figure out because there are many layers involved (ssh service, dialog happens down in the auth error handler, etc.) and I'm not sure how it's supposed to work.

The basic pattern is as follows (look at the cloneRepository command as it does this very same thing).
1) define the command as having username and ssh password parameters, and more options (which would invoke the dialog for private key, etc.).
2) you can default the username parameter if you already know it
3) when the command is invoked, the slideout would come out prompting for user and ssh password, with a more button that invokes the entire dialog if they need the private key instead
4) the callback gets changed to look for values in the command parameters before deciding to invoke the dialog.  It's also nice if the dialog values are defaulted to anything that was put in the slideout.

The current layering of the code doesn't make it as simple as it was for cloneRepository, so I'll leave this to those that understand the code.

A nice benefit that would come from this is that the parameter remembers the last input value, so until a page reload, you would only have to enter the ssh password once.
Comment 2 Susan McCourt CLA 2011-12-06 18:12:22 EST
fixed in commit 3205b4330f6baecdeb7a5a53c5e0e57290459be7

Once I took the time to figure out what this code was doing, it wasn't too bad.  I changed the code so that the generic fetch/push commands use the parameters and the slideout.  This means that you'll get slideouts on the git log page, and you'll get some tooltip dialogs in the menus on the git clones page.

I did not convert the git status commands because I don't think a behavior besides using the dialogs makes sense at this time.  The slideout is too far up on the page from where you are working.  We can revisit this.

(In reply to comment #1)
> A nice benefit that would come from this is that the parameter remembers the
> last input value, so until a page reload, you would only have to enter the ssh
> password once.

This made me a bit nervous, so I talked to Simon about it, and he didn't have a problem with storing the password in the memory.  But it felt wrong to get that behavior as a side effect of how command parameters work.  I had it working and it was mighty convenient, but in the end, the behavior changed when I fixed bug 364668.  Command parameters are only remembered per invocation/rendering, and since the git page rerenders commands after an operation, the last parameter values are lost.