paulovmr commented on code in PR #2018:
URL: 
https://github.com/apache/incubator-kie-kogito-apps/pull/2018#discussion_r1532816825


##########
runtime-tools-quarkus-extension-parent/runtime-tools-quarkus-extension-deployment/src/main/java/org/kie/kogito/runtime/tools/quarkus/extension/deployment/DevConsoleProcessor.java:
##########
@@ -79,31 +79,133 @@ public void deployStaticResources(final DevConsoleRecorder 
recorder,
 
         routeBuildItemBuildProducer.produce(new RouteBuildItem.Builder()
                 .route(BASE_RELATIVE_URL + "/resources/*")
-                
.handler(recorder.devConsoleHandler(devConsoleStaticResourcesDeploymentPath.toString(),
+                
.handler(devUIStaticArtifactsRecorder.handler(devConsoleStaticResourcesDeploymentPath.toString(),
                         shutdownContext))
                 .build());
 
         routeBuildItemBuildProducer.produce(new RouteBuildItem.Builder()
                 .route(BASE_RELATIVE_URL + "/*")
-                
.handler(recorder.devConsoleHandler(devConsoleStaticResourcesDeploymentPath.toString(),
+                
.handler(devUIStaticArtifactsRecorder.handler(devConsoleStaticResourcesDeploymentPath.toString(),
                         shutdownContext))
                 .build());
     }
 
-    @SuppressWarnings("unused")
     @BuildStep(onlyIf = IsDevelopment.class)
-    public void 
isProcessEnabled(BuildProducer<DevConsoleTemplateInfoBuildItem> 
devConsoleTemplateInfoBuildItemBuildProducer,
-            Optional<KogitoDataIndexServiceAvailableBuildItem> 
dataIndexServiceAvailableBuildItem,
-            Capabilities capabilities) {
-        devConsoleTemplateInfoBuildItemBuildProducer.produce(new 
DevConsoleTemplateInfoBuildItem("isProcessEnabled",
-                dataIndexServiceAvailableBuildItem.isPresent() || 
capabilities.isPresent(DATA_INDEX_CAPABILITY)));
+    public JsonRPCProvidersBuildItem createJsonRPCServiceForJBPMDevUi() {
+        return new JsonRPCProvidersBuildItem(JBPMDevuiJsonRPCService.class);
     }
 
-    @SuppressWarnings("unused")
     @BuildStep(onlyIf = IsDevelopment.class)
-    public void isTracingEnabled(final 
BuildProducer<DevConsoleTemplateInfoBuildItem> 
devConsoleTemplateInfoBuildItemBuildProducer,
-            final Optional<TrustyServiceAvailableBuildItem> 
trustyServiceAvailableBuildItem) {
-        devConsoleTemplateInfoBuildItemBuildProducer.produce(new 
DevConsoleTemplateInfoBuildItem("isTracingEnabled",
-                trustyServiceAvailableBuildItem.isPresent()));
+    public CardPageBuildItem pages(
+            final NonApplicationRootPathBuildItem 
nonApplicationRootPathBuildItem,
+            final DevConsoleRuntimeConfig devConsoleRuntimeConfig,
+            final ManagementInterfaceBuildTimeConfig 
managementInterfaceBuildTimeConfig,
+            final LaunchModeBuildItem launchModeBuildItem,
+            final ConfigurationBuildItem configurationBuildItem,
+            final List<SystemPropertyBuildItem> systemPropertyBuildItems,
+            final Optional<KogitoDataIndexServiceAvailableBuildItem> 
dataIndexServiceAvailableBuildItem,
+            final Optional<TrustyServiceAvailableBuildItem> 
trustyServiceAvailableBuildItem,
+            final Capabilities capabilities) {
+
+        CardPageBuildItem cardPageBuildItem = new CardPageBuildItem();
+
+        String uiPath = 
nonApplicationRootPathBuildItem.resolveManagementPath(BASE_RELATIVE_URL,
+                managementInterfaceBuildTimeConfig, launchModeBuildItem, true);
+
+        String openapiPath = getProperty(configurationBuildItem, 
systemPropertyBuildItems, "quarkus.smallrye-openapi.path");
+        String devUIUrl = getProperty(configurationBuildItem, 
systemPropertyBuildItems, "kogito.dev-ui.url");
+        String dataIndexUrl = getProperty(configurationBuildItem, 
systemPropertyBuildItems, "kogito.data-index.url");
+        String trustyServiceUrl = getProperty(configurationBuildItem, 
systemPropertyBuildItems, "kogito.trusty.http.url");
+
+        cardPageBuildItem.addBuildTimeData("extensionBasePath", uiPath);
+        cardPageBuildItem.addBuildTimeData("openapiPath", openapiPath);
+        cardPageBuildItem.addBuildTimeData("devUIUrl", devUIUrl);
+        cardPageBuildItem.addBuildTimeData("dataIndexUrl", dataIndexUrl);
+        cardPageBuildItem.addBuildTimeData("isTracingEnabled", 
trustyServiceAvailableBuildItem.isPresent());
+        cardPageBuildItem.addBuildTimeData("trustyServiceUrl", 
trustyServiceUrl);
+        cardPageBuildItem.addBuildTimeData("userData", 
readUsersInfo(devConsoleRuntimeConfig));
+
+        if (dataIndexServiceAvailableBuildItem.isPresent() || 
capabilities.isPresent(DATA_INDEX_CAPABILITY)) {
+            cardPageBuildItem.addPage(Page.webComponentPageBuilder()
+                    .componentLink("qwc-jbpm-quarkus-devui.js")
+                    .metadata("page", "Processes")
+                    .title("Process Instances")
+                    .icon("font-awesome-solid:diagram-project")
+                    
.streamingLabelJsonRPCMethodName("queryProcessInstancesCount"));

Review Comment:
   @pefernan The `streamingLabelJsonRPCMethodName` does not seen to be working 
for me. Process Instances is not showing a counter in the card while the others 
are. And they only appear after the extension is opened for the first time and 
I go back by clicking the logo, without refreshing the page.
   
   
![image](https://github.com/apache/incubator-kie-kogito-apps/assets/832830/6c3f137f-8d74-46ab-a0c9-0f40327b966e)
   



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to