Allowing config flag to turn off javascript controls (#4400)

* Allowing config flag to turn off javascript controls

* lint

* one line, avoiding mutation

* Setting JS fields as readOnly

(cherry picked from commit a373db24f0)
This commit is contained in:
Maxime Beauchemin
2018-02-21 08:31:07 -08:00
parent f99c22af0f
commit 05367a0c10
6 changed files with 45 additions and 2 deletions

View File

@@ -97,6 +97,11 @@ function jsFunctionControl(label, description, extraDescr = null, height = 100,
{extraDescr}
</div>
),
mapStateToProps: state => ({
warning: !state.common.conf.ENABLE_JAVASCRIPT_CONTROLS ?
t('This functionality is disabled in your environment for security reasons.') : null,
readOnly: !state.common.conf.ENABLE_JAVASCRIPT_CONTROLS,
}),
};
}