-
Notifications
You must be signed in to change notification settings - Fork 8.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Controls] Redux Toolkit and Embeddable Redux Wrapper (#114371)
Use new redux wrapper for control group management and upgrade all control group methods to use redux wrapper. Get order of controls from embeddable input, set up preconfigured story. Co-authored-by: andreadelrio <[email protected]>
- Loading branch information
1 parent
e5576d6
commit f8cbbbb
Showing
39 changed files
with
1,308 additions
and
625 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
27 changes: 27 additions & 0 deletions
27
...s/presentation_util/public/components/controls/__stories__/storybook_control_factories.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
/* | ||
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one | ||
* or more contributor license agreements. Licensed under the Elastic License | ||
* 2.0 and the Server Side Public License, v 1; you may not use this file except | ||
* in compliance with, at your election, the Elastic License 2.0 or the Server | ||
* Side Public License, v 1. | ||
*/ | ||
|
||
import { flightFields, getEuiSelectableOptions } from './flights'; | ||
import { OptionsListEmbeddableFactory } from '../control_types/options_list'; | ||
import { InputControlFactory, PresentationControlsService } from '../../../services/controls'; | ||
|
||
export const populateStorybookControlFactories = ( | ||
controlsServiceStub: PresentationControlsService | ||
) => { | ||
const optionsListFactoryStub = new OptionsListEmbeddableFactory( | ||
({ field, search }) => | ||
new Promise((r) => setTimeout(() => r(getEuiSelectableOptions(field, search)), 500)), | ||
() => Promise.resolve(['demo data flights']), | ||
() => Promise.resolve(flightFields) | ||
); | ||
|
||
// cast to unknown because the stub cannot use the embeddable start contract to transform the EmbeddableFactoryDefinition into an EmbeddableFactory | ||
const optionsListControlFactory = optionsListFactoryStub as unknown as InputControlFactory; | ||
optionsListControlFactory.getDefaultInput = () => ({}); | ||
controlsServiceStub.registerInputControlType(optionsListControlFactory); | ||
}; |
22 changes: 0 additions & 22 deletions
22
...ugins/presentation_util/public/components/controls/control_frame/control_frame_strings.ts
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.