Merge "Layout commit message on left of ChangeScreen2"
This commit is contained in:
@@ -55,7 +55,6 @@ import com.google.gerrit.reviewdb.client.Project.SubmitType;
|
|||||||
import com.google.gwt.core.client.GWT;
|
import com.google.gwt.core.client.GWT;
|
||||||
import com.google.gwt.core.client.JsArray;
|
import com.google.gwt.core.client.JsArray;
|
||||||
import com.google.gwt.core.client.JsArrayString;
|
import com.google.gwt.core.client.JsArrayString;
|
||||||
import com.google.gwt.dom.client.AnchorElement;
|
|
||||||
import com.google.gwt.dom.client.Element;
|
import com.google.gwt.dom.client.Element;
|
||||||
import com.google.gwt.dom.client.NativeEvent;
|
import com.google.gwt.dom.client.NativeEvent;
|
||||||
import com.google.gwt.event.dom.client.ClickEvent;
|
import com.google.gwt.event.dom.client.ClickEvent;
|
||||||
@@ -70,15 +69,16 @@ import com.google.gwt.uibinder.client.UiHandler;
|
|||||||
import com.google.gwt.user.client.DOM;
|
import com.google.gwt.user.client.DOM;
|
||||||
import com.google.gwt.user.client.EventListener;
|
import com.google.gwt.user.client.EventListener;
|
||||||
import com.google.gwt.user.client.rpc.AsyncCallback;
|
import com.google.gwt.user.client.rpc.AsyncCallback;
|
||||||
|
import com.google.gwt.user.client.ui.Anchor;
|
||||||
import com.google.gwt.user.client.ui.Button;
|
import com.google.gwt.user.client.ui.Button;
|
||||||
import com.google.gwt.user.client.ui.FlowPanel;
|
import com.google.gwt.user.client.ui.FlowPanel;
|
||||||
import com.google.gwt.user.client.ui.HTMLPanel;
|
import com.google.gwt.user.client.ui.HTMLPanel;
|
||||||
import com.google.gwt.user.client.ui.Image;
|
import com.google.gwt.user.client.ui.Image;
|
||||||
import com.google.gwt.user.client.ui.ToggleButton;
|
import com.google.gwt.user.client.ui.ToggleButton;
|
||||||
import com.google.gwtexpui.clippy.client.CopyableLabel;
|
|
||||||
import com.google.gwtexpui.globalkey.client.GlobalKey;
|
import com.google.gwtexpui.globalkey.client.GlobalKey;
|
||||||
import com.google.gwtexpui.globalkey.client.KeyCommand;
|
import com.google.gwtexpui.globalkey.client.KeyCommand;
|
||||||
import com.google.gwtexpui.globalkey.client.KeyCommandSet;
|
import com.google.gwtexpui.globalkey.client.KeyCommandSet;
|
||||||
|
import com.google.gwtexpui.safehtml.client.SafeHtmlBuilder;
|
||||||
import com.google.gwtorm.client.KeyUtil;
|
import com.google.gwtorm.client.KeyUtil;
|
||||||
|
|
||||||
import java.sql.Timestamp;
|
import java.sql.Timestamp;
|
||||||
@@ -128,13 +128,12 @@ public class ChangeScreen2 extends Screen {
|
|||||||
|
|
||||||
@UiField HTMLPanel headerLine;
|
@UiField HTMLPanel headerLine;
|
||||||
@UiField Style style;
|
@UiField Style style;
|
||||||
|
@UiField Element commitSubjectText;
|
||||||
@UiField ToggleButton star;
|
@UiField ToggleButton star;
|
||||||
@UiField Reload reload;
|
@UiField Anchor permalink;
|
||||||
@UiField AnchorElement permalink;
|
|
||||||
|
|
||||||
@UiField Element reviewersText;
|
@UiField Element reviewersText;
|
||||||
@UiField Reviewers reviewers;
|
@UiField Reviewers reviewers;
|
||||||
@UiField Element changeIdText;
|
|
||||||
@UiField Element ownerText;
|
@UiField Element ownerText;
|
||||||
@UiField Element statusText;
|
@UiField Element statusText;
|
||||||
@UiField Image projectQuery;
|
@UiField Image projectQuery;
|
||||||
@@ -142,7 +141,6 @@ public class ChangeScreen2 extends Screen {
|
|||||||
@UiField InlineHyperlink branchLink;
|
@UiField InlineHyperlink branchLink;
|
||||||
@UiField Element submitActionText;
|
@UiField Element submitActionText;
|
||||||
@UiField Element notMergeable;
|
@UiField Element notMergeable;
|
||||||
@UiField CopyableLabel idText;
|
|
||||||
@UiField Topic topic;
|
@UiField Topic topic;
|
||||||
@UiField Element actionText;
|
@UiField Element actionText;
|
||||||
@UiField Element actionDate;
|
@UiField Element actionDate;
|
||||||
@@ -236,7 +234,7 @@ public class ChangeScreen2 extends Screen {
|
|||||||
keysNavigation.add(new KeyCommand(0, 'R', Util.C.keyReloadChange()) {
|
keysNavigation.add(new KeyCommand(0, 'R', Util.C.keyReloadChange()) {
|
||||||
@Override
|
@Override
|
||||||
public void onKeyPress(final KeyPressEvent event) {
|
public void onKeyPress(final KeyPressEvent event) {
|
||||||
reload.reload();
|
Gerrit.display(PageLinks.toChange(changeId));
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -412,6 +410,12 @@ public class ChangeScreen2 extends Screen {
|
|||||||
onReply();
|
onReply();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@UiHandler("permalink")
|
||||||
|
void onReload(ClickEvent e) {
|
||||||
|
e.preventDefault();
|
||||||
|
Gerrit.display(PageLinks.toChange(changeId));
|
||||||
|
}
|
||||||
|
|
||||||
private void onReply() {
|
private void onReply() {
|
||||||
if (Gerrit.isSignedIn()) {
|
if (Gerrit.isSignedIn()) {
|
||||||
replyAction.onReply();
|
replyAction.onReply();
|
||||||
@@ -650,6 +654,7 @@ public class ChangeScreen2 extends Screen {
|
|||||||
statusText.setInnerText(Util.toLongString(info.status()));
|
statusText.setInnerText(Util.toLongString(info.status()));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
renderCommitSubject(info);
|
||||||
renderOwner(info);
|
renderOwner(info);
|
||||||
renderActionTextDate(info);
|
renderActionTextDate(info);
|
||||||
renderHistory(info);
|
renderHistory(info);
|
||||||
@@ -662,10 +667,7 @@ public class ChangeScreen2 extends Screen {
|
|||||||
|
|
||||||
star.setValue(info.starred());
|
star.setValue(info.starred());
|
||||||
permalink.setHref(ChangeLink.permalink(changeId));
|
permalink.setHref(ChangeLink.permalink(changeId));
|
||||||
changeIdText.setInnerText(String.valueOf(info.legacy_id()));
|
permalink.setText(String.valueOf(info.legacy_id()));
|
||||||
idText.setText("Change-Id: " + info.change_id());
|
|
||||||
idText.setPreviewText(info.change_id());
|
|
||||||
reload.set(info);
|
|
||||||
topic.set(info, revision);
|
topic.set(info, revision);
|
||||||
commit.set(commentLinkProcessor, info, revision);
|
commit.set(commentLinkProcessor, info, revision);
|
||||||
related.set(info, revision);
|
related.set(info, revision);
|
||||||
@@ -697,6 +699,13 @@ public class ChangeScreen2 extends Screen {
|
|||||||
setWindowTitle(sb.toString());
|
setWindowTitle(sb.toString());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void renderCommitSubject(ChangeInfo info) {
|
||||||
|
RevisionInfo rev = info.revision(revision);
|
||||||
|
String sub = rev.commit().subject();
|
||||||
|
commitSubjectText.setInnerSafeHtml(commentLinkProcessor.apply(
|
||||||
|
new SafeHtmlBuilder().append(sub).linkify()));
|
||||||
|
}
|
||||||
|
|
||||||
private void renderOwner(ChangeInfo info) {
|
private void renderOwner(ChangeInfo info) {
|
||||||
// TODO info card hover
|
// TODO info card hover
|
||||||
String name = info.owner().name() != null
|
String name = info.owner().name() != null
|
||||||
@@ -755,7 +764,7 @@ public class ChangeScreen2 extends Screen {
|
|||||||
updateAvailable = new UpdateAvailableBar() {
|
updateAvailable = new UpdateAvailableBar() {
|
||||||
@Override
|
@Override
|
||||||
void onShow() {
|
void onShow() {
|
||||||
reload.reload();
|
Gerrit.display(PageLinks.toChange(changeId));
|
||||||
}
|
}
|
||||||
|
|
||||||
void onIgnore(Timestamp newTime) {
|
void onIgnore(Timestamp newTime) {
|
||||||
|
|||||||
@@ -18,15 +18,14 @@ limitations under the License.
|
|||||||
xmlns:ui='urn:ui:com.google.gwt.uibinder'
|
xmlns:ui='urn:ui:com.google.gwt.uibinder'
|
||||||
xmlns:c='urn:import:com.google.gerrit.client.change'
|
xmlns:c='urn:import:com.google.gerrit.client.change'
|
||||||
xmlns:g='urn:import:com.google.gwt.user.client.ui'
|
xmlns:g='urn:import:com.google.gwt.user.client.ui'
|
||||||
xmlns:x='urn:import:com.google.gerrit.client.ui'
|
xmlns:x='urn:import:com.google.gerrit.client.ui'>
|
||||||
xmlns:clippy='urn:import:com.google.gwtexpui.clippy.client'>
|
|
||||||
<ui:with field='ico' type='com.google.gerrit.client.GerritResources'/>
|
<ui:with field='ico' type='com.google.gerrit.client.GerritResources'/>
|
||||||
<ui:with field='res' type='com.google.gerrit.client.change.Resources'/>
|
<ui:with field='res' type='com.google.gerrit.client.change.Resources'/>
|
||||||
<ui:style type='com.google.gerrit.client.change.ChangeScreen2.Style'>
|
<ui:style type='com.google.gerrit.client.change.ChangeScreen2.Style'>
|
||||||
@eval textColor com.google.gerrit.client.Gerrit.getTheme().textColor;
|
@eval textColor com.google.gerrit.client.Gerrit.getTheme().textColor;
|
||||||
@eval trimColor com.google.gerrit.client.Gerrit.getTheme().trimColor;
|
@eval trimColor com.google.gerrit.client.Gerrit.getTheme().trimColor;
|
||||||
|
|
||||||
@def INFO_WIDTH 450px;
|
@def COMMIT_WIDTH 560px;
|
||||||
@def HEADER_HEIGHT 29px;
|
@def HEADER_HEIGHT 29px;
|
||||||
|
|
||||||
.headerLine {
|
.headerLine {
|
||||||
@@ -35,60 +34,74 @@ limitations under the License.
|
|||||||
height: HEADER_HEIGHT;
|
height: HEADER_HEIGHT;
|
||||||
}
|
}
|
||||||
|
|
||||||
.idBlock {
|
.subjectLine {
|
||||||
position: relative;
|
position: relative;
|
||||||
width: INFO_WIDTH;
|
width: COMMIT_WIDTH;
|
||||||
height: HEADER_HEIGHT;
|
height: HEADER_HEIGHT;
|
||||||
background-color: trimColor;
|
background-color: trimColor;
|
||||||
color: textColor;
|
color: textColor;
|
||||||
font-family: sans-serif;
|
font-family: sans-serif;
|
||||||
font-weight: bold;
|
font-weight: bold;
|
||||||
}
|
}
|
||||||
.star {
|
.subjectText {
|
||||||
cursor: pointer;
|
width: 460px;
|
||||||
outline: none;
|
height: HEADER_HEIGHT;
|
||||||
position: absolute;
|
|
||||||
left: 5px;
|
|
||||||
top: 5px;
|
|
||||||
}
|
|
||||||
.idLine, .idStatus {
|
|
||||||
line-height: HEADER_HEIGHT;
|
line-height: HEADER_HEIGHT;
|
||||||
}
|
|
||||||
.idLine {
|
|
||||||
position: absolute;
|
|
||||||
top: 0;
|
|
||||||
left: 29px;
|
|
||||||
width: 245px;
|
|
||||||
white-space: nowrap;
|
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
text-overflow: ellipsis;
|
text-overflow: ellipsis;
|
||||||
}
|
}
|
||||||
.idStatus {
|
.subjectButtons {
|
||||||
position: absolute;
|
position: absolute;
|
||||||
top: 0;
|
top: 0;
|
||||||
right: 26px;
|
right: 3px;
|
||||||
}
|
}
|
||||||
.reload {
|
|
||||||
|
.infoLine {
|
||||||
|
position: absolute;
|
||||||
|
top: 0;
|
||||||
|
left: COMMIT_WIDTH;
|
||||||
|
height: HEADER_HEIGHT;
|
||||||
|
padding-left: 25px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.statusRight {
|
||||||
|
position: absolute;
|
||||||
|
top: 0;
|
||||||
|
right: 0;
|
||||||
|
height: HEADER_HEIGHT;
|
||||||
|
}
|
||||||
|
.starChangeStatus {
|
||||||
|
display: inline-block;
|
||||||
|
width: 325px;
|
||||||
|
}
|
||||||
|
.star {
|
||||||
|
position: absolute;
|
||||||
|
top: 5px;
|
||||||
|
left: 0;
|
||||||
|
cursor: pointer;
|
||||||
|
outline: none;
|
||||||
|
}
|
||||||
|
.changeId {
|
||||||
display: block;
|
display: block;
|
||||||
position: absolute;
|
|
||||||
top: 7px;
|
|
||||||
right: 5px;
|
|
||||||
cursor: pointer;
|
|
||||||
}
|
|
||||||
|
|
||||||
.headerButtons {
|
|
||||||
position: absolute;
|
position: absolute;
|
||||||
top: 0;
|
top: 0;
|
||||||
left: INFO_WIDTH;
|
left: 22px;
|
||||||
height: HEADER_HEIGHT;
|
width: 300px;
|
||||||
padding-left: 5px;
|
white-space: nowrap;
|
||||||
|
line-height: HEADER_HEIGHT;
|
||||||
|
overflow: hidden;
|
||||||
|
text-overflow: ellipsis;
|
||||||
|
}
|
||||||
|
.statusText {
|
||||||
|
font-weight: bold;
|
||||||
}
|
}
|
||||||
|
|
||||||
.popdown {
|
div.popdown {
|
||||||
position: absolute;
|
display: inline-block;
|
||||||
top: 2px;
|
margin-top: 2px;
|
||||||
right: 0;
|
margin-left: 5px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.popdown button {
|
.popdown button {
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
height: 25px;
|
height: 25px;
|
||||||
@@ -110,18 +123,22 @@ limitations under the License.
|
|||||||
.popdown button.selected {
|
.popdown button.selected {
|
||||||
font-weight: bold;
|
font-weight: bold;
|
||||||
}
|
}
|
||||||
.headerLine button:disabled,
|
.popdown button:focus {
|
||||||
.headerTable button:disabled,
|
outline: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
.headerButtons button:disabled,
|
||||||
|
#change_infoTable button:disabled,
|
||||||
.popdown button:disabled {
|
.popdown button:disabled {
|
||||||
background-color: #999;
|
background-color: #999;
|
||||||
background-image: -webkit-linear-gradient(top, #999, #999);
|
background-image: -webkit-linear-gradient(top, #999, #999);
|
||||||
}
|
}
|
||||||
|
|
||||||
.headerTable {
|
.infoTable {
|
||||||
border-spacing: 0;
|
border-spacing: 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
.headerTable th {
|
.infoTable th {
|
||||||
width: 60px;
|
width: 60px;
|
||||||
color: #444;
|
color: #444;
|
||||||
font-weight: normal;
|
font-weight: normal;
|
||||||
@@ -130,10 +147,6 @@ limitations under the License.
|
|||||||
padding-right: 5px;
|
padding-right: 5px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.clippy div {
|
|
||||||
float: right;
|
|
||||||
}
|
|
||||||
|
|
||||||
.queryProject {
|
.queryProject {
|
||||||
float: left;
|
float: left;
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
@@ -141,7 +154,8 @@ limitations under the License.
|
|||||||
|
|
||||||
.infoColumn {
|
.infoColumn {
|
||||||
width: 440px;
|
width: 440px;
|
||||||
padding-right: 10px;
|
padding-left: 17px;
|
||||||
|
padding-right: 17px;
|
||||||
vertical-align: top;
|
vertical-align: top;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -158,12 +172,16 @@ limitations under the License.
|
|||||||
color: red;
|
color: red;
|
||||||
}
|
}
|
||||||
|
|
||||||
.commitColumn, .related {
|
.commitColumn, .relatedColumn {
|
||||||
padding: 0;
|
padding: 0;
|
||||||
vertical-align: top;
|
vertical-align: top;
|
||||||
}
|
}
|
||||||
.commitColumn {
|
.commitColumn { width: COMMIT_WIDTH; }
|
||||||
width: 600px;
|
.relatedColumn { width: 375px; }
|
||||||
|
|
||||||
|
.commitSubjectText {
|
||||||
|
font-family: monospace;
|
||||||
|
white-space: pre;
|
||||||
}
|
}
|
||||||
|
|
||||||
.labels {
|
.labels {
|
||||||
@@ -246,9 +264,12 @@ limitations under the License.
|
|||||||
padding: 5px 10px;
|
padding: 5px 10px;
|
||||||
}
|
}
|
||||||
.sectionHeader .headerButtons {
|
.sectionHeader .headerButtons {
|
||||||
|
position: absolute;
|
||||||
|
left: 300px;
|
||||||
top: 2px;
|
top: 2px;
|
||||||
height: 18px;
|
height: 18px;
|
||||||
border-left: 1px inset #fff;
|
border-left: 1px inset #fff;
|
||||||
|
padding-left: 5px;
|
||||||
padding-top: 3px;
|
padding-top: 3px;
|
||||||
padding-bottom: 3px;
|
padding-bottom: 3px;
|
||||||
}
|
}
|
||||||
@@ -261,19 +282,20 @@ limitations under the License.
|
|||||||
|
|
||||||
<g:HTMLPanel>
|
<g:HTMLPanel>
|
||||||
<g:HTMLPanel styleName='{style.headerLine}' ui:field='headerLine'>
|
<g:HTMLPanel styleName='{style.headerLine}' ui:field='headerLine'>
|
||||||
<div class='{style.idBlock}'>
|
<div class='{style.subjectLine}'>
|
||||||
<c:StarIcon ui:field='star' styleName='{style.star}'/>
|
<div class='{style.subjectText}' ui:field='commitSubjectText'/>
|
||||||
<div class='{style.idLine}'>
|
<div class='{style.subjectButtons} {style.headerButtons}'>
|
||||||
<ui:msg>Change <span ui:field='changeIdText'/> by <span ui:field='ownerText'/></ui:msg>
|
<g:Button ui:field='editMessage'
|
||||||
</div>
|
styleName=''
|
||||||
<div ui:field='statusText' class='{style.idStatus}'/>
|
visible='false'
|
||||||
<a ui:field='permalink' class='{style.reload}'>
|
title='Edit commit message (Shortcut: e)'>
|
||||||
<c:Reload ui:field='reload'
|
|
||||||
title='Reload the change (Shortcut: R)'>
|
|
||||||
<ui:attribute name='title'/>
|
<ui:attribute name='title'/>
|
||||||
</c:Reload>
|
<div><ui:msg>Edit Message</ui:msg></div>
|
||||||
</a>
|
</g:Button>
|
||||||
</div>
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class='{style.infoLine}'>
|
||||||
<div class='{style.headerButtons}'>
|
<div class='{style.headerButtons}'>
|
||||||
<g:Button ui:field='reply'
|
<g:Button ui:field='reply'
|
||||||
styleName=''
|
styleName=''
|
||||||
@@ -286,15 +308,18 @@ limitations under the License.
|
|||||||
title='Apply score with one click'>
|
title='Apply score with one click'>
|
||||||
<ui:attribute name='title'/>
|
<ui:attribute name='title'/>
|
||||||
</c:QuickApprove>
|
</c:QuickApprove>
|
||||||
<g:Button ui:field='editMessage'
|
</div>
|
||||||
styleName=''
|
|
||||||
visible='false'
|
|
||||||
title='Edit commit message (Shortcut: e)'>
|
|
||||||
<ui:attribute name='title'/>
|
|
||||||
<div><ui:msg>Edit Message</ui:msg></div>
|
|
||||||
</g:Button>
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<div class='{style.statusRight}'>
|
||||||
|
<div class='{style.starChangeStatus}'>
|
||||||
|
<c:StarIcon ui:field='star' styleName='{style.star}'/>
|
||||||
|
<span class='{style.changeId}'>
|
||||||
|
<ui:msg>Change <g:Anchor ui:field='permalink' title='Reload the change (Shortcut: R)'>
|
||||||
|
<ui:attribute name='title'/>
|
||||||
|
</g:Anchor> - <span ui:field='statusText' class='{style.statusText}'/></ui:msg>
|
||||||
|
</span>
|
||||||
|
</div>
|
||||||
<g:FlowPanel styleName='{style.popdown}'>
|
<g:FlowPanel styleName='{style.popdown}'>
|
||||||
<g:Button ui:field='includedIn' styleName='' visible="false">
|
<g:Button ui:field='includedIn' styleName='' visible="false">
|
||||||
<div><ui:msg>Included in</ui:msg></div>
|
<div><ui:msg>Included in</ui:msg></div>
|
||||||
@@ -306,12 +331,20 @@ limitations under the License.
|
|||||||
<div><ui:msg>Download</ui:msg></div>
|
<div><ui:msg>Download</ui:msg></div>
|
||||||
</g:Button>
|
</g:Button>
|
||||||
</g:FlowPanel>
|
</g:FlowPanel>
|
||||||
|
</div>
|
||||||
</g:HTMLPanel>
|
</g:HTMLPanel>
|
||||||
|
|
||||||
<table class='{style.headerTable}'>
|
<table class='{style.infoTable}'>
|
||||||
<tr>
|
<tr>
|
||||||
|
<td class='{style.commitColumn}'>
|
||||||
|
<c:CommitBox ui:field='commit'/>
|
||||||
|
</td>
|
||||||
<td class='{style.infoColumn}'>
|
<td class='{style.infoColumn}'>
|
||||||
<table id='change_infoTable'>
|
<table id='change_infoTable'>
|
||||||
|
<tr>
|
||||||
|
<th><ui:msg>Owner</ui:msg></th>
|
||||||
|
<td ui:field='ownerText'/>
|
||||||
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<th><ui:msg>Reviewers</ui:msg></th>
|
<th><ui:msg>Reviewers</ui:msg></th>
|
||||||
<td ui:field='reviewersText'/>
|
<td ui:field='reviewersText'/>
|
||||||
@@ -345,6 +378,10 @@ limitations under the License.
|
|||||||
</x:InlineHyperlink>
|
</x:InlineHyperlink>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<th><ui:msg>Topic</ui:msg></th>
|
||||||
|
<td><c:Topic ui:field='topic'/></td>
|
||||||
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<th><ui:msg>Strategy</ui:msg></th>
|
<th><ui:msg>Strategy</ui:msg></th>
|
||||||
<td>
|
<td>
|
||||||
@@ -357,29 +394,16 @@ limitations under the License.
|
|||||||
</div>
|
</div>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr><td colspan='2'><c:Actions ui:field='actions'/></td></tr>
|
|
||||||
<tr>
|
<tr>
|
||||||
<th ui:field='actionText'/>
|
<th ui:field='actionText'/>
|
||||||
<td ui:field='actionDate'/>
|
<td ui:field='actionDate'/>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr><td colspan='2'><c:Actions ui:field='actions'/></td></tr>
|
||||||
<th><ui:msg>Change-Id</ui:msg></th>
|
|
||||||
<td><clippy:CopyableLabel styleName='{style.clippy}' ui:field='idText'/></td>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<th><ui:msg>Topic</ui:msg></th>
|
|
||||||
<td><c:Topic ui:field='topic'/></td>
|
|
||||||
</tr>
|
|
||||||
</table>
|
</table>
|
||||||
<hr/>
|
<hr/>
|
||||||
<c:Labels ui:field='labels' styleName='{style.labels}'/>
|
<c:Labels ui:field='labels' styleName='{style.labels}'/>
|
||||||
</td>
|
</td>
|
||||||
|
<td class='{style.relatedColumn}'>
|
||||||
<td class='{style.commitColumn}'>
|
|
||||||
<c:CommitBox ui:field='commit'/>
|
|
||||||
</td>
|
|
||||||
|
|
||||||
<td class='{style.related}'>
|
|
||||||
<c:RelatedChanges ui:field='related'/>
|
<c:RelatedChanges ui:field='related'/>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
|
|||||||
@@ -28,27 +28,61 @@ import com.google.gerrit.reviewdb.client.Change.Status;
|
|||||||
import com.google.gwt.core.client.GWT;
|
import com.google.gwt.core.client.GWT;
|
||||||
import com.google.gwt.dom.client.AnchorElement;
|
import com.google.gwt.dom.client.AnchorElement;
|
||||||
import com.google.gwt.dom.client.Element;
|
import com.google.gwt.dom.client.Element;
|
||||||
|
import com.google.gwt.event.dom.client.ClickEvent;
|
||||||
|
import com.google.gwt.resources.client.CssResource;
|
||||||
import com.google.gwt.uibinder.client.UiBinder;
|
import com.google.gwt.uibinder.client.UiBinder;
|
||||||
import com.google.gwt.uibinder.client.UiField;
|
import com.google.gwt.uibinder.client.UiField;
|
||||||
|
import com.google.gwt.uibinder.client.UiHandler;
|
||||||
|
import com.google.gwt.user.client.ui.Button;
|
||||||
import com.google.gwt.user.client.ui.Composite;
|
import com.google.gwt.user.client.ui.Composite;
|
||||||
|
import com.google.gwt.user.client.ui.HTML;
|
||||||
import com.google.gwt.user.client.ui.HTMLPanel;
|
import com.google.gwt.user.client.ui.HTMLPanel;
|
||||||
|
import com.google.gwt.user.client.ui.ScrollPanel;
|
||||||
import com.google.gwt.user.client.ui.UIObject;
|
import com.google.gwt.user.client.ui.UIObject;
|
||||||
|
import com.google.gwtexpui.clippy.client.CopyableLabel;
|
||||||
import com.google.gwtexpui.safehtml.client.SafeHtmlBuilder;
|
import com.google.gwtexpui.safehtml.client.SafeHtmlBuilder;
|
||||||
|
|
||||||
class CommitBox extends Composite {
|
class CommitBox extends Composite {
|
||||||
interface Binder extends UiBinder<HTMLPanel, CommitBox> {}
|
interface Binder extends UiBinder<HTMLPanel, CommitBox> {}
|
||||||
private static final Binder uiBinder = GWT.create(Binder.class);
|
private static final Binder uiBinder = GWT.create(Binder.class);
|
||||||
|
|
||||||
|
interface Style extends CssResource {
|
||||||
|
String collapsed();
|
||||||
|
String expanded();
|
||||||
|
}
|
||||||
|
|
||||||
|
@UiField Style style;
|
||||||
@UiField Element commitName;
|
@UiField Element commitName;
|
||||||
@UiField AnchorElement browserLink;
|
@UiField AnchorElement browserLink;
|
||||||
@UiField InlineHyperlink authorNameEmail;
|
@UiField InlineHyperlink authorNameEmail;
|
||||||
@UiField Element authorDate;
|
@UiField Element authorDate;
|
||||||
@UiField InlineHyperlink committerNameEmail;
|
@UiField InlineHyperlink committerNameEmail;
|
||||||
@UiField Element committerDate;
|
@UiField Element committerDate;
|
||||||
@UiField Element commitMessageText;
|
@UiField CopyableLabel idText;
|
||||||
|
@UiField HTML text;
|
||||||
|
@UiField ScrollPanel scroll;
|
||||||
|
@UiField Button more;
|
||||||
|
private boolean expanded;
|
||||||
|
|
||||||
CommitBox() {
|
CommitBox() {
|
||||||
initWidget(uiBinder.createAndBindUi(this));
|
initWidget(uiBinder.createAndBindUi(this));
|
||||||
|
addStyleName(style.collapsed());
|
||||||
|
}
|
||||||
|
|
||||||
|
void onShowView() {
|
||||||
|
more.setVisible(scroll.getMaximumVerticalScrollPosition() > 0);
|
||||||
|
}
|
||||||
|
|
||||||
|
@UiHandler("more")
|
||||||
|
void onMore(ClickEvent e) {
|
||||||
|
if (expanded) {
|
||||||
|
removeStyleName(style.expanded());
|
||||||
|
addStyleName(style.collapsed());
|
||||||
|
} else {
|
||||||
|
removeStyleName(style.collapsed());
|
||||||
|
addStyleName(style.expanded());
|
||||||
|
}
|
||||||
|
expanded = !expanded;
|
||||||
}
|
}
|
||||||
|
|
||||||
void set(CommentLinkProcessor commentLinkProcessor,
|
void set(CommentLinkProcessor commentLinkProcessor,
|
||||||
@@ -56,14 +90,24 @@ class CommitBox extends Composite {
|
|||||||
String revision) {
|
String revision) {
|
||||||
RevisionInfo revInfo = change.revision(revision);
|
RevisionInfo revInfo = change.revision(revision);
|
||||||
CommitInfo commit = revInfo.commit();
|
CommitInfo commit = revInfo.commit();
|
||||||
|
String sub = commit.subject();
|
||||||
|
String msg = commit.message();
|
||||||
|
if (msg.startsWith(sub)) {
|
||||||
|
msg = msg.substring(sub.length());
|
||||||
|
if (msg.length() > 0 && msg.charAt(0) == '\n') {
|
||||||
|
msg = msg.substring(1);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
commitName.setInnerText(revision);
|
commitName.setInnerText(revision);
|
||||||
|
idText.setText("Change-Id: " + change.change_id());
|
||||||
|
idText.setPreviewText(change.change_id());
|
||||||
formatLink(commit.author(), authorNameEmail,
|
formatLink(commit.author(), authorNameEmail,
|
||||||
authorDate, change.status());
|
authorDate, change.status());
|
||||||
formatLink(commit.committer(), committerNameEmail,
|
formatLink(commit.committer(), committerNameEmail,
|
||||||
committerDate, change.status());
|
committerDate, change.status());
|
||||||
commitMessageText.setInnerSafeHtml(commentLinkProcessor.apply(
|
text.setHTML(commentLinkProcessor.apply(
|
||||||
new SafeHtmlBuilder().append(commit.message()).linkify()));
|
new SafeHtmlBuilder().append(msg).linkify()));
|
||||||
|
|
||||||
GitwebLink gw = Gerrit.getGitwebLink();
|
GitwebLink gw = Gerrit.getGitwebLink();
|
||||||
if (gw != null && gw.canLink(revInfo)) {
|
if (gw != null && gw.canLink(revInfo)) {
|
||||||
@@ -86,7 +130,7 @@ class CommitBox extends Composite {
|
|||||||
return person.name() + " <" + person.email() + ">";
|
return person.name() + " <" + person.email() + ">";
|
||||||
}
|
}
|
||||||
|
|
||||||
public static String owner(GitPerson person) {
|
private static String owner(GitPerson person) {
|
||||||
if (person.email() != null) {
|
if (person.email() != null) {
|
||||||
return person.email();
|
return person.email();
|
||||||
} else if (person.name() != null) {
|
} else if (person.name() != null) {
|
||||||
|
|||||||
@@ -17,34 +17,82 @@ limitations under the License.
|
|||||||
<ui:UiBinder
|
<ui:UiBinder
|
||||||
xmlns:ui='urn:ui:com.google.gwt.uibinder'
|
xmlns:ui='urn:ui:com.google.gwt.uibinder'
|
||||||
xmlns:g='urn:import:com.google.gwt.user.client.ui'
|
xmlns:g='urn:import:com.google.gwt.user.client.ui'
|
||||||
xmlns:x='urn:import:com.google.gerrit.client.ui'>
|
xmlns:x='urn:import:com.google.gerrit.client.ui'
|
||||||
<ui:style>
|
xmlns:clippy='urn:import:com.google.gwtexpui.clippy.client'>
|
||||||
.commitHeader {
|
<ui:image field="toggle" src="more_less.png"/>
|
||||||
border-spacing: 0;
|
<ui:style type='com.google.gerrit.client.change.CommitBox.Style'>
|
||||||
padding: 0;
|
@eval trimColor com.google.gerrit.client.Gerrit.getTheme().trimColor;
|
||||||
width: 564px;
|
|
||||||
|
.collapsed .scroll { height: 250px }
|
||||||
|
.scroll, .more { width: 560px }
|
||||||
|
.scroll {
|
||||||
|
border-right: 1px solid trimColor;
|
||||||
|
border-bottom: 1px solid trimColor;
|
||||||
}
|
}
|
||||||
|
|
||||||
.commitHeader th { width: 70px; }
|
.text {
|
||||||
.commitHeader td { white-space: pre; }
|
|
||||||
|
|
||||||
.commitMessageBox { margin: 2px; }
|
|
||||||
.commitMessage {
|
|
||||||
box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
|
|
||||||
border: 1px solid white;
|
|
||||||
background-color: white;
|
|
||||||
font-family: monospace;
|
font-family: monospace;
|
||||||
white-space: pre;
|
white-space: pre;
|
||||||
width: 47em;
|
}
|
||||||
|
|
||||||
|
.more {
|
||||||
|
height: 8px;
|
||||||
|
line-height: 8px;
|
||||||
|
text-align: center;
|
||||||
|
}
|
||||||
|
.moreButton {
|
||||||
|
padding: 0 5px 0 5px;
|
||||||
|
margin: 0;
|
||||||
|
border: none;
|
||||||
|
height: 8px;
|
||||||
|
background-color: #F7F7F7;
|
||||||
|
}
|
||||||
|
.moreButton:focus {
|
||||||
|
outline: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
@sprite .toggle {
|
||||||
|
gwt-image: "toggle";
|
||||||
|
width: 13px;
|
||||||
|
height: 8px;
|
||||||
|
padding: 0;
|
||||||
|
}
|
||||||
|
.collapsed .toggle { background-position: -13px -8px }
|
||||||
|
.expanded .toggle { background-position: 0px -8px }
|
||||||
|
.collapsed button:hover .toggle { background-position: -13px 0px }
|
||||||
|
.expanded button:hover .toggle { background-position: 0px 0px }
|
||||||
|
|
||||||
|
.header {
|
||||||
|
border-spacing: 0;
|
||||||
|
padding: 0;
|
||||||
|
width: 560px;
|
||||||
|
}
|
||||||
|
.header th { width: 70px; }
|
||||||
|
.header td { white-space: nowrap; }
|
||||||
|
.date { width: 132px; }
|
||||||
|
|
||||||
|
.clippy {
|
||||||
|
position: relative;
|
||||||
|
}
|
||||||
|
.clippy div {
|
||||||
|
position: absolute;
|
||||||
|
top: 0px;
|
||||||
|
right: -16px;
|
||||||
}
|
}
|
||||||
</ui:style>
|
</ui:style>
|
||||||
<g:HTMLPanel>
|
<g:HTMLPanel>
|
||||||
<table class='{style.commitHeader}'>
|
<g:ScrollPanel styleName='{style.scroll}' ui:field='scroll'>
|
||||||
<tr>
|
<g:HTML styleName='{style.text}' ui:field='text'/>
|
||||||
<th><ui:msg>Commit</ui:msg></th>
|
</g:ScrollPanel>
|
||||||
<td ui:field='commitName'/>
|
<div class='{style.more}'>
|
||||||
<td><a ui:field='browserLink' href=""/></td>
|
<g:Button ui:field='more'
|
||||||
</tr>
|
styleName='{style.moreButton}'
|
||||||
|
title='Expand/Collapse'>
|
||||||
|
<ui:attribute name='title'/>
|
||||||
|
<div class='{style.toggle}'/>
|
||||||
|
</g:Button>
|
||||||
|
</div>
|
||||||
|
<table class='{style.header}'>
|
||||||
<tr>
|
<tr>
|
||||||
<th><ui:msg>Author</ui:msg></th>
|
<th><ui:msg>Author</ui:msg></th>
|
||||||
<td><x:InlineHyperlink ui:field='authorNameEmail'
|
<td><x:InlineHyperlink ui:field='authorNameEmail'
|
||||||
@@ -52,7 +100,7 @@ limitations under the License.
|
|||||||
<ui:attribute name='title'/>
|
<ui:attribute name='title'/>
|
||||||
</x:InlineHyperlink>
|
</x:InlineHyperlink>
|
||||||
</td>
|
</td>
|
||||||
<td ui:field='authorDate'/>
|
<td ui:field='authorDate' class='{style.date}'/>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<th><ui:msg>Committer</ui:msg></th>
|
<th><ui:msg>Committer</ui:msg></th>
|
||||||
@@ -61,12 +109,17 @@ limitations under the License.
|
|||||||
<ui:attribute name='title'/>
|
<ui:attribute name='title'/>
|
||||||
</x:InlineHyperlink>
|
</x:InlineHyperlink>
|
||||||
</td>
|
</td>
|
||||||
<td ui:field='committerDate'/>
|
<td ui:field='committerDate' class='{style.date}'/>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<th><ui:msg>Commit</ui:msg></th>
|
||||||
|
<td ui:field='commitName'/>
|
||||||
|
<td><a ui:field='browserLink' href=""/></td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<th><ui:msg>Change-Id</ui:msg></th>
|
||||||
|
<td><clippy:CopyableLabel styleName='{style.clippy}' ui:field='idText'/></td>
|
||||||
</tr>
|
</tr>
|
||||||
</table>
|
</table>
|
||||||
|
|
||||||
<div class='{style.commitMessageBox}'>
|
|
||||||
<div class='{style.commitMessage}' ui:field='commitMessageText'/>
|
|
||||||
</div>
|
|
||||||
</g:HTMLPanel>
|
</g:HTMLPanel>
|
||||||
</ui:UiBinder>
|
</ui:UiBinder>
|
||||||
|
|||||||
@@ -30,7 +30,7 @@ limitations under the License.
|
|||||||
<div class='{res.style.section}'>
|
<div class='{res.style.section}'>
|
||||||
<c:NpTextArea
|
<c:NpTextArea
|
||||||
visibleLines='30'
|
visibleLines='30'
|
||||||
characterWidth='72'
|
characterWidth='78'
|
||||||
styleName='{style.commitMessage}'
|
styleName='{style.commitMessage}'
|
||||||
ui:field='message'/>
|
ui:field='message'/>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -1,77 +0,0 @@
|
|||||||
// Copyright (C) 2013 The Android Open Source Project
|
|
||||||
//
|
|
||||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
|
||||||
// you may not use this file except in compliance with the License.
|
|
||||||
// You may obtain a copy of the License at
|
|
||||||
//
|
|
||||||
// http://www.apache.org/licenses/LICENSE-2.0
|
|
||||||
//
|
|
||||||
// Unless required by applicable law or agreed to in writing, software
|
|
||||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
|
||||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
||||||
// See the License for the specific language governing permissions and
|
|
||||||
// limitations under the License.
|
|
||||||
|
|
||||||
package com.google.gerrit.client.change;
|
|
||||||
|
|
||||||
import com.google.gerrit.client.Gerrit;
|
|
||||||
import com.google.gerrit.client.changes.ChangeInfo;
|
|
||||||
import com.google.gerrit.common.PageLinks;
|
|
||||||
import com.google.gerrit.reviewdb.client.Change;
|
|
||||||
import com.google.gwt.core.client.GWT;
|
|
||||||
import com.google.gwt.event.dom.client.ClickEvent;
|
|
||||||
import com.google.gwt.event.dom.client.ClickHandler;
|
|
||||||
import com.google.gwt.event.dom.client.MouseOutEvent;
|
|
||||||
import com.google.gwt.event.dom.client.MouseOutHandler;
|
|
||||||
import com.google.gwt.event.dom.client.MouseOverEvent;
|
|
||||||
import com.google.gwt.event.dom.client.MouseOverHandler;
|
|
||||||
import com.google.gwt.user.client.Event;
|
|
||||||
import com.google.gwt.user.client.ui.Image;
|
|
||||||
import com.google.gwt.user.client.ui.impl.HyperlinkImpl;
|
|
||||||
|
|
||||||
class Reload extends Image implements ClickHandler,
|
|
||||||
MouseOverHandler, MouseOutHandler {
|
|
||||||
private static final HyperlinkImpl link = GWT.create(HyperlinkImpl.class);
|
|
||||||
private Change.Id changeId;
|
|
||||||
private boolean in;
|
|
||||||
|
|
||||||
Reload() {
|
|
||||||
setResource(Resources.I.reload_black());
|
|
||||||
addClickHandler(this);
|
|
||||||
addMouseOverHandler(this);
|
|
||||||
addMouseOutHandler(this);
|
|
||||||
}
|
|
||||||
|
|
||||||
void set(ChangeInfo info) {
|
|
||||||
changeId = info.legacy_id();
|
|
||||||
}
|
|
||||||
|
|
||||||
void reload() {
|
|
||||||
Gerrit.display(PageLinks.toChange(changeId));
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onMouseOver(MouseOverEvent event) {
|
|
||||||
if (!in) {
|
|
||||||
in = true;
|
|
||||||
setResource(Resources.I.reload_white());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onMouseOut(MouseOutEvent event) {
|
|
||||||
if (in) {
|
|
||||||
in = false;
|
|
||||||
setResource(Resources.I.reload_black());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onClick(ClickEvent e) {
|
|
||||||
if (link.handleAsClick(e.getNativeEvent().<Event> cast())) {
|
|
||||||
e.preventDefault();
|
|
||||||
e.stopPropagation();
|
|
||||||
reload();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -25,8 +25,6 @@ public interface Resources extends ClientBundle {
|
|||||||
|
|
||||||
@Source("star_open.png") ImageResource star_open();
|
@Source("star_open.png") ImageResource star_open();
|
||||||
@Source("star_filled.png") ImageResource star_filled();
|
@Source("star_filled.png") ImageResource star_filled();
|
||||||
@Source("reload_black.png") ImageResource reload_black();
|
|
||||||
@Source("reload_white.png") ImageResource reload_white();
|
|
||||||
@Source("remove_reviewer.png") ImageResource remove_reviewer();
|
@Source("remove_reviewer.png") ImageResource remove_reviewer();
|
||||||
@Source("common.css") Style style();
|
@Source("common.css") Style style();
|
||||||
|
|
||||||
|
|||||||
Binary file not shown.
|
After Width: | Height: | Size: 235 B |
Binary file not shown.
|
Before Width: | Height: | Size: 273 B |
Binary file not shown.
|
Before Width: | Height: | Size: 279 B |
Reference in New Issue
Block a user