Merge branch 'stable-2.9'
* stable-2.9: Copy label approvals when cherry-picking change to same branch Remove unused "Change Username" string constant Require the user to confirm setting the username Change-Id: I650481770d95f06680499947834f01beaca08cff
This commit is contained in:
@@ -67,7 +67,8 @@ public interface AccountConstants extends Constants {
|
|||||||
String userName();
|
String userName();
|
||||||
String password();
|
String password();
|
||||||
String buttonSetUserName();
|
String buttonSetUserName();
|
||||||
String buttonChangeUserName();
|
String confirmSetUserNameTitle();
|
||||||
|
String confirmSetUserName();
|
||||||
String buttonClearPassword();
|
String buttonClearPassword();
|
||||||
String buttonGeneratePassword();
|
String buttonGeneratePassword();
|
||||||
String linkObtainPassword();
|
String linkObtainPassword();
|
||||||
|
|||||||
@@ -49,7 +49,8 @@ buttonAddSshKey = Add
|
|||||||
userName = Username
|
userName = Username
|
||||||
password = Password
|
password = Password
|
||||||
buttonSetUserName = Select Username
|
buttonSetUserName = Select Username
|
||||||
buttonChangeUserName = Change Username
|
confirmSetUserNameTitle = Confirm Setting the Username
|
||||||
|
confirmSetUserName Setting the Username is permanent. Are you sure?
|
||||||
buttonClearPassword = Clear Password
|
buttonClearPassword = Clear Password
|
||||||
buttonGeneratePassword = Generate Password
|
buttonGeneratePassword = Generate Password
|
||||||
linkObtainPassword = Obtain Password
|
linkObtainPassword = Obtain Password
|
||||||
|
|||||||
@@ -14,6 +14,8 @@
|
|||||||
|
|
||||||
package com.google.gerrit.client.account;
|
package com.google.gerrit.client.account;
|
||||||
|
|
||||||
|
import com.google.gerrit.client.ConfirmationCallback;
|
||||||
|
import com.google.gerrit.client.ConfirmationDialog;
|
||||||
import com.google.gerrit.client.ErrorDialog;
|
import com.google.gerrit.client.ErrorDialog;
|
||||||
import com.google.gerrit.client.Gerrit;
|
import com.google.gerrit.client.Gerrit;
|
||||||
import com.google.gerrit.client.rpc.GerritCallback;
|
import com.google.gerrit.client.rpc.GerritCallback;
|
||||||
@@ -31,6 +33,7 @@ import com.google.gwt.user.client.ui.FlowPanel;
|
|||||||
import com.google.gwt.user.client.ui.TextBox;
|
import com.google.gwt.user.client.ui.TextBox;
|
||||||
import com.google.gwtexpui.clippy.client.CopyableLabel;
|
import com.google.gwtexpui.clippy.client.CopyableLabel;
|
||||||
import com.google.gwtexpui.globalkey.client.NpTextBox;
|
import com.google.gwtexpui.globalkey.client.NpTextBox;
|
||||||
|
import com.google.gwtexpui.safehtml.client.SafeHtmlBuilder;
|
||||||
import com.google.gwtjsonrpc.common.VoidResult;
|
import com.google.gwtjsonrpc.common.VoidResult;
|
||||||
|
|
||||||
class UsernameField extends Composite {
|
class UsernameField extends Composite {
|
||||||
@@ -59,7 +62,7 @@ class UsernameField extends Composite {
|
|||||||
@Override
|
@Override
|
||||||
public void onKeyPress(KeyPressEvent event) {
|
public void onKeyPress(KeyPressEvent event) {
|
||||||
if (event.getNativeEvent().getKeyCode() == KeyCodes.KEY_ENTER) {
|
if (event.getNativeEvent().getKeyCode() == KeyCodes.KEY_ENTER) {
|
||||||
doSetUserName();
|
confirmSetUserName();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
@@ -70,7 +73,7 @@ class UsernameField extends Composite {
|
|||||||
setUserName.addClickHandler(new ClickHandler() {
|
setUserName.addClickHandler(new ClickHandler() {
|
||||||
@Override
|
@Override
|
||||||
public void onClick(final ClickEvent event) {
|
public void onClick(final ClickEvent event) {
|
||||||
doSetUserName();
|
confirmSetUserName();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
new OnEditEnabler(setUserName, userNameTxt);
|
new OnEditEnabler(setUserName, userNameTxt);
|
||||||
@@ -86,6 +89,18 @@ class UsernameField extends Composite {
|
|||||||
return Gerrit.getConfig().canEdit(Account.FieldName.USER_NAME);
|
return Gerrit.getConfig().canEdit(Account.FieldName.USER_NAME);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void confirmSetUserName() {
|
||||||
|
new ConfirmationDialog(
|
||||||
|
Util.C.confirmSetUserNameTitle(),
|
||||||
|
new SafeHtmlBuilder().append(Util.C.confirmSetUserName()),
|
||||||
|
new ConfirmationCallback() {
|
||||||
|
@Override
|
||||||
|
public void onOk() {
|
||||||
|
doSetUserName();
|
||||||
|
}
|
||||||
|
}).center();
|
||||||
|
}
|
||||||
|
|
||||||
private void doSetUserName() {
|
private void doSetUserName() {
|
||||||
if (!canEditUserName()) {
|
if (!canEditUserName()) {
|
||||||
return;
|
return;
|
||||||
|
|||||||
@@ -206,6 +206,7 @@ public class CherryPickChange {
|
|||||||
.setMessage("Uploaded patch set " + newPatchSetId.get() + ".")
|
.setMessage("Uploaded patch set " + newPatchSetId.get() + ".")
|
||||||
.setDraft(current.isDraft())
|
.setDraft(current.isDraft())
|
||||||
.setUploader(uploader.getAccountId())
|
.setUploader(uploader.getAccountId())
|
||||||
|
.setCopyLabels(true)
|
||||||
.insert();
|
.insert();
|
||||||
return change.getId();
|
return change.getId();
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user