-
Notifications
You must be signed in to change notification settings - Fork 1
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
Add openAddDataControlFlyout
to API
#42
Add openAddDataControlFlyout
to API
#42
Conversation
@@ -66,7 +69,9 @@ export type ControlGroupApi = PresentationContainer & | |||
ignoreParentSettings$: PublishingSubject<ParentIgnoreSettings | undefined>; | |||
allowExpensiveQueries$: PublishingSubject<boolean>; | |||
untilInitialized: () => Promise<void>; | |||
openAddDataControlFlyout: () => void; | |||
openAddDataControlFlyout: (settings?: { |
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.
Since settings is just a wrapper around controlInputTransform? How about just openAddDataControlFlyout: (controlInputTransform?: ControlInputTransform) => void
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.
There used to be more than one setting for the legacy version of openAddDataControlFlyout
(it included an onSave
callback) - I still haven't fully narrowed down which ones are necessary, and I won't know until the control group renderer is fully converted. For now, maybe we keep that extra level?
panelType: controlType, | ||
initialState, | ||
initialState: controlInputTransform!( | ||
initialState as Partial<ControlGroupSerializedState>, |
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.
Shouldn't this be Partial<DefaultControlState>
since the initialState is the control's initial state?
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.
Definitely a bad cast here, woops! Technically it should be Partial<ControlInput>
because of how ControlInputTransform
is defined in src/plugins/controls/common/types.ts
. But since we don't want to touch any of the stuff that is shared between React controls and legacy at this point, perhaps we just cast to DataControlEditorState
? This satisfies Partial<ControlInput>
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.
sounds good. We can always iterator on this
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.
LGTM
code review only
6582cf5
into
nreese:move_react_controls_into_controls_plugin
This migrates some of my work from elastic#190185 into a separate PR