From 69f2dd13246427b0940633db36623190cc44eeba Mon Sep 17 00:00:00 2001 From: nmirasch Date: Thu, 1 Mar 2018 23:25:28 +0100 Subject: [PATCH] error detail breadcrumb updated with the error detail title (#21) --- .../ExecutionErrorDetailsPresenter.java | 8 ++++---- .../errorlist/ExecutionErrorListPresenter.java | 3 ++- .../ExecutionErrorDetailsPresenterTest.java | 14 ++++++++++++++ 3 files changed, 20 insertions(+), 5 deletions(-) diff --git a/jbpm-wb-executor-service/jbpm-wb-executor-service-client/src/main/java/org/jbpm/workbench/es/client/editors/errordetails/ExecutionErrorDetailsPresenter.java b/jbpm-wb-executor-service/jbpm-wb-executor-service-client/src/main/java/org/jbpm/workbench/es/client/editors/errordetails/ExecutionErrorDetailsPresenter.java index f7ef65180e..9fef88bf21 100644 --- a/jbpm-wb-executor-service/jbpm-wb-executor-service-client/src/main/java/org/jbpm/workbench/es/client/editors/errordetails/ExecutionErrorDetailsPresenter.java +++ b/jbpm-wb-executor-service/jbpm-wb-executor-service-client/src/main/java/org/jbpm/workbench/es/client/editors/errordetails/ExecutionErrorDetailsPresenter.java @@ -73,6 +73,10 @@ public void onStartup(final PlaceRequest place) { this.place = place; } + public static String getErrorDetailTitle(final ExecutionErrorSummary summary) { + return summary.getProcessId() + " - " + summary.getProcessInstanceId() + " (" + summary.getDeploymentId() + ")"; + } + public void onExecutionErrorSelectedEvent(@Observes ExecutionErrorSelectedEvent event) { this.serverTemplateId = event.getServerTemplateId(); this.deploymentId = event.getDeploymentId(); @@ -104,10 +108,6 @@ public void refreshExecutionErrorDataRemote(final String serverTemplateId, errorId); } - private String getErrorDetailTitle(ExecutionErrorSummary summary) { - return summary.getProcessId() + " - " + summary.getProcessInstanceId() + " (" + summary.getDeploymentId() + ")"; - } - @Inject public void setExecutorService(final Caller executorServices) { this.executorServices = executorServices; diff --git a/jbpm-wb-executor-service/jbpm-wb-executor-service-client/src/main/java/org/jbpm/workbench/es/client/editors/errorlist/ExecutionErrorListPresenter.java b/jbpm-wb-executor-service/jbpm-wb-executor-service-client/src/main/java/org/jbpm/workbench/es/client/editors/errorlist/ExecutionErrorListPresenter.java index 34a6b57a9d..d1a741c445 100644 --- a/jbpm-wb-executor-service/jbpm-wb-executor-service-client/src/main/java/org/jbpm/workbench/es/client/editors/errorlist/ExecutionErrorListPresenter.java +++ b/jbpm-wb-executor-service/jbpm-wb-executor-service-client/src/main/java/org/jbpm/workbench/es/client/editors/errorlist/ExecutionErrorListPresenter.java @@ -36,6 +36,7 @@ import org.jbpm.workbench.common.client.menu.RefreshMenuBuilder; import org.jbpm.workbench.df.client.filter.FilterSettings; import org.jbpm.workbench.df.client.filter.FilterSettingsBuilderHelper; +import org.jbpm.workbench.es.client.editors.errordetails.ExecutionErrorDetailsPresenter; import org.jbpm.workbench.es.client.i18n.Constants; import org.jbpm.workbench.es.model.ExecutionErrorSummary; import org.jbpm.workbench.es.client.editors.events.ExecutionErrorSelectedEvent; @@ -246,7 +247,7 @@ public Menus getMenus() { } public void selectExecutionError(final ExecutionErrorSummary summary) { - setupDetailBreadcrumb(constants.ExecutionErrorBreadcrumb(summary.getErrorId())); + setupDetailBreadcrumb(constants.ExecutionErrorBreadcrumb(ExecutionErrorDetailsPresenter.getErrorDetailTitle(summary))); placeManager.goTo(PerspectiveIds.EXECUTION_ERROR_DETAILS_SCREEN); executionErrorSelectedEvent.fire(new ExecutionErrorSelectedEvent(getSelectedServerTemplate(), summary.getDeploymentId(), diff --git a/jbpm-wb-executor-service/jbpm-wb-executor-service-client/src/test/java/org/jbpm/workbench/es/client/editors/errordetails/ExecutionErrorDetailsPresenterTest.java b/jbpm-wb-executor-service/jbpm-wb-executor-service-client/src/test/java/org/jbpm/workbench/es/client/editors/errordetails/ExecutionErrorDetailsPresenterTest.java index b27052bdb7..452173cc94 100644 --- a/jbpm-wb-executor-service/jbpm-wb-executor-service-client/src/test/java/org/jbpm/workbench/es/client/editors/errordetails/ExecutionErrorDetailsPresenterTest.java +++ b/jbpm-wb-executor-service/jbpm-wb-executor-service-client/src/test/java/org/jbpm/workbench/es/client/editors/errordetails/ExecutionErrorDetailsPresenterTest.java @@ -17,6 +17,7 @@ import com.google.gwtmockito.GwtMockitoTestRunner; import org.jboss.errai.common.client.api.Caller; +import org.jbpm.workbench.es.model.ErrorSummary; import org.jbpm.workbench.es.model.ExecutionErrorSummary; import org.jbpm.workbench.es.client.editors.events.ExecutionErrorSelectedEvent; import org.jbpm.workbench.es.service.ExecutorService; @@ -98,4 +99,17 @@ private void assertRefresErrorDetails(){ " (" + testError.getDeploymentId() + ")", captor.getValue().getTitle()); } + + @Test + public void testErrorDetailTitleGeneration() { + + ExecutionErrorSummary testError = createTestError(errorId, + deploymentId); + String title = ExecutionErrorDetailsPresenter.getErrorDetailTitle(testError); + + assertEquals(testError.getProcessId() + + " - " + testError.getProcessInstanceId() + + " (" + testError.getDeploymentId() + ")", + title); + } } \ No newline at end of file