InlineEdit: Rename 'Edit' button in comment box to 'Fix'
Naming the button to switch to the edit screen 'Edit' was a bad choice since for draft comments there was already an 'Edit' button to edit the draft comment. Having two 'Edit' buttons with different actions was confusing. In addition the 'Fix' button is moved to the end of the line to keep the focus on the 'Reply' button, since the main purpose of the diff screen is reviewing changes and commenting on them. Change-Id: I09b928a46d5f4cfeb2dc715fe13fadb755801050
This commit is contained in:

committed by
Edwin Kempin

parent
ed819f30bc
commit
f549aa70c1
@@ -59,9 +59,9 @@ class PublishedBox extends CommentBox {
|
||||
@UiField Element date;
|
||||
@UiField Element message;
|
||||
@UiField Element buttons;
|
||||
@UiField Button edit;
|
||||
@UiField Button reply;
|
||||
@UiField Button done;
|
||||
@UiField Button fix;
|
||||
|
||||
@UiField(provided = true)
|
||||
AvatarImage avatar;
|
||||
@@ -156,17 +156,6 @@ class PublishedBox extends CommentBox {
|
||||
}
|
||||
}
|
||||
|
||||
@UiHandler("edit")
|
||||
void onEdit(ClickEvent e) {
|
||||
e.stopPropagation();
|
||||
String t = Dispatcher.toEditScreen(psId, comment.path(), comment.line());
|
||||
if (!Gerrit.isSignedIn()) {
|
||||
Gerrit.doSignIn(t);
|
||||
} else {
|
||||
Gerrit.display(t);
|
||||
}
|
||||
}
|
||||
|
||||
@UiHandler("reply")
|
||||
void onReply(ClickEvent e) {
|
||||
e.stopPropagation();
|
||||
@@ -197,6 +186,17 @@ class PublishedBox extends CommentBox {
|
||||
}
|
||||
}
|
||||
|
||||
@UiHandler("fix")
|
||||
void onFix(ClickEvent e) {
|
||||
e.stopPropagation();
|
||||
String t = Dispatcher.toEditScreen(psId, comment.path(), comment.line());
|
||||
if (!Gerrit.isSignedIn()) {
|
||||
Gerrit.doSignIn(t);
|
||||
} else {
|
||||
Gerrit.display(t);
|
||||
}
|
||||
}
|
||||
|
||||
private static String authorName(CommentInfo info) {
|
||||
if (info.author() != null) {
|
||||
if (info.author().name() != null) {
|
||||
|
@@ -56,11 +56,6 @@ limitations under the License.
|
||||
<div ui:field='message' class='{res.style.message}'
|
||||
aria-hidden='true' style='display: NONE'/>
|
||||
<div ui:field='buttons' aria-hidden='true' style='display: NONE'>
|
||||
<g:Button ui:field='edit' styleName=''
|
||||
title='Address this comment in the inline editor'>
|
||||
<ui:attribute name='title'/>
|
||||
<div><ui:msg>Edit</ui:msg></div>
|
||||
</g:Button>
|
||||
<g:Button ui:field='reply' styleName=''
|
||||
title='Reply to this comment'>
|
||||
<ui:attribute name='title'/>
|
||||
@@ -71,6 +66,11 @@ limitations under the License.
|
||||
<ui:attribute name='title'/>
|
||||
<div><ui:msg>Done</ui:msg></div>
|
||||
</g:Button>
|
||||
<g:Button ui:field='fix' styleName=''
|
||||
title='Fix this comment in the inline editor'>
|
||||
<ui:attribute name='title'/>
|
||||
<div><ui:msg>Fix</ui:msg></div>
|
||||
</g:Button>
|
||||
</div>
|
||||
</div>
|
||||
</g:HTMLPanel>
|
||||
|
Reference in New Issue
Block a user