Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

kie-issues#1276: Reuse components and retrieve workflow definitions from data index instead of openapi.json in sonataflow-deployment-webapp #2537

Merged
merged 9 commits into from
Sep 6, 2024
3 changes: 1 addition & 2 deletions packages/sonataflow-deployment-webapp/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,6 @@
"@patternfly/patternfly": "^4.224.2",
"@patternfly/react-core": "^4.276.6",
"@patternfly/react-icons": "^4.93.6",
"@patternfly/react-table": "^4.112.39",
"openapi-types": "^7.0.1",
"react": "^17.0.2",
"react-dom": "^17.0.2",
Expand Down Expand Up @@ -73,7 +72,7 @@
"stream-http": "^3.2.0",
"terser-webpack-plugin": "^5.3.9",
"ts-jest": "^29.1.5",
"webpack": "^5.88.2",
"webpack": "^5.92.1",
"webpack-cli": "^4.10.0",
"webpack-dev-server": "^4.15.1",
"webpack-merge": "^5.9.0"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ import { Redirect, Route, Switch } from "react-router-dom";
import { APPDATA_JSON_FILENAME } from "../AppConstants";
import { ErrorKind, ErrorPage } from "../pages/ErrorPage";
import { NoMatchPage } from "../pages/NoMatchPage";
import { Workflows } from "../pages/Workflows/";
import { CloudEventFormPage } from "../pages/Workflows/CloudEventFormPage";
import { WorkflowFormPage } from "../pages/Workflows/WorkflowFormPage";
import { routes } from "../routes";
Expand All @@ -43,7 +42,7 @@ export function RoutesSwitch() {
<ErrorPage kind={ErrorKind.APPDATA_JSON} errors={[`There was an error with the ${APPDATA_JSON_FILENAME}`]} />
</Route>
<Route path={routes.home.path({})}>
<Redirect to={routes.runtimeTools.runtimeToolsWorkflowDefinitions.path({})} />
<Redirect to={routes.runtimeTools.workflowDefinitions.path({})} />
</Route>
<Route component={NoMatchPage} />
</Switch>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ import { RuntimeToolsWorkflowDefinitions } from "../runtimeTools/pages/RuntimeTo
export function RuntimeToolsRoutesSwitch() {
return (
<Switch>
<Route path={routes.runtimeTools.runtimeToolsWorkflowDefinitions.path({})}>
<Route path={routes.runtimeTools.workflowDefinitions.path({})}>
<RuntimeToolsWorkflowDefinitions />
</Route>
<Route path={routes.runtimeTools.workflowInstances.path({})}>
Expand Down
kumaradityaraj marked this conversation as resolved.
Outdated
Show resolved Hide resolved
kumaradityaraj marked this conversation as resolved.
Outdated
Show resolved Hide resolved
fantonangeli marked this conversation as resolved.
Outdated
Show resolved Hide resolved

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -17,5 +17,4 @@
* under the License.
*/

export * from "./Workflows";
export * from "./WorkflowFormPage";
8 changes: 1 addition & 7 deletions packages/sonataflow-deployment-webapp/src/routes/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -106,13 +106,7 @@ export const routes = {
queryParams: QueryParams.FILTERS | QueryParams.SORT_BY;
pathParams: PathParams.WORKFLOW_ID;
}>(({ workflowId }) => RUNTIME_TOOLS_ROUTE + `/workflow-details/${workflowId}`),
runtimeToolsWorkflowDefinitions: new Route<{}>(() => RUNTIME_TOOLS_ROUTE + `/workflow-definitions`),
runtimeToolsWorkflowForm: new Route<{
pathParams: PathParams.WORKFLOW_NAME;
}>(({ workflowName }) => RUNTIME_TOOLS_ROUTE + `/workflow-definition/${workflowName}`),
runtimeToolsTriggerCloudEventForWorkflowDefinition: new Route<{
pathParams: PathParams.WORKFLOW_NAME;
}>(({ workflowName }) => RUNTIME_TOOLS_ROUTE + `/workflow-definition/${workflowName}/trigger-cloud-event`),
workflowDefinitions: new Route<{}>(() => RUNTIME_TOOLS_ROUTE + `/workflow-definitions`),
},
dataJson: new Route<{}>(() => "/" + APPDATA_JSON_FILENAME),
openApiJson: new Route<{}>(() => "/q/openapi.json"),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
* under the License.
*/

import React, { useCallback } from "react";
import React, { useCallback, useState } from "react";
kumaradityaraj marked this conversation as resolved.
Show resolved Hide resolved
import { WorkflowDefinitionListContainer } from "@kie-tools/runtime-tools-swf-webapp-components/dist/WorkflowDefinitionListContainer";
import { Card } from "@patternfly/react-core/dist/esm/components/Card";
import { Page, PageSection } from "@patternfly/react-core/dist/js/components/Page";
Expand All @@ -36,7 +36,7 @@ export function RuntimeToolsWorkflowDefinitions() {
const onOpenWorkflowForm = useCallback(
(workflowDefinition: WorkflowDefinition) => {
history.push({
pathname: routes.runtimeTools.runtimeToolsWorkflowForm.path({ workflowName: workflowDefinition.workflowName }),
pathname: routes.workflows.form.path({ workflowId: workflowDefinition.workflowName }),
state: {
workflowDefinition: {
workflowName: workflowDefinition.workflowName,
Expand All @@ -52,8 +52,8 @@ export function RuntimeToolsWorkflowDefinitions() {
const onOpenTriggerCloudEventForWorkflow = useCallback(
(workflowDefinition: WorkflowDefinition) => {
history.push({
pathname: routes.runtimeTools.runtimeToolsTriggerCloudEventForWorkflowDefinition.path({
workflowName: workflowDefinition.workflowName,
pathname: routes.workflows.cloudEvent.path({
workflowId: workflowDefinition.workflowName,
}),
state: {
workflowDefinition: {
Expand Down
Loading