-
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
Create Painless Lab app #57538
Create Painless Lab app #57538
Conversation
Pinging @elastic/es-ui (Team:Elasticsearch UI) |
6ea2efd
to
e683bc6
Compare
- Add def keyword to Painless spec. - Temporarily fix broken highlighting. - Add small padding to main controls.
On that, it looks like the contexts can also be dynamically created beyond known ones. We should consider supporting this in future iterations. |
* Code restructure, improve types, add plugin id, introduced hook Moved the code execution hook to a custom hook outside of main, also chaining off promise to avoid lower level handling of sequencing. * Re-instated formatting code To improve DX the execution error response from the painless API was massaged to a more reader friendly state, only giving non-repeating information. Currently it is hard to determine the line and character information from the painless endpoint. If the user wishes to see this raw information it will be available in the API response flyout. * Remove leading new line in default script * Remove registration of feature flag * Fix types * Restore previous auto-submit request behaviour * Remove use of null and remove old comment Stick with "undefined" as the designation for something not existing.
@elasticmachine merge upstream |
@elasticmachine merge upstream |
* Clarify data and persistence flow. Fix floating point precision bug. * Send a string to API and ES client instead of an object.
@elasticmachine merge upstream |
Just want to highlight that this whole project is awesome! I'm looking forward to working with @stu-elastic and the UI team to continue to add new features and make more improvements. After testing this I do not have much to add in the way of constructive feedback that I think should go into this specific PR outside of what @stu-elastic has already highlighted. The one thing I keep thinking is it seems a bit clunky to have the output of the error message both take up a significant portion of the usable space and be presented as part of a screen on the right side. I'm hopeful that this can be migrated to syntax error highlighting in a similar way that other IDE's such as Intellij/Eclipse do it with the underlined red syntax showing the error and pop up to say what the error is. |
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.
From my perspective this is ready to go as a beta feature. Thanks to all that put in the work to make this happen.
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.
No show stoppers.
This is amazing work, I can't wait for customers to get it into their hands.
@cchaos Could you take a look at the Sass? No UI review necessary at this point. |
@elasticmachine merge upstream |
@cjcenizal If this is going to be released in 7.7, then I think it deserves a day for a simple UI/design review. Especially when it comes to the use of the bottom bar. From the screenshots, I can tell that there's an overlap issue with the nav drawer, and the application is re-inventing where to get help. You should look at how the Advanced Settings page fixes the nav drawer overlap issue or reconsider if it's necessary to use the bottom bar vs putting the help in the header help menu. We can push you a PR to cleanup spacing, sizing, etc issues. |
@cchaos A PR for cleaning up layout would be great, thanks!
Sounds great. All feedback is always welcome esp re that bottom bar. Re some of your comments, #60833 will address the bottom bar overlap issue once merged. I have an issue with the way the help menu in the top nav makes it non-obvious that there is app-related help in there (it looks the same whether it contains app-related content or not). I'd like to surface it more prominently within the app until we find a way around that. I'd be happy to Zoom about this. |
* Make JSON format of parameters field more prominent. Set default parameters to provide an example to users. * Set default document to provide an example to users. * Simplify context's updateState interface. * Refactor store and context file organization. - Remove common directory, move constants and types files to root. - Move initialState into context file, where it's being used. * Add validation for index input. * Create context directory.
…arther from the close button.
💚 Build SucceededHistory
To update your PR or re-run it, just comment with: |
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.
SCSS looks good. And CJ made some tweaks to the UI per our discussion. I think we'll want to revisit the structure of the right side. But we need a bit more time to figure out the right direction.
@elastic/kibana-app I can't spot any changed files which fall under your purview, so I'm going to override the codeowner block and merge. |
* Create Painless Playground app (#54578) * Replace heart script with smiley face script. (#57755) * Rename Painless Playground -> Painless Lab. (#57545) * Fix i18n namespace. * Improve smiley face proportions. - Add def keyword to Painless spec. - Temporarily fix broken highlighting. - Add small padding to main controls. * [Painless Lab] Minor Fixes (#58135) * Code restructure, improve types, add plugin id, introduced hook Moved the code execution hook to a custom hook outside of main, also chaining off promise to avoid lower level handling of sequencing. * Re-instated formatting code To improve DX the execution error response from the painless API was massaged to a more reader friendly state, only giving non-repeating information. Currently it is hard to determine the line and character information from the painless endpoint. If the user wishes to see this raw information it will be available in the API response flyout. * Remove leading new line in default script * Remove registration of feature flag * Fix types * Restore previous auto-submit request behaviour * Remove use of null and remove old comment Stick with "undefined" as the designation for something not existing. * [Painless Lab] NP migration (#59794) * Fix sample document editor. * [Painless Lab] Fix float -> integer coercion bug (#60201) * Clarify data and persistence flow. Fix floating point precision bug. * Send a string to API and ES client instead of an object. * Rename helpers lib to format. Add tests for formatRequestPayload. * Add query parameter to score context (#60414) * Fix typo and i18n * Make state init lazy Otherwise we are needlessly reading and JSON.parse'ing on every state update * Support the query parameter in requests to Painless * Fix borked i18n * Fix i18n * Another i18n issue * [Painless] Minor state update model refactor (#60532) * Fix typo and i18n * Make state init lazy Otherwise we are needlessly reading and JSON.parse'ing on every state update * Support the query parameter in requests to Painless * WiP on state refactor * Some cleanup after manual testing * Fix types and i18n * Fix i18n in context_tab * i18n * [Painless] Language Service (#60612) * Added language service * Use the correct monaco instance and add wordwise operations * Remove plugin context initializer for now * [Painless] Replace hard-coded links (#60603) * Replace hard-coded links Also remove all props from Main component * Pass the new links object to the request flyout too * Link directly to painless execute API's contexts * Remove responsive stacking from tabs with icons in them. * Resize Painless Lab bottom bar to accommodate nav drawer width (#60833) * Validate Painless Lab index field (#60841) * Make JSON format of parameters field more prominent. Set default parameters to provide an example to users. * Set default document to provide an example to users. * Simplify context's updateState interface. * Refactor store and context file organization. - Remove common directory, move constants and types files to root. - Move initialState into context file, where it's being used. * Add validation for index input. * Create context directory. * Fix bottom bar z-index. * Position flyout help link so it's bottom-aligned with the title and farther from the close button. Co-authored-by: Matthias Wilhelm <[email protected]> Co-authored-by: Jean-Louis Leysens <[email protected]> Co-authored-by: Elastic Machine <[email protected]> Co-authored-by: Alison Goryachev <[email protected]> Co-authored-by: Matthias Wilhelm <[email protected]> Co-authored-by: Jean-Louis Leysens <[email protected]> Co-authored-by: Elastic Machine <[email protected]> Co-authored-by: Alison Goryachev <[email protected]>
* master: (34 commits) [APM] add service map config options to legacy plugin (elastic#61002) [App Arch] migrate legacy CSS to new platform (core_plugins/kibana_react) (elastic#59882) Migrated styles for "share" plugin to new platform (elastic#59981) [ML] Module setup with dynamic model memory estimation (elastic#60656) Drilldowns (elastic#59632) Upgrade mocha dev-dependency from 6.2.2 to 7.1.1 (elastic#60779) [SIEM] Overview: Recent cases widget (elastic#60993) [ML] Functional tests - stabilize df analytics clone tests (elastic#60497) [SIEM] Updates process and TLS tables to use ECS 1.5 fields (elastic#60854) Migrate doc view part of discover (elastic#58094) Revert "[APM] Collect telemetry about data/API performance (elastic#51612)" fix(NA): log rotation watchers usage (elastic#60956) [SIEM] [CASES] Build lego blocks case details view (elastic#60864) Create Painless Lab app (elastic#57538) [SIEM] Move Timeline Template field to first step of rule creation (elastic#60840) [Reporting/New Platform Migration] Use a new config service on server-side (elastic#55882) [Alerting] allow email action to not require auth (elastic#60839) [Maps] Default ES document layer scaling type to clusters and show scaling UI in the create wizard (elastic#60668) [APM] Collect telemetry about data/API performance (elastic#51612) Implement Kibana Login Selector (elastic#53010) ...
Been early at the party, and now I'm a bit late (busy with work before our features turn to ice): |
Pertains to #59500
See original PR #54578 for history, including alternative approaches in the UI (e.g. a "Submit" button for sending the request instead of live-updating).
Release note
The Painless Lab dev tool helps you experiment with and learn about the Painless language.
Use cases
Currently, Kibana allows users to test out scripted fields against their cluster data from within Management > Index Patterns > Scripted Fields, but there are many other ways Painless can be used, which aren't addressed by that particular tool.
Ingested data
In this situation, the user has ingested data they want to simulate a script against. However even this use case extends beyond the way the Index Pattern Scripted Fields UI is used. That use case is limited to the Field context but there are numerous other contexts which expect ingested data (reindexing, watcher conditions/transforms, and so on).
The ideal solution might be to update each UI with better Painless support within that particular context, the same way the Scripted Fields UI does. But in the meantime, generic support for these testing scripts within these contexts in the Painless Lab could be a more efficient way to provide this functionality to users.
Pre-ingestion data
Tal mentioned that there's a strong ingestion use case for Painless, specifically the ingest node Script processor which has access to the Ingest processor context. In this case, the user has data they're going to ingest but the data isn't yet available in the cluster. So the Scripted Fields UX isn't applicable here.
Developer tool
Stu helped me understand the role this tool can play for our own development of the Painless language and API. For example, by being able to see how errors are surfaced in the UI, they were able to improve the way syntax errors are indicated in the error response (elastic/elasticsearch#51069). Jack also mentioned that this UI will support their development of an API to support autocomplete.
Prep for other apps, e.g. Watcher
As mentioned by @jeffvestal in #54578 (comment):
To-do
Requirements for shipping
painless_lab
i18n namespace topainlessLab
.Optional enhancements
Kibana header bar help menu
Resources