Skip to content
This repository has been archived by the owner on Nov 9, 2017. It is now read-only.

Commit

Permalink
Implement report bug link in workspace: https://bugzilla.redhat.com/s…
Browse files Browse the repository at this point in the history
  • Loading branch information
Alex Eng authored and alex-sl-eng committed Aug 2, 2012
1 parent 3192a92 commit 838fda9
Show file tree
Hide file tree
Showing 6 changed files with 30 additions and 7 deletions.
Expand Up @@ -69,8 +69,6 @@ public interface Display extends net.customware.gwt.presenter.client.widget.Widg

HasClickHandlers getDocumentsLink();

void initMenuList(String userLabel, Command helpMenuCommand, Command leaveWorkspaceMenuCommand, Command signOutMenuCommand, Command layoutMenuCommand);

void setWorkspaceNameLabel(String workspaceNameLabel, String workspaceTitle);

void setDocumentLabel(String docPath, String docName);
Expand All @@ -93,6 +91,8 @@ public interface Display extends net.customware.gwt.presenter.client.widget.Widg

void cancelNotificationAlert();

void initMenuList(String userLabel, Command helpMenuCommand, Command reportProblemMenuCommand, Command leaveWorkspaceMenuCommand, Command signOutMenuCommand, Command layoutMenuCommand);

}

private final DashboardPresenter dashboardPresenter;
Expand All @@ -118,6 +118,7 @@ public interface Display extends net.customware.gwt.presenter.client.widget.Widg
private MainView currentView = null;

private static final String WORKSPACE_TITLE_QUERY_PARAMETER_KEY = "title";
private static final String REPORT_PROBLEM_LINK = "https://bugzilla.redhat.com/enter_bug.cgi?format=guided&product=Zanata";

private boolean enableDashBoard = false;

Expand Down Expand Up @@ -302,6 +303,15 @@ public void execute()
}
};

Command reportProblemCommand = new Command()
{
@Override
public void execute()
{
com.google.gwt.user.client.Window.open(REPORT_PROBLEM_LINK, REPORT_PROBLEM_LINK, null);
}
};

Command signOutMenuCommand = new Command()
{
@Override
Expand Down Expand Up @@ -330,7 +340,7 @@ public void execute()
}
};

display.initMenuList(identity.getPerson().getName(), helpMenuCommand, leaveWorkspaceMenuCommand, signOutMenuCommand, layoutMenuMenuCommand);
display.initMenuList(identity.getPerson().getName(), helpMenuCommand, reportProblemCommand, leaveWorkspaceMenuCommand, signOutMenuCommand, layoutMenuMenuCommand);

if (enableDashBoard)
{
Expand Down
Expand Up @@ -120,4 +120,7 @@ public interface Resources extends ClientBundle
@Source("images/crystal_project/_24x24/apps/kfind.png")
ImageResource search();

@Source("images/crystal_project/_16x16/apps/bug.png")
ImageResource bug();

}
@@ -1,7 +1,5 @@
package org.zanata.webtrans.client.resources;

import java.util.List;

import com.google.gwt.i18n.client.LocalizableResource.DefaultLocale;
import com.google.gwt.i18n.client.LocalizableResource.Generate;
import com.google.gwt.i18n.client.Messages;
Expand Down Expand Up @@ -379,4 +377,7 @@ public interface WebTransMessages extends Messages

@DefaultMessage("Chat")
String chatScope();

@DefaultMessage("Report a problem")
String reportAProblem();
}
Expand Up @@ -104,6 +104,8 @@ interface Styles extends CssResource

MenuItem helpMenuItem;

MenuItem reportProblemMenuItem;

MenuItem leaveWorkspaceMenuItem;

MenuItem signOutMenuItem;
Expand Down Expand Up @@ -219,14 +221,17 @@ public HasClickHandlers getDocumentsLink()
}

@Override
public void initMenuList(String userLabel, Command helpMenuCommand, Command leaveWorkspaceMenuCommand, Command signOutMenuCommand, Command layoutMenuCommand)
public void initMenuList(String userLabel, Command helpMenuCommand, Command reportProblemMenuCommand, Command leaveWorkspaceMenuCommand, Command signOutMenuCommand, Command layoutMenuCommand)
{
MenuBar menuBar = new MenuBar(true);
menuBar.addStyleName(style.menuBar());

ImageLabel helpImageLabel = new ImageLabel(resources.help(), messages.help());
helpImageLabel.setImageStyle(style.image());

ImageLabel reportProblemImageLabel = new ImageLabel(resources.bug(), messages.reportAProblem());
reportProblemImageLabel.setImageStyle(style.image());

ImageLabel layoutImageLabel = new ImageLabel(resources.viewChoose(), messages.layoutSelection());
layoutImageLabel.setImageStyle(style.image());

Expand All @@ -240,6 +245,10 @@ public void initMenuList(String userLabel, Command helpMenuCommand, Command leav
helpMenuItem.addStyleName(style.menuItem());
menuBar.addSeparator();

reportProblemMenuItem = menuBar.addItem(reportProblemImageLabel.getElement().getString(), true, reportProblemMenuCommand);
reportProblemMenuItem.addStyleName(style.menuItem());
menuBar.addSeparator();

layoutMenuItem = menuBar.addItem(layoutImageLabel.getElement().getString(), true, layoutMenuCommand);
layoutMenuItem.addStyleName(style.menuItem());
layoutMenuSeperator = menuBar.addSeparator();
Expand Down
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Expand Up @@ -758,7 +758,7 @@ private void expectPresenterSetupActions()
mockSearchResultsPresenter.concealDisplay();
expectLastCall().once();

mockDisplay.initMenuList(isA(String.class), isA(Command.class), isA(Command.class), isA(Command.class), isA(Command.class));
mockDisplay.initMenuList(isA(String.class), isA(Command.class), isA(Command.class), isA(Command.class), isA(Command.class), isA(Command.class));
expectLastCall().once();

mockDisplay.setLayoutMenuVisible(false);
Expand Down

0 comments on commit 838fda9

Please sign in to comment.