Skip to content

Commit

Permalink
JBPM-6885 - Split Task & Process Dashboard tabs into separated screens (
Browse files Browse the repository at this point in the history
  • Loading branch information
cristianonicolai authored Feb 28, 2018
1 parent 78de788 commit 047227e
Show file tree
Hide file tree
Showing 21 changed files with 275 additions and 554 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,8 @@ public interface PerspectiveIds extends org.kie.workbench.common.workbench.clien
String PROCESS_INSTANCE_LIST_SCREEN = "ProcessInstanceListScreen";
String PROCESS_DEFINITION_DETAILS_SCREEN = "ProcessDefinitionDetailsScreen";
String PROCESS_DEFINITION_LIST_SCREEN = "ProcessDefinitionListScreen";
String DASHBOARD_SCREEN = "DashboardScreen";
String PROCESS_DASHBOARD_SCREEN = "ProcessDashboardScreen";
String TASK_DASHBOARD_SCREEN = "TaskDashboardScreen";
String EXECUTION_ERROR_DETAILS_SCREEN = "ExecutionErrorDetailsScreen";
String EXECUTION_ERROR_LIST_SCREEN = "ExecutionErrorListScreen";
String JOB_LIST_SCREEN = "JobListScreen";
Expand Down

This file was deleted.

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,12 @@

import java.util.ArrayList;
import java.util.List;
import javax.annotation.PostConstruct;
import javax.enterprise.context.Dependent;
import javax.enterprise.event.Event;
import javax.enterprise.event.Observes;
import javax.inject.Inject;

import com.google.gwt.user.client.ui.IsWidget;
import org.dashbuilder.dataset.DataSet;
import org.dashbuilder.dataset.client.DataSetClientServices;
import org.dashbuilder.dataset.filter.DataSetFilter;
Expand All @@ -37,25 +37,32 @@
import org.dashbuilder.displayer.client.DisplayerLocator;
import org.dashbuilder.renderer.client.metric.MetricDisplayer;
import org.dashbuilder.renderer.client.table.TableDisplayer;
import org.jbpm.dashboard.renderer.client.panel.i18n.DashboardConstants;
import org.jbpm.workbench.common.client.PerspectiveIds;
import org.jbpm.workbench.common.client.menu.ServerTemplateSelectorMenuBuilder;
import org.jbpm.workbench.common.events.ServerTemplateSelected;
import org.jbpm.workbench.pr.events.ProcessInstanceSelectionEvent;
import org.jbpm.dashboard.renderer.client.panel.events.ProcessDashboardFocusEvent;
import org.jbpm.dashboard.renderer.client.panel.events.TaskDashboardFocusEvent;
import org.jbpm.dashboard.renderer.client.panel.formatter.DurationFormatter;
import org.jbpm.dashboard.renderer.client.panel.widgets.ProcessBreadCrumb;
import org.uberfire.client.annotations.WorkbenchMenu;
import org.uberfire.client.annotations.WorkbenchPartTitle;
import org.uberfire.client.annotations.WorkbenchPartView;
import org.uberfire.client.annotations.WorkbenchScreen;
import org.uberfire.client.mvp.PlaceManager;
import org.uberfire.client.mvp.PlaceStatus;
import org.uberfire.workbench.model.menu.MenuFactory;
import org.uberfire.workbench.model.menu.Menus;

import static org.jbpm.dashboard.renderer.model.DashboardData.*;
import static org.jbpm.workbench.common.client.PerspectiveIds.PROCESS_INSTANCE_DETAILS_SCREEN;


@Dependent
public class ProcessDashboard extends AbstractDashboard implements IsWidget {
@WorkbenchScreen(identifier = PerspectiveIds.PROCESS_DASHBOARD_SCREEN)
public class ProcessDashboard extends AbstractDashboard {

protected View view;
protected Event<ProcessInstanceSelectionEvent> instanceSelectionEvent;
protected Event<ProcessDashboardFocusEvent> processDashboardFocusEvent;
protected MetricDisplayer totalMetric;
protected MetricDisplayer activeMetric;
protected MetricDisplayer pendingMetric;
Expand Down Expand Up @@ -130,7 +137,6 @@ public ProcessDashboard(final View view,
final DisplayerCoordinator displayerCoordinator,
final PlaceManager placeManager,
final Event<ProcessInstanceSelectionEvent> instanceSelectionEvent,
final Event<ProcessDashboardFocusEvent> processDashboardFocusEvent,
final ServerTemplateSelectorMenuBuilder serverTemplateSelectorMenuBuilder) {

super(dataSetClientServices,
Expand All @@ -142,12 +148,29 @@ public ProcessDashboard(final View view,
serverTemplateSelectorMenuBuilder);
this.view = view;
this.instanceSelectionEvent = instanceSelectionEvent;
this.processDashboardFocusEvent = processDashboardFocusEvent;
}

@WorkbenchPartTitle
public String getTitle() {
return DashboardConstants.INSTANCE.processDashboardName();
}

@WorkbenchMenu
public Menus getMenus() {
return MenuFactory
.newTopLevelCustomMenu(serverTemplateSelectorMenuBuilder)
.endMenu()
.build();
}

this.init();
public void onServerTemplateSelected(@Observes final ServerTemplateSelected serverTemplateSelected) {
//Refresh view
placeManager.closePlace(PerspectiveIds.PROCESS_DASHBOARD_SCREEN);
placeManager.goTo(PerspectiveIds.PROCESS_DASHBOARD_SCREEN);
}

protected void init() {
@PostConstruct
public void init() {
processBreadCrumb.setOnRootSelectedCommand(this::resetProcessBreadcrumb);

view.showLoading();
Expand Down Expand Up @@ -252,6 +275,7 @@ public TableDisplayer getProcessesTable() {
}

@Override
@WorkbenchPartView
public AbstractDashboard.View getView() {
return view;
}
Expand Down Expand Up @@ -322,12 +346,10 @@ public void tableCellSelected(String columnId,

public void showDashboard() {
view.showDashboard();
processDashboardFocusEvent.fire(new ProcessDashboardFocusEvent());
closeProcessDetailsScreen();
}

public void openProcessDetailsScreen() {
processDashboardFocusEvent.fire(new ProcessDashboardFocusEvent());
PlaceStatus status = placeManager.getStatus(PROCESS_INSTANCE_DETAILS_SCREEN);
if (status == PlaceStatus.CLOSE) {
placeManager.goTo(PROCESS_INSTANCE_DETAILS_SCREEN);
Expand All @@ -344,11 +366,6 @@ public void closeProcessDetailsScreen() {
public void showProcessesTable() {
view.showInstances();
processesTable.redraw();
processDashboardFocusEvent.fire(new ProcessDashboardFocusEvent());
}

public void onManagingTasks(@Observes TaskDashboardFocusEvent event) {
closeProcessDetailsScreen();
}

public interface View extends AbstractDashboard.View {
Expand Down
Loading

0 comments on commit 047227e

Please sign in to comment.