From 508269cec3bba7653a94738cf5902136aacfc4ae Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=81lvaro=20Arranz?= Date: Mon, 26 Jun 2017 14:09:22 +0200 Subject: [PATCH] Honor required attribute for widget and operator preferences on client side. See #291 --- src/wirecloud/platform/static/js/wirecloud/UserPref.js | 2 +- src/wirecloud/platform/static/js/wirecloud/UserPrefDef.js | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/src/wirecloud/platform/static/js/wirecloud/UserPref.js b/src/wirecloud/platform/static/js/wirecloud/UserPref.js index cb976de205..b64c205bf1 100644 --- a/src/wirecloud/platform/static/js/wirecloud/UserPref.js +++ b/src/wirecloud/platform/static/js/wirecloud/UserPref.js @@ -61,7 +61,7 @@ 'defaultValue': this.meta.default, 'initiallyDisabled': this.readonly, 'initialValue': this.value, - 'required': false + 'required': this.meta.required }); if (type === 'select') { diff --git a/src/wirecloud/platform/static/js/wirecloud/UserPrefDef.js b/src/wirecloud/platform/static/js/wirecloud/UserPrefDef.js index 7f93f6b5ec..554ec56f15 100644 --- a/src/wirecloud/platform/static/js/wirecloud/UserPrefDef.js +++ b/src/wirecloud/platform/static/js/wirecloud/UserPrefDef.js @@ -48,6 +48,7 @@ Object.defineProperty(this, 'type', {value: type}); Object.defineProperty(this, 'label', {value: options.label}); Object.defineProperty(this, 'description', {value: options.description}); + Object.defineProperty(this, 'required', {value: options.required}); Object.defineProperty(this, 'options', {value: options}); var default_value = '';