Merge "Move 'Delete Change' button in GWT to better position"
This commit is contained in:
commit
2552728e92
@ -27,6 +27,7 @@ import com.google.gwt.event.dom.client.ClickEvent;
|
||||
import com.google.gwt.uibinder.client.UiBinder;
|
||||
import com.google.gwt.uibinder.client.UiField;
|
||||
import com.google.gwt.uibinder.client.UiHandler;
|
||||
import com.google.gwt.user.client.Window;
|
||||
import com.google.gwt.user.client.ui.Button;
|
||||
import com.google.gwt.user.client.ui.Composite;
|
||||
import com.google.gwt.user.client.ui.FlowPanel;
|
||||
@ -62,6 +63,8 @@ class Actions extends Composite {
|
||||
@UiField Button abandon;
|
||||
private AbandonAction abandonAction;
|
||||
|
||||
@UiField Button deleteChange;
|
||||
|
||||
@UiField Button restore;
|
||||
private RestoreAction restoreAction;
|
||||
|
||||
@ -115,6 +118,7 @@ class Actions extends Composite {
|
||||
|
||||
if (hasUser) {
|
||||
a2b(actions, "abandon", abandon);
|
||||
a2b(actions, "/", deleteChange);
|
||||
a2b(actions, "restore", restore);
|
||||
a2b(actions, "revert", revert);
|
||||
a2b(actions, "followup", followUp);
|
||||
@ -181,6 +185,13 @@ class Actions extends Composite {
|
||||
abandonAction.show();
|
||||
}
|
||||
|
||||
@UiHandler("deleteChange")
|
||||
void onDeleteChange(@SuppressWarnings("unused") ClickEvent e) {
|
||||
if (Window.confirm(Resources.C.deleteChange())) {
|
||||
ChangeActions.delete(changeId, deleteChange);
|
||||
}
|
||||
}
|
||||
|
||||
@UiHandler("restore")
|
||||
void onRestore(@SuppressWarnings("unused") ClickEvent e) {
|
||||
if (restoreAction == null) {
|
||||
|
@ -72,6 +72,9 @@ limitations under the License.
|
||||
<g:Button ui:field='abandon' styleName='' visible='false'>
|
||||
<div><ui:msg>Abandon</ui:msg></div>
|
||||
</g:Button>
|
||||
<g:Button ui:field='deleteChange' styleName='' visible='false'>
|
||||
<div><ui:msg>Delete Change</ui:msg></div>
|
||||
</g:Button>
|
||||
<g:Button ui:field='restore' styleName='' visible='false'>
|
||||
<div><ui:msg>Restore</ui:msg></div>
|
||||
</g:Button>
|
||||
|
@ -23,7 +23,7 @@ import com.google.gwt.core.client.JavaScriptObject;
|
||||
import com.google.gwt.user.client.rpc.AsyncCallback;
|
||||
import com.google.gwt.user.client.ui.Button;
|
||||
|
||||
public class DraftActions {
|
||||
public class ChangeActions {
|
||||
|
||||
static void publish(Change.Id id, String revision, Button... draftButtons) {
|
||||
ChangeApi.publish(id.get(), revision, cs(id, draftButtons));
|
@ -230,7 +230,6 @@ public class ChangeScreen extends Screen {
|
||||
@UiField Button rebaseEdit;
|
||||
@UiField Button deleteEdit;
|
||||
@UiField Button publish;
|
||||
@UiField Button deleteChange;
|
||||
@UiField Button deleteRevision;
|
||||
@UiField Button openAll;
|
||||
@UiField Button editMode;
|
||||
@ -521,10 +520,6 @@ public class ChangeScreen extends Screen {
|
||||
private void initChangeAction(ChangeInfo info) {
|
||||
NativeMap<ActionInfo> actions = info.hasActions() ? info.actions() : NativeMap.create();
|
||||
actions.copyKeysIntoChildren("id");
|
||||
if (actions.containsKey("/")) {
|
||||
deleteChange.setVisible(true);
|
||||
deleteChange.setTitle(actions.get("/").title());
|
||||
}
|
||||
}
|
||||
|
||||
private void updatePatchSetsTextStyle(boolean isPatchSetCurrent) {
|
||||
@ -673,20 +668,13 @@ public class ChangeScreen extends Screen {
|
||||
|
||||
@UiHandler("publish")
|
||||
void onPublish(@SuppressWarnings("unused") ClickEvent e) {
|
||||
DraftActions.publish(changeId, revision, publish, deleteRevision, deleteChange);
|
||||
ChangeActions.publish(changeId, revision, publish, deleteRevision);
|
||||
}
|
||||
|
||||
@UiHandler("deleteRevision")
|
||||
void onDeleteRevision(@SuppressWarnings("unused") ClickEvent e) {
|
||||
if (Window.confirm(Resources.C.deleteDraftRevision())) {
|
||||
DraftActions.delete(changeId, revision, publish, deleteRevision, deleteChange);
|
||||
}
|
||||
}
|
||||
|
||||
@UiHandler("deleteChange")
|
||||
void onDeleteChange(@SuppressWarnings("unused") ClickEvent e) {
|
||||
if (Window.confirm(Resources.C.deleteChange())) {
|
||||
DraftActions.delete(changeId, publish, deleteRevision, deleteChange);
|
||||
ChangeActions.delete(changeId, revision, publish, deleteRevision);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -410,9 +410,6 @@ limitations under the License.
|
||||
styleName='{style.highlight}' visible='false'>
|
||||
<div><ui:msg>Publish</ui:msg></div>
|
||||
</g:Button>
|
||||
<g:Button ui:field='deleteChange' styleName='' visible='false'>
|
||||
<div><ui:msg>Delete Change</ui:msg></div>
|
||||
</g:Button>
|
||||
<g:Button ui:field='deleteRevision' styleName='' visible='false'>
|
||||
<div><ui:msg>Delete Revision</ui:msg></div>
|
||||
</g:Button>
|
||||
|
Loading…
x
Reference in New Issue
Block a user