Merge branch 'stable-2.9'

* stable-2.9:
  ChangeScreen2: Make project settings gear icon a proper hyperlink
  Remove unused dashboard icon resource
  ChangeScreen2: Link project name to dashboard

Conflicts:
	gerrit-gwtui/src/main/java/com/google/gerrit/client/GerritResources.java
	gerrit-gwtui/src/main/java/com/google/gerrit/client/change/ChangeScreen2.java
	gerrit-gwtui/src/main/java/com/google/gerrit/client/change/ChangeScreen2.ui.xml

Change-Id: I2d67b91f39fa844afcc8ab4a2a4fb9e1234c2003
This commit is contained in:
David Pursehouse
2014-04-28 13:18:48 +09:00
5 changed files with 21 additions and 13 deletions

View File

@@ -78,7 +78,4 @@ public interface GerritResources extends ClientBundle {
@Source("listAdd.png")
public ImageResource listAdd();
@Source("dashboard.png")
public ImageResource dashboard();
}

View File

@@ -43,6 +43,7 @@ import com.google.gerrit.client.rpc.ScreenLoadCallback;
import com.google.gerrit.client.ui.BranchLink;
import com.google.gerrit.client.ui.ChangeLink;
import com.google.gerrit.client.ui.CommentLinkProcessor;
import com.google.gerrit.client.ui.Hyperlink;
import com.google.gerrit.client.ui.InlineHyperlink;
import com.google.gerrit.client.ui.Screen;
import com.google.gerrit.client.ui.UserActivityMonitor;
@@ -55,6 +56,7 @@ import com.google.gerrit.reviewdb.client.PatchSet;
import com.google.gwt.core.client.GWT;
import com.google.gwt.core.client.JsArray;
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.NativeEvent;
import com.google.gwt.dom.client.SelectElement;
@@ -69,6 +71,7 @@ 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.DOM;
import com.google.gwt.user.client.Event;
import com.google.gwt.user.client.EventListener;
import com.google.gwt.user.client.rpc.AsyncCallback;
import com.google.gwt.user.client.ui.Anchor;
@@ -139,6 +142,7 @@ public class ChangeScreen2 extends Screen {
@UiField InlineHyperlink ownerLink;
@UiField Element statusText;
@UiField Image projectSettings;
@UiField AnchorElement projectSettingsLink;
@UiField InlineHyperlink projectDashboard;
@UiField InlineHyperlink branchLink;
@UiField Element strategy;
@@ -356,11 +360,16 @@ public class ChangeScreen2 extends Screen {
}
private void initProjectLinks(final ChangeInfo info) {
projectSettingsLink.setHref(
"#" + PageLinks.toProject(info.project_name_key()));
projectSettings.addDomHandler(new ClickHandler() {
@Override
public void onClick(ClickEvent event) {
Gerrit.display(
PageLinks.toProject(info.project_name_key()));
if (Hyperlink.impl.handleAsClick((Event) event.getNativeEvent())) {
event.stopPropagation();
event.preventDefault();
Gerrit.display(PageLinks.toProject(info.project_name_key()));
}
}
}, ClickEvent.getType());
projectDashboard.setText(info.project());

View File

@@ -386,13 +386,15 @@ limitations under the License.
title='Go to project dashboard'>
<ui:attribute name='title'/>
</x:InlineHyperlink>
<a ui:field='projectSettingsLink'
class='{style.projectSettings}'>
<g:Image
ui:field='projectSettings'
resource='{ico.gear}'
styleName='{style.projectSettings}'
title='Go to project settings'>
<ui:attribute name='title'/>
</g:Image>
</a>
</td>
</tr>
<tr>

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.2 KiB

View File

@@ -23,7 +23,7 @@ import com.google.gwt.user.client.ui.impl.HyperlinkImpl;
/** Standard GWT hyperlink with late updating of the token. */
public class Hyperlink extends com.google.gwt.user.client.ui.Hyperlink {
static final HyperlinkImpl impl = GWT.create(HyperlinkImpl.class);
public static final HyperlinkImpl impl = GWT.create(HyperlinkImpl.class);
/** Initialize a default hyperlink with no target and no text. */
public Hyperlink() {