Skip to content

Commit

Permalink
Merge branch 'master' into telemetry/opt-in-version
Browse files Browse the repository at this point in the history
  • Loading branch information
elasticmachine authored Nov 4, 2019
2 parents 4b7902e + 601800c commit dc11b3e
Show file tree
Hide file tree
Showing 249 changed files with 8,006 additions and 5,429 deletions.
4 changes: 3 additions & 1 deletion .github/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@
/x-pack/test/functional/services/ml.ts @elastic/ml-ui
# ML team owns the transform plugin, ES team added here for visibility
# because the plugin lives in Kibana's Elasticsearch management section.
/x-pack/legacy/plugins/transform/ @elastic/ml-ui @elastic/es-ui
/x-pack/legacy/plugins/transform/ @elastic/ml-ui @elastic/es-ui

# Operations
/renovate.json5 @elastic/kibana-operations
Expand All @@ -68,7 +68,9 @@
# Security
/x-pack/legacy/plugins/security/ @elastic/kibana-security
/x-pack/legacy/plugins/spaces/ @elastic/kibana-security
/x-pack/plugins/spaces/ @elastic/kibana-security
/x-pack/legacy/plugins/encrypted_saved_objects/ @elastic/kibana-security
/x-pack/plugins/encrypted_saved_objects/ @elastic/kibana-security
/src/legacy/server/csp/ @elastic/kibana-security
/x-pack/plugins/security/ @elastic/kibana-security
/x-pack/test/api_integration/apis/security/ @elastic/kibana-security
Expand Down
8 changes: 4 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@
"dependencies": {
"@babel/core": "^7.5.5",
"@babel/register": "^7.5.5",
"@elastic/charts": "^13.5.9",
"@elastic/charts": "^13.5.12",
"@elastic/datemath": "5.0.2",
"@elastic/ems-client": "1.0.5",
"@elastic/eui": "14.8.0",
Expand Down Expand Up @@ -156,8 +156,8 @@
"d3": "3.5.17",
"d3-cloud": "1.2.5",
"del": "^5.1.0",
"elasticsearch": "^16.4.0",
"elasticsearch-browser": "^16.4.0",
"elasticsearch": "^16.5.0",
"elasticsearch-browser": "^16.5.0",
"encode-uri-query": "1.0.1",
"execa": "^3.2.0",
"expiry-js": "0.1.7",
Expand Down Expand Up @@ -233,7 +233,7 @@
"reselect": "^3.0.1",
"resize-observer-polyfill": "^1.5.0",
"rison-node": "1.0.2",
"rxjs": "^6.2.1",
"rxjs": "^6.5.3",
"script-loader": "0.7.2",
"semver": "^5.5.0",
"style-it": "^2.1.3",
Expand Down
2 changes: 1 addition & 1 deletion packages/kbn-dev-utils/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
"exit-hook": "^2.2.0",
"getopts": "^2.2.5",
"moment": "^2.24.0",
"rxjs": "^6.2.1",
"rxjs": "^6.5.3",
"tree-kill": "^1.2.1",
"tslib": "^1.9.3"
},
Expand Down
4 changes: 2 additions & 2 deletions packages/kbn-dev-utils/src/proc_runner/proc.ts
Original file line number Diff line number Diff line change
Expand Up @@ -100,9 +100,9 @@ export function startProc(name: string, options: ProcOptions, log: ToolingLog) {

const outcome$: Rx.Observable<number | null> = Rx.race(
// observe first exit event
Rx.fromEvent(childProcess, 'exit').pipe(
Rx.fromEvent<[number]>(childProcess, 'exit').pipe(
take(1),
map(([code]: [number]) => {
map(([code]) => {
if (stopCalled) {
return null;
}
Expand Down
4,730 changes: 2,410 additions & 2,320 deletions packages/kbn-pm/dist/index.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion packages/kbn-pm/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@
"ora": "^1.4.0",
"prettier": "^1.18.2",
"read-pkg": "^5.2.0",
"rxjs": "^6.2.1",
"rxjs": "^6.5.3",
"spawn-sync": "^1.0.15",
"string-replace-loader": "^2.2.0",
"strip-ansi": "^4.0.0",
Expand Down
2 changes: 1 addition & 1 deletion packages/kbn-test/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
"glob": "^7.1.2",
"parse-link-header": "^1.0.1",
"strip-ansi": "^5.2.0",
"rxjs": "^6.2.1",
"rxjs": "^6.5.3",
"tar-fs": "^1.16.3",
"tmp": "^0.1.0",
"xml2js": "^0.4.22",
Expand Down
2 changes: 1 addition & 1 deletion src/core/public/chrome/ui/header/header.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@ interface Props {
navLinks$: Rx.Observable<ChromeNavLink[]>;
recentlyAccessed$: Rx.Observable<ChromeRecentlyAccessedHistoryItem[]>;
forceAppSwitcherNavigation$: Rx.Observable<boolean>;
helpExtension$: Rx.Observable<ChromeHelpExtension>;
helpExtension$: Rx.Observable<ChromeHelpExtension | undefined>;
legacyMode: boolean;
navControlsLeft$: Rx.Observable<readonly ChromeNavControl[]>;
navControlsRight$: Rx.Observable<readonly ChromeNavControl[]>;
Expand Down
2 changes: 1 addition & 1 deletion src/core/public/chrome/ui/header/header_help_menu.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ import { HeaderExtension } from './header_extension';
import { ChromeHelpExtension } from '../../chrome_service';

interface Props {
helpExtension$: Rx.Observable<ChromeHelpExtension>;
helpExtension$: Rx.Observable<ChromeHelpExtension | undefined>;
intl: InjectedIntl;
kibanaVersion: string;
useDefaultContent?: boolean;
Expand Down
2 changes: 1 addition & 1 deletion src/core/server/legacy/plugins/find_legacy_plugin_specs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ export async function findLegacyPluginSpecs(settings: unknown, loggerFactory: Lo
invalidDirectoryError$: Observable<{ path: string }>;
invalidPackError$: Observable<{ path: string }>;
otherError$: Observable<unknown>;
deprecation$: Observable<unknown>;
deprecation$: Observable<{ spec: LegacyPluginSpec; message: string }>;
invalidVersionSpec$: Observable<LegacyPluginSpec>;
spec$: Observable<LegacyPluginSpec>;
disabledSpec$: Observable<LegacyPluginSpec>;
Expand Down
2 changes: 1 addition & 1 deletion src/core/server/plugins/discovery/plugins_discovery.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ import { PluginsConfig } from '../plugins_config';
import { PluginDiscoveryError } from './plugin_discovery_error';
import { parseManifest } from './plugin_manifest_parser';

const fsReadDir$ = bindNodeCallback(readdir);
const fsReadDir$ = bindNodeCallback<string, string[]>(readdir);
const fsStat$ = bindNodeCallback(stat);

/**
Expand Down
2 changes: 1 addition & 1 deletion src/dev/build/lib/scan_delete.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ import { count, map, mergeAll, mergeMap } from 'rxjs/operators';
import { assertAbsolute } from './fs';

const getStat$ = Rx.bindNodeCallback(Fs.stat);
const getReadDir$ = Rx.bindNodeCallback(Fs.readdir);
const getReadDir$ = Rx.bindNodeCallback<string, string[]>(Fs.readdir);

interface Options {
directory: string;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,10 @@
margin-top: $euiSizeXS;
}

.globalFilterBar__addButton {
min-height: $euiSizeL + $euiSizeXS; // same height as the badges
}

// sass-lint:disable quotes
.globalFilterGroup__branch {
padding: $euiSizeS $euiSizeM 0 0;
Expand Down Expand Up @@ -40,4 +44,3 @@
margin-top: $euiSize * -1;
}
}

Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
@import '@elastic/eui/src/components/form/mixins';
@import '@elastic/eui/src/components/form/variables';
@import '@elastic/eui/src/components/form/mixins';

/**
* 1. Allow wrapping of long filter items
Expand All @@ -19,11 +19,17 @@

&:not(.globalFilterItem-isDisabled) {
@include euiFormControlDefaultShadow;
box-shadow: #{$euiFormControlBoxShadow}, inset 0 0 0 1px $kbnGlobalFilterItemBorderColor; // Make the actual border more visible
}

&:focus-within {
animation: none !important; // Remove focus ring animation otherwise it overrides simulated border via box-shadow
}
}

.globalFilterItem-isDisabled {
background-color: transparentize($euiColorLightShade, .4);
color: $euiColorDarkShade;
background-color: transparentize($euiColorLightShade, 0.5);
text-decoration: line-through;
font-weight: $euiFontWeightRegular;
font-style: italic;
Expand All @@ -39,12 +45,22 @@
bottom: 0;
left: 0;
width: $euiSizeXS;
background-color: $euiColorVis0;
background-color: $kbnGlobalFilterItemBorderColor;
border-top-left-radius: $euiBorderRadius / 2;
border-bottom-left-radius: $euiBorderRadius / 2;
}
}

.globalFilterItem-isExcluded {
&:not(.globalFilterItem-isDisabled) {
box-shadow: #{$euiFormControlBoxShadow}, inset 0 0 0 1px $kbnGlobalFilterItemBorderColorExcluded;

&::before {
background-color: $kbnGlobalFilterItemPinnedColorExcluded;
}
}
}

.globalFilterItem__editorForm {
padding: $euiSizeM;
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
@import 'variables';
@import 'global_filter_group';
@import 'global_filter_item';
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
$kbnGlobalFilterItemBorderColor: tintOrShade($euiColorMediumShade, 35%, 20%);
$kbnGlobalFilterItemBorderColorExcluded: tintOrShade($euiColorDanger, 70%, 50%);
$kbnGlobalFilterItemPinnedColorExcluded: tintOrShade($euiColorDanger, 30%, 20%);
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,7 @@ function FilterBarUI(props: Props) {
size="xs"
onClick={() => setIsAddFilterPopoverOpen(true)}
data-test-subj="addFilter"
className="globalFilterBar__addButton"
>
+{' '}
<FormattedMessage
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,37 +17,86 @@
* under the License.
*/

import React, { Fragment } from 'react';
import { EuiTextColor } from '@elastic/eui';
import { Filter } from '@kbn/es-query';
import { i18n } from '@kbn/i18n';
import { existsOperator, isOneOfOperator } from './filter_operators';

export function getFilterDisplayText(filter: Filter, filterDisplayName: string) {
const prefix = filter.meta.negate
const prefixText = filter.meta.negate
? ` ${i18n.translate('data.filter.filterBar.negatedFilterPrefix', {
defaultMessage: 'NOT ',
})}`
: '';
const prefix =
filter.meta.negate && !filter.meta.disabled ? (
<EuiTextColor color="danger">{prefixText}</EuiTextColor>
) : (
prefixText
);

if (filter.meta.alias !== null) {
return `${prefix}${filter.meta.alias}`;
}

switch (filter.meta.type) {
case 'exists':
return `${prefix}${filter.meta.key} ${existsOperator.message}`;
return (
<Fragment>
{prefix}
{filter.meta.key} {existsOperator.message}
</Fragment>
);
case 'geo_bounding_box':
return `${prefix}${filter.meta.key}: ${filterDisplayName}`;
return (
<Fragment>
{prefix}
{filter.meta.key}: {filterDisplayName}
</Fragment>
);
case 'geo_polygon':
return `${prefix}${filter.meta.key}: ${filterDisplayName}`;
return (
<Fragment>
{prefix}
{filter.meta.key}: {filterDisplayName}
</Fragment>
);
case 'phrase':
return `${prefix}${filter.meta.key}: ${filterDisplayName}`;
return (
<Fragment>
{prefix}
{filter.meta.key}: {filterDisplayName}
</Fragment>
);
case 'phrases':
return `${prefix}${filter.meta.key} ${isOneOfOperator.message} ${filterDisplayName}`;
return (
<Fragment>
{prefix}
{filter.meta.key} {isOneOfOperator.message} {filterDisplayName}
</Fragment>
);
case 'query_string':
return `${prefix}${filterDisplayName}`;
return (
<Fragment>
{prefix}
{filterDisplayName}
</Fragment>
);
case 'range':
return `${prefix}${filter.meta.key}: ${filterDisplayName}`;
case 'phrase':
return (
<Fragment>
{prefix}
{filter.meta.key}: {filterDisplayName}
</Fragment>
);
default:
return `${prefix}${JSON.stringify(filter.query)}`;
return (
<Fragment>
{prefix}
{JSON.stringify(filter.query)}
</Fragment>
);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
* under the License.
*/

import { EuiBadge } from '@elastic/eui';
import { EuiBadge, useInnerText } from '@elastic/eui';
import { Filter, isFilterPinned } from '@kbn/es-query';
import { i18n } from '@kbn/i18n';
import React, { SFC } from 'react';
Expand All @@ -36,9 +36,12 @@ export const FilterView: SFC<Props> = ({
displayName,
...rest
}: Props) => {
const [ref, innerText] = useInnerText();
const displayText = <span ref={ref}>{getFilterDisplayText(filter, displayName)}</span>;

let title = i18n.translate('data.filter.filterBar.moreFilterActionsMessage', {
defaultMessage: 'Filter: {displayText}. Select for more filter actions.',
values: { displayText: getFilterDisplayText(filter, displayName) },
defaultMessage: 'Filter: {innerText}. Select for more filter actions.',
values: { innerText },
});

if (isFilterPinned(filter)) {
Expand Down Expand Up @@ -72,7 +75,7 @@ export const FilterView: SFC<Props> = ({
})}
{...rest}
>
<span>{getFilterDisplayText(filter, displayName)}</span>
{displayText}
</EuiBadge>
);
};
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ import { useRef, useEffect, useState } from 'react';
import React from 'react';
import classNames from 'classnames';
import { EuiLoadingChart, EuiProgress } from '@elastic/eui';
import { ExpressionAST, IExpressionLoaderParams, IInterpreterErrorResult } from './types';
import { ExpressionAST, IExpressionLoaderParams } from './types';
import { ExpressionLoader } from './loader';

// Accept all options of the runner as props except for the
Expand All @@ -35,7 +35,7 @@ export interface ExpressionRendererProps extends IExpressionLoaderParams {
interface State {
isEmpty: boolean;
isLoading: boolean;
error: null | Error;
error: null | { message: string };
}

export type ExpressionRenderer = React.FC<ExpressionRendererProps>;
Expand Down Expand Up @@ -82,7 +82,7 @@ export const ExpressionRendererImplementation = ({
}
setState(prevState => ({ ...prevState, isLoading: true }));
});
handlerRef.current.render$.subscribe((item: number | IInterpreterErrorResult) => {
handlerRef.current.render$.subscribe(item => {
if (!handlerRef.current) {
return;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,17 +23,22 @@ import { share } from 'rxjs/operators';
import { event, RenderId, Data, IInterpreterRenderHandlers } from './types';
import { getRenderersRegistry } from './services';

interface RenderError {
type: 'error';
error: { type?: string; message: string };
}

export type IExpressionRendererExtraHandlers = Record<string, any>;

export class ExpressionRenderHandler {
render$: Observable<RenderId>;
render$: Observable<RenderId | RenderError>;
update$: Observable<any>;
events$: Observable<event>;

private element: HTMLElement;
private destroyFn?: any;
private renderCount: number = 0;
private renderSubject: Rx.Subject<unknown>;
private renderSubject: Rx.Subject<RenderId | RenderError>;
private eventsSubject: Rx.Subject<unknown>;
private updateSubject: Rx.Subject<unknown>;
private handlers: IInterpreterRenderHandlers;
Expand Down
Loading

0 comments on commit dc11b3e

Please sign in to comment.