ref 18753: Add menu to Accounting Dashboard pages
https://support.d4science.org/issues/18753 Added TOC menu in reports
This commit is contained in:
parent
95b009ae60
commit
95f5670e9f
|
@ -5,6 +5,7 @@
|
|||
<Change>Added Core Services support [ticket #18291]</Change>
|
||||
<Change>Added Detached REs support [ticket #18815]</Change>
|
||||
<Change>Added the alphabetical sorting of tabs [ticket #18754]</Change>
|
||||
<Change>Added TOC menu in reports [ticket #18753]</Change>
|
||||
</Changeset>
|
||||
<Changeset component="org.gcube.portlets.user.accounting-dashboard.1-1-0"
|
||||
date="2019-10-01">
|
||||
|
|
|
@ -1,8 +1,11 @@
|
|||
package org.gcube.portlets.user.accountingdashboard.client.application;
|
||||
|
||||
import java.util.logging.Level;
|
||||
import java.util.logging.Logger;
|
||||
|
||||
import org.gcube.portlets.user.accountingdashboard.client.application.controller.Controller;
|
||||
import org.gcube.portlets.user.accountingdashboard.client.application.menu.MenuPresenter;
|
||||
import org.gcube.portlets.user.accountingdashboard.client.place.NameTokens;
|
||||
|
||||
import com.google.gwt.user.client.Window;
|
||||
import com.google.inject.Inject;
|
||||
|
@ -15,6 +18,7 @@ import com.gwtplatform.mvp.client.presenter.slots.PermanentSlot;
|
|||
import com.gwtplatform.mvp.client.proxy.NavigationEvent;
|
||||
import com.gwtplatform.mvp.client.proxy.NavigationHandler;
|
||||
import com.gwtplatform.mvp.client.proxy.Proxy;
|
||||
import com.gwtplatform.mvp.shared.proxy.PlaceRequest;
|
||||
|
||||
/**
|
||||
*
|
||||
|
@ -24,6 +28,9 @@ import com.gwtplatform.mvp.client.proxy.Proxy;
|
|||
public class ApplicationPresenter
|
||||
extends Presenter<ApplicationPresenter.PresenterView, ApplicationPresenter.ApplicationPresenterProxy>
|
||||
implements NavigationHandler {
|
||||
|
||||
private static Logger logger = java.util.logging.Logger.getLogger("");
|
||||
|
||||
interface PresenterView extends View {
|
||||
}
|
||||
|
||||
|
@ -36,11 +43,10 @@ public class ApplicationPresenter
|
|||
|
||||
private MenuPresenter menuPresenter;
|
||||
private Controller controller;
|
||||
|
||||
|
||||
@Inject
|
||||
ApplicationPresenter(EventBus eventBus, PresenterView view, ApplicationPresenterProxy proxy, MenuPresenter menuPresenter,
|
||||
Controller controller) {
|
||||
ApplicationPresenter(EventBus eventBus, PresenterView view, ApplicationPresenterProxy proxy,
|
||||
MenuPresenter menuPresenter, Controller controller) {
|
||||
super(eventBus, view, proxy, RevealType.Root);
|
||||
this.menuPresenter = menuPresenter;
|
||||
this.controller = controller;
|
||||
|
@ -63,16 +69,21 @@ public class ApplicationPresenter
|
|||
|
||||
@Override
|
||||
public void onNavigation(NavigationEvent navigationEvent) {
|
||||
Window.scrollTo(0, 0);
|
||||
// PlaceRequest placeRequest=navigationEvent.getRequest();
|
||||
// placeManager.revealPlace(placeRequest);
|
||||
|
||||
if (navigationEvent != null) {
|
||||
PlaceRequest placeRequest = navigationEvent.getRequest();
|
||||
logger.log(Level.FINE, "Navigation: " + placeRequest);
|
||||
// If the navigation is related to mainarea scrollbar is not reset
|
||||
if (placeRequest.getNameToken().compareTo(NameTokens.getMainArea()) != 0) {
|
||||
Window.scrollTo(0, 0);
|
||||
}
|
||||
// placeManager.revealPlace(placeRequest);
|
||||
} else {
|
||||
Window.scrollTo(0, 0);
|
||||
}
|
||||
}
|
||||
|
||||
private void callHello(){
|
||||
|
||||
private void callHello() {
|
||||
controller.callHello();
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
|
|
@ -12,9 +12,13 @@ import org.gcube.portlets.user.accountingdashboard.client.resources.AppResources
|
|||
import org.gcube.portlets.user.accountingdashboard.shared.data.ReportData;
|
||||
import org.gcube.portlets.user.accountingdashboard.shared.data.ReportElementData;
|
||||
|
||||
import com.github.gwtbootstrap.client.ui.NavHeader;
|
||||
import com.github.gwtbootstrap.client.ui.NavLink;
|
||||
import com.github.gwtbootstrap.client.ui.Tab;
|
||||
import com.github.gwtbootstrap.client.ui.TabPanel;
|
||||
import com.github.gwtbootstrap.client.ui.WellNavList;
|
||||
import com.github.gwtbootstrap.client.ui.base.IconAnchor;
|
||||
import com.github.gwtbootstrap.client.ui.constants.IconType;
|
||||
import com.google.gwt.event.dom.client.ClickEvent;
|
||||
import com.google.gwt.event.dom.client.ClickHandler;
|
||||
import com.google.gwt.uibinder.client.UiBinder;
|
||||
|
@ -96,6 +100,31 @@ public class ReportAreaView extends ViewWithUiHandlers<ReportAreaPresenter>
|
|||
Tab tab = new Tab();
|
||||
tab.setHeading(category);
|
||||
HTMLPanel tabContent = new HTMLPanel("");
|
||||
if(categories.get(category).size()>0){
|
||||
WellNavList toc=new WellNavList();
|
||||
toc.addStyleName(resources.uiDataCss().uiDataReportToc());
|
||||
NavHeader navHeader=new NavHeader();
|
||||
if(categories.get(category).size()>1){
|
||||
navHeader.setText("Available Graphs");
|
||||
}else {
|
||||
navHeader.setText("Available Graph");
|
||||
}
|
||||
toc.add(navHeader);
|
||||
for (Chart chart : categories.get(category)) {
|
||||
ReportElementData reData=chart.getReportElementData();
|
||||
StringBuilder navLinkText=new StringBuilder();
|
||||
navLinkText.append(reData.getLabel());
|
||||
//navLinkText.append("[");
|
||||
//navLinkText.append(reData.getCategory());
|
||||
//navLinkText.append("]");
|
||||
NavLink navLink=new NavLink(navLinkText.toString(),"#"+chart.getName());
|
||||
navLink.setIcon(IconType.BAR_CHART);
|
||||
navLink.addStyleName(resources.uiDataCss().uiDataReportTocNavLink());
|
||||
toc.add(navLink);
|
||||
}
|
||||
tabContent.add(toc);
|
||||
}
|
||||
|
||||
for (Chart chart : categories.get(category)) {
|
||||
tabContent.add(chart);
|
||||
}
|
||||
|
|
|
@ -46,6 +46,14 @@ public class Chart extends HTMLPanel {
|
|||
|
||||
}
|
||||
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
|
||||
public ReportElementData getReportElementData() {
|
||||
return reportElementData;
|
||||
}
|
||||
|
||||
public void forceLayout() {
|
||||
redrawChart();
|
||||
}
|
||||
|
@ -181,9 +189,9 @@ public class Chart extends HTMLPanel {
|
|||
heading += "," + recordData.getX();
|
||||
datasetRow += "," + recordData.getY();
|
||||
}
|
||||
|
||||
var csvData=heading+"\n"+datasetRow + "\n";
|
||||
var csvDataEncoded=encodeURI(csvData);
|
||||
|
||||
var csvData = heading + "\n" + datasetRow + "\n";
|
||||
var csvDataEncoded = encodeURI(csvData);
|
||||
csvContent += csvDataEncoded;
|
||||
} else {
|
||||
var datasetRow = seriesData.getLabel();
|
||||
|
@ -191,8 +199,8 @@ public class Chart extends HTMLPanel {
|
|||
var recordData = dataRow[j];
|
||||
datasetRow += "," + recordData.getY();
|
||||
}
|
||||
var csvData=datasetRow + "\n";
|
||||
var csvDataEncoded=encodeURI(csvData);
|
||||
var csvData = datasetRow + "\n";
|
||||
var csvDataEncoded = encodeURI(csvData);
|
||||
csvContent += csvDataEncoded;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -38,7 +38,11 @@ public interface AppResources extends ClientBundle {
|
|||
String uiDataReportPanel();
|
||||
|
||||
String uiDataReportTabPanel();
|
||||
|
||||
|
||||
String uiDataReportToc();
|
||||
|
||||
String uiDataReportTocNavLink();
|
||||
|
||||
String uiDataChartWrapper();
|
||||
|
||||
String uiDataChartCanvas();
|
||||
|
|
|
@ -67,6 +67,22 @@
|
|||
max-width: 800px;
|
||||
}
|
||||
|
||||
/* TOC WellNavList */
|
||||
.uiDataReportToc {
|
||||
padding: 8px 0px;
|
||||
max-width: 600px;
|
||||
}
|
||||
|
||||
/* TOC NavLink */
|
||||
.uiDataReportTocNavLink {
|
||||
color: rgb(59, 89, 152);
|
||||
}
|
||||
|
||||
/* TOC NavLink href */
|
||||
.uiDataReportTocNavLink a {
|
||||
color: rgb(59, 89, 152);
|
||||
}
|
||||
|
||||
|
||||
/* Chart */
|
||||
.uiDataChartWrapper {
|
||||
|
|
Loading…
Reference in New Issue