From 1787cbd5eb51ca7270b3648356b868e5217e486b Mon Sep 17 00:00:00 2001 From: Dishank Date: Thu, 25 Mar 2021 11:42:29 +0530 Subject: [PATCH] ADDON-35152: Updated default value for form components in config mode --- .../ucc_ui_lib/src/main/webapp/components/BaseFormView.jsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/splunk_add_on_ucc_framework/ucc_ui_lib/src/main/webapp/components/BaseFormView.jsx b/splunk_add_on_ucc_framework/ucc_ui_lib/src/main/webapp/components/BaseFormView.jsx index 395b6b55e..3c35d7e3a 100644 --- a/splunk_add_on_ucc_framework/ucc_ui_lib/src/main/webapp/components/BaseFormView.jsx +++ b/splunk_add_on_ucc_framework/ucc_ui_lib/src/main/webapp/components/BaseFormView.jsx @@ -80,8 +80,7 @@ class BaseFormView extends PureComponent { const temState = {}; this.entities.forEach((e) => { const tempEntity = {}; - e.defaultValue = e.defaultValue ? e.defaultValue : ''; - + if (props.mode === MODE_CREATE) { tempEntity.value = typeof e.defaultValue !== 'undefined' ? e.defaultValue : null; tempEntity.display = @@ -114,6 +113,7 @@ class BaseFormView extends PureComponent { tempEntity.disabled = false; temState[e.field] = tempEntity; } else if (props.mode === MODE_CONFIG) { + e.defaultValue = typeof e.defaultValue !== 'undefined' ? e.defaultValue : null; tempEntity.value = typeof this.currentInput[e.field] !== 'undefined' ? this.currentInput[e.field]