added no copies div

pull/10986/head
Patrick O'Carroll 8 years ago
parent 5e5a4cf1b0
commit ce9c8ae854
  1. 14
      public/app/features/dashboard/dashgrid/AddPanelPanel.tsx
  2. 7
      public/sass/components/_panel_add_panel.scss

@ -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';
panelTab = this.state.copiedPanelPlugins.map(this.renderPanelItem);
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…
Cancel
Save