diff --git a/app/components/widget-label.js b/app/components/widget-label.js index 732430e..5fd22fe 100644 --- a/app/components/widget-label.js +++ b/app/components/widget-label.js @@ -19,6 +19,7 @@ export default WidgetAbstract.extend({ if (this.get('editing') === true) { // prepare modal this.set('name', this.get('widget.name')); + this.set('errorMessage', null); // show modal this.set('isShowingModal', true); diff --git a/app/components/widget-plot.js b/app/components/widget-plot.js index 9b553d7..7574de0 100644 --- a/app/components/widget-plot.js +++ b/app/components/widget-plot.js @@ -188,11 +188,6 @@ export default WidgetAbstract.extend({ // verify properties let properties = this.getProperties('name'); - if (properties['name'] === null || properties['name'] === "") { - this.set('errorMessage', 'Widget name is missing'); - return; - } - // set simulator by simulation model name let simulationModelName = this.get('simulationModelName'); let self = this; diff --git a/app/components/widget-table.js b/app/components/widget-table.js index 8272310..74c14bd 100644 --- a/app/components/widget-table.js +++ b/app/components/widget-table.js @@ -83,6 +83,7 @@ export default WidgetAbstract.extend({ if (this.get('editing') === true) { // prepare modal this.set('name', this.get('widget.name')); + this.set('errorMessage', null); // get simlator name from id let self = this; @@ -117,11 +118,6 @@ export default WidgetAbstract.extend({ // verify properties let properties = this.getProperties('name'); - if (properties['name'] === null || properties['name'] === "") { - this.set('errorMessage', 'Widget name is missing'); - return; - } - // set simulator by simulation model name let simulationModelName = this.get('simulationModelName'); let self = this; diff --git a/app/components/widget-value.js b/app/components/widget-value.js index ed42fb8..efcbfbe 100644 --- a/app/components/widget-value.js +++ b/app/components/widget-value.js @@ -44,6 +44,7 @@ export default WidgetAbstract.extend({ if (this.get('editing') === true) { // prepare modal this.set('name', this.get('widget.name')); + this.set('errorMessage', null); // get signal mapping for simulation model let self = this; @@ -82,11 +83,6 @@ export default WidgetAbstract.extend({ // verify properties let properties = this.getProperties('name'); - if (properties['name'] === null || properties['name'] === "") { - this.set('errorMessage', 'Widget name is missing'); - return; - } - // set simulator by simulation model name let simulationModelName = this.get('simulationModelName'); let self = this; diff --git a/app/templates/components/widget-plot.hbs b/app/templates/components/widget-plot.hbs index 7fd4040..8e95dda 100644 --- a/app/templates/components/widget-plot.hbs +++ b/app/templates/components/widget-plot.hbs @@ -35,6 +35,12 @@ {{#modal-dialog attachment="middle center" translucentOverlay=true}}
+ Error: {{errorMessage}} +
+ {{/if}} + - - {{#if errorMessage}} -Error: {{errorMessage}}
- {{/if}} {{/modal-dialog}} {{/if}} diff --git a/app/templates/components/widget-value.hbs b/app/templates/components/widget-value.hbs index 6bfb445..00c246b 100644 --- a/app/templates/components/widget-value.hbs +++ b/app/templates/components/widget-value.hbs @@ -1,4 +1,4 @@ -{{name}}: {{value}} +{{name}}{{#if name}}:{{/if}} {{value}} {{#if isShowingModal}} {{#modal-dialog attachment="middle center" translucentOverlay=true}}