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
9e24c094
Unverified
Commit
9e24c094
authored
May 13, 2020
by
Dominik Prokop
Committed by
GitHub
May 13, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Transformations: Make transform dropdowns not cropped (#24615)
parent
ab12c908
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
34 additions
and
10 deletions
+34
-10
packages/grafana-ui/src/components/StatsPicker/StatsPicker.tsx
+3
-1
packages/grafana-ui/src/components/ValuePicker/ValuePicker.tsx
+3
-0
public/app/core/components/TransformersUI/CalculateFieldTransformerEditor.tsx
+5
-0
public/app/core/components/TransformersUI/ReduceTransformerEditor.tsx
+1
-0
public/app/core/components/TransformersUI/SeriesToFieldsTransformerEditor.tsx
+7
-1
public/app/features/dashboard/components/TransformationsEditor/TransformationsEditor.tsx
+15
-8
No files found.
packages/grafana-ui/src/components/StatsPicker/StatsPicker.tsx
View file @
9e24c094
...
@@ -14,6 +14,7 @@ interface Props {
...
@@ -14,6 +14,7 @@ interface Props {
allowMultiple
?:
boolean
;
allowMultiple
?:
boolean
;
defaultStat
?:
string
;
defaultStat
?:
string
;
className
?:
string
;
className
?:
string
;
menuPlacement
?:
'auto'
|
'bottom'
|
'top'
;
}
}
export
class
StatsPicker
extends
PureComponent
<
Props
>
{
export
class
StatsPicker
extends
PureComponent
<
Props
>
{
...
@@ -62,7 +63,7 @@ export class StatsPicker extends PureComponent<Props> {
...
@@ -62,7 +63,7 @@ export class StatsPicker extends PureComponent<Props> {
};
};
render
()
{
render
()
{
const
{
stats
,
allowMultiple
,
defaultStat
,
placeholder
,
className
}
=
this
.
props
;
const
{
stats
,
allowMultiple
,
defaultStat
,
placeholder
,
className
,
menuPlacement
}
=
this
.
props
;
const
select
=
fieldReducers
.
selectOptions
(
stats
);
const
select
=
fieldReducers
.
selectOptions
(
stats
);
return
(
return
(
...
@@ -75,6 +76,7 @@ export class StatsPicker extends PureComponent<Props> {
...
@@ -75,6 +76,7 @@ export class StatsPicker extends PureComponent<Props> {
options=
{
select
.
options
}
options=
{
select
.
options
}
placeholder=
{
placeholder
}
placeholder=
{
placeholder
}
onChange=
{
this
.
onSelectionChange
}
onChange=
{
this
.
onSelectionChange
}
menuPlacement=
{
menuPlacement
}
/>
/>
);
);
}
}
...
...
packages/grafana-ui/src/components/ValuePicker/ValuePicker.tsx
View file @
9e24c094
...
@@ -17,6 +17,7 @@ interface ValuePickerProps<T> {
...
@@ -17,6 +17,7 @@ interface ValuePickerProps<T> {
variant
?:
ButtonVariant
;
variant
?:
ButtonVariant
;
size
?:
ComponentSize
;
size
?:
ComponentSize
;
isFullWidth
?:
boolean
;
isFullWidth
?:
boolean
;
menuPlacement
?:
'auto'
|
'bottom'
|
'top'
;
}
}
export
function
ValuePicker
<
T
>
({
export
function
ValuePicker
<
T
>
({
...
@@ -27,6 +28,7 @@ export function ValuePicker<T>({
...
@@ -27,6 +28,7 @@ export function ValuePicker<T>({
variant
,
variant
,
size
=
'sm'
,
size
=
'sm'
,
isFullWidth
=
true
,
isFullWidth
=
true
,
menuPlacement
,
}:
ValuePickerProps
<
T
>
)
{
}:
ValuePickerProps
<
T
>
)
{
const
[
isPicking
,
setIsPicking
]
=
useState
(
false
);
const
[
isPicking
,
setIsPicking
]
=
useState
(
false
);
...
@@ -50,6 +52,7 @@ export function ValuePicker<T>({
...
@@ -50,6 +52,7 @@ export function ValuePicker<T>({
setIsPicking
(
false
);
setIsPicking
(
false
);
onChange
(
value
);
onChange
(
value
);
}
}
}
}
menuPlacement=
{
menuPlacement
}
/>
/>
)
}
)
}
</>
</>
...
...
public/app/core/components/TransformersUI/CalculateFieldTransformerEditor.tsx
View file @
9e24c094
...
@@ -201,6 +201,7 @@ export class CalculateFieldTransformerEditor extends React.PureComponent<
...
@@ -201,6 +201,7 @@ export class CalculateFieldTransformerEditor extends React.PureComponent<
stats=
{
[
options
.
reducer
]
}
stats=
{
[
options
.
reducer
]
}
onChange=
{
this
.
onStatsChange
}
onChange=
{
this
.
onStatsChange
}
defaultStat=
{
ReducerID
.
sum
}
defaultStat=
{
ReducerID
.
sum
}
menuPlacement=
"bottom"
/>
/>
</
div
>
</
div
>
</
div
>
</
div
>
...
@@ -279,12 +280,14 @@ export class CalculateFieldTransformerEditor extends React.PureComponent<
...
@@ -279,12 +280,14 @@ export class CalculateFieldTransformerEditor extends React.PureComponent<
className=
"min-width-18 gf-form-spacing"
className=
"min-width-18 gf-form-spacing"
value=
{
options
?.
left
}
value=
{
options
?.
left
}
onChange=
{
this
.
onBinaryLeftChanged
}
onChange=
{
this
.
onBinaryLeftChanged
}
menuPlacement=
"bottom"
/>
/>
<
Select
<
Select
className=
"width-8 gf-form-spacing"
className=
"width-8 gf-form-spacing"
options=
{
ops
}
options=
{
ops
}
value=
{
options
.
operator
??
ops
[
0
].
value
}
value=
{
options
.
operator
??
ops
[
0
].
value
}
onChange=
{
this
.
onBinaryOperationChanged
}
onChange=
{
this
.
onBinaryOperationChanged
}
menuPlacement=
"bottom"
/>
/>
<
Select
<
Select
allowCustomValue
allowCustomValue
...
@@ -293,6 +296,7 @@ export class CalculateFieldTransformerEditor extends React.PureComponent<
...
@@ -293,6 +296,7 @@ export class CalculateFieldTransformerEditor extends React.PureComponent<
options=
{
rightNames
}
options=
{
rightNames
}
value=
{
options
?.
right
}
value=
{
options
?.
right
}
onChange=
{
this
.
onBinaryRightChanged
}
onChange=
{
this
.
onBinaryRightChanged
}
menuPlacement=
"bottom"
/>
/>
</
div
>
</
div
>
</
div
>
</
div
>
...
@@ -318,6 +322,7 @@ export class CalculateFieldTransformerEditor extends React.PureComponent<
...
@@ -318,6 +322,7 @@ export class CalculateFieldTransformerEditor extends React.PureComponent<
options=
{
calculationModes
}
options=
{
calculationModes
}
value=
{
calculationModes
.
find
(
v
=>
v
.
value
===
mode
)
}
value=
{
calculationModes
.
find
(
v
=>
v
.
value
===
mode
)
}
onChange=
{
this
.
onModeChanged
}
onChange=
{
this
.
onModeChanged
}
menuPlacement=
"bottom"
/>
/>
</
div
>
</
div
>
</
div
>
</
div
>
...
...
public/app/core/components/TransformersUI/ReduceTransformerEditor.tsx
View file @
9e24c094
...
@@ -30,6 +30,7 @@ export const ReduceTransformerEditor: React.FC<TransformerUIProps<ReduceTransfor
...
@@ -30,6 +30,7 @@ export const ReduceTransformerEditor: React.FC<TransformerUIProps<ReduceTransfor
reducers
:
stats
as
ReducerID
[],
reducers
:
stats
as
ReducerID
[],
});
});
}
}
}
}
menuPlacement=
"bottom"
/>
/>
</
div
>
</
div
>
</
div
>
</
div
>
...
...
public/app/core/components/TransformersUI/SeriesToFieldsTransformerEditor.tsx
View file @
9e24c094
...
@@ -33,7 +33,13 @@ export const SeriesToFieldsTransformerEditor: React.FC<TransformerUIProps<Series
...
@@ -33,7 +33,13 @@ export const SeriesToFieldsTransformerEditor: React.FC<TransformerUIProps<Series
<
div
className=
"gf-form-inline"
>
<
div
className=
"gf-form-inline"
>
<
div
className=
"gf-form gf-form--grow"
>
<
div
className=
"gf-form gf-form--grow"
>
<
div
className=
"gf-form-label width-8"
>
Field name
</
div
>
<
div
className=
"gf-form-label width-8"
>
Field name
</
div
>
<
Select
options=
{
fieldNameOptions
}
value=
{
options
.
byField
}
onChange=
{
onSelectField
}
isClearable
/>
<
Select
options=
{
fieldNameOptions
}
value=
{
options
.
byField
}
onChange=
{
onSelectField
}
isClearable
menuPlacement=
"bottom"
/>
</
div
>
</
div
>
</
div
>
</
div
>
);
);
...
...
public/app/features/dashboard/components/TransformationsEditor/TransformationsEditor.tsx
View file @
9e24c094
...
@@ -65,14 +65,21 @@ export class TransformationsEditor extends React.PureComponent<Props> {
...
@@ -65,14 +65,21 @@ export class TransformationsEditor extends React.PureComponent<Props> {
});
});
return
(
return
(
<
ValuePicker
<
div
size=
"md"
className=
{
css
`
variant=
"secondary"
max-width: 66%;
label=
"Add transformation"
`
}
options=
{
availableTransformers
}
>
onChange=
{
this
.
onTransformationAdd
}
<
ValuePicker
isFullWidth=
{
false
}
size=
"md"
/>
variant=
"secondary"
label=
"Add transformation"
options=
{
availableTransformers
}
onChange=
{
this
.
onTransformationAdd
}
isFullWidth=
{
false
}
menuPlacement=
"bottom"
/>
</
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