Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
$scope.error = 'Invalid JSON string';
}
}
} else if ($scope.pluginProperties[watchProperty] === 'grok') {
$scope.disableEdit = false;
$scope.fields = 'GROK';
watcher = $scope.$watch('grok', function () {
$scope.pluginProperties['format.setting.pattern'] = $scope.grok.pattern;
}, true);
}
else {
$scope.disableEdit = false;
$scope.fields = 'SHOW';
$scope.pluginProperties['format.setting.pattern'] = null;
initialize($scope.model);
}
}
function initialize(jsonString) {
filledCount = 0;
var schema = {};
$scope.avro = {};
$scope.grok = {
pattern: $scope.pluginProperties['format.setting.pattern']
};
$scope.error = null;
if (jsonString) {
try {
schema = JSON.parse(jsonString);
$scope.avro.schema = schema;
} catch (e) {
$scope.error = 'Invalid JSON string';
}
}
schema = myHelpers.objectQuery(schema, 'fields');
$scope.properties = [];
$scope.activeCell = false;