mirror of
https://github.com/getredash/redash.git
synced 2025-12-25 01:03:20 -05:00
Merge pull request #1819 from getredash/patches
Fix: form component was inserting empty values
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
import { each, contains, find } from 'underscore';
|
||||
import { isUndefined, each, contains, find } from 'underscore';
|
||||
import endsWith from 'underscore.string/endsWith';
|
||||
import template from './dynamic-form.html';
|
||||
|
||||
@@ -115,8 +115,9 @@ function DynamicForm($http, toastr, $q) {
|
||||
if (Object.keys($scope.target.options).length === 0) {
|
||||
const properties = type.configuration_schema.properties;
|
||||
Object.keys(properties).forEach((property) => {
|
||||
$scope.target.options[property] =
|
||||
properties[property].default || '';
|
||||
if (!isUndefined(properties[property].default)) {
|
||||
$scope.target.options[property] = properties[property].default;
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user