Skip to content

Commit

Permalink
feat(chart): Add support for selecting device features and loading ch…
Browse files Browse the repository at this point in the history
…art data
  • Loading branch information
Terdious committed Sep 3, 2024
1 parent b731728 commit cebce56
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions front/src/components/boxs/chart/EditChart.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -351,7 +351,12 @@ class EditChart extends Component {
this.props = props;
this.deviceFeatureBySelector = new Map();
this.state = {
chart_type: ''
chart_type: '',
selectedDeviceFeaturesOptions: [],
deviceOptions: [],
loading: false,
displayPreview: false,
chartTypeList: [...CHART_TYPE_BINARY, ...CHART_TYPE_OTHERS]
};
}

Expand All @@ -360,7 +365,7 @@ class EditChart extends Component {
}

componentDidUpdate(previousProps) {
const deviceFeatureChanged = get(previousProps, 'box.device_feature') !== get(this.props, 'box.device_feature');
const deviceFeatureChanged = get(previousProps, 'box.device_features') !== get(this.props, 'box.device_features');
const unitsChanged = get(previousProps, 'box.units') !== get(this.props, 'box.units');
if (deviceFeatureChanged || unitsChanged) {
this.refreshDisplayForNewProps();
Expand Down

0 comments on commit cebce56

Please sign in to comment.