-
Notifications
You must be signed in to change notification settings - Fork 3.5k
feat(ui): add previous runs section to sensor details page #14851
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
base: main
Are you sure you want to change the base?
Changes from 7 commits
18a78bf
8ad1425
997c5ea
9d3af8f
42b9018
fb3b119
c5aec21
cb89ad5
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,9 @@ | ||
| Component: UI | ||
| Issues: 14807 | ||
| Description: Add label query parameter sync with URL in WorkflowTemplates UI to match Workflows list behavior for consistent filtering. | ||
| Author: [puretension](https://github.com/puretension) | ||
|
|
||
| - WorkflowTemplates UI now properly handles label query parameters (e.g., ?label=key%3Dvalue) | ||
| - Combined URL updates and localStorage persistence in single useEffect | ||
| - Enables custom UI links for filtered template views | ||
| - Verified that URL updates when changing filters and filters persist on page refresh | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,8 @@ | ||
| Component: UI | ||
| Issues: 14809 | ||
| Description: Add Previous Runs section to Sensor details page to display workflows triggered by sensors | ||
| Author: [puretension](https://github.com/puretension) | ||
|
|
||
| - Added Previous Runs section below Sensor editor tabs using `workflows.argoproj.io/sensor` label filtering | ||
| - Implemented identical UI pattern as CronWorkflow with WorkflowDetailsList component for consistency | ||
| - Fixed empty state handling with proper array length check to display triggered workflows correctly |
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -9,13 +9,16 @@ import {uiUrl} from '../shared/base'; | |||||||||||||||||||||||||||||||
| import {ErrorNotice} from '../shared/components/error-notice'; | ||||||||||||||||||||||||||||||||
| import {Node} from '../shared/components/graph/types'; | ||||||||||||||||||||||||||||||||
| import {Loading} from '../shared/components/loading'; | ||||||||||||||||||||||||||||||||
| import {ZeroState} from '../shared/components/zero-state'; | ||||||||||||||||||||||||||||||||
| import {Context} from '../shared/context'; | ||||||||||||||||||||||||||||||||
| import {historyUrl} from '../shared/history'; | ||||||||||||||||||||||||||||||||
| import {Sensor} from '../shared/models'; | ||||||||||||||||||||||||||||||||
| import * as models from '../shared/models'; | ||||||||||||||||||||||||||||||||
| import {Sensor, Workflow} from '../shared/models'; | ||||||||||||||||||||||||||||||||
| import {services} from '../shared/services'; | ||||||||||||||||||||||||||||||||
| import {useCollectEvent} from '../shared/use-collect-event'; | ||||||||||||||||||||||||||||||||
| import {useEditableObject} from '../shared/use-editable-object'; | ||||||||||||||||||||||||||||||||
| import {useQueryParams} from '../shared/use-query-params'; | ||||||||||||||||||||||||||||||||
| import {WorkflowDetailsList} from '../workflows/components/workflow-details-list/workflow-details-list'; | ||||||||||||||||||||||||||||||||
| import {SensorEditor} from './sensor-editor'; | ||||||||||||||||||||||||||||||||
| import {SensorSidePanel} from './sensor-side-panel'; | ||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||
|
|
@@ -30,6 +33,8 @@ export function SensorDetails({match, location, history}: RouteComponentProps<an | |||||||||||||||||||||||||||||||
| const [namespace] = useState(match.params.namespace); | ||||||||||||||||||||||||||||||||
| const [name] = useState(match.params.name); | ||||||||||||||||||||||||||||||||
| const [tab, setTab] = useState<string>(queryParams.get('tab')); | ||||||||||||||||||||||||||||||||
| const [workflows, setWorkflows] = useState<Workflow[]>([]); | ||||||||||||||||||||||||||||||||
| const [columns, setColumns] = useState<models.Column[]>([]); | ||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||
| const {object: sensor, setObject: setSensor, resetObject: resetSensor, serialization, edited, lang, setLang} = useEditableObject<Sensor>(); | ||||||||||||||||||||||||||||||||
| const [selectedLogNode, setSelectedLogNode] = useState<Node>(queryParams.get('selectedLogNode')); | ||||||||||||||||||||||||||||||||
|
|
@@ -66,6 +71,16 @@ export function SensorDetails({match, location, history}: RouteComponentProps<an | |||||||||||||||||||||||||||||||
| .catch(setError); | ||||||||||||||||||||||||||||||||
| }, [namespace, name]); | ||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||
| useEffect(() => { | ||||||||||||||||||||||||||||||||
| (async () => { | ||||||||||||||||||||||||||||||||
| const workflowList = await services.workflows.list(namespace, null, [`${models.labels.sensor}=${name}`], {limit: 50}); | ||||||||||||||||||||||||||||||||
| const workflowsInfo = await services.info.getInfo(); | ||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||
| setWorkflows(workflowList.items); | ||||||||||||||||||||||||||||||||
| setColumns(workflowsInfo.columns); | ||||||||||||||||||||||||||||||||
|
Comment on lines
+76
to
+80
|
||||||||||||||||||||||||||||||||
| const workflowList = await services.workflows.list(namespace, null, [`${models.labels.sensor}=${name}`], {limit: 50}); | |
| const workflowsInfo = await services.info.getInfo(); | |
| setWorkflows(workflowList.items); | |
| setColumns(workflowsInfo.columns); | |
| try { | |
| const workflowList = await services.workflows.list(namespace, null, [`${models.labels.sensor}=${name}`], {limit: 50}); | |
| const workflowsInfo = await services.info.getInfo(); | |
| setWorkflows(workflowList.items); | |
| setColumns(workflowsInfo.columns); | |
| setError(null); | |
| } catch (err) { | |
| setError(err); | |
| } |
Copilot
AI
Nov 14, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The condition !workflows will always be false since workflows is initialized to [] on line 36. The check should be workflows.length === 0 only, matching the pattern in cron-workflow-details.tsx which checks !workflows where workflows is initialized to undefined.
| {!workflows || workflows.length === 0 ? ( | |
| {workflows.length === 0 ? ( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This file shouldn't be in this PR.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@Joibel Fixed! I removed the incorrect file from the PR. It was accidentally included from a wrong branch merge.
(I think it came my previous work - #14816)