-
Notifications
You must be signed in to change notification settings - Fork 8.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
* use differential colors for duration chart * remove duration chart gql * update type * type fix * fix tyoe * update translation * update test * update conflicts * type checking * update snaps * PR feedback * PR feedback Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com> Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
- Loading branch information
1 parent
bb8c4d6
commit 56a7c58
Showing
50 changed files
with
824 additions
and
4,963 deletions.
There are no files selected for viewing
4,032 changes: 0 additions & 4,032 deletions
4,032
x-pack/legacy/plugins/uptime/common/graphql/introspection.json
This file was deleted.
Oops, something went wrong.
This file contains 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
This file contains 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
This file contains 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
41 changes: 41 additions & 0 deletions
41
x-pack/legacy/plugins/uptime/public/components/connected/charts/monitor_duration.tsx
This file contains 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 |
---|---|---|
@@ -0,0 +1,41 @@ | ||
/* | ||
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one | ||
* or more contributor license agreements. Licensed under the Elastic License; | ||
* you may not use this file except in compliance with the Elastic License. | ||
*/ | ||
|
||
import React, { useContext, useEffect } from 'react'; | ||
import { useDispatch, useSelector } from 'react-redux'; | ||
import { useUrlParams } from '../../../hooks'; | ||
import { getMonitorDurationAction } from '../../../state/actions'; | ||
import { DurationChartComponent } from '../../functional/charts'; | ||
import { selectDurationLines } from '../../../state/selectors'; | ||
import { UptimeRefreshContext } from '../../../contexts'; | ||
|
||
interface Props { | ||
monitorId: string; | ||
} | ||
|
||
export const DurationChart: React.FC<Props> = ({ monitorId }: Props) => { | ||
const [getUrlParams] = useUrlParams(); | ||
const { dateRangeStart, dateRangeEnd } = getUrlParams(); | ||
|
||
const { monitor_duration, loading } = useSelector(selectDurationLines); | ||
|
||
const dispatch = useDispatch(); | ||
|
||
const { lastRefresh } = useContext(UptimeRefreshContext); | ||
|
||
useEffect(() => { | ||
dispatch( | ||
getMonitorDurationAction({ monitorId, dateStart: dateRangeStart, dateEnd: dateRangeEnd }) | ||
); | ||
}, [dateRangeStart, dateRangeEnd, dispatch, lastRefresh, monitorId]); | ||
|
||
return ( | ||
<DurationChartComponent | ||
locationDurationLines={monitor_duration?.locationDurationLines ?? []} | ||
loading={loading} | ||
/> | ||
); | ||
}; |
This file contains 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
134 changes: 1 addition & 133 deletions
134
.../uptime/public/components/functional/__tests__/__snapshots__/monitor_charts.test.tsx.snap
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Oops, something went wrong.