forked from elastic/kibana
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
scripted fields preview and validate script before saving (elastic#20746
) * add preview for creating scripted fields * Move previewed results into flyout. (#25) * Move previewed results into flyout. Execute script as soon as the tab is selected. * Format error in a danger callout. * add functional test for preview * move executeScript functionallity into lib so it can be used to validate on save * validate script on save * add functional test for script validation during save * fix jest tests * fix jest tests * only validate script when field is scripted * only add script callouts and help flyout to DOM for scripted fields * move scripting stuff to its own render method * right justify delete button to have same style as delete button for user management * use data-test-subj key to find invalid script error msg in functional tests * move help flyout link out of formRow help text and into its own row
- Loading branch information
Showing
22 changed files
with
1,244 additions
and
601 deletions.
There are no files selected for viewing
601 changes: 387 additions & 214 deletions
601
src/ui/public/field_editor/__snapshots__/field_editor.test.js.snap
Large diffs are not rendered by default.
Oops, something went wrong.
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
134 changes: 0 additions & 134 deletions
134
...public/field_editor/components/scripting_call_outs/__snapshots__/help_flyout.test.js.snap
This file was deleted.
Oops, something went wrong.
113 changes: 0 additions & 113 deletions
113
src/ui/public/field_editor/components/scripting_call_outs/help_flyout.js
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
48 changes: 48 additions & 0 deletions
48
src/ui/public/field_editor/components/scripting_help/__snapshots__/help_flyout.test.js.snap
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
// Jest Snapshot v1, https://goo.gl/fbAQLP | ||
|
||
exports[`ScriptingHelpFlyout should render normally 1`] = ` | ||
<EuiFlyout | ||
data-test-subj="scriptedFieldsHelpFlyout" | ||
hideCloseButton={false} | ||
onClose={[Function]} | ||
ownFocus={false} | ||
size="m" | ||
> | ||
<EuiFlyoutBody> | ||
<EuiTabbedContent | ||
initialSelectedTab={ | ||
Object { | ||
"content": <Unknown />, | ||
"data-test-subj": "syntaxTab", | ||
"id": "syntax", | ||
"name": "Syntax", | ||
} | ||
} | ||
tabs={ | ||
Array [ | ||
Object { | ||
"content": <Unknown />, | ||
"data-test-subj": "syntaxTab", | ||
"id": "syntax", | ||
"name": "Syntax", | ||
}, | ||
Object { | ||
"content": <TestScript | ||
executeScript={[Function]} | ||
indexPattern={Object {}} | ||
lang="painless" | ||
name="myScriptedField" | ||
script={undefined} | ||
/>, | ||
"data-test-subj": "testTab", | ||
"id": "test", | ||
"name": "Preview results", | ||
}, | ||
] | ||
} | ||
/> | ||
</EuiFlyoutBody> | ||
</EuiFlyout> | ||
`; | ||
|
||
exports[`ScriptingHelpFlyout should render nothing if not visible 1`] = `""`; |
Oops, something went wrong.