Skip to content

[7.x] Move Ace XJSON lexer-rules, worker and utils to es_ui_shared (#57563)#57781

Merged
jloleysens merged 1 commit intoelastic:7.xfrom
jloleysens:backport/7.x/pr-57563
Feb 17, 2020
Merged

[7.x] Move Ace XJSON lexer-rules, worker and utils to es_ui_shared (#57563)#57781
jloleysens merged 1 commit intoelastic:7.xfrom
jloleysens:backport/7.x/pr-57563

Conversation

@jloleysens
Copy link
Copy Markdown
Contributor

Backports the following commits to 7.x:

…#57563)

* Move mode and lexer rules to shared space

* Update searchprofiler mode rules

* Moved x-json worker out of searchprofiler and into es_ui_shared (for use in Watcher)
Renamed ace/mode -> ace/modes

* Moved collapse and expand literal string functions to es_ui_shared

* Fix some imports
Enable Watcher editor to parse XJson using XJsonMode

* Fix imports

Import JSON highlight rules in XJSONHighlight rules

* Move console_lang, fix Jest tests

Exporting console_lang through the es_ui_shared/public barrel caused the XJsonMode to imported to a index_management too and any other plugin that may
import something from that directory. console_lang was moved to it's own top level directory es_ui_shared/console_lang.

We also included a mock for tests using XJsonMode to import from console_lang.

* Fixed OSS Jest tests

Console Jest tests were still failing because they did not mock out the raw-loader imported worker file

* Expand triple quotes in editor

Upon entering the advanced watcher creation view, the JSON should be scanned for triple quote expansion

* Bring all editors themes in line

Editors had github theme, which diverged from the textmate theme used in Console and SearchProfiler

* Added XJSON mode to simulate alternative input editor

Slight refactor to the logic for using XJSON mode. Created an adhoc hook for wrapping the
logic of useState and moved lanugage util imports there too to reduce the number of imports
in both the watcher form and simulate tabs in advanced creation.

* Moved x-json worker to x-pack

x-json worker is currently only used inside of x-pack. Also testing
for if this will fix the CI/prod build

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
@jloleysens jloleysens added the backport This PR is a backport of another PR label Feb 17, 2020
@kibanamachine
Copy link
Copy Markdown
Contributor

💚 Build Succeeded

To update your PR or re-run it, just comment with:
@elasticmachine merge upstream

@jloleysens jloleysens merged commit 1bba65e into elastic:7.x Feb 17, 2020
@jloleysens jloleysens deleted the backport/7.x/pr-57563 branch February 17, 2020 12:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backport This PR is a backport of another PR

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants