-
Notifications
You must be signed in to change notification settings - Fork 8.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Scripted fields interface #2076
Conversation
…to check for naming conflicts
I think it'd be really helpful if there was some info about writing scripts. Maybe warnings about dangerous operations, useful "quick start" examples, and a link to the docs for different scripting languages? ## Warning
Something about scripting being potentially expensive, but
there are ways to mitigate that...
## Reference
Our examples
## Quick Start
**append some text to a value**
'prefix' + doc['fieldname'].value + 'postfix'
**padd values to 20 characters**
doc['fieldname'].value.padLeft(20, ' ') |
}]; | ||
|
||
$scope.$watch('indexPattern.scriptedFields', function () { | ||
_.invoke(rowScopes, '$destroy'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You probably want to clear the rowScopes array too.
if (type === 'scripted') { | ||
return _.where(self.fields, { scripted: true }); | ||
} | ||
return _.where(self.fields, { scripted: undefined }); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I realize that this probably works fine, but an explicit check for undefined
is dangerous IMO. The scripted property is boolean and should probably be treated as true
or false
-y, not true
or undefined
.
var getScripted = type === 'scripted';
return _.where(self.fields, function (field) {
return field.scripted ? getScripted : !getScripted;
});
also ends up being a better fix for the select box
👍 |
Adds interface to create, edit and remove scripted fields from the index pattern.
Also adds another change to the
paginated-table
directive - columns can now be marked as not sortable.This completes the second task on #1537