-
Notifications
You must be signed in to change notification settings - Fork 3.4k
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
Open
puretension
wants to merge
8
commits into
argoproj:main
Choose a base branch
from
puretension:feature/sensor-previous-runs
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 1 commit
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
18a78bf
feat(ui): add label filter sync with URL query params
puretension 8ad1425
feat(ui): add feature description for label filter URL sync
puretension 997c5ea
feat(ui): add sensor label to workflows model
puretension 9d3af8f
feat(ui): add previous runs section to sensor details page
puretension 42b9018
feat(ui): add feature description for previous runs section to sensor…
puretension fb3b119
feat(ui): add feature description for previous runs section to sensor…
puretension c5aec21
feat(ui): add feature description for previous runs section to sensor…
puretension cb89ad5
feat(ui): delete incorrect file from PR
puretension File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
feat(ui): add previous runs section to sensor details page
Signed-off-by: puretension <[email protected]>
- Loading branch information
commit 9d3af8f66b1bbf9f159065ebfff3bb8f121c826c
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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); | ||||||
| })(); | ||||||
| }, [namespace, name]); | ||||||
|
|
||||||
| useCollectEvent('openedSensorDetails'); | ||||||
|
|
||||||
| const selected = (() => { | ||||||
|
|
@@ -142,6 +157,15 @@ export function SensorDetails({match, location, history}: RouteComponentProps<an | |||||
| onTabSelected={setTab} | ||||||
| /> | ||||||
| )} | ||||||
| <> | ||||||
| {!workflows || workflows.length === 0 ? ( | ||||||
|
||||||
| {!workflows || workflows.length === 0 ? ( | |
| {workflows.length === 0 ? ( |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
Missing error handling for the async workflow fetching. If
services.workflows.list()orservices.info.getInfo()fails, the error is not caught or displayed to the user. Add.catch(setError)or wrap in try-catch to handle potential errors, similar to the sensor fetching useEffect on line 66-72.