Add help text to dialog box that explains how to create an SSH key
Change-Id: I4ac2aed5eef46cc1477b08ea17ed06ca0c89b03c
Signed-off-by: Edwin Kempin <edwin.kempin@sap.com>
diff --git a/src/main/java/com/googlesource/gerrit/plugins/serviceuser/client/CreateServiceUserForm.java b/src/main/java/com/googlesource/gerrit/plugins/serviceuser/client/CreateServiceUserForm.java
index 8125819..8f5f4a0 100644
--- a/src/main/java/com/googlesource/gerrit/plugins/serviceuser/client/CreateServiceUserForm.java
+++ b/src/main/java/com/googlesource/gerrit/plugins/serviceuser/client/CreateServiceUserForm.java
@@ -27,6 +27,8 @@
import com.google.gwt.user.client.rpc.AsyncCallback;
import com.google.gwt.user.client.ui.Button;
import com.google.gwt.user.client.ui.DialogBox;
+import com.google.gwt.user.client.ui.DisclosurePanel;
+import com.google.gwt.user.client.ui.HTML;
import com.google.gwt.user.client.ui.HorizontalPanel;
import com.google.gwt.user.client.ui.Label;
import com.google.gwt.user.client.ui.Panel;
@@ -82,6 +84,27 @@
Panel sshKeyPanel = new VerticalPanel();
sshKeyPanel.add(new Label("Public SSH Key:"));
+ DisclosurePanel dp = new DisclosurePanel("How to generate an SSH Key");
+ StringBuilder b = new StringBuilder();
+ b.append("<ol>")
+ .append("<li>From the Terminal or Git Bash, run <em>ssh-keygen</em></li>")
+ .append("<li>")
+ .append("Enter a path for the key, e.g. <em>id_rsa</em>. If you are generating the key<br />")
+ .append("on your local system take care to not overwrite your own SSH key.")
+ .append("</li>")
+ .append("<li>")
+ .append("Enter a passphrase only if the service where you intend to use this<br />")
+ .append("service user is able to deal with passphrases, otherwise leave it blank.<br />")
+ .append("Remember this passphrase, as you will need it to unlock the key.")
+ .append("</li>")
+ .append("<li>")
+ .append("Open <em>id_rsa.pub</em> and copy & paste the contents into the box below.<br />")
+ .append("Note that <em>id_rsa.pub</em> is your public key and can be shared,<br />")
+ .append("while <em>id_rsa</em> is your private key and should be kept secret.")
+ .append("</li>")
+ .append("</ol>");
+ dp.add(new HTML(b.toString()));
+ sshKeyPanel.add(dp);
sshKeyTxt = new TextArea();
sshKeyTxt.addKeyPressHandler(new KeyPressHandler() {
@Override