From f52553572bac886e4b503eb1f4888b2520e7be57 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pere=20Fern=C3=A1ndez?= Date: Fri, 3 Nov 2023 10:15:25 +0100 Subject: [PATCH] kie-issues#639: Upgrade kie-tools to 0.32 (#1899) * kie-issues#639: Upgrade kie-tools to 0.32 * - fixed webapp resources path * - fix monaco-editor versions conflicts * - snapshot updates --- .../pom.xml | 12 +- .../resources/dev-templates/monitoring.html | 3 +- .../dev-templates/workflowInstances.html | 3 +- .../pom.xml | 4 + .../deployment/DevConsoleProcessor.java | 9 +- ui-packages/package.json | 7 +- .../packages/cloud-event-form/package.json | 10 +- .../CloudEventFormEnvelopeView.test.tsx.snap | 30 +- .../custom-dashboard-list/package.json | 4 +- .../custom-dashboard-view/package.json | 6 +- .../packages/form-details/package.json | 10 +- .../packages/form-displayer/package.json | 4 +- ui-packages/packages/forms-list/package.json | 4 +- .../packages/jobs-management/package.json | 4 +- .../management-console-shared/package.json | 4 +- .../process-definition-list/package.json | 4 +- .../packages/process-details/package.json | 10 +- .../src/api/ProcessDetailsEnvelopeApi.ts | 1 - .../src/embedded/EmbeddedProcessDetails.tsx | 2 - .../envelope/ProcessDetailsEnvelopeView.tsx | 3 - .../ProcessDetails/ProcessDetails.tsx | 5 +- .../SwfCombinedEditor/SwfCombinedEditor.tsx | 31 +- .../tests/SwfCombinedEditor.test.tsx | 6 +- .../packages/process-form/package.json | 4 +- .../packages/process-list/package.json | 6 +- .../runtime-tools-dev-ui-webapp/package.json | 17 +- ...less-workflow-mermaid-viewer-envelope.html | 46 - .../server/server.js | 4 +- .../src/api/RuntimeToolsDevUIEnvelopeApi.ts | 1 - .../DevUI/DevUILayout/DevUILayout.tsx | 3 - .../DevUILayout/tests/DevUILayout.test.tsx | 9 +- .../DevUI/RuntimeTools/RuntimeTools.tsx | 6 +- .../tests/CloudEventFormContainer.test.tsx | 1 - .../CustomDashboardViewContainer.test.tsx | 1 - .../tests/FormDetailsContainer.test.tsx | 1 - .../tests/FormsListContainer.test.tsx | 1 - .../tests/JosManagementContainer.test.tsx | 1 - .../ProcessDefinitionListContainer.test.tsx | 1 - .../ProcessDetailsContainer.tsx | 1 - .../tests/ProcessDetailsContainer.test.tsx | 1 - .../tests/ProcessFormContainer.test.tsx | 1 - .../tests/ProcessListContainer.test.tsx | 1 - .../tests/TaskFormContainer.test.tsx | 1 - .../tests/TaskInboxContainer.test.tsx | 1 - .../tests/WorkflowFormContainer.test.tsx | 1 - .../components/contexts/DevUIAppContext.tsx | 11 - .../contexts/DevUIAppContextProvider.tsx | 5 +- .../tests/FormDetailsPage.test.tsx | 1 - .../tests/JobsManagementPage.test.tsx | 1 - .../tests/ProcessDetailsPage.test.tsx | 1 - .../tests/TaskDetailsPage.test.tsx | 1 - .../RuntimeToolsDevUIEnvelopeApiImpl.ts | 2 - .../RuntimeToolsDevUIEnvelopeView.tsx | 6 - .../RuntimeToolsDevUIEnvelopeViewApi.ts | 1 - .../RuntimeToolsDevUIEnvelopeApiImpl.test.ts | 3 +- .../RuntimeToolsDevUIEnvelopeView.test.tsx | 5 - ...erlessWorkflowCombinedEditorEnvelopeApp.ts | 17 +- ...verlessWorkflowMermaidViewerEnvelopeApp.ts | 31 - ...ServerlessWorkflowTextEditorEnvelopeApp.ts | 25 +- .../src/standalone/standalone.ts | 5 - .../webpack.common.js | 49 +- .../packages/task-console-webapp/package.json | 4 +- .../packages/task-details/package.json | 4 +- ui-packages/packages/task-form/package.json | 4 +- ui-packages/packages/task-inbox/package.json | 4 +- ui-packages/packages/trusty/package.json | 2 +- .../packages/workflow-form/package.json | 10 +- .../__snapshots__/WorkflowForm.test.tsx.snap | 90 +- .../WorkflowFormEnvelopeView.test.tsx.snap | 30 +- ui-packages/pnpm-lock.yaml | 1149 ++++++----------- 70 files changed, 660 insertions(+), 1086 deletions(-) delete mode 100644 ui-packages/packages/runtime-tools-dev-ui-webapp/resources/serverless-workflow-mermaid-viewer-envelope.html delete mode 100644 ui-packages/packages/runtime-tools-dev-ui-webapp/src/resources/ServerlessWorkflowMermaidViewerEnvelopeApp.ts diff --git a/kogito-quarkus-serverless-workflow-devui-parent/kogito-quarkus-serverless-workflow-devui-deployment/pom.xml b/kogito-quarkus-serverless-workflow-devui-parent/kogito-quarkus-serverless-workflow-devui-deployment/pom.xml index a88f4645e1..20b5806d47 100644 --- a/kogito-quarkus-serverless-workflow-devui-parent/kogito-quarkus-serverless-workflow-devui-deployment/pom.xml +++ b/kogito-quarkus-serverless-workflow-devui-parent/kogito-quarkus-serverless-workflow-devui-deployment/pom.xml @@ -133,7 +133,11 @@ ${basedir}/target/classes/dev-static/webapp - ${path.to.webapp.app}/dist + ${path.to.webapp.app}/dist/resources/webapp + false + + + ${path.to.webapp.app}/dist/webapp false @@ -155,8 +159,6 @@ form-displayer.js serverless-workflow-combined-editor-envelope.html serverless-workflow-combined-editor-envelope.js - serverless-workflow-mermaid-viewer-envelope.html - serverless-workflow-mermaid-viewer-envelope.js serverless-workflow-text-editor-envelope.html serverless-workflow-text-editor-envelope.js serverless-workflow-diagram-editor-envelope.html @@ -164,8 +166,8 @@ - - ${path.to.webapp.app}/dist + + ${path.to.webapp.app}/dist/resources diagram/ diff --git a/kogito-quarkus-serverless-workflow-devui-parent/kogito-quarkus-serverless-workflow-devui-deployment/src/main/resources/dev-templates/monitoring.html b/kogito-quarkus-serverless-workflow-devui-parent/kogito-quarkus-serverless-workflow-devui-deployment/src/main/resources/dev-templates/monitoring.html index e244af0b41..160e99fbb3 100644 --- a/kogito-quarkus-serverless-workflow-devui-parent/kogito-quarkus-serverless-workflow-devui-deployment/src/main/resources/dev-templates/monitoring.html +++ b/kogito-quarkus-serverless-workflow-devui-parent/kogito-quarkus-serverless-workflow-devui-deployment/src/main/resources/dev-templates/monitoring.html @@ -41,8 +41,7 @@ diagramPreviewSize: { width: 1000, height: 1000 - }, - isStunnerEnabled: {config:property('kogito.swf.stunner.enabled') ?: true} + } }) {/body} {/include} diff --git a/kogito-quarkus-serverless-workflow-devui-parent/kogito-quarkus-serverless-workflow-devui-deployment/src/main/resources/dev-templates/workflowInstances.html b/kogito-quarkus-serverless-workflow-devui-parent/kogito-quarkus-serverless-workflow-devui-deployment/src/main/resources/dev-templates/workflowInstances.html index b82807a446..20024126b0 100644 --- a/kogito-quarkus-serverless-workflow-devui-parent/kogito-quarkus-serverless-workflow-devui-deployment/src/main/resources/dev-templates/workflowInstances.html +++ b/kogito-quarkus-serverless-workflow-devui-parent/kogito-quarkus-serverless-workflow-devui-deployment/src/main/resources/dev-templates/workflowInstances.html @@ -41,8 +41,7 @@ diagramPreviewSize: { width: 1000, height: 1000 - }, - isStunnerEnabled: {config:property('kogito.swf.stunner.enabled') ?: true} + } }) {/body} {/include} diff --git a/runtime-tools-quarkus-extension-parent/runtime-tools-quarkus-extension-deployment/pom.xml b/runtime-tools-quarkus-extension-parent/runtime-tools-quarkus-extension-deployment/pom.xml index a71f5e7e80..2c402db635 100644 --- a/runtime-tools-quarkus-extension-parent/runtime-tools-quarkus-extension-deployment/pom.xml +++ b/runtime-tools-quarkus-extension-parent/runtime-tools-quarkus-extension-deployment/pom.xml @@ -136,6 +136,10 @@ ${path.to.webapp.app}/dist/resources/webapp false + + ${path.to.webapp.app}/dist/webapp + false + diff --git a/runtime-tools-quarkus-extension-parent/runtime-tools-quarkus-extension-deployment/src/main/java/org/kie/kogito/runtime/tools/quarkus/extension/deployment/DevConsoleProcessor.java b/runtime-tools-quarkus-extension-parent/runtime-tools-quarkus-extension-deployment/src/main/java/org/kie/kogito/runtime/tools/quarkus/extension/deployment/DevConsoleProcessor.java index d3fb479805..f2b39a6f5d 100644 --- a/runtime-tools-quarkus-extension-parent/runtime-tools-quarkus-extension-deployment/src/main/java/org/kie/kogito/runtime/tools/quarkus/extension/deployment/DevConsoleProcessor.java +++ b/runtime-tools-quarkus-extension-parent/runtime-tools-quarkus-extension-deployment/src/main/java/org/kie/kogito/runtime/tools/quarkus/extension/deployment/DevConsoleProcessor.java @@ -46,6 +46,7 @@ public class DevConsoleProcessor { private static final String STATIC_RESOURCES_PATH = "dev-static/"; + private static final String BASE_RELATIVE_URL = "/q/dev/org.kie.kogito.runtime-tools-quarkus-extension"; private static final String DATA_INDEX_CAPABILITY = "org.kie.kogito.data-index"; @SuppressWarnings("unused") @@ -77,7 +78,13 @@ public void deployStaticResources(final DevConsoleRecorder recorder, true); routeBuildItemBuildProducer.produce(new RouteBuildItem.Builder() - .route("/q/dev/org.kie.kogito.runtime-tools-quarkus-extension/resources/*") + .route(BASE_RELATIVE_URL + "/resources/*") + .handler(recorder.devConsoleHandler(devConsoleStaticResourcesDeploymentPath.toString(), + shutdownContext)) + .build()); + + routeBuildItemBuildProducer.produce(new RouteBuildItem.Builder() + .route(BASE_RELATIVE_URL + "/*") .handler(recorder.devConsoleHandler(devConsoleStaticResourcesDeploymentPath.toString(), shutdownContext)) .build()); diff --git a/ui-packages/package.json b/ui-packages/package.json index 2e7623a6c9..38001af4fe 100644 --- a/ui-packages/package.json +++ b/ui-packages/package.json @@ -18,7 +18,7 @@ "prepare": "cd .. && husky install" }, "devDependencies": { - "@kie-tools/dashbuilder-client": "^0.30.0", + "@kie-tools/dashbuilder-client": "^0.32.0", "@kie/lock-treatment-tool": "^0.2.4", "@types/node": "^18.16.19", "@typescript-eslint/eslint-plugin": "^4.33.0", @@ -47,7 +47,10 @@ "minimatch": "^3.0.5", "@types/react": "17.0.5", "ua-parser-js": "0.7.35", - "yaml": "2.3.1" + "yaml": "2.3.1", + "monaco-editor": "^0.39.0", + "react-monaco-editor": "^0.54.0", + "monaco-yaml": "^4.0.4" }, "engines": { "node": ">=18", diff --git a/ui-packages/packages/cloud-event-form/package.json b/ui-packages/packages/cloud-event-form/package.json index a3c7517e9e..0bc493e658 100644 --- a/ui-packages/packages/cloud-event-form/package.json +++ b/ui-packages/packages/cloud-event-form/package.json @@ -28,18 +28,16 @@ "clean": "rimraf dist" }, "dependencies": { - "@kie-tools-core/envelope": "0.30.0", - "@kie-tools-core/envelope-bus": "0.30.0", + "@kie-tools-core/envelope": "0.32.0", + "@kie-tools-core/envelope-bus": "0.32.0", "@kogito-apps/components-common": "workspace:*", "@patternfly/patternfly": "^4.224.2", - "@patternfly/react-code-editor": "4.82.113", + "@patternfly/react-code-editor": "^4.82.113", "@patternfly/react-core": "^4.276.8", "@patternfly/react-icons": "^4.93.6", "lodash": "^4.17.21", - "monaco-yaml": "^4.0.4", "react": "^17.0.2", - "react-dom": "^17.0.2", - "react-monaco-editor": "^0.49.0" + "react-dom": "^17.0.2" }, "devDependencies": { "@babel/core": "^7.22.8", diff --git a/ui-packages/packages/cloud-event-form/src/envelope/tests/__snapshots__/CloudEventFormEnvelopeView.test.tsx.snap b/ui-packages/packages/cloud-event-form/src/envelope/tests/__snapshots__/CloudEventFormEnvelopeView.test.tsx.snap index 4915e931a8..939859f1cf 100644 --- a/ui-packages/packages/cloud-event-form/src/envelope/tests/__snapshots__/CloudEventFormEnvelopeView.test.tsx.snap +++ b/ui-packages/packages/cloud-event-form/src/envelope/tests/__snapshots__/CloudEventFormEnvelopeView.test.tsx.snap @@ -463,7 +463,7 @@ exports[`CloudEventFormEnvelopeView tests Snapshot 1`] = ` aria-hidden="true" class="margin-view-overlays" role="presentation" - style="position: absolute; width: 51px; font-family: Consolas, 'Courier New', monospace; font-weight: normal; font-size: 14px; font-feature-settings: \\"liga\\" off, \\"calt\\" off; line-height: 19px; letter-spacing: 0px; height: 19px;" + style="position: absolute; font-family: Consolas, 'Courier New', monospace; font-weight: normal; font-size: 14px; font-feature-settings: \\"liga\\" off, \\"calt\\" off; font-variation-settings: normal; line-height: 19px; letter-spacing: 0px; width: 51px; height: 19px;" >
1 @@ -495,14 +495,14 @@ exports[`CloudEventFormEnvelopeView tests Snapshot 1`] = ` aria-hidden="true" class="view-overlays" role="presentation" - style="position: absolute; height: 0px; width: 26px;" + style="position: absolute; font-family: Consolas, 'Courier New', monospace; font-weight: normal; font-size: 14px; font-feature-settings: \\"liga\\" off, \\"calt\\" off; font-variation-settings: normal; line-height: 19px; letter-spacing: 0px; height: 0px; width: 35px;" >
@@ -522,7 +522,7 @@ exports[`CloudEventFormEnvelopeView tests Snapshot 1`] = ` class="view-lines monaco-mouse-cursor-text" data-mprt="7" role="presentation" - style="position: absolute; font-family: Consolas, 'Courier New', monospace; font-weight: normal; font-size: 14px; font-feature-settings: \\"liga\\" off, \\"calt\\" off; line-height: 19px; letter-spacing: 0px; width: 26px; height: 19px;" + style="position: absolute; font-family: Consolas, 'Courier New', monospace; font-weight: normal; font-size: 14px; font-feature-settings: \\"liga\\" off, \\"calt\\" off; font-variation-settings: normal; line-height: 19px; letter-spacing: 0px; width: 35px; height: 19px;" >
@@ -582,7 +582,7 @@ exports[`CloudEventFormEnvelopeView tests Snapshot 1`] = `