Skip to content

Commit d994877

Browse files
committed
Fix issue with pipeline name save and errors during execution
1 parent e995baf commit d994877

File tree

3 files changed

+15
-8
lines changed

3 files changed

+15
-8
lines changed

app/components/pipeline/nodes/output/OutputNode.tsx

+11-6
Original file line numberDiff line numberDiff line change
@@ -79,13 +79,18 @@ export function OutputNode() {
7979
}, [litlytics, pipeline]);
8080

8181
const doRunPipeline = async () => {
82-
const newPipeline = await litlytics.runPipeline({
83-
onStatus: (status) => setPipelineStatus(status),
84-
});
85-
setPipeline(newPipeline);
82+
try {
83+
const newPipeline = await litlytics.runPipeline({
84+
onStatus: (status) => setPipelineStatus(status),
85+
});
86+
setPipeline(newPipeline);
8687

87-
// write final status to update on end
88-
setPipelineStatus({ status: 'done' });
88+
// write final status to update on end
89+
setPipelineStatus({ status: 'done' });
90+
} catch (err) {
91+
console.error('Error executing pipeline', err);
92+
setPipelineStatus({ status: 'error' });
93+
}
8994
};
9095

9196
const running =

app/components/pipeline/nodes/source/SourceNode.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ export function SourceNode() {
4747
const source = useMemo(() => {
4848
return pipeline.source;
4949
}, [pipeline.source]);
50-
const docs = useMemo(() => source.docs, [source.docs]);
50+
const docs = useMemo(() => source.docs ?? [], [source.docs]);
5151

5252
const sourceType = useMemo(
5353
() => ((source.config as SourceConfig)?.type ?? 'text') as SourceType,

app/components/ui/Overlay.tsx

+3-1
Original file line numberDiff line numberDiff line change
@@ -340,7 +340,9 @@ export function OverlayUI() {
340340
placeholder="Pipeline name"
341341
autoFocus
342342
value={pipeline.name}
343-
onChange={(e) => (pipeline.name = e.target.value)}
343+
onChange={(e) =>
344+
setPipeline({ ...pipeline, name: e.target.value })
345+
}
344346
/>
345347
</Field>
346348
</FieldGroup>

0 commit comments

Comments
 (0)