mirror of
https://git.rwth-aachen.de/acs/public/villas/web/
synced 2025-03-09 00:00:01 +01:00
delete unnecessary / unused code
This commit is contained in:
parent
46850fb82d
commit
3e10861cb8
4 changed files with 0 additions and 44 deletions
|
@ -249,12 +249,6 @@ class Dashboard extends Component {
|
|||
|
||||
};
|
||||
|
||||
|
||||
widgetStatusChange(updated_widget, key) {
|
||||
// Widget changed internally, make changes effective then save them
|
||||
this.widgetChange(updated_widget, key, this.saveChanges);
|
||||
}
|
||||
|
||||
widgetChange(widget, index, callback = null) {
|
||||
let temp = this.state.widgetChangeData;
|
||||
temp.push(widget);
|
||||
|
@ -383,19 +377,6 @@ class Dashboard extends Component {
|
|||
this.setState({ editing: false, widgetChangeData: [] });
|
||||
};
|
||||
|
||||
saveChanges() {
|
||||
// Transform to a list
|
||||
const dashboard = Object.assign({}, this.state.dashboard.toJS(), {
|
||||
widgets: this.transformToWidgetsList(this.state.widgets)
|
||||
});
|
||||
|
||||
AppDispatcher.dispatch({
|
||||
type: 'dashboards/start-edit',
|
||||
data: dashboard,
|
||||
token: this.state.sessionToken
|
||||
});
|
||||
}
|
||||
|
||||
cancelEditing() {
|
||||
//raw widget has no id -> cannot be deleted in its original form
|
||||
this.state.widgets.forEach(widget => {
|
||||
|
@ -534,7 +515,6 @@ class Dashboard extends Component {
|
|||
onChange={this.widgetChange.bind(this)}
|
||||
|
||||
onWidgetChange={this.widgetChange.bind(this)}
|
||||
onWidgetStatusChange={this.widgetStatusChange.bind(this)}
|
||||
editing={this.state.editing}
|
||||
grid={grid}
|
||||
paused={this.state.paused}
|
||||
|
@ -561,7 +541,6 @@ class Dashboard extends Component {
|
|||
onChange={this.widgetChange.bind(this)}
|
||||
|
||||
onWidgetChange={this.widgetChange.bind(this)}
|
||||
onWidgetStatusChange={this.widgetStatusChange.bind(this)}
|
||||
editing={this.state.editing}
|
||||
paused={this.state.paused}
|
||||
/>
|
||||
|
|
|
@ -125,7 +125,6 @@ class WidgetContextMenu extends React.Component {
|
|||
<Widget
|
||||
data={this.props.widget}
|
||||
onWidgetChange={this.props.onWidgetChange}
|
||||
onWidgetStatusChange={this.props.onWidgetStatusChange}
|
||||
editing={this.props.editing}
|
||||
index={this.props.index}
|
||||
paused={this.props.paused}
|
||||
|
|
|
@ -191,7 +191,6 @@ class Widget extends React.Component {
|
|||
return <WidgetSlider
|
||||
widget={widget}
|
||||
editing={this.props.editing}
|
||||
onWidgetChange={(w) => this.props.onWidgetStatusChange(w, this.props.index) }
|
||||
onInputChanged={(value, controlID, controlValue) => this.inputDataChanged(widget, value, controlID, controlValue)}
|
||||
signals={this.state.signals}
|
||||
/>
|
||||
|
|
|
@ -76,27 +76,6 @@ class WidgetSlider extends Component {
|
|||
}
|
||||
}
|
||||
|
||||
componentDidUpdate(prevProps: Readonly<P>, prevState: Readonly<S>, snapshot: SS): void {
|
||||
// Check if the orientation changed, update the size if it did
|
||||
// this part didn't work -> dimensions and constraints are now handled by the edit orientation component
|
||||
if (this.props.widget.customProperties.orientation !== prevProps.widget.customProperties.orientation) {
|
||||
let baseWidget = this.props.widget;
|
||||
|
||||
// Exchange dimensions and constraints
|
||||
let newWidget = Object.assign({}, baseWidget, {
|
||||
width: baseWidget.height,
|
||||
height: baseWidget.width,
|
||||
minWidth: baseWidget.minHeight,
|
||||
minHeight: baseWidget.minWidth,
|
||||
maxWidth: baseWidget.customProperties.maxHeight,
|
||||
maxHeight: baseWidget.customProperties.maxWidth
|
||||
});
|
||||
|
||||
this.props.onWidgetChange(newWidget);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
valueIsChanging(newValue) {
|
||||
this.props.widget.customProperties.value = newValue;
|
||||
if (this.props.widget.customProperties.continous_update)
|
||||
|
|
Loading…
Add table
Reference in a new issue