Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
N
nexpie-grafana-theme
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Registry
Registry
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Kornkitt Poolsup
nexpie-grafana-theme
Commits
690a96e4
Unverified
Commit
690a96e4
authored
Jan 18, 2021
by
Erik Sundell
Committed by
GitHub
Jan 18, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
make sure stats are added horizontally and not vertically (#30106)
parent
3db5abbe
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
5 additions
and
3 deletions
+5
-3
public/app/plugins/datasource/cloudwatch/components/Stats.test.tsx
+3
-1
public/app/plugins/datasource/cloudwatch/components/Stats.tsx
+2
-2
No files found.
public/app/plugins/datasource/cloudwatch/components/Stats.test.tsx
View file @
690a96e4
...
...
@@ -8,12 +8,14 @@ describe('Stats', () => {
it
(
'should render component'
,
()
=>
{
render
(
<
Stats
data
-
testid=
"stats"
values=
{
[
'Average'
,
'Minimum'
]
}
variableOptionGroup=
{
{
label
:
'templateVar'
,
value
:
'templateVar'
}
}
onChange=
{
()
=>
{}
}
stats=
{
[
'Average'
,
'Maximum'
,
'Minimum'
,
'Sum'
,
'SampleCount'
].
map
(
toOption
)
}
/>
);
expect
(
screen
.
getByTestId
(
'stats'
)).
toBeInTheDocument
();
expect
(
screen
.
getByText
(
'Average'
)).
toBeInTheDocument
();
expect
(
screen
.
getByText
(
'Minimum'
)).
toBeInTheDocument
();
});
});
public/app/plugins/datasource/cloudwatch/components/Stats.tsx
View file @
690a96e4
...
...
@@ -14,7 +14,7 @@ const removeText = '-- remove stat --';
const
removeOption
:
SelectableValue
<
string
>
=
{
label
:
removeText
,
value
:
removeText
};
export
const
Stats
:
FunctionComponent
<
Props
>
=
({
stats
,
values
,
onChange
,
variableOptionGroup
})
=>
(
<
div
data
-
testid=
"stats"
>
<>
{
values
&&
values
.
map
((
value
,
index
)
=>
(
<
Segment
...
...
@@ -41,5 +41,5 @@ export const Stats: FunctionComponent<Props> = ({ stats, values, onChange, varia
onChange=
{
({
value
})
=>
onChange
([...
values
,
value
!
])
}
options=
{
[...
stats
.
filter
(({
value
})
=>
!
values
.
includes
(
value
!
)),
variableOptionGroup
]
}
/>
</
div
>
</>
);
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment