From dd784a6e8cb729ceab468019da7543a67fc0e4f8 Mon Sep 17 00:00:00 2001 From: Zoe Steinkamp Date: Wed, 18 Dec 2019 09:34:31 -0700 Subject: [PATCH] feat (ui): Add the view check page --- ui/src/alerting/components/CheckCard.tsx | 5 +---- ui/src/alerting/components/CheckHistory.tsx | 4 ++-- ui/src/alerting/components/CheckHistoryVisualization.tsx | 5 ++++- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/ui/src/alerting/components/CheckCard.tsx b/ui/src/alerting/components/CheckCard.tsx index 9c732399a8..326f0798d1 100644 --- a/ui/src/alerting/components/CheckCard.tsx +++ b/ui/src/alerting/components/CheckCard.tsx @@ -10,9 +10,7 @@ import InlineLabels from 'src/shared/components/inlineLabels/InlineLabels' // Constants import {DEFAULT_CHECK_NAME} from 'src/alerting/constants' -import { - SEARCH_QUERY_PARAM -} from 'src/alerting/constants/history' +import {SEARCH_QUERY_PARAM} from 'src/alerting/constants/history' // Actions and Selectors import { @@ -105,7 +103,6 @@ const CheckCard: FunctionComponent = ({ } const onView = () => { - const queryParams = new URLSearchParams({ [SEARCH_QUERY_PARAM]: `"checkID" == "${check.id}"`, }) diff --git a/ui/src/alerting/components/CheckHistory.tsx b/ui/src/alerting/components/CheckHistory.tsx index 61a97ba7f3..63887b9bd2 100644 --- a/ui/src/alerting/components/CheckHistory.tsx +++ b/ui/src/alerting/components/CheckHistory.tsx @@ -46,11 +46,10 @@ const CheckHistory: FC = ({ timeZone, resourceIDs, }) => { - const loadRows = useMemo(() => options => loadStatuses(orgID, options), [ orgID, ]) - + const historyType = 'statuses' const fields = STATUS_FIELDS return ( @@ -69,6 +68,7 @@ const CheckHistory: FC = ({ /> {/* */} diff --git a/ui/src/alerting/components/CheckHistoryVisualization.tsx b/ui/src/alerting/components/CheckHistoryVisualization.tsx index 5fe56f528d..b689632464 100644 --- a/ui/src/alerting/components/CheckHistoryVisualization.tsx +++ b/ui/src/alerting/components/CheckHistoryVisualization.tsx @@ -13,6 +13,7 @@ import TimeSeries from 'src/shared/components/TimeSeries' import {createView} from 'src/shared/utils/view' import {checkResultsLength} from 'src/shared/utils/vis' import {getTimeRangeVars} from 'src/variables/utils/getTimeRangeVars' +import {TimeRange} from 'src/types' interface ResourceIDs { checkIDs: {[x: string]: boolean} @@ -28,6 +29,7 @@ interface OwnProps { } type Props = OwnProps +//TODO maybe update submitToken when we know how const CheckHistoryVisualization: FC = ({check, timeZone}) => { const view = createView(get(check, 'type', 'threshold')) @@ -40,7 +42,7 @@ const CheckHistoryVisualization: FC = ({check, timeZone}) => { submitToken={submitToken} queries={[check.query]} key={manualRefresh} - variables={getTimeRangeVars({lower: 'now() - 5m'})} + variables={getTimeRangeVars({lower: 'now() - 5m'} as TimeRange)} check={check} > {({giraffeResult, loading, errorMessage, isInitialFetch, statuses}) => { @@ -65,6 +67,7 @@ const CheckHistoryVisualization: FC = ({check, timeZone}) => { > {config => } + {/* {} */} ) }}