mirror of
https://github.com/elastic/kibana.git
synced 2025-04-24 01:38:56 -04:00
[Security Solution] Clean up expandable flyout props (#160628)
## Summary This PR removes `onClose` prop from the expandable flyout as it is not necessary anymore --------- Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
This commit is contained in:
parent
9791c47fa2
commit
74e3eca687
4 changed files with 7 additions and 9 deletions
|
@ -20,7 +20,6 @@ describe('ExpandableFlyout', () => {
|
|||
component: () => <div>{'component'}</div>,
|
||||
},
|
||||
];
|
||||
const onClose = () => window.alert('closed');
|
||||
|
||||
it(`shouldn't render flyout if no panels`, () => {
|
||||
const context: ExpandableFlyoutContext = {
|
||||
|
@ -33,7 +32,7 @@ describe('ExpandableFlyout', () => {
|
|||
|
||||
const result = render(
|
||||
<ExpandableFlyoutContext.Provider value={context}>
|
||||
<ExpandableFlyout registeredPanels={registeredPanels} onClose={onClose} />
|
||||
<ExpandableFlyout registeredPanels={registeredPanels} />
|
||||
</ExpandableFlyoutContext.Provider>
|
||||
);
|
||||
|
||||
|
@ -53,7 +52,7 @@ describe('ExpandableFlyout', () => {
|
|||
|
||||
const { getByTestId } = render(
|
||||
<ExpandableFlyoutContext.Provider value={context}>
|
||||
<ExpandableFlyout registeredPanels={registeredPanels} onClose={onClose} />
|
||||
<ExpandableFlyout registeredPanels={registeredPanels} />
|
||||
</ExpandableFlyoutContext.Provider>
|
||||
);
|
||||
|
||||
|
@ -73,7 +72,7 @@ describe('ExpandableFlyout', () => {
|
|||
|
||||
const { getByTestId } = render(
|
||||
<ExpandableFlyoutContext.Provider value={context}>
|
||||
<ExpandableFlyout registeredPanels={registeredPanels} onClose={onClose} />
|
||||
<ExpandableFlyout registeredPanels={registeredPanels} />
|
||||
</ExpandableFlyoutContext.Provider>
|
||||
);
|
||||
|
||||
|
@ -95,7 +94,7 @@ describe('ExpandableFlyout', () => {
|
|||
|
||||
const { getByTestId } = render(
|
||||
<ExpandableFlyoutContext.Provider value={context}>
|
||||
<ExpandableFlyout registeredPanels={registeredPanels} onClose={onClose} />
|
||||
<ExpandableFlyout registeredPanels={registeredPanels} />
|
||||
</ExpandableFlyoutContext.Provider>
|
||||
);
|
||||
|
||||
|
|
|
@ -16,7 +16,7 @@ import { RightSection } from './components/right_section';
|
|||
import type { FlyoutPanel, Panel } from './types';
|
||||
import { LeftSection } from './components/left_section';
|
||||
|
||||
export interface ExpandableFlyoutProps extends EuiFlyoutProps {
|
||||
export interface ExpandableFlyoutProps extends Omit<EuiFlyoutProps, 'onClose'> {
|
||||
/**
|
||||
* List of all registered panels available for render
|
||||
*/
|
||||
|
|
|
@ -110,7 +110,6 @@ export const SecuritySolutionTemplateWrapper: React.FC<Omit<KibanaPageTemplatePr
|
|||
)}
|
||||
<ExpandableFlyout
|
||||
registeredPanels={expandableFlyoutDocumentsPanels}
|
||||
onClose={() => {}}
|
||||
handleOnFlyoutClosed={handleFlyoutChangedOrClosed}
|
||||
/>
|
||||
</StyledKibanaPageTemplate>
|
||||
|
|
|
@ -23,7 +23,7 @@ export interface UseAccordionStateValue {
|
|||
/**
|
||||
* Use this to control the accordion visual state
|
||||
*/
|
||||
state: typeof CLOSED | typeof OPEN;
|
||||
state: ToggleReducerState;
|
||||
|
||||
/**
|
||||
* Handler function for cycling between the states
|
||||
|
@ -32,7 +32,7 @@ export interface UseAccordionStateValue {
|
|||
}
|
||||
|
||||
/**
|
||||
* Tiny hook for controlled useAccordionState
|
||||
* Tiny hook for controlled AccordionState
|
||||
* @param expandedInitially - is accordion expanded on first render
|
||||
*/
|
||||
export const useAccordionState = (expandedInitially: boolean): UseAccordionStateValue => {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue