-
Notifications
You must be signed in to change notification settings - Fork 8.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
7 changed files
with
116 additions
and
38 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
17 changes: 17 additions & 0 deletions
17
...s/public/components/flyout_list_manage_drilldowns/flyout_list_manage_drilldowns.story.tsx
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,17 @@ | ||
/* | ||
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one | ||
* or more contributor license agreements. Licensed under the Elastic License; | ||
* you may not use this file except in compliance with the Elastic License. | ||
*/ | ||
|
||
import * as React from 'react'; | ||
import { EuiFlyout } from '@elastic/eui'; | ||
import { storiesOf } from '@storybook/react'; | ||
import { FlyoutListManageDrilldowns } from './flyout_list_manage_drilldowns'; | ||
import { drilldowns } from '../list_manage_drilldowns/test_data'; | ||
|
||
storiesOf('components/FlyoutListManageDrilldowns', module).add('default', () => ( | ||
<EuiFlyout onClose={() => {}}> | ||
<FlyoutListManageDrilldowns drilldowns={drilldowns} /> | ||
</EuiFlyout> | ||
)); |
46 changes: 46 additions & 0 deletions
46
...lldowns/public/components/flyout_list_manage_drilldowns/flyout_list_manage_drilldowns.tsx
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,46 @@ | ||
/* | ||
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one | ||
* or more contributor license agreements. Licensed under the Elastic License; | ||
* you may not use this file except in compliance with the Elastic License. | ||
*/ | ||
|
||
import React from 'react'; | ||
import { FlyoutFrame } from '../flyout_frame'; | ||
import { DrilldownListItem, ListManageDrilldowns } from '../list_manage_drilldowns'; | ||
import { txtManageDrilldowns } from './i18n'; | ||
import { DrilldownHelloBar } from '../drilldown_hello_bar'; | ||
|
||
export interface FlyoutListManageDrilldownsProps { | ||
drilldowns: DrilldownListItem[]; | ||
onClose?: () => void; | ||
onCreate?: () => void; | ||
onEdit?: (drilldownId: string) => void; | ||
onDelete?: (drilldownIds: string[]) => void; | ||
showWelcomeMessage?: boolean; | ||
onWelcomeHideClick?: () => void; | ||
} | ||
|
||
export function FlyoutListManageDrilldowns({ | ||
drilldowns, | ||
onClose = () => {}, | ||
onCreate, | ||
onDelete, | ||
onEdit, | ||
showWelcomeMessage = true, | ||
onWelcomeHideClick, | ||
}: FlyoutListManageDrilldownsProps) { | ||
return ( | ||
<FlyoutFrame | ||
title={txtManageDrilldowns} | ||
onClose={onClose} | ||
banner={showWelcomeMessage && <DrilldownHelloBar onHideClick={onWelcomeHideClick} />} | ||
> | ||
<ListManageDrilldowns | ||
drilldowns={drilldowns} | ||
onCreate={onCreate} | ||
onEdit={onEdit} | ||
onDelete={onDelete} | ||
/> | ||
</FlyoutFrame> | ||
); | ||
} |
14 changes: 14 additions & 0 deletions
14
x-pack/plugins/drilldowns/public/components/flyout_list_manage_drilldowns/i18n.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,14 @@ | ||
/* | ||
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one | ||
* or more contributor license agreements. Licensed under the Elastic License; | ||
* you may not use this file except in compliance with the Elastic License. | ||
*/ | ||
|
||
import { i18n } from '@kbn/i18n'; | ||
|
||
export const txtManageDrilldowns = i18n.translate( | ||
'xpack.drilldowns.components.FlyoutListManageDrilldowns.manageDrilldownsTitle', | ||
{ | ||
defaultMessage: 'Manage Drilldowns', | ||
} | ||
); |
7 changes: 7 additions & 0 deletions
7
x-pack/plugins/drilldowns/public/components/flyout_list_manage_drilldowns/index.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,7 @@ | ||
/* | ||
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one | ||
* or more contributor license agreements. Licensed under the Elastic License; | ||
* you may not use this file except in compliance with the Elastic License. | ||
*/ | ||
|
||
export * from './flyout_list_manage_drilldowns'; |
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
7 changes: 7 additions & 0 deletions
7
x-pack/plugins/drilldowns/public/components/flyout_manage_drilldowns/index.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,7 @@ | ||
/* | ||
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one | ||
* or more contributor license agreements. Licensed under the Elastic License; | ||
* you may not use this file except in compliance with the Elastic License. | ||
*/ | ||
|
||
export * from './flyout_manage_drilldowns'; |