Fix bug, don't try to render Dashboard charts if the project doesn't have tasks
FEA: ItEr76S15OrganizingPerProjectDashboard
This commit is contained in:
parent
03d8e6cc36
commit
a2470de890
1 changed files with 10 additions and 17 deletions
|
|
@ -32,7 +32,6 @@ import java.util.Set;
|
||||||
import org.apache.commons.lang.StringUtils;
|
import org.apache.commons.lang.StringUtils;
|
||||||
import org.libreplan.business.orders.entities.Order;
|
import org.libreplan.business.orders.entities.Order;
|
||||||
import org.libreplan.business.planner.entities.TaskStatusEnum;
|
import org.libreplan.business.planner.entities.TaskStatusEnum;
|
||||||
import org.libreplan.web.common.Util;
|
|
||||||
import org.libreplan.web.dashboard.DashboardModel.Interval;
|
import org.libreplan.web.dashboard.DashboardModel.Interval;
|
||||||
import org.springframework.beans.factory.config.BeanDefinition;
|
import org.springframework.beans.factory.config.BeanDefinition;
|
||||||
import org.springframework.context.annotation.Scope;
|
import org.springframework.context.annotation.Scope;
|
||||||
|
|
@ -42,7 +41,6 @@ import org.zkoss.zk.ui.util.GenericForwardComposer;
|
||||||
import org.zkoss.zul.Div;
|
import org.zkoss.zul.Div;
|
||||||
import org.zkoss.zul.Grid;
|
import org.zkoss.zul.Grid;
|
||||||
import org.zkoss.zul.Label;
|
import org.zkoss.zul.Label;
|
||||||
import org.zkoss.zul.Window;
|
|
||||||
|
|
||||||
import br.com.digilabs.jqplot.Chart;
|
import br.com.digilabs.jqplot.Chart;
|
||||||
import br.com.digilabs.jqplot.JqPlotUtils;
|
import br.com.digilabs.jqplot.JqPlotUtils;
|
||||||
|
|
@ -62,8 +60,6 @@ public class DashboardController extends GenericForwardComposer {
|
||||||
|
|
||||||
private IDashboardModel dashboardModel;
|
private IDashboardModel dashboardModel;
|
||||||
|
|
||||||
private Window dashboardWindow;
|
|
||||||
|
|
||||||
private Grid gridTasksSummary;
|
private Grid gridTasksSummary;
|
||||||
private Grid gridMarginWithDeadline;
|
private Grid gridMarginWithDeadline;
|
||||||
|
|
||||||
|
|
@ -78,28 +74,25 @@ public class DashboardController extends GenericForwardComposer {
|
||||||
@Override
|
@Override
|
||||||
public void doAfterCompose(org.zkoss.zk.ui.Component comp) throws Exception {
|
public void doAfterCompose(org.zkoss.zk.ui.Component comp) throws Exception {
|
||||||
super.doAfterCompose(comp);
|
super.doAfterCompose(comp);
|
||||||
this.dashboardWindow = (Window) comp;
|
|
||||||
self.setAttribute("controller", this);
|
|
||||||
Util.createBindingsFor(this.dashboardWindow);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setCurrentOrder(Order order) {
|
public void setCurrentOrder(Order order) {
|
||||||
dashboardModel.setCurrentOrder(order);
|
dashboardModel.setCurrentOrder(order);
|
||||||
if (dashboardModel.tasksAvailable()) {
|
if (dashboardModel.tasksAvailable()) {
|
||||||
|
if (self != null) {
|
||||||
|
renderGlobalProgress();
|
||||||
|
renderTaskStatus();
|
||||||
|
renderTaskCompletationLag();
|
||||||
|
renderTasksSummary();
|
||||||
|
renderDeadlineViolation();
|
||||||
|
renderMarginWithDeadline();
|
||||||
|
renderEstimationAccuracy();
|
||||||
|
renderCostStatus(order);
|
||||||
|
}
|
||||||
showCharts();
|
showCharts();
|
||||||
} else {
|
} else {
|
||||||
hideCharts();
|
hideCharts();
|
||||||
}
|
}
|
||||||
if (this.dashboardWindow != null) {
|
|
||||||
renderGlobalProgress();
|
|
||||||
renderTaskStatus();
|
|
||||||
renderTaskCompletationLag();
|
|
||||||
renderTasksSummary();
|
|
||||||
renderDeadlineViolation();
|
|
||||||
renderMarginWithDeadline();
|
|
||||||
renderEstimationAccuracy();
|
|
||||||
renderCostStatus(order);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private void renderCostStatus(Order order) {
|
private void renderCostStatus(Order order) {
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue