From f096b8d3e0a05d1d6f28fe671d3b73dd26e67fa0 Mon Sep 17 00:00:00 2001 From: Laura Fuentes Grau Date: Fri, 13 Nov 2020 16:43:02 +0100 Subject: [PATCH] externally managed ICs don't appear immediately in IC list, add button activates as soon as all required fields are filled #266 --- src/common/array-store.js | 1 + src/ic/new-ic.js | 8 +++++--- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/src/common/array-store.js b/src/common/array-store.js index c2cdd27..1ab4b7f 100644 --- a/src/common/array-store.js +++ b/src/common/array-store.js @@ -98,6 +98,7 @@ class ArrayStore extends ReduceStore { return state; case this.type + '/added': + if(typeof action.data.managedexternally !== "undefined" && action.data.managedexternally === true ) return state; return this.updateElements(state, [action.data]); case this.type + '/add-error': diff --git a/src/ic/new-ic.js b/src/ic/new-ic.js index 5e8a49a..514055a 100644 --- a/src/ic/new-ic.js +++ b/src/ic/new-ic.js @@ -105,6 +105,8 @@ class NewICDialog extends React.Component { if (target === 'websocketurl') return websocketurl ? "success" : "error"; if (target === 'type') return type ? "success" : "error"; if (target === 'category') return category ? "success" : "error"; + + return this.valid; } uuidv4() { @@ -137,7 +139,7 @@ class NewICDialog extends React.Component { typeOptions =[]; } return ( - this.onClose(c)} onReset={() => this.resetState()} valid={this.valid}> + this.onClose(c)} onReset={() => this.resetState()} valid={this.validateForm()}>
this.handleChange(e)}> @@ -151,7 +153,7 @@ class NewICDialog extends React.Component { this.handleChange(e)} /> - + Category of component this.handleChange(e)}> @@ -162,7 +164,7 @@ class NewICDialog extends React.Component { - + Type of component this.handleChange(e)}>