mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
added no copies div
This commit is contained in:
parent
5e5a4cf1b0
commit
ce9c8ae854
@ -112,11 +112,8 @@ export class AddPanelPanel extends React.Component<AddPanelPanelProps, AddPanelP
|
||||
}
|
||||
|
||||
renderText(text: string) {
|
||||
//if(this.state.filter) {
|
||||
let searchWords = this.state.filter.split('');
|
||||
return <Highlighter highlightClassName="highlight-search-match" textToHighlight={text} searchWords={searchWords} />;
|
||||
//}
|
||||
//return text;
|
||||
}
|
||||
|
||||
renderPanelItem(panel, index) {
|
||||
@ -128,6 +125,10 @@ export class AddPanelPanel extends React.Component<AddPanelPanelProps, AddPanelP
|
||||
);
|
||||
}
|
||||
|
||||
noCopiedPanelPlugins() {
|
||||
return <div className="add-panel__no-panels">No copied panels yet.</div>;
|
||||
}
|
||||
|
||||
filterChange(evt) {
|
||||
this.setState({
|
||||
filter: evt.target.value,
|
||||
@ -173,7 +174,12 @@ export class AddPanelPanel extends React.Component<AddPanelPanelProps, AddPanelP
|
||||
} else if (this.state.tab === 'Copy') {
|
||||
addClass = '';
|
||||
copyClass = 'active active--panel';
|
||||
console.log(this.state.copiedPanelPlugins);
|
||||
if (this.state.copiedPanelPlugins.length > 0) {
|
||||
panelTab = this.state.copiedPanelPlugins.map(this.renderPanelItem);
|
||||
} else {
|
||||
panelTab = this.noCopiedPanelPlugins();
|
||||
}
|
||||
}
|
||||
|
||||
return (
|
||||
|
@ -86,3 +86,10 @@
|
||||
margin-bottom: 10px;
|
||||
margin-top: 7px;
|
||||
}
|
||||
|
||||
.add-panel__no-panels {
|
||||
color: $text-color-weak;
|
||||
font-style: italic;
|
||||
width: 100%;
|
||||
padding: 3px 8px;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user