Skip to content

Commit

Permalink
Merge branch '7.x' into backport/7.x/pr-79007
Browse files Browse the repository at this point in the history
  • Loading branch information
kibanamachine authored Oct 5, 2020
2 parents 805252e + 23150c8 commit 7d2110c
Show file tree
Hide file tree
Showing 105 changed files with 2,312 additions and 3,604 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@
"dependencies": {
"@elastic/datemath": "5.0.3",
"@elastic/elasticsearch": "7.9.1",
"@elastic/eui": "29.0.0",
"@elastic/eui": "29.3.0",
"@elastic/good": "8.1.1-kibana2",
"@elastic/numeral": "^2.5.0",
"@elastic/request-crypto": "1.1.4",
Expand Down
2 changes: 1 addition & 1 deletion packages/kbn-ui-framework/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
},
"devDependencies": {
"@babel/core": "^7.11.6",
"@elastic/eui": "29.0.0",
"@elastic/eui": "29.3.0",
"@kbn/babel-preset": "1.0.0",
"@kbn/optimizer": "1.0.0",
"babel-loader": "^8.0.6",
Expand Down
3 changes: 2 additions & 1 deletion packages/kbn-ui-shared-deps/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
},
"dependencies": {
"@elastic/charts": "23.0.0",
"@elastic/eui": "29.0.0",
"@elastic/eui": "29.3.0",
"@elastic/numeral": "^2.5.0",
"@kbn/i18n": "1.0.0",
"@kbn/monaco": "1.0.0",
Expand Down Expand Up @@ -39,6 +39,7 @@
"devDependencies": {
"@kbn/babel-preset": "1.0.0",
"@kbn/dev-utils": "1.0.0",
"babel-plugin-transform-react-remove-prop-types": "^0.4.24",
"css-loader": "^3.4.2",
"del": "^5.1.0",
"loader-utils": "^1.2.3",
Expand Down
19 changes: 19 additions & 0 deletions packages/kbn-ui-shared-deps/webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,25 @@ exports.getWebpackConfig = ({ dev = false } = {}) => ({
},
],
},
{
test: !dev ? /[\\\/]@elastic[\\\/]eui[\\\/].*\.js$/ : () => false,
use: [
{
loader: 'babel-loader',
options: {
plugins: [
[
require.resolve('babel-plugin-transform-react-remove-prop-types'),
{
mode: 'remove',
removeImport: true,
},
],
],
},
},
],
},
],
},

Expand Down
5 changes: 0 additions & 5 deletions src/plugins/navigation/public/top_nav_menu/_index.scss
Original file line number Diff line number Diff line change
@@ -1,8 +1,3 @@
.kbnTopNavMenu {
margin-right: $euiSizeXS;
}

.kbnTopNavMenu > * > * {
// TEMP fix to adjust spacing between EuiHeaderList__list items
margin: 0 $euiSizeXS;
}
Original file line number Diff line number Diff line change
Expand Up @@ -164,10 +164,6 @@ describe('TopNavMenu', () => {

// menu is rendered outside of the component
expect(component.find(TOP_NAV_ITEM_SELECTOR).length).toBe(0);

const buttons = portalTarget.querySelectorAll('button');
expect(buttons.length).toBe(menuItems.length + 1); // should be n+1 buttons in mobile for popover button
expect(buttons[buttons.length - 1].getAttribute('aria-label')).toBe('Open navigation menu'); // last button should be mobile button
});
});
});
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ export function TopNavMenu(props: TopNavMenuProps): ReactElement | null {
function renderMenu(className: string): ReactElement | null {
if (!config || config.length === 0) return null;
return (
<EuiHeaderLinks data-test-subj="top-nav" className={className}>
<EuiHeaderLinks data-test-subj="top-nav" gutterSize="xs" className={className}>
{renderItems()}
</EuiHeaderLinks>
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ export function TopNavMenuItem(props: TopNavMenuData) {
{upperFirst(props.label || props.id!)}
</EuiButton>
) : (
<EuiHeaderLink size="xs" isActive {...commonButtonProps}>
<EuiHeaderLink size="xs" color="primary" {...commonButtonProps}>
{upperFirst(props.label || props.id!)}
</EuiHeaderLink>
);
Expand Down
6 changes: 4 additions & 2 deletions src/plugins/share/public/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,8 @@
*/

import { ComponentType } from 'react';
import { EuiContextMenuPanelDescriptor, EuiContextMenuPanelItemDescriptor } from '@elastic/eui';
import { EuiContextMenuPanelDescriptor } from '@elastic/eui';
import { EuiContextMenuPanelItemDescriptorEntry } from '@elastic/eui/src/components/context_menu/context_menu';

/**
* @public
Expand Down Expand Up @@ -53,7 +54,8 @@ export interface ShareContext {
* used to order the individual items in a flat list returned by all registered
* menu providers.
* */
export interface ShareContextMenuPanelItem extends Omit<EuiContextMenuPanelItemDescriptor, 'name'> {
export interface ShareContextMenuPanelItem
extends Omit<EuiContextMenuPanelItemDescriptorEntry, 'name'> {
name: string; // EUI will accept a `ReactNode` for the `name` prop, but `ShareContentMenu` assumes a `string`.
sortOrder?: number;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
"build": "rm -rf './target' && tsc"
},
"devDependencies": {
"@elastic/eui": "29.0.0",
"@elastic/eui": "29.3.0",
"@kbn/plugin-helpers": "1.0.0",
"react": "^16.12.0",
"react-dom": "^16.12.0",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
"build": "rm -rf './target' && tsc"
},
"devDependencies": {
"@elastic/eui": "29.0.0",
"@elastic/eui": "29.3.0",
"react": "^16.12.0",
"typescript": "4.0.2"
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
"build": "rm -rf './target' && tsc"
},
"devDependencies": {
"@elastic/eui": "29.0.0",
"@elastic/eui": "29.3.0",
"@kbn/plugin-helpers": "1.0.0",
"react": "^16.12.0",
"typescript": "4.0.2"
Expand Down
2 changes: 1 addition & 1 deletion x-pack/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -275,7 +275,7 @@
"@babel/runtime": "^7.11.2",
"@elastic/datemath": "5.0.3",
"@elastic/ems-client": "7.10.0",
"@elastic/eui": "29.0.0",
"@elastic/eui": "29.3.0",
"@elastic/filesaver": "1.1.2",
"@elastic/node-crypto": "1.2.1",
"@elastic/numeral": "^2.5.0",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,41 +4,44 @@
* you may not use this file except in compliance with the Elastic License.
*/

import { storiesOf } from '@storybook/react';
import React from 'react';
import { MemoryRouter } from 'react-router-dom';
import { ErrorCountAlertTrigger } from '.';
import { ApmPluginContextValue } from '../../../context/ApmPluginContext';
import {
mockApmPluginContextValue,
MockApmPluginContextWrapper,
} from '../../../context/ApmPluginContext/MockApmPluginContext';

storiesOf('app/ErrorCountAlertTrigger', module).add(
'example',
() => {
const params = {
threshold: 2,
window: '5m',
};

return (
export default {
title: 'app/ErrorCountAlertTrigger',
component: ErrorCountAlertTrigger,
decorators: [
(Story: React.ComponentClass) => (
<MockApmPluginContextWrapper
value={(mockApmPluginContextValue as unknown) as ApmPluginContextValue}
>
<div style={{ width: 400 }}>
<ErrorCountAlertTrigger
alertParams={params as any}
setAlertParams={() => undefined}
setAlertProperty={() => undefined}
/>
</div>
<MemoryRouter>
<div style={{ width: 400 }}>
<Story />
</div>
</MemoryRouter>
</MockApmPluginContextWrapper>
);
},
{
info: {
propTablesExclude: [ErrorCountAlertTrigger, MockApmPluginContextWrapper],
source: false,
},
}
);
),
],
};

export function Example() {
const params = {
threshold: 2,
window: '5m',
};

return (
<ErrorCountAlertTrigger
alertParams={params as any}
setAlertParams={() => undefined}
setAlertProperty={() => undefined}
/>
);
}
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import { act, fireEvent, render } from '@testing-library/react';
import { expectTextsInDocument } from '../../utils/testHelpers';

describe('alerting fields', () => {
describe('Service Fiels', () => {
describe('Service Field', () => {
it('renders with value', () => {
const component = render(<ServiceField value="foo" />);
expectTextsInDocument(component, ['foo']);
Expand Down
4 changes: 2 additions & 2 deletions x-pack/plugins/apm/public/components/alerting/fields.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ export function EnvironmentField({
})}
>
<EuiSelect
value={currentValue}
defaultValue={currentValue}
options={options}
onChange={onChange}
compressed
Expand Down Expand Up @@ -75,7 +75,7 @@ export function TransactionTypeField({
<PopoverExpression value={currentValue} title={label}>
<EuiSelect
data-test-subj="transactionTypeField"
value={currentValue}
defaultValue={currentValue}
options={options}
onChange={onChange}
compressed
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,6 @@ describe('ErrorGroupOverview -> List', () => {
<MemoryRouter>
<MockApmPluginContextWrapper>
<MockUrlParamsContextProvider>
{/* @ts-expect-error invalid json props */}
<ErrorGroupList items={props.items} serviceName="opbeans-python" />
</MockUrlParamsContextProvider>
</MockApmPluginContextWrapper>
Expand Down
Loading

0 comments on commit 7d2110c

Please sign in to comment.