This is an automated email from the ASF dual-hosted git repository.

wmedvedeo pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/incubator-kie-tools.git


The following commit(s) were added to refs/heads/main by this push:
     new 084154c3fcd kie-tools-2483: sonataflow-quarkus-devui: send the DevUI 
webapp a parameter to recognize we are in a local cluster (#2510)
084154c3fcd is described below

commit 084154c3fcdb5f5eb0bd201400f392cd872bda5a
Author: Walter Medvedeo <[email protected]>
AuthorDate: Tue Aug 6 17:18:13 2024 +0200

    kie-tools-2483: sonataflow-quarkus-devui: send the DevUI webapp a parameter 
to recognize we are in a local cluster (#2510)
---
 .../swf/tools/deployment/DevConsoleProcessor.java  |  9 ++++---
 .../dev-ui/qwc-sonataflow-quarkus-devui.js         | 25 ++++++++++--------
 .../SonataFlowQuarkusExtensionJsonRPCService.java  | 30 +++++++++++++---------
 3 files changed, 38 insertions(+), 26 deletions(-)

diff --git 
a/packages/sonataflow-quarkus-devui/sonataflow-quarkus-devui-deployment/src/main/java/org/kie/sonataflow/swf/tools/deployment/DevConsoleProcessor.java
 
b/packages/sonataflow-quarkus-devui/sonataflow-quarkus-devui-deployment/src/main/java/org/kie/sonataflow/swf/tools/deployment/DevConsoleProcessor.java
index c047eda5dc5..b5e8285bb20 100644
--- 
a/packages/sonataflow-quarkus-devui/sonataflow-quarkus-devui-deployment/src/main/java/org/kie/sonataflow/swf/tools/deployment/DevConsoleProcessor.java
+++ 
b/packages/sonataflow-quarkus-devui/sonataflow-quarkus-devui-deployment/src/main/java/org/kie/sonataflow/swf/tools/deployment/DevConsoleProcessor.java
@@ -108,15 +108,18 @@ public class DevConsoleProcessor {
 
         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 dataIndexUrl = null;
 
         cardPageBuildItem.addBuildTimeData("extensionBasePath", uiPath);
         cardPageBuildItem.addBuildTimeData("openapiPath", openapiPath);
         cardPageBuildItem.addBuildTimeData("devUIUrl", devUIUrl);
-        cardPageBuildItem.addBuildTimeData("dataIndexUrl", dataIndexUrl);
 
-        boolean isLocalCluster = 
ConfigProvider.getConfig().getOptionalValue(IS_LOCAL_CLUSTER, 
Boolean.class).orElse(false);
+        boolean isLocalCluster = 
ConfigProvider.getConfig().getOptionalValue(IS_LOCAL_CLUSTER, 
Boolean.class).orElse(true);
         cardPageBuildItem.addBuildTimeData("isLocalCluster", isLocalCluster);
+        if (!isLocalCluster) {
+            dataIndexUrl = getProperty(configurationBuildItem, 
systemPropertyBuildItems, "kogito.data-index.url");
+        }
+        cardPageBuildItem.addBuildTimeData("dataIndexUrl", dataIndexUrl);
 
         cardPageBuildItem.addPage(Page.webComponentPageBuilder()
                                           
.componentLink("qwc-sonataflow-quarkus-devui.js")
diff --git 
a/packages/sonataflow-quarkus-devui/sonataflow-quarkus-devui-deployment/src/main/resources/dev-ui/qwc-sonataflow-quarkus-devui.js
 
b/packages/sonataflow-quarkus-devui/sonataflow-quarkus-devui-deployment/src/main/resources/dev-ui/qwc-sonataflow-quarkus-devui.js
index a9075811e52..bd5920665c1 100644
--- 
a/packages/sonataflow-quarkus-devui/sonataflow-quarkus-devui-deployment/src/main/resources/dev-ui/qwc-sonataflow-quarkus-devui.js
+++ 
b/packages/sonataflow-quarkus-devui/sonataflow-quarkus-devui-deployment/src/main/resources/dev-ui/qwc-sonataflow-quarkus-devui.js
@@ -1,17 +1,20 @@
 /*
- * Copyright 2024 Red Hat, Inc. and/or its affiliates.
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
  *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ *  http://www.apache.org/licenses/LICENSE-2.0
  *
- *       http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
  */
 
 import { html, LitElement } from "lit";
diff --git 
a/packages/sonataflow-quarkus-devui/sonataflow-quarkus-devui/src/main/java/org/kie/sonataflow/swf/tools/runtime/rpc/SonataFlowQuarkusExtensionJsonRPCService.java
 
b/packages/sonataflow-quarkus-devui/sonataflow-quarkus-devui/src/main/java/org/kie/sonataflow/swf/tools/runtime/rpc/SonataFlowQuarkusExtensionJsonRPCService.java
index d148ba7aa0c..a6cdc7e5de0 100644
--- 
a/packages/sonataflow-quarkus-devui/sonataflow-quarkus-devui/src/main/java/org/kie/sonataflow/swf/tools/runtime/rpc/SonataFlowQuarkusExtensionJsonRPCService.java
+++ 
b/packages/sonataflow-quarkus-devui/sonataflow-quarkus-devui/src/main/java/org/kie/sonataflow/swf/tools/runtime/rpc/SonataFlowQuarkusExtensionJsonRPCService.java
@@ -1,17 +1,20 @@
 /*
- * Copyright 2024 Red Hat, Inc. and/or its affiliates.
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
  *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ *  http://www.apache.org/licenses/LICENSE-2.0
  *
- *       http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
  */
 
 package org.kie.sonataflow.swf.tools.runtime.rpc;
@@ -43,6 +46,9 @@ public class SonataFlowQuarkusExtensionJsonRPCService {
 
     public static final String ALL_WORKFLOWS_IDS_QUERY = "{ \"operationName\": 
\"getAllProcessesIds\", \"query\": \"query getAllProcessesIds{  
ProcessInstances{ id } }\" }";
 
+    /**
+     * Configures if the sonataflow-quarkus-devui will execute deployed in a 
k8s.
+     */
     public static final String IS_LOCAL_CLUSTER = 
"sonataflow.devui.isLocalCluster";
 
     private WebClient dataIndexWebClient;
@@ -58,7 +64,7 @@ public class SonataFlowQuarkusExtensionJsonRPCService {
 
     @PostConstruct
     public void init() {
-        isLocalCluster = 
ConfigProvider.getConfig().getOptionalValue(IS_LOCAL_CLUSTER, 
Boolean.class).orElse(false);
+        isLocalCluster = 
ConfigProvider.getConfig().getOptionalValue(IS_LOCAL_CLUSTER, 
Boolean.class).orElse(true);
         if (!isLocalCluster) {
             Optional<String> dataIndexURL = 
ConfigProvider.getConfig().getOptionalValue(DATA_INDEX_URL, String.class);
             dataIndexURL.ifPresent(this::initDataIndexWebClient);


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

Reply via email to