Skip to content
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

[ML] Transforms: replace deprecated EuiCodeEditor #108310

Conversation

alvarezmelissa87
Copy link
Contributor

@alvarezmelissa87 alvarezmelissa87 commented Aug 12, 2021

Summary

Related meta issue: #107082

Replaces deprecated EuiCodeEditor in Transforms:

  • public/app/sections/create_components/advanced_pivot_editor/advanced_pivot_editor.tsx
  • public/app/sections/create_components/advanced_runtime_mappings_editor/advanced_runtime_mappings_editor.tsx
  • public/app/sections/create_components/advanced_source_editor/advanced_source_editor.tsx
  • public/app/sections/create_components/aggregation_list/popover_form.tsx
  • public/app/sections/create_components/group_by_list/popover_form.tsx
  • public/app/sections/create_components/step_define/common/filter_agg/components/editor_form.tsx
  • public/app/sections/transform_management/components/transform_list/expanded_row_json_pane.tsx

Checklist

Delete any items that are not applicable to this PR.

Fixes #41832

@alvarezmelissa87 alvarezmelissa87 added :ml release_note:skip Skip the PR/issue when compiling release notes Feature:Transforms ML transforms v7.15.0 labels Aug 12, 2021
@alvarezmelissa87 alvarezmelissa87 self-assigned this Aug 12, 2021
@alvarezmelissa87 alvarezmelissa87 requested a review from a team as a code owner August 12, 2021 00:15
@elasticmachine
Copy link
Contributor

Pinging @elastic/ml-ui (:ml)

Copy link
Contributor

@peteharverson peteharverson left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tested and just left a couple of comments.

@@ -25,13 +19,9 @@ export const ExpandedRowJsonPane: FC<Props> = ({ json }) => {
<EuiFlexGroup>
<EuiFlexItem>
<EuiSpacer size="s" />
<EuiCodeEditor
<EuiCodeBlock fontSize="s" language="json" paddingSize="s" style={{ width: '100%' }}>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You should add an aria-label, something like JSON of transform configuration

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added in 80c039b

@@ -25,13 +19,9 @@ export const ExpandedRowJsonPane: FC<Props> = ({ json }) => {
<EuiFlexGroup>
<EuiFlexItem>
<EuiSpacer size="s" />
<EuiCodeEditor
<EuiCodeBlock fontSize="s" language="json" paddingSize="s" style={{ width: '100%' }}>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there a reason why this doesn't have isCopyable set? It is set for the DFA one.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added in 80c039b

@qn895
Copy link
Member

qn895 commented Aug 16, 2021

Tested the runtime field editor, query/source editor, and pivot agg editor and functionally they all work great. Left a few comments but otherwise LGTM 🎉

@alvarezmelissa87 alvarezmelissa87 force-pushed the ml-transform-replace-code-editor branch from 91e9df1 to a30a25b Compare August 16, 2021 18:09
@kibanamachine
Copy link
Contributor

💚 Build Succeeded

Metrics [docs]

Async chunks

Total size of all lazy-loaded chunks that will be downloaded as the user navigates the app

id before after diff
transform 917.2KB 917.9KB +700.0B

History

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

cc @alvarezmelissa87

@alvarezmelissa87
Copy link
Contributor Author

This has been updated and is ready for a final look when you get a chance 🙏 cc @walterra, @qn895

@qn895
Copy link
Member

qn895 commented Aug 17, 2021

Latest changes LGTM 🎉

Copy link
Contributor

@walterra walterra left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@alvarezmelissa87 alvarezmelissa87 merged commit 4e0375f into elastic:master Aug 18, 2021
alvarezmelissa87 added a commit that referenced this pull request Aug 18, 2021
* replace deprecated EuiCodeEditor in transform

* update jest snapshot

* add aria label and move data attribute to parent element for testing

* update jest snapshot for aria label

* update functional tests
@alvarezmelissa87 alvarezmelissa87 deleted the ml-transform-replace-code-editor branch August 18, 2021 14:22
kibanamachine pushed a commit to kibanamachine/kibana that referenced this pull request Jan 9, 2023
kibanamachine added a commit that referenced this pull request Jan 9, 2023
# Backport

This will backport the following commits from `main` to `8.6`:
- [[ML] Transforms: Fix transforms JSON display
(#147996)](#147996)

<!--- Backport version: 8.9.7 -->

### Questions ?
Please refer to the [Backport tool
documentation](https://github.com/sqren/backport)

<!--BACKPORT [{"author":{"name":"James
Gowdy","email":"[email protected]"},"sourceCommit":{"committedDate":"2023-01-09T14:58:56Z","message":"[ML]
Transforms: Fix transforms JSON display (#147996)\n\nFixing a typo in
the code from when the JSON editor
was\r\n[converted](#108310) from
using\r\n`EuiCodeEditor`\r\n\r\n**Before**\r\n\r\n![image](https://user-images.githubusercontent.com/22172091/209140230-fcb3fff5-0040-487a-bffc-581a8fe2f4e4.png)\r\n\r\n**After**\r\n\r\n![image](https://user-images.githubusercontent.com/22172091/209140326-98eecef0-d9bf-4145-8342-788b4166b28d.png)","sha":"ba06f687522fed393036ff01d9230f341e37d710","branchLabelMapping":{"^v8.7.0$":"main","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["bug","release_note:fix",":ml","Feature:Transforms","v8.6.0","v8.7.0"],"number":147996,"url":"https://github.com/elastic/kibana/pull/147996","mergeCommit":{"message":"[ML]
Transforms: Fix transforms JSON display (#147996)\n\nFixing a typo in
the code from when the JSON editor
was\r\n[converted](#108310) from
using\r\n`EuiCodeEditor`\r\n\r\n**Before**\r\n\r\n![image](https://user-images.githubusercontent.com/22172091/209140230-fcb3fff5-0040-487a-bffc-581a8fe2f4e4.png)\r\n\r\n**After**\r\n\r\n![image](https://user-images.githubusercontent.com/22172091/209140326-98eecef0-d9bf-4145-8342-788b4166b28d.png)","sha":"ba06f687522fed393036ff01d9230f341e37d710"}},"sourceBranch":"main","suggestedTargetBranches":["8.6"],"targetPullRequestStates":[{"branch":"8.6","label":"v8.6.0","labelRegex":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"},{"branch":"main","label":"v8.7.0","labelRegex":"^v8.7.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/147996","number":147996,"mergeCommit":{"message":"[ML]
Transforms: Fix transforms JSON display (#147996)\n\nFixing a typo in
the code from when the JSON editor
was\r\n[converted](#108310) from
using\r\n`EuiCodeEditor`\r\n\r\n**Before**\r\n\r\n![image](https://user-images.githubusercontent.com/22172091/209140230-fcb3fff5-0040-487a-bffc-581a8fe2f4e4.png)\r\n\r\n**After**\r\n\r\n![image](https://user-images.githubusercontent.com/22172091/209140326-98eecef0-d9bf-4145-8342-788b4166b28d.png)","sha":"ba06f687522fed393036ff01d9230f341e37d710"}}]}]
BACKPORT-->

Co-authored-by: James Gowdy <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Feature:Transforms ML transforms :ml release_note:skip Skip the PR/issue when compiling release notes v7.15.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[ML] Data frame transform JSON tab wrongly implies it is edit-able
6 participants