Skip to content

Commit 929c8eb

Browse files
feat: add errors inspector
1 parent 7e43b77 commit 929c8eb

17 files changed

+2445
-54
lines changed

docker/server/Dockerfile

+1
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ WORKDIR /conductor/ui
3737

3838
# Include monaco sources into bundle (instead of using CDN)
3939
ENV REACT_APP_MONACO_EDITOR_USING_CDN=false
40+
ENV REACT_APP_ENABLE_ERRORS_INSPECTOR=true
4041
RUN yarn ${YARN_OPTS} install && cp -r node_modules/monaco-editor public/ && yarn ${YARN_OPTS} build
4142
RUN ls -ltr
4243
RUN echo "Done building UI"

docker/ui/Dockerfile

+1-1
Original file line numberDiff line numberDiff line change
@@ -24,5 +24,5 @@ COPY ./ui .
2424

2525
# Include monaco sources into bundle (instead of using CDN)
2626
ENV REACT_APP_MONACO_EDITOR_USING_CDN=false
27-
27+
ENV REACT_APP_ENABLE_ERRORS_INSPECTOR=true
2828
CMD [ "yarn", "start" ]

ui/README.md

+2
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@ For more information regarding CRA configuration and usage, see the official [do
1212

1313
To run the UI on the bundled development server, run `yarn run start`. Navigate your browser to `http://localhost:5000`.
1414

15+
To enable errors inspector module export env var: `REACT_APP_ENABLE_ERRORS_INSPECTOR=true`, then run `yarn start`.
16+
1517
#### Reverse Proxy configuration
1618

1719
The default setup expects that the Conductor Server API will be available at `localhost:8080/api`. You may select an alternate port and hostname, or rewrite the API path by editing `setupProxy.js`. Note that `setupProxy.js` is used ONLY by the development server.

ui/package.json

+4-2
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,8 @@
4242
"use-local-storage-state": "^10.0.0",
4343
"xss": "^1.0.8",
4444
"yarn": "^1.22.22",
45-
"yup": "^0.32.11"
45+
"yup": "^0.32.11",
46+
"recharts": "^2.11.0"
4647
},
4748
"scripts": {
4849
"start": "react-scripts start",
@@ -90,5 +91,6 @@
9091
"engines": {
9192
"node": ">=14.17.0"
9293
},
93-
"license": "Apache-2.0"
94+
"license": "Apache-2.0",
95+
"packageManager": "[email protected]+sha512.a6b2f7906b721bba3d67d4aff083df04dad64c399707841b7acf00f6b133b7ac24255f2652fa22ae3534329dc6180534e98d17432037ff6fd140556e2bb3137e"
9496
}

ui/src/App.jsx

+68-49
Original file line numberDiff line numberDiff line change
@@ -26,9 +26,18 @@ import Gantt from "./pages/kitchensink/Gantt";
2626
import CustomRoutes from "./plugins/CustomRoutes";
2727
import AppBarModules from "./plugins/AppBarModules";
2828
import CustomAppBarButtons from "./plugins/CustomAppBarButtons";
29+
2930
import Workbench from "./pages/workbench/Workbench";
3031
import { getBasename } from "./utils/helpers";
3132

33+
// Feature flag for errors inspector
34+
const ERRORS_INSPECTOR_ENABLED = process.env.REACT_APP_ENABLE_ERRORS_INSPECTOR === 'true';
35+
36+
// Import ErrorsInspector conditionally based on feature flag
37+
const ErrorsInspector = ERRORS_INSPECTOR_ENABLED
38+
? React.lazy(() => import("./pages/errors/ErrorsInspector"))
39+
: () => <WorkflowSearch />; // Fallback to WorkflowSearch if disabled
40+
3241
const useStyles = makeStyles((theme) => ({
3342
root: {
3443
backgroundColor: "#efefef", // TODO: Use theme var
@@ -63,8 +72,13 @@ export default function App() {
6372
>
6473
<AppLogo />
6574
<Button component={NavLink} path="/">
66-
Executions
75+
{ERRORS_INSPECTOR_ENABLED ? "Errors" : "Executions"}
6776
</Button>
77+
{ERRORS_INSPECTOR_ENABLED && (
78+
<Button component={NavLink} path="/executions">
79+
Executions
80+
</Button>
81+
)}
6882
<Button component={NavLink} path="/workflowDefs">
6983
Definitions
7084
</Button>
@@ -82,54 +96,59 @@ export default function App() {
8296
</Toolbar>
8397
</AppBar>
8498
<div className={classes.body}>
85-
<Switch>
86-
<Route exact path="/">
87-
<WorkflowSearch />
88-
</Route>
89-
<Route exact path="/search/tasks">
90-
<TaskSearch />
91-
</Route>
92-
<Route path="/execution/:id/:taskId?">
93-
<Execution />
94-
</Route>
95-
<Route exact path="/workflowDefs">
96-
<WorkflowDefinitions />
97-
</Route>
98-
<Route exact path="/workflowDef/:name?/:version?">
99-
<WorkflowDefinition />
100-
</Route>
101-
<Route exact path="/taskDefs">
102-
<TaskDefinitions />
103-
</Route>
104-
<Route exact path="/taskDef/:name?">
105-
<TaskDefinition />
106-
</Route>
107-
<Route exact path="/eventHandlerDef">
108-
<EventHandlerDefinitions />
109-
</Route>
110-
<Route exact path="/eventHandlerDef/:name">
111-
<EventHandlerDefinition />
112-
</Route>
113-
<Route exact path="/taskQueue/:name?">
114-
<TaskQueue />
115-
</Route>
116-
<Route exact path="/workbench">
117-
<Workbench />
118-
</Route>
119-
<Route exact path="/kitchen">
120-
<KitchenSink />
121-
</Route>
122-
<Route exact path="/kitchen/diagram">
123-
<DiagramTest />
124-
</Route>
125-
<Route exact path="/kitchen/examples">
126-
<Examples />
127-
</Route>
128-
<Route exact path="/kitchen/gantt">
129-
<Gantt />
130-
</Route>
131-
<CustomRoutes />
132-
</Switch>
99+
<React.Suspense fallback={<div>Loading...</div>}>
100+
<Switch>
101+
<Route exact path="/">
102+
{ERRORS_INSPECTOR_ENABLED ? <ErrorsInspector /> : <WorkflowSearch />}
103+
</Route>
104+
<Route exact path="/executions">
105+
<WorkflowSearch />
106+
</Route>
107+
<Route exact path="/search/tasks">
108+
<TaskSearch />
109+
</Route>
110+
<Route path="/execution/:id/:taskId?">
111+
<Execution />
112+
</Route>
113+
<Route exact path="/workflowDefs">
114+
<WorkflowDefinitions />
115+
</Route>
116+
<Route exact path="/workflowDef/:name?/:version?">
117+
<WorkflowDefinition />
118+
</Route>
119+
<Route exact path="/taskDefs">
120+
<TaskDefinitions />
121+
</Route>
122+
<Route exact path="/taskDef/:name?">
123+
<TaskDefinition />
124+
</Route>
125+
<Route exact path="/eventHandlerDef">
126+
<EventHandlerDefinitions />
127+
</Route>
128+
<Route exact path="/eventHandlerDef/:name">
129+
<EventHandlerDefinition />
130+
</Route>
131+
<Route exact path="/taskQueue/:name?">
132+
<TaskQueue />
133+
</Route>
134+
<Route exact path="/workbench">
135+
<Workbench />
136+
</Route>
137+
<Route exact path="/kitchen">
138+
<KitchenSink />
139+
</Route>
140+
<Route exact path="/kitchen/diagram">
141+
<DiagramTest />
142+
</Route>
143+
<Route exact path="/kitchen/examples">
144+
<Examples />
145+
</Route>
146+
<Route exact path="/kitchen/gantt">
147+
<Gantt />
148+
</Route>
149+
<CustomRoutes />
150+
</Switch>
151+
</React.Suspense>
133152
</div>
134153
</div>
135154
);

0 commit comments

Comments
 (0)