-
Notifications
You must be signed in to change notification settings - Fork 8.1k
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
[Embeddable Rebuild] [Controls] Remove non-React controls from controls
plugin
#192017
[Embeddable Rebuild] [Controls] Remove non-React controls from controls
plugin
#192017
Conversation
cff635b
to
ed106ab
Compare
…ld_final-controls-cleanup_2024-09-03
… github.com:heenawter/kibana into embeddableRebuild_final-controls-cleanup_2024-09-03
…ld_final-controls-cleanup_2024-09-03
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.
This file was refactored to support the new types and then moved from src/plugins/controls/public/control_group/actions
to src/plugins/controls/public/actions
- because of this, GitHub is reporting it as an entirely new file 🤷 This is not actually a new test
@@ -7,6 +7,6 @@ | |||
* License v3.0 only", or the "Server Side Public License, v 1". | |||
*/ | |||
|
|||
export const ACTION_EDIT_CONTROL = 'editLegacyEmbeddableControl'; | |||
export const ACTION_EDIT_CONTROL = 'editDataControl'; |
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.
editLegacyEmbeddableControl
isn't necessary anymore, as the legacy edit action has been deleted and replaced with the React control edit action
} | ||
|
||
export interface ControlsPluginStart { | ||
getControlFactory: ControlsServiceType['getControlFactory']; | ||
getControlTypes: ControlsServiceType['getControlTypes']; | ||
getAllControlTypes: ControlsServiceType['getAllControlTypes']; |
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 decided to keep the setup
and start
contracts more-or-less the same, despite the fact that no one is using them - if we want to remove the ability for outside plugins to register controls, we can delete this in a follow up PR.
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.
This file was moved from common
to server
, but some of the code was also changed to make the types happy - it is worth taking a closer look at this file 🙇
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.
This file was moved from common
to server
, but some of the code was also changed to make the types happy - it is worth taking a closer look at this file 🙇
export type { | ||
ControlGroupRuntimeState, | ||
ControlGroupSerializedState, | ||
ControlPanelState, | ||
ControlPanelsState, | ||
DefaultDataControlState, | ||
} from '../common'; | ||
export type { OptionsListControlState } from '../common/options_list'; |
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've had to export some stuff from common
to keep the imports consistent for external uses - I kept these minimal though (i.e. only included the types that are used externally), since any internal controls
code should just import from common
when necessary.
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.
This file used to contain a bunch of other styles specific to control panels - that logic was moved to control_panel.scss
as part of the initial refactor, so this file now contains the bare minimum control group styling.
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 decided to move a bunch of styles from the old control_group.scss
to this file - that is why you are seeing a bunch of changes 🙇 I added some comments to try to clarify which styles are doing what, since this SASS file is a bit... unruly.
@@ -50,7 +52,7 @@ describe('render', () => { | |||
await waitFor(() => { | |||
const controlFrame = controlPanel.getByTestId('control-frame'); | |||
expect(controlFrame.getAttribute('class')).toContain('controlFrameWrapper--medium'); | |||
expect(controlFrame.getAttribute('class')).toContain('controlFrameWrapper--grow'); | |||
expect(controlFrame.getAttribute('class')).toContain('euiFlexItem-grow'); |
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.
We were never actually using the controlFrameWrapper--grow
class so I removed it - a euiFlexItem-grow
class check accomplishes the same thing, though.
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.
This service had a bunch of stuff for the old timeslider control + the range slider control that are no longer being used 🤷 So I removed it all. I plan on doing a full audit of the services as part of #192005 to ensure everything is being used, but it was easier to remove this now because it was tied to old ControlInput
types.
Pinging @elastic/kibana-presentation (Team:Presentation) |
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.
kibana-presentation changes LGTM
code review only
src/plugins/controls/public/actions/delete_control_action.test.tsx
Outdated
Show resolved
Hide resolved
src/plugins/controls/public/actions/edit_control_action.test.tsx
Outdated
Show resolved
Hide resolved
src/plugins/controls/public/services/embeddable/embeddable.stub.ts
Outdated
Show resolved
Hide resolved
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.
Style changes LGTM. Very nice *.scss clean up @Heenawter !
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.
Code-only review, Data Discovery change LGTM 👍
💛 Build succeeded, but was flaky
Failed CI StepsTest FailuresMetrics [docs]Module Count
Public APIs missing comments
Async chunks
Public APIs missing exports
Page load bundle
Unknown metric groupsAPI count
async chunk count
ESLint disabled line counts
References to deprecated APIs
Total ESLint disabled count
History
To update your PR or re-run it, just comment with: cc @Heenawter |
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.
Investigations changes, LGTM, sorry for the delay!
…ols` plugin (elastic#192017) Part of elastic#192005 Closes elastic#176533 ## Summary This PR represents the first major cleanup task for the control group embeddable refactor. The tasks included in this PR can be loosely summarized as follows: 1. This PR removes the old, non-React version of controls - Note that the new controls are still included under the `react_controls` folder - I will address this in a follow up PR. 2. This PR removes **all** types associated with the old embeddable system; i.e. any `*input*` or `*output*` types. - As part of cleaning up these types, some of the types included in the `public/react_controls` folder had to be moved to `common` to make them available to server-side code. - This resulted in an... unfortunate number of import changes 🫠 Hence the rather large file change count. I took this opportunity to organize the imports, too - so a significant chunk of these files are simply import changes. 3. This PR removes the controls Storybook and all related mocks - Since the controls storybooks have been broken for awhile, and since we had plans to remove them but never got around to it, I just decided to delete them as part of this PR and close elastic#176533 rather than spending time to fix the types for non-operational stories ### Checklist - [x] Any text added follows [EUI's writing guidelines](https://elastic.github.io/eui/#/guidelines/writing), uses sentence case text and includes [i18n support](https://github.com/elastic/kibana/blob/main/packages/kbn-i18n/README.md) - [x] [Unit or functional tests](https://www.elastic.co/guide/en/kibana/master/development-tests.html) were updated or added to match the most common scenarios ### For maintainers - [ ] This was checked for breaking API changes and was [labeled appropriately](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process) --------- Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com> (cherry picked from commit 5082eef)
💚 All backports created successfully
Note: Successful backport PRs will be merged automatically after passing CI. Questions ?Please refer to the Backport tool documentation |
…`controls` plugin (#192017) (#193174) # Backport This will backport the following commits from `main` to `8.x`: - [[Embeddable Rebuild] [Controls] Remove non-React controls from `controls` plugin (#192017)](#192017) <!--- Backport version: 9.4.3 --> ### Questions ? Please refer to the [Backport tool documentation](https://github.com/sqren/backport) <!--BACKPORT [{"author":{"name":"Hannah Mudge","email":"Heenawter@users.noreply.github.com"},"sourceCommit":{"committedDate":"2024-09-17T14:12:54Z","message":"[Embeddable Rebuild] [Controls] Remove non-React controls from `controls` plugin (#192017)\n\nPart of #192005 #176533 Summary\r\n\r\nThis PR represents the first major cleanup task for the control group\r\nembeddable refactor. The tasks included in this PR can be loosely\r\nsummarized as follows:\r\n1. This PR removes the old, non-React version of controls \r\n- Note that the new controls are still included under the\r\n`react_controls` folder - I will address this in a follow up PR.\r\n2. This PR removes **all** types associated with the old embeddable\r\nsystem; i.e. any `*input*` or `*output*` types.\r\n- As part of cleaning up these types, some of the types included in the\r\n`public/react_controls` folder had to be moved to `common` to make them\r\navailable to server-side code.\r\n- This resulted in an... unfortunate number of import changes 🫠 Hence\r\nthe rather large file change count. I took this opportunity to organize\r\nthe imports, too - so a significant chunk of these files are simply\r\nimport changes.\r\n3. This PR removes the controls Storybook and all related mocks\r\n- Since the controls storybooks have been broken for awhile, and since\r\nwe had plans to remove them but never got around to it, I just decided\r\nto delete them as part of this PR and close\r\nhttps://github.com//issues/176533 rather than spending\r\ntime to fix the types for non-operational stories\r\n\r\n### Checklist\r\n\r\n- [x] Any text added follows [EUI's writing\r\nguidelines](https://elastic.github.io/eui/#/guidelines/writing), uses\r\nsentence case text and includes [i18n\r\nsupport](https://github.com/elastic/kibana/blob/main/packages/kbn-i18n/README.md)\r\n- [x] [Unit or functional\r\ntests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)\r\nwere updated or added to match the most common scenarios\r\n\r\n\r\n### For maintainers\r\n\r\n- [ ] This was checked for breaking API changes and was [labeled\r\nappropriately](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process)\r\n\r\n---------\r\n\r\nCo-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>","sha":"5082eef2f1df8b6d7e9bb15d2221b9f4c67b00bf","branchLabelMapping":{"^v9.0.0$":"main","^v8.16.0$":"8.x","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["Team:Presentation","release_note:skip","impact:critical","v9.0.0","backport:prev-minor","project:embeddableRebuild"],"title":"[Embeddable Rebuild] [Controls] Remove non-React controls from `controls` plugin","number":192017,"url":"#192017 Rebuild] [Controls] Remove non-React controls from `controls` plugin (#192017)\n\nPart of #192005 #176533 Summary\r\n\r\nThis PR represents the first major cleanup task for the control group\r\nembeddable refactor. The tasks included in this PR can be loosely\r\nsummarized as follows:\r\n1. This PR removes the old, non-React version of controls \r\n- Note that the new controls are still included under the\r\n`react_controls` folder - I will address this in a follow up PR.\r\n2. This PR removes **all** types associated with the old embeddable\r\nsystem; i.e. any `*input*` or `*output*` types.\r\n- As part of cleaning up these types, some of the types included in the\r\n`public/react_controls` folder had to be moved to `common` to make them\r\navailable to server-side code.\r\n- This resulted in an... unfortunate number of import changes 🫠 Hence\r\nthe rather large file change count. I took this opportunity to organize\r\nthe imports, too - so a significant chunk of these files are simply\r\nimport changes.\r\n3. This PR removes the controls Storybook and all related mocks\r\n- Since the controls storybooks have been broken for awhile, and since\r\nwe had plans to remove them but never got around to it, I just decided\r\nto delete them as part of this PR and close\r\nhttps://github.com//issues/176533 rather than spending\r\ntime to fix the types for non-operational stories\r\n\r\n### Checklist\r\n\r\n- [x] Any text added follows [EUI's writing\r\nguidelines](https://elastic.github.io/eui/#/guidelines/writing), uses\r\nsentence case text and includes [i18n\r\nsupport](https://github.com/elastic/kibana/blob/main/packages/kbn-i18n/README.md)\r\n- [x] [Unit or functional\r\ntests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)\r\nwere updated or added to match the most common scenarios\r\n\r\n\r\n### For maintainers\r\n\r\n- [ ] This was checked for breaking API changes and was [labeled\r\nappropriately](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process)\r\n\r\n---------\r\n\r\nCo-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>","sha":"5082eef2f1df8b6d7e9bb15d2221b9f4c67b00bf"}},"sourceBranch":"main","suggestedTargetBranches":[],"targetPullRequestStates":[{"branch":"main","label":"v9.0.0","branchLabelMappingKey":"^v9.0.0$","isSourceBranch":true,"state":"MERGED","url":"#192017 Rebuild] [Controls] Remove non-React controls from `controls` plugin (#192017)\n\nPart of #192005 #176533 Summary\r\n\r\nThis PR represents the first major cleanup task for the control group\r\nembeddable refactor. The tasks included in this PR can be loosely\r\nsummarized as follows:\r\n1. This PR removes the old, non-React version of controls \r\n- Note that the new controls are still included under the\r\n`react_controls` folder - I will address this in a follow up PR.\r\n2. This PR removes **all** types associated with the old embeddable\r\nsystem; i.e. any `*input*` or `*output*` types.\r\n- As part of cleaning up these types, some of the types included in the\r\n`public/react_controls` folder had to be moved to `common` to make them\r\navailable to server-side code.\r\n- This resulted in an... unfortunate number of import changes 🫠 Hence\r\nthe rather large file change count. I took this opportunity to organize\r\nthe imports, too - so a significant chunk of these files are simply\r\nimport changes.\r\n3. This PR removes the controls Storybook and all related mocks\r\n- Since the controls storybooks have been broken for awhile, and since\r\nwe had plans to remove them but never got around to it, I just decided\r\nto delete them as part of this PR and close\r\nhttps://github.com//issues/176533 rather than spending\r\ntime to fix the types for non-operational stories\r\n\r\n### Checklist\r\n\r\n- [x] Any text added follows [EUI's writing\r\nguidelines](https://elastic.github.io/eui/#/guidelines/writing), uses\r\nsentence case text and includes [i18n\r\nsupport](https://github.com/elastic/kibana/blob/main/packages/kbn-i18n/README.md)\r\n- [x] [Unit or functional\r\ntests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)\r\nwere updated or added to match the most common scenarios\r\n\r\n\r\n### For maintainers\r\n\r\n- [ ] This was checked for breaking API changes and was [labeled\r\nappropriately](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process)\r\n\r\n---------\r\n\r\nCo-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>","sha":"5082eef2f1df8b6d7e9bb15d2221b9f4c67b00bf"}}]}] BACKPORT--> Co-authored-by: Hannah Mudge <Heenawter@users.noreply.github.com>
…ols` plugin (elastic#192017) Part of elastic#192005 Closes elastic#176533 ## Summary This PR represents the first major cleanup task for the control group embeddable refactor. The tasks included in this PR can be loosely summarized as follows: 1. This PR removes the old, non-React version of controls - Note that the new controls are still included under the `react_controls` folder - I will address this in a follow up PR. 2. This PR removes **all** types associated with the old embeddable system; i.e. any `*input*` or `*output*` types. - As part of cleaning up these types, some of the types included in the `public/react_controls` folder had to be moved to `common` to make them available to server-side code. - This resulted in an... unfortunate number of import changes 🫠 Hence the rather large file change count. I took this opportunity to organize the imports, too - so a significant chunk of these files are simply import changes. 3. This PR removes the controls Storybook and all related mocks - Since the controls storybooks have been broken for awhile, and since we had plans to remove them but never got around to it, I just decided to delete them as part of this PR and close elastic#176533 rather than spending time to fix the types for non-operational stories ### Checklist - [x] Any text added follows [EUI's writing guidelines](https://elastic.github.io/eui/#/guidelines/writing), uses sentence case text and includes [i18n support](https://github.com/elastic/kibana/blob/main/packages/kbn-i18n/README.md) - [x] [Unit or functional tests](https://www.elastic.co/guide/en/kibana/master/development-tests.html) were updated or added to match the most common scenarios ### For maintainers - [ ] This was checked for breaking API changes and was [labeled appropriately](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process) --------- Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
Part of #192005
Closes #176533
Summary
This PR represents the first major cleanup task for the control group embeddable refactor. The tasks included in this PR can be loosely summarized as follows:
react_controls
folder - I will address this in a follow up PR.*input*
or*output*
types.public/react_controls
folder had to be moved tocommon
to make them available to server-side code.Checklist
For maintainers