-
Notifications
You must be signed in to change notification settings - Fork 8.3k
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
* add flyout * add state * update state * ad job * update * updat * add ml analyze button * update api * use differential colors for duration chart * remove duration chart gql * update type * type fix * fix tyoe * update translation * update test * update conflicts * update anomaly record * chart * added annotations * update error handling * update * update types * fixed types * fix types * update types * update * update * remove unnecessary change * remove unnecessary change * fix type * update * save * update pr * update tets * update job deletion * update * update tets * upadte tests * fix types * update title text * update types * fixed tests * update tests and types * updated types * fix PR feedback * unit test * update more types * update test and manage job * resolve conflicts * types * remove unnecessary change * revert ml code * revert ml code * fixed formatting issues pointed by pr feedback
- Loading branch information
Showing
69 changed files
with
2,522 additions
and
180 deletions.
There are no files selected for viewing
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
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
2 changes: 2 additions & 0 deletions
2
...public/components/functional/charts/__tests__/__snapshots__/duration_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.
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
54 changes: 54 additions & 0 deletions
54
x-pack/legacy/plugins/uptime/public/components/functional/charts/annotation_tooltip.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,54 @@ | ||
/* | ||
* 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 from 'react'; | ||
import moment from 'moment'; | ||
import styled from 'styled-components'; | ||
import { FormattedMessage } from '@kbn/i18n/react'; | ||
|
||
const Header = styled.div` | ||
font-weight: bold; | ||
padding-left: 4px; | ||
`; | ||
|
||
const RecordSeverity = styled.div` | ||
font-weight: bold; | ||
border-left: 4px solid ${props => props.color}; | ||
padding-left: 2px; | ||
`; | ||
|
||
const TimeDiv = styled.div` | ||
font-weight: 500; | ||
border-bottom: 1px solid gray; | ||
padding-bottom: 2px; | ||
`; | ||
|
||
export const AnnotationTooltip = ({ details }: { details: string }) => { | ||
const data = JSON.parse(details); | ||
|
||
function capitalizeFirstLetter(str: string) { | ||
return str.charAt(0).toUpperCase() + str.slice(1); | ||
} | ||
|
||
return ( | ||
<> | ||
<TimeDiv>{moment(data.time).format('lll')}</TimeDiv> | ||
<Header> | ||
<FormattedMessage | ||
id="xpack.uptime.charts.mlAnnotation.header" | ||
defaultMessage="Score: {score}" | ||
values={{ score: data.score.toFixed(2) }} | ||
/> | ||
</Header> | ||
<RecordSeverity color={data.color}> | ||
<FormattedMessage | ||
id="xpack.uptime.charts.mlAnnotation.severity" | ||
defaultMessage="Severity: {severity}" | ||
values={{ severity: capitalizeFirstLetter(data.severity) }} | ||
/> | ||
</RecordSeverity> | ||
</> | ||
); | ||
}; |
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
Oops, something went wrong.