Explorar el Código

graph legend: scroll component refactor

Alexander Zobnin hace 7 años
padre
commit
729cc94daf
Se han modificado 1 ficheros con 11 adiciones y 2 borrados
  1. 11 2
      public/app/plugins/panel/graph/Legend.tsx

+ 11 - 2
public/app/plugins/panel/graph/Legend.tsx

@@ -1,7 +1,7 @@
 import _ from 'lodash';
 import _ from 'lodash';
 import React from 'react';
 import React from 'react';
 import { TimeSeries } from 'app/core/core';
 import { TimeSeries } from 'app/core/core';
-import withScrollBar from 'app/core/components/ScrollBar/withScrollBar';
+import GrafanaScrollbar from 'app/core/components/ScrollBar/GrafanaScrollbar';
 
 
 const LEGEND_STATS = ['min', 'max', 'avg', 'current', 'total'];
 const LEGEND_STATS = ['min', 'max', 'avg', 'current', 'total'];
 
 
@@ -309,5 +309,14 @@ function getOptionSeriesCSSClasses(series, hiddenSeries) {
   return classes.join(' ');
   return classes.join(' ');
 }
 }
 
 
-export const Legend = withScrollBar(GraphLegend);
+export class Legend extends React.Component<GraphLegendProps, GraphLegendState> {
+  render() {
+    return (
+      <GrafanaScrollbar>
+        <GraphLegend {...this.props} />
+      </GrafanaScrollbar>
+    );
+  }
+}
+
 export default Legend;
 export default Legend;