-
Notifications
You must be signed in to change notification settings - Fork 19
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
This reverts commit 279272d.
- Loading branch information
Showing
18 changed files
with
882 additions
and
49 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
module.exports = { | ||
// TODD: enable the before init hooks once grafana/toolkit can limit the jest workers | ||
git: { | ||
commitMessage: 'chore: update version', | ||
tag: false, | ||
push: false, | ||
commit: false, | ||
}, | ||
github: { | ||
release: false, | ||
}, | ||
npm: { | ||
publish: false, | ||
}, | ||
plugins: { | ||
'@release-it/conventional-changelog': { | ||
preset: 'angular', | ||
infile: 'CHANGELOG.md', | ||
}, | ||
}, | ||
}; |
Large diffs are not rendered by default.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
module.exports = { | ||
faro: { | ||
api: { | ||
pushMeasurement: jest.fn(() => console.log('hhhhhhiiiiii')), | ||
pushEvent: jest.fn(), | ||
pushError: jest.fn(), | ||
}, | ||
}, | ||
isError: jest.fn(), | ||
isObject: jest.fn(), | ||
}; |
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,42 @@ | ||
// @ts-ignore | ||
window.__react_router_build__ = undefined; | ||
|
||
const ui = jest.requireActual('@grafana/ui'); | ||
import React, { forwardRef } from 'react'; | ||
|
||
const Icon = forwardRef((props, ref) => <svg {...props} />); | ||
Icon.displayName = 'Icon'; | ||
|
||
interface BigValueProps { | ||
value: { | ||
numeric: number; | ||
text?: string; | ||
title?: string; | ||
}; | ||
} | ||
|
||
export function BigValue({ value }: BigValueProps) { | ||
return ( | ||
<div> | ||
{/* {value.numeric} */} | ||
{value.text && <span>{value.text}</span>} | ||
{value.title && <label>{value.title}</label>} | ||
</div> | ||
); | ||
} | ||
|
||
// Monaco does not render with jest and is stuck at "Loading..." | ||
// There doesn't seem to be a solution to this at this point, | ||
// mocking it instead. Related github issue: | ||
// https://github.com/suren-atoyan/monaco-react/issues/88 | ||
const CodeEditor = React.forwardRef((props: any, ref: any) => { | ||
return <textarea ref={ref} data-testid="code-editor" onChange={props.onChange} value={props.value} />; | ||
}); | ||
CodeEditor.displayName = 'CodeEditor'; | ||
|
||
module.exports = { | ||
...ui, | ||
Icon, | ||
BigValue, | ||
CodeEditor, | ||
}; |
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,5 @@ | ||
import React from 'react'; | ||
|
||
export const SimpleMap = () => { | ||
return <div>A pretty map</div>; | ||
}; |
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,5 @@ | ||
export const appEvents = { | ||
emit: () => {}, | ||
}; | ||
// eslint-disable-next-line no-restricted-syntax | ||
export default appEvents; |
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,5 @@ | ||
{ | ||
"ignorePaths": ["node_modules"], | ||
"ignoreRegExpList": [".*"], | ||
"words": ["grafana", "datasource", "datasources", "gifs", ".*"] | ||
} |
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 @@ | ||
// this file exists solely to trick the spell check. Delete this as soon as possible |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
import React, { useEffect, useRef, useState } from 'react'; | ||
import { GrafanaTheme2 } from '@grafana/data'; | ||
import { useStyles2 } from '@grafana/ui'; | ||
import { css } from '@emotion/css'; | ||
|
||
interface ChildrenArgs { | ||
width: number; | ||
height: number; | ||
} | ||
|
||
interface Props { | ||
children: (dimensions: ChildrenArgs) => JSX.Element; | ||
} | ||
|
||
const getStyles = (theme: GrafanaTheme2) => ({ | ||
fillContainer: css` | ||
display: flex; | ||
justify-content: center; | ||
max-width: 1300px; | ||
margin-left: auto; | ||
margin-right: auto; | ||
width: 100%; | ||
`, | ||
}); | ||
|
||
export const Autosizer = ({ children }: Props) => { | ||
const el = useRef<HTMLDivElement>(null); | ||
const styles = useStyles2(getStyles); | ||
const [size, setSize] = useState({ width: 0, height: 0 }); | ||
|
||
useEffect(() => { | ||
const rect = el.current?.getBoundingClientRect(); | ||
if (rect) { | ||
setSize({ width: rect.width, height: rect.height }); | ||
} | ||
}, [el]); | ||
|
||
return ( | ||
<div className={styles.fillContainer} ref={el}> | ||
{children(size)} | ||
</div> | ||
); | ||
}; |
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,14 @@ | ||
import React from 'react'; | ||
|
||
interface ChildrenArgs { | ||
width: number; | ||
height: number; | ||
} | ||
|
||
interface Props { | ||
children: (dimensions: ChildrenArgs) => JSX.Element; | ||
} | ||
|
||
export const Autosizer = ({ children }: Props) => { | ||
return <div>{children({ width: 500, height: 500 })}</div>; | ||
}; |
File renamed without changes.
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 was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
File renamed without changes.