ChangeScreen: Highlight selected outdated patch set
Gives a visual hint when the currently viewed patch set is not the latest one. An example use-case is when change A depends on some previous patch set of change B. Clicking change B in the Related Changes tab opens the dependent patch set, but usually the latest PS is what interests the user. The color used for this indication is the same as the marker color for not current patch sets in Related Changes. Change-Id: If7d1e673172a44ba1c5ef9aea332d8fc54b1125c
This commit is contained in:
Binary file not shown.
After Width: | Height: | Size: 26 KiB |
@@ -391,6 +391,10 @@ operations are only available on the current patch set.
|
|||||||
|
|
||||||
image::images/user-review-ui-change-screen-patch-sets.png[width=800, link="images/user-review-ui-change-screen-patch-sets.png"]
|
image::images/user-review-ui-change-screen-patch-sets.png[width=800, link="images/user-review-ui-change-screen-patch-sets.png"]
|
||||||
|
|
||||||
|
Another indication is a highlighted drop-down label.
|
||||||
|
|
||||||
|
image::images/user-review-ui-change-screen-not-current.png[width=800, link="images/user-review-ui-change-screen-not-current.png"]
|
||||||
|
|
||||||
[[patch-set-drop-down]]
|
[[patch-set-drop-down]]
|
||||||
The patch set drop-down list shows the list of patch sets and allows to
|
The patch set drop-down list shows the list of patch sets and allows to
|
||||||
switch between them. The patch sets are sorted in descending order so
|
switch between them. The patch sets are sorted in descending order so
|
||||||
|
@@ -126,6 +126,7 @@ public class ChangeScreen extends Screen {
|
|||||||
String pushCertStatus();
|
String pushCertStatus();
|
||||||
String replyBox();
|
String replyBox();
|
||||||
String selected();
|
String selected();
|
||||||
|
String notCurrentPatchSet();
|
||||||
}
|
}
|
||||||
|
|
||||||
static ChangeScreen get(NativeEvent in) {
|
static ChangeScreen get(NativeEvent in) {
|
||||||
@@ -416,6 +417,14 @@ public class ChangeScreen extends Screen {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void updatePatchSetsTextStyle(boolean isPatchSetCurrent) {
|
||||||
|
if (isPatchSetCurrent) {
|
||||||
|
patchSetsText.removeClassName(style.notCurrentPatchSet());
|
||||||
|
} else {
|
||||||
|
patchSetsText.addClassName(style.notCurrentPatchSet());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
private void initRevisionsAction(ChangeInfo info, String revision,
|
private void initRevisionsAction(ChangeInfo info, String revision,
|
||||||
NativeMap<ActionInfo> actions) {
|
NativeMap<ActionInfo> actions) {
|
||||||
int currentPatchSet;
|
int currentPatchSet;
|
||||||
@@ -429,16 +438,22 @@ public class ChangeScreen extends Screen {
|
|||||||
}
|
}
|
||||||
|
|
||||||
String currentlyViewedPatchSet;
|
String currentlyViewedPatchSet;
|
||||||
if (info.revision(revision).id().equals("edit")) {
|
boolean isPatchSetCurrent = true;
|
||||||
|
String revisionId = info.revision(revision).id();
|
||||||
|
if (revisionId.equals("edit")) {
|
||||||
currentlyViewedPatchSet =
|
currentlyViewedPatchSet =
|
||||||
Resources.M.editPatchSet(RevisionInfo.findEditParent(info.revisions()
|
Resources.M.editPatchSet(RevisionInfo.findEditParent(info.revisions()
|
||||||
.values()));
|
.values()));
|
||||||
currentPatchSet = info.revisions().values().length() - 1;
|
currentPatchSet = info.revisions().values().length() - 1;
|
||||||
} else {
|
} else {
|
||||||
currentlyViewedPatchSet = info.revision(revision).id();
|
currentlyViewedPatchSet = revisionId;
|
||||||
|
if (!currentlyViewedPatchSet.equals(Integer.toString(currentPatchSet))) {
|
||||||
|
isPatchSetCurrent = false;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
patchSetsText.setInnerText(Resources.M.patchSets(
|
patchSetsText.setInnerText(Resources.M.patchSets(
|
||||||
currentlyViewedPatchSet, currentPatchSet));
|
currentlyViewedPatchSet, currentPatchSet));
|
||||||
|
updatePatchSetsTextStyle(isPatchSetCurrent);
|
||||||
patchSetsAction = new PatchSetsAction(
|
patchSetsAction = new PatchSetsAction(
|
||||||
info.legacyId(), revision, edit,
|
info.legacyId(), revision, edit,
|
||||||
style, headerLine, patchSets);
|
style, headerLine, patchSets);
|
||||||
|
@@ -338,6 +338,10 @@ limitations under the License.
|
|||||||
.pushCertStatus {
|
.pushCertStatus {
|
||||||
padding-left: 5px;
|
padding-left: 5px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.notCurrentPatchSet {
|
||||||
|
background-color: #FFA62F;
|
||||||
|
}
|
||||||
</ui:style>
|
</ui:style>
|
||||||
|
|
||||||
<g:HTMLPanel styleName='{style.cs2}'>
|
<g:HTMLPanel styleName='{style.cs2}'>
|
||||||
|
Reference in New Issue
Block a user