-
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.
Merge branch 'main' into vis_editors_gauge-legacy_percent_mode
- Loading branch information
Showing
50 changed files
with
1,284 additions
and
587 deletions.
There are no files selected for viewing
415 changes: 213 additions & 202 deletions
415
src/plugins/kibana_react/public/page_template/__snapshots__/page_template.test.tsx.snap
Large diffs are not rendered by default.
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
96 changes: 15 additions & 81 deletions
96
...s/kibana_react/public/page_template/no_data_page/__snapshots__/no_data_page.test.tsx.snap
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
File renamed without changes.
31 changes: 31 additions & 0 deletions
31
...plugins/kibana_react/public/page_template/no_data_page/action_cards/action_cards.test.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,31 @@ | ||
/* | ||
* 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 React from 'react'; | ||
import { shallowWithIntl } from '@kbn/test-jest-helpers'; | ||
import { NoDataCard } from '../no_data_card'; | ||
import { ActionCards } from './action_cards'; | ||
|
||
describe('ActionCards', () => { | ||
const onClick = jest.fn(); | ||
const action = { | ||
recommended: false, | ||
button: 'Button text', | ||
onClick, | ||
}; | ||
const card = <NoDataCard key={'key'} {...action} />; | ||
const actionCard1 = <div key={'first'}>{card}</div>; | ||
const actionCard2 = <div key={'second'}>{card}</div>; | ||
|
||
test('renders correctly', () => { | ||
const component = shallowWithIntl(<ActionCards actionCards={[actionCard1, actionCard2]} />); | ||
const actionCards = component.find('div'); | ||
expect(actionCards.length).toBe(2); | ||
expect(actionCards.at(0).key()).toBe('first'); | ||
expect(actionCards.at(1).key()).toBe('second'); | ||
}); | ||
}); |
29 changes: 29 additions & 0 deletions
29
src/plugins/kibana_react/public/page_template/no_data_page/action_cards/action_cards.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,29 @@ | ||
/* | ||
* 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 './action_cards.scss'; | ||
|
||
import { EuiFlexGrid, EuiFlexItem } from '@elastic/eui'; | ||
import React, { ReactElement } from 'react'; | ||
import { ElasticAgentCard, NoDataCard } from '../no_data_card'; | ||
|
||
interface ActionCardsProps { | ||
actionCards: Array<ReactElement<typeof NoDataCard> | ReactElement<typeof ElasticAgentCard>>; | ||
} | ||
export const ActionCards = ({ actionCards }: ActionCardsProps) => { | ||
const cards = actionCards.map((card) => ( | ||
<EuiFlexItem key={card.key || ''} className="kbnNoDataPageContents__item"> | ||
{card} | ||
</EuiFlexItem> | ||
)); | ||
return ( | ||
<EuiFlexGrid columns={2} style={{ justifyContent: 'space-around' }}> | ||
{cards} | ||
</EuiFlexGrid> | ||
); | ||
}; |
9 changes: 9 additions & 0 deletions
9
src/plugins/kibana_react/public/page_template/no_data_page/action_cards/index.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,9 @@ | ||
/* | ||
* 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. | ||
*/ | ||
|
||
export { ActionCards } from './action_cards'; |
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 |
---|---|---|
|
@@ -8,3 +8,4 @@ | |
|
||
export * from './no_data_page'; | ||
export * from './no_data_card'; | ||
export * from './no_data_config_page'; |
9 changes: 9 additions & 0 deletions
9
src/plugins/kibana_react/public/page_template/no_data_page/no_data_config_page/index.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,9 @@ | ||
/* | ||
* 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. | ||
*/ | ||
|
||
export { NoDataConfigPage, NoDataConfigPageWithSolutionNavBar } from './no_data_config_page'; |
38 changes: 38 additions & 0 deletions
38
...ibana_react/public/page_template/no_data_page/no_data_config_page/no_data_config_page.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,38 @@ | ||
/* | ||
* 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 { EuiPageTemplate } from '@elastic/eui'; | ||
import React from 'react'; | ||
import { NoDataPage } from '../no_data_page'; | ||
import { withSolutionNav } from '../../with_solution_nav'; | ||
import { KibanaPageTemplateProps } from '../../page_template'; | ||
import { getClasses, NO_DATA_PAGE_TEMPLATE_PROPS } from '../../util'; | ||
|
||
export const NoDataConfigPage = (props: KibanaPageTemplateProps) => { | ||
const { className, noDataConfig, ...rest } = props; | ||
|
||
if (!noDataConfig) { | ||
return null; | ||
} | ||
|
||
const template = NO_DATA_PAGE_TEMPLATE_PROPS.template; | ||
const classes = getClasses(template, className); | ||
|
||
return ( | ||
<EuiPageTemplate | ||
data-test-subj={props['data-test-subj']} | ||
template={template} | ||
className={classes} | ||
{...rest} | ||
{...NO_DATA_PAGE_TEMPLATE_PROPS} | ||
> | ||
<NoDataPage {...noDataConfig} /> | ||
</EuiPageTemplate> | ||
); | ||
}; | ||
|
||
export const NoDataConfigPageWithSolutionNavBar = withSolutionNav(NoDataConfigPage); |
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.