Skip to content
This repository has been archived by the owner on Dec 7, 2023. It is now read-only.

Commit

Permalink
fix(ui): show placeholder instead of line chart if metrics for select…
Browse files Browse the repository at this point in the history
…ed queue is empty
  • Loading branch information
s-r-x committed Jul 19, 2021
1 parent 7c7118d commit 5bac414
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion packages/ui/src/screens/metrics/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ import { activeQueueAtom } from '@/atoms/workspaces';
import NetworkRequest from '@/components/NetworkRequest';
import { getPollingInterval } from '@/stores/network-settings';
import { QueryKeysConfig } from '@/config/query-keys';
import isempty from 'lodash/isEmpty';
import Alert from '@material-ui/lab/Alert';

const MetricsScreen = () => {
const {
Expand All @@ -31,7 +33,11 @@ const MetricsScreen = () => {
return (
<NetworkRequest error={error} refetch={refetch} status={status}>
<Actions />
{data && <Chart metrics={data} />}
{!data || isempty(data) ? (
<Alert severity="warning">No metrics</Alert>
) : (
<Chart metrics={data} />
)}
</NetworkRequest>
);
};
Expand Down

0 comments on commit 5bac414

Please sign in to comment.