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
32555fc7
Unverified
Commit
32555fc7
authored
Apr 10, 2020
by
Ryan McKinley
Committed by
GitHub
Apr 10, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Plugins: add a deprecated state (#23496)
Co-authored-by: Dominik Prokop <dominik.prokop@grafana.com>
parent
f458da4d
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
19 additions
and
5 deletions
+19
-5
packages/grafana-data/src/types/plugin.ts
+1
-0
public/app/features/dashboard/components/PanelEditor/VisualizationTab.tsx
+1
-1
public/app/features/dashboard/panel_editor/VizTypePicker.tsx
+16
-4
public/app/plugins/panel/singlestat/plugin.json
+1
-0
No files found.
packages/grafana-data/src/types/plugin.ts
View file @
32555fc7
...
...
@@ -4,6 +4,7 @@ import { KeyValue } from './data';
export
enum
PluginState
{
alpha
=
'alpha'
,
// Only included it `enable_alpha` is true
beta
=
'beta'
,
// Will show a warning banner
deprecated
=
'deprecated'
,
// Will continue to work -- but not show up in the the options to add
}
export
enum
PluginType
{
...
...
public/app/features/dashboard/components/PanelEditor/VisualizationTab.tsx
View file @
32555fc7
...
...
@@ -41,7 +41,7 @@ export const VisualizationTabUnconnected: FC<Props> = ({ panel, plugin, changePa
if
(
e
.
key
===
'Enter'
)
{
const
query
=
e
.
currentTarget
.
value
;
const
plugins
=
getAllPanelPluginMeta
();
const
match
=
filterPluginList
(
plugins
,
query
);
const
match
=
filterPluginList
(
plugins
,
query
,
plugin
.
meta
);
if
(
match
&&
match
.
length
)
{
onPluginTypeChange
(
match
[
0
]);
}
...
...
public/app/features/dashboard/panel_editor/VizTypePicker.tsx
View file @
32555fc7
...
...
@@ -3,7 +3,7 @@ import React, { useCallback, useMemo } from 'react';
import
config
from
'app/core/config'
;
import
VizTypePickerPlugin
from
'./VizTypePickerPlugin'
;
import
{
EmptySearchResult
,
stylesFactory
,
useTheme
}
from
'@grafana/ui'
;
import
{
GrafanaTheme
,
PanelPluginMeta
}
from
'@grafana/data'
;
import
{
GrafanaTheme
,
PanelPluginMeta
,
PluginState
}
from
'@grafana/data'
;
import
{
css
}
from
'emotion'
;
export
interface
Props
{
...
...
@@ -22,14 +22,26 @@ export function getAllPanelPluginMeta(): PanelPluginMeta[] {
.
sort
((
a
:
PanelPluginMeta
,
b
:
PanelPluginMeta
)
=>
a
.
sort
-
b
.
sort
);
}
export
function
filterPluginList
(
pluginsList
:
PanelPluginMeta
[],
searchQuery
:
string
):
PanelPluginMeta
[]
{
export
function
filterPluginList
(
pluginsList
:
PanelPluginMeta
[],
searchQuery
:
string
,
current
:
PanelPluginMeta
):
PanelPluginMeta
[]
{
if
(
!
searchQuery
.
length
)
{
return
pluginsList
;
return
pluginsList
.
filter
(
p
=>
{
if
(
p
.
state
===
PluginState
.
deprecated
)
{
return
current
.
id
===
p
.
id
;
}
return
true
;
});
}
const
query
=
searchQuery
.
toLowerCase
();
const
first
:
PanelPluginMeta
[]
=
[];
const
match
:
PanelPluginMeta
[]
=
[];
for
(
const
item
of
pluginsList
)
{
if
(
item
.
state
===
PluginState
.
deprecated
&&
current
.
id
!==
item
.
id
)
{
continue
;
}
const
name
=
item
.
name
.
toLowerCase
();
const
idx
=
name
.
indexOf
(
query
);
if
(
idx
===
0
)
{
...
...
@@ -65,7 +77,7 @@ export const VizTypePicker: React.FC<Props> = ({ searchQuery, onTypeChange, curr
};
const
getFilteredPluginList
=
useCallback
(():
PanelPluginMeta
[]
=>
{
return
filterPluginList
(
pluginsList
,
searchQuery
);
return
filterPluginList
(
pluginsList
,
searchQuery
,
current
);
},
[
searchQuery
]);
const
filteredPluginList
=
getFilteredPluginList
();
...
...
public/app/plugins/panel/singlestat/plugin.json
View file @
32555fc7
...
...
@@ -2,6 +2,7 @@
"type"
:
"panel"
,
"name"
:
"Singlestat"
,
"id"
:
"singlestat"
,
"state"
:
"deprecated"
,
"info"
:
{
"description"
:
"Singlestat Panel for Grafana"
,
...
...
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