Skip to content
Merged
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 15 additions & 2 deletions web/src/components/forms/pipeline.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,7 @@

const getStatus = React.useCallback(
(types: string[], status: string) => {
let hasWarning = false;
for (let i = 0; i < types.length; i++) {
const type = types[i];
const condition: K8sResourceCondition | null = existing?.status?.conditions?.find(
Expand All @@ -116,9 +117,21 @@
} else if (condition?.type.startsWith('Waiting') || condition?.reason === 'Pending') {
return RunStatus.Pending;
}
// Check if this is a warning type
if (type.toLowerCase().includes('warning')) {
hasWarning = true;
continue; // Don't return immediately, check for failures first
}
return RunStatus.Failed;
}
}
// If we have a warning but no failures, return a warning status
if (hasWarning) {
// PatternFly topology doesn't have a dedicated Warning status,
// but we can use the same color scheme by using RunStatus.Cancelled
// which typically shows yellow/orange
return RunStatus.Cancelled;
}
return RunStatus.Succeeded;
},
[existing?.status?.conditions]
Expand Down Expand Up @@ -172,13 +185,13 @@

const cpRunAfter: string[] = [];
if (existing?.spec?.loki?.enable) {
const types = ['LokiIssue'];
const types = ['LokiIssue', 'LokiWarning'];
steps.push({
id: 'loki',
label: 'Loki',
runAfterTasks: ['flp'],
data: {
status: getStatus(types, 'NoIssue'), // TODO: NoIssue / Unknown is not a valid status. That should be False.
status: getStatus(types, 'False'),
selected: _.some(selectedTypes, t => types.includes(t)),
onSelect: () => setSelectedTypes(types)
}
Expand Down Expand Up @@ -233,7 +246,7 @@
},
...s
})) as PipelineNodeModel[];
}, [existing, getStatus, selectedTypes, setSelectedTypes]);

Check warning on line 249 in web/src/components/forms/pipeline.tsx

View workflow job for this annotation

GitHub Actions / Build, lint, test frontend

React Hook React.useCallback has a missing dependency: 't'. Either include it or remove the dependency array

React.useEffect(() => {
if (containerRef.current) {
Expand Down
Loading