From 3d7635b42977472690ea4d85879b45d847d9525d Mon Sep 17 00:00:00 2001 From: Sonja Happ Date: Mon, 8 Mar 2021 09:45:46 +0100 Subject: [PATCH 1/2] Rename IC startParameterScheme --> startParameterSchema, closes #292 --- src/ic/edit-ic.js | 20 ++++++++++---------- src/ic/ic-dialog.js | 4 ++-- 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/src/ic/edit-ic.js b/src/ic/edit-ic.js index 69ba89b..b328742 100644 --- a/src/ic/edit-ic.js +++ b/src/ic/edit-ic.js @@ -37,7 +37,7 @@ class EditICDialog extends React.Component { type: '', category: '', managedexternally: false, - startParameterScheme: {}, + startParameterSchema: {}, }; } @@ -73,8 +73,8 @@ class EditICDialog extends React.Component { if (this.state.category != null && this.state.category !== "" && this.state.category !== this.props.ic.category) { data.category = this.state.category; } - if (this.state.startParameterScheme !== {}) { - data.startParameterScheme = this.state.startParameterScheme + if (this.state.startParameterSchema !== {}) { + data.startParameterSchema = this.state.startParameterSchema } data.managedexternally = this.state.managedexternally; @@ -98,8 +98,8 @@ class EditICDialog extends React.Component { } } - handleStartParameterSchemeChange(data) { - this.setState({ startParameterScheme: data }); + handleStartParameterSchemaChange(data) { + this.setState({ startParameterSchema: data }); } resetState() { @@ -112,7 +112,7 @@ class EditICDialog extends React.Component { description: this.props.ic.description, category: this.props.ic.category, managedexternally: false, - startParameterScheme: this.props.ic.startParameterScheme, + startParameterSchema: this.props.ic.startParameterSchema, }); } @@ -193,12 +193,12 @@ class EditICDialog extends React.Component { this.handleChange(e)} /> - - Start parameter scheme of IC + + Start parameter schema of IC this.handleStartParameterSchemeChange(data)} + onChange={(data) => this.handleStartParameterSchemaChange(data)} /> diff --git a/src/ic/ic-dialog.js b/src/ic/ic-dialog.js index cba6291..5908623 100644 --- a/src/ic/ic-dialog.js +++ b/src/ic/ic-dialog.js @@ -76,9 +76,9 @@ class ICDialog extends React.Component {
Description: {this.props.ic.description}
Websocket URL: {this.props.ic.websocketurl}
API URL: {this.props.ic.apiurl}
-
Start parameter scheme:
+
Start parameter schema:
Date: Mon, 8 Mar 2021 10:27:48 +0100 Subject: [PATCH 2/2] fix saving of raw status update and optional statistics --- src/ic/ic-store.js | 13 +++---------- 1 file changed, 3 insertions(+), 10 deletions(-) diff --git a/src/ic/ic-store.js b/src/ic/ic-store.js index b852b94..d892c7d 100644 --- a/src/ic/ic-store.js +++ b/src/ic/ic-store.js @@ -117,12 +117,7 @@ class InfrastructureComponentStore extends ArrayStore { if(!tempIC.managedexternally){ tempIC.state = action.data.state; tempIC.uptime = action.data.time_now - action.data.time_started; - if (tempIC.statusupdateraw === null || tempIC.statusupdateraw === undefined){ - tempIC.statusupdateraw = {}; - tempIC.statusupdateraw["status"] = action.data; - } else { - tempIC.statusupdateraw["status"] = action.data; - } + tempIC.statusupdateraw = action.data AppDispatcher.dispatch({ type: 'ics/start-edit', data: tempIC, @@ -138,12 +133,10 @@ class InfrastructureComponentStore extends ArrayStore { case 'ics/nodestats-received': let tempIC2 = action.ic; if(!tempIC2.managedexternally){ - if (tempIC2.statusupdateraw === null || tempIC2.statusupdateraw === undefined){ + if (tempIC2.statusupdateraw === null || tempIC2.statusupdateraw === undefined) { tempIC2.statusupdateraw = {}; - tempIC2.statusupdateraw["statistics"] = action.data; - } else { - tempIC2.statusupdateraw["statistics"] = action.data; } + tempIC2.statusupdateraw["statistics"] = action.data; AppDispatcher.dispatch({ type: 'ics/start-edit', data: tempIC2,