Skip to content

Commit

Permalink
Merge branch 'main' into fix_network_page
Browse files Browse the repository at this point in the history
  • Loading branch information
kibanamachine authored Jan 10, 2022
2 parents a7c86d0 + a9b82b0 commit c954d86
Show file tree
Hide file tree
Showing 88 changed files with 2,135 additions and 325 deletions.
2 changes: 0 additions & 2 deletions .github/workflows/backport.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,5 +39,3 @@ jobs:
github_token: ${{secrets.KIBANAMACHINE_TOKEN}}
commit_user: kibanamachine
commit_email: [email protected]
auto_merge: 'true'
auto_merge_method: 'squash'
14 changes: 7 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,13 +49,13 @@ _Note: The version numbers below are only examples, meant to illustrate the rela

| Situation | Example Kibana version | Example ES version | Outcome |
| ------------------------- | -------------------------- |------------------- | ------- |
| Versions are the same. | 5.1.2 | 5.1.2 | 💚 OK |
| ES patch number is newer. | 5.1.__2__ | 5.1.__5__ | ⚠️ Logged warning |
| ES minor number is newer. | 5.__1__.2 | 5.__5__.0 | ⚠️ Logged warning |
| ES major number is newer. | __5__.1.2 | __6__.0.0 | 🚫 Fatal error |
| ES patch number is older. | 5.1.__2__ | 5.1.__0__ | ⚠️ Logged warning |
| ES minor number is older. | 5.__1__.2 | 5.__0__.0 | 🚫 Fatal error |
| ES major number is older. | __5__.1.2 | __4__.0.0 | 🚫 Fatal error |
| Versions are the same. | 7.15.1 | 7.15.1 | 💚 OK |
| ES patch number is newer. | 7.15.__0__ | 7.15.__1__ | ⚠️ Logged warning |
| ES minor number is newer. | 7.__14__.2 | 7.__15__.0 | ⚠️ Logged warning |
| ES major number is newer. | __7__.15.1 | __8__.0.0 | 🚫 Fatal error |
| ES patch number is older. | 7.15.__1__ | 7.15.__0__ | ⚠️ Logged warning |
| ES minor number is older. | 7.__15__.1 | 7.__14__.2 | 🚫 Fatal error |
| ES major number is older. | __8__.0.0 | __7__.15.1 | 🚫 Fatal error |

## Questions? Problems? Suggestions?

Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -712,7 +712,7 @@
"babel-plugin-require-context-hook": "^1.0.0",
"babel-plugin-styled-components": "^2.0.2",
"babel-plugin-transform-react-remove-prop-types": "^0.4.24",
"backport": "^6.1.3",
"backport": "6.1.5",
"callsites": "^3.1.0",
"chai": "3.5.0",
"chance": "1.0.18",
Expand Down
37 changes: 23 additions & 14 deletions src/plugins/discover/public/embeddable/saved_search_grid.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import { DiscoverGrid, DiscoverGridProps } from '../components/discover_grid/dis
import { getServices } from '../kibana_services';
import { TotalDocuments } from '../application/main/components/total_documents/total_documents';
import { ElasticSearchHit } from '../types';
import { KibanaContextProvider } from '../../../kibana_react/public';

export interface DiscoverGridEmbeddableProps extends DiscoverGridProps {
totalHitCount: number;
Expand All @@ -22,25 +23,33 @@ export const DataGridMemoized = React.memo((props: DiscoverGridProps) => (
));

export function DiscoverGridEmbeddable(props: DiscoverGridEmbeddableProps) {
const services = getServices();
const [expandedDoc, setExpandedDoc] = useState<ElasticSearchHit | undefined>(undefined);

return (
<I18nProvider>
<EuiFlexGroup style={{ width: '100%' }} direction="column" gutterSize="xs" responsive={false}>
{props.totalHitCount !== 0 && (
<EuiFlexItem grow={false} style={{ alignSelf: 'flex-end' }}>
<TotalDocuments totalHitCount={props.totalHitCount} />
<KibanaContextProvider services={services}>
<EuiFlexGroup
style={{ width: '100%' }}
direction="column"
gutterSize="xs"
responsive={false}
>
{props.totalHitCount !== 0 && (
<EuiFlexItem grow={false} style={{ alignSelf: 'flex-end' }}>
<TotalDocuments totalHitCount={props.totalHitCount} />
</EuiFlexItem>
)}
<EuiFlexItem style={{ minHeight: 0 }}>
<DataGridMemoized
{...props}
setExpandedDoc={setExpandedDoc}
expandedDoc={expandedDoc}
services={services}
/>
</EuiFlexItem>
)}
<EuiFlexItem style={{ minHeight: 0 }}>
<DataGridMemoized
{...props}
setExpandedDoc={setExpandedDoc}
expandedDoc={expandedDoc}
services={getServices()}
/>
</EuiFlexItem>
</EuiFlexGroup>
</EuiFlexGroup>
</KibanaContextProvider>
</I18nProvider>
);
}
20 changes: 20 additions & 0 deletions src/plugins/shared_ux/.storybook/decorators.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
/*
* 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 { DecoratorFn } from '@storybook/react';
import { ServicesProvider } from '../public/services';
import { servicesFactory } from '../public/services/storybook';

/**
* A Storybook decorator that provides the Shared UX `ServicesProvider` with Storybook-specific
* implementations to stories.
*/
export const servicesDecorator: DecoratorFn = (storyFn) => (
<ServicesProvider {...servicesFactory({})}>{storyFn()}</ServicesProvider>
);
12 changes: 12 additions & 0 deletions src/plugins/shared_ux/.storybook/preview.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
/*
* 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 { addDecorator } from '@storybook/react';
import { servicesDecorator } from './decorators';

addDecorator(servicesDecorator);
3 changes: 3 additions & 0 deletions src/plugins/shared_ux/common/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,8 @@
* Side Public License, v 1.
*/

/** The ID of the Shared UX plugin. */
export const PLUGIN_ID = 'sharedUX';

/** The name of the Shared UX plugin. */
export const PLUGIN_NAME = 'sharedUX';
19 changes: 19 additions & 0 deletions src/plugins/shared_ux/jest.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
/*
* 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.
*/

module.exports = {
preset: '@kbn/test',
rootDir: '../../..',
roots: ['<rootDir>/src/plugins/shared_ux'],
transform: {
'^.+\\.stories\\.tsx?$': '@storybook/addon-storyshots/injectFileName',
},
coverageDirectory: '<rootDir>/target/kibana-coverage/jest/src/plugins/shared_ux',
coverageReporters: ['text', 'html'],
collectCoverageFrom: ['<rootDir>/src/plugins/shared_ux/{common,public,server}/**/*.{js,ts,tsx}'],
};
Loading

0 comments on commit c954d86

Please sign in to comment.