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
44eaa3ea
Commit
44eaa3ea
authored
Feb 13, 2019
by
Johannes Schill
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Revert "feat: Highlight vizpicker input when there are no panels matching the search query"
This reverts commit
11db48e7
.
parent
11db48e7
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
7 additions
and
22 deletions
+7
-22
public/app/features/dashboard/panel_editor/EditorTabBody.tsx
+1
-1
public/app/features/dashboard/panel_editor/VisualizationTab.tsx
+4
-17
public/app/features/dashboard/panel_editor/VizTypePicker.tsx
+2
-4
No files found.
public/app/features/dashboard/panel_editor/EditorTabBody.tsx
View file @
44eaa3ea
...
@@ -36,7 +36,7 @@ export class EditorTabBody extends PureComponent<Props, State> {
...
@@ -36,7 +36,7 @@ export class EditorTabBody extends PureComponent<Props, State> {
toolbarItems
:
[],
toolbarItems
:
[],
};
};
constructor
(
props
:
Props
)
{
constructor
(
props
)
{
super
(
props
);
super
(
props
);
this
.
state
=
{
this
.
state
=
{
...
...
public/app/features/dashboard/panel_editor/VisualizationTab.tsx
View file @
44eaa3ea
// Libraries
// Libraries
import
React
,
{
PureComponent
,
ChangeEvent
}
from
'react'
;
import
React
,
{
PureComponent
}
from
'react'
;
// Utils & Services
// Utils & Services
import
{
AngularComponent
,
getAngularLoader
}
from
'app/core/services/AngularLoader'
;
import
{
AngularComponent
,
getAngularLoader
}
from
'app/core/services/AngularLoader'
;
...
@@ -31,7 +31,6 @@ interface Props {
...
@@ -31,7 +31,6 @@ interface Props {
interface
State
{
interface
State
{
isVizPickerOpen
:
boolean
;
isVizPickerOpen
:
boolean
;
searchQuery
:
string
;
searchQuery
:
string
;
searchResults
:
PanelPlugin
[];
scrollTop
:
number
;
scrollTop
:
number
;
}
}
...
@@ -40,13 +39,12 @@ export class VisualizationTab extends PureComponent<Props, State> {
...
@@ -40,13 +39,12 @@ export class VisualizationTab extends PureComponent<Props, State> {
angularOptions
:
AngularComponent
;
angularOptions
:
AngularComponent
;
searchInput
:
HTMLElement
;
searchInput
:
HTMLElement
;
constructor
(
props
:
Props
)
{
constructor
(
props
)
{
super
(
props
);
super
(
props
);
this
.
state
=
{
this
.
state
=
{
isVizPickerOpen
:
this
.
props
.
urlOpenVizPicker
,
isVizPickerOpen
:
this
.
props
.
urlOpenVizPicker
,
searchQuery
:
''
,
searchQuery
:
''
,
searchResults
:
[],
scrollTop
:
0
,
scrollTop
:
0
,
};
};
}
}
...
@@ -172,7 +170,7 @@ export class VisualizationTab extends PureComponent<Props, State> {
...
@@ -172,7 +170,7 @@ export class VisualizationTab extends PureComponent<Props, State> {
this
.
setState
({
isVizPickerOpen
:
false
});
this
.
setState
({
isVizPickerOpen
:
false
});
};
};
onSearchQueryChange
=
(
evt
:
ChangeEvent
<
HTMLInputElement
>
)
=>
{
onSearchQueryChange
=
evt
=>
{
const
value
=
evt
.
target
.
value
;
const
value
=
evt
.
target
.
value
;
this
.
setState
({
this
.
setState
({
searchQuery
:
value
,
searchQuery
:
value
,
...
@@ -189,7 +187,7 @@ export class VisualizationTab extends PureComponent<Props, State> {
...
@@ -189,7 +187,7 @@ export class VisualizationTab extends PureComponent<Props, State> {
<
label
className=
"gf-form--has-input-icon"
>
<
label
className=
"gf-form--has-input-icon"
>
<
input
<
input
type=
"text"
type=
"text"
className=
{
`gf-form-input width-13 ${!this.hasSearchResults ? 'gf-form-input--invalid' : ''}`
}
className=
"gf-form-input width-13"
placeholder=
""
placeholder=
""
onChange=
{
this
.
onSearchQueryChange
}
onChange=
{
this
.
onSearchQueryChange
}
value=
{
searchQuery
}
value=
{
searchQuery
}
...
@@ -221,16 +219,6 @@ export class VisualizationTab extends PureComponent<Props, State> {
...
@@ -221,16 +219,6 @@ export class VisualizationTab extends PureComponent<Props, State> {
}
}
};
};
setSearchResults
=
(
searchResults
:
PanelPlugin
[])
=>
{
this
.
setState
({
searchResults
:
searchResults
});
};
get
hasSearchResults
()
{
return
this
.
state
.
searchResults
&&
this
.
state
.
searchResults
.
length
>
0
;
}
renderHelp
=
()
=>
<
PluginHelp
plugin=
{
this
.
props
.
plugin
}
type=
"help"
/>;
renderHelp
=
()
=>
<
PluginHelp
plugin=
{
this
.
props
.
plugin
}
type=
"help"
/>;
setScrollTop
=
(
event
:
React
.
MouseEvent
<
HTMLElement
>
)
=>
{
setScrollTop
=
(
event
:
React
.
MouseEvent
<
HTMLElement
>
)
=>
{
...
@@ -263,7 +251,6 @@ export class VisualizationTab extends PureComponent<Props, State> {
...
@@ -263,7 +251,6 @@ export class VisualizationTab extends PureComponent<Props, State> {
onTypeChanged=
{
this
.
onTypeChanged
}
onTypeChanged=
{
this
.
onTypeChanged
}
searchQuery=
{
searchQuery
}
searchQuery=
{
searchQuery
}
onClose=
{
this
.
onCloseVizPicker
}
onClose=
{
this
.
onCloseVizPicker
}
onPluginListChange=
{
this
.
setSearchResults
}
/>
/>
</
FadeIn
>
</
FadeIn
>
{
this
.
renderPanelOptions
()
}
{
this
.
renderPanelOptions
()
}
...
...
public/app/features/dashboard/panel_editor/VizTypePicker.tsx
View file @
44eaa3ea
...
@@ -10,14 +10,13 @@ export interface Props {
...
@@ -10,14 +10,13 @@ export interface Props {
onTypeChanged
:
(
newType
:
PanelPlugin
)
=>
void
;
onTypeChanged
:
(
newType
:
PanelPlugin
)
=>
void
;
searchQuery
:
string
;
searchQuery
:
string
;
onClose
:
()
=>
void
;
onClose
:
()
=>
void
;
onPluginListChange
:
(
searchResults
:
PanelPlugin
[])
=>
void
;
}
}
export
class
VizTypePicker
extends
PureComponent
<
Props
>
{
export
class
VizTypePicker
extends
PureComponent
<
Props
>
{
searchInput
:
HTMLElement
;
searchInput
:
HTMLElement
;
pluginList
=
this
.
getPanelPlugins
(
''
);
pluginList
=
this
.
getPanelPlugins
(
''
);
constructor
(
props
:
Props
)
{
constructor
(
props
)
{
super
(
props
);
super
(
props
);
}
}
...
@@ -51,7 +50,7 @@ export class VizTypePicker extends PureComponent<Props> {
...
@@ -51,7 +50,7 @@ export class VizTypePicker extends PureComponent<Props> {
};
};
getFilteredPluginList
=
():
PanelPlugin
[]
=>
{
getFilteredPluginList
=
():
PanelPlugin
[]
=>
{
const
{
searchQuery
,
onPluginListChange
}
=
this
.
props
;
const
{
searchQuery
}
=
this
.
props
;
const
regex
=
new
RegExp
(
searchQuery
,
'i'
);
const
regex
=
new
RegExp
(
searchQuery
,
'i'
);
const
pluginList
=
this
.
pluginList
;
const
pluginList
=
this
.
pluginList
;
...
@@ -59,7 +58,6 @@ export class VizTypePicker extends PureComponent<Props> {
...
@@ -59,7 +58,6 @@ export class VizTypePicker extends PureComponent<Props> {
return
regex
.
test
(
item
.
name
);
return
regex
.
test
(
item
.
name
);
});
});
onPluginListChange
(
filtered
);
return
filtered
;
return
filtered
;
};
};
...
...
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