Skip to content

Add Data Status Component#96

Draft
krowvin wants to merge 13 commits intomainfrom
component/data-status-summary
Draft

Add Data Status Component#96
krowvin wants to merge 13 commits intomainfrom
component/data-status-summary

Conversation

@krowvin
Copy link
Contributor

@krowvin krowvin commented Feb 25, 2025

This PR adds a data status component that uses quality codes returned via the timeseries endpoint to show a graphical bar line of quality codes at a glance.

It is similar to the DataStatusSummary.exe program within CWMS.

This allows districts to provide a path to a new line delimited file or an array of timeseries to be shown at a glance.

Thoughts

  • Should we use the timeseries/recent or another such endpoint for this?

image

@krowvin krowvin marked this pull request as ready for review February 25, 2025 22:33
@krowvin krowvin requested a review from jbkolze February 25, 2025 22:33
Copy link
Collaborator

@jbkolze jbkolze left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Component looks good -- just a little docs stuff to clean up (mostly around the useDataStatusFile update).

Comment on lines +140 to +143
<Badge color="yellow" className="my-2">
You must specify either dataStatusUrl or tsids or the table will have no
values!
</Badge>
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can remove dataStatusUrl here

import Divider from "../../components/divider";
import { Code } from "../../components/code";
// import { DataStatus } from "@usace-watermanagement/groundwork-water"
import DataStatus from "../../../../../lib/components/data/summary/DataStatus";
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Think we need to import from @usace-watermanagement/groundwork-water rather than local

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should probably add this page to the nav-links

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also should probably throw in some quick docs for useDataStatusFile. Could see them either just being an addendum to the DataStatus page or on their own. Either way works.

return <DataStatus
office="SWT"
tsids={[...tsids, ...fileTsids]}
dataStatusUrl={"/data/summary/swt.datastatus"}
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can remove the dataStatusUrl line

{!filePending && fileError ? <div>Failed to load TSID data status file! {fileError?.message}</div> : <DataStatus
office="SWT"
tsids={["KEYS.Elev.Inst.1Hour.0.Ccp-Rev", ...fileTsids]}
dataStatusUrl={"/data/summary/swt.datastatus"}
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

dataStatusUrl here can be removed as well

{
name: "linkPath",
type: "string",
desc: "A url path to a project or some other page. I.e. /{office}/projects/ would end up pointing to /{office}/projects/{name}",
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like this doesn't want a trailing slash, so /{office}/projects is probably a better example. Also, maybe use {location} instead of {name} (just to use consistent CWMS terminology).

@krowvin krowvin marked this pull request as draft June 3, 2025 16:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants