Skip to content

Commit

Permalink
Merge branch 'master' into alerts/custom-recovery-action-group
Browse files Browse the repository at this point in the history
* master:
  [Lens] Show color in flyout instead of auto (elastic#84532)
  [Lens] Use index pattern through service instead of reading saved object (elastic#84432)
  Make it possible to use Kibana anonymous authentication provider with ES anonymous access. (elastic#84074)
  TelemetryCollectionManager: Use X-Pack strategy as an OSS overwrite (elastic#84477)
  migrate away from rest_total_hits_as_int (elastic#84508)
  [Input Control] Custom renderer (elastic#84423)
  Attempt to more granularly separate App Search vs Workplace Search vs shared GitHub notifications (elastic#84713)
  [Security Solutino][Case] Case connector alert UI (elastic#82405)
  [Maps] Support runtime fields in tooltips (elastic#84377)
  [CCR] Fix row actions in follower index and auto-follow pattern tables (elastic#84433)
  [Enterprise Search] Migrate shared Indexing Status component (elastic#84571)
  [maps] remove fields from index-pattern test artifacts (elastic#84379)
  Add routes for use in Sources Schema (elastic#84579)
  Changes UI links for drilldowns (elastic#83971)
  endpoint telemetry cloned endpoint tests (elastic#81498)
  [Fleet] Handler api key creation errors when Fleet Admin is invalid (elastic#84576)
  • Loading branch information
gmmorris committed Dec 2, 2020
2 parents 94a30d5 + 30f8e41 commit b92d4b8
Show file tree
Hide file tree
Showing 152 changed files with 13,928 additions and 1,719 deletions.
25 changes: 24 additions & 1 deletion .github/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
Expand Up @@ -262,8 +262,31 @@ x-pack/plugins/telemetry_collection_xpack/schema/xpack_plugins.json @elastic/kib

# Enterprise Search
# Shared
/x-pack/plugins/enterprise_search/ @elastic/enterprise-search-frontend
/x-pack/plugins/enterprise_search/* @elastic/enterprise-search-frontend
/x-pack/plugins/enterprise_search/common/ @elastic/enterprise-search-frontend
/x-pack/plugins/enterprise_search/public/* @elastic/enterprise-search-frontend
/x-pack/plugins/enterprise_search/public/applications/* @elastic/enterprise-search-frontend
/x-pack/plugins/enterprise_search/public/applications/enterprise_search/ @elastic/enterprise-search-frontend
/x-pack/plugins/enterprise_search/public/applications/shared/ @elastic/enterprise-search-frontend
/x-pack/plugins/enterprise_search/public/applications/__mocks__/ @elastic/enterprise-search-frontend
/x-pack/plugins/enterprise_search/server/* @elastic/enterprise-search-frontend
/x-pack/plugins/enterprise_search/server/lib/ @elastic/enterprise-search-frontend
/x-pack/plugins/enterprise_search/server/__mocks__/ @elastic/enterprise-search-frontend
/x-pack/plugins/enterprise_search/server/collectors/enterprise_search/ @elastic/enterprise-search-frontend
/x-pack/plugins/enterprise_search/server/collectors/lib/ @elastic/enterprise-search-frontend
/x-pack/plugins/enterprise_search/server/routes/enterprise_search/ @elastic/enterprise-search-frontend
/x-pack/plugins/enterprise_search/server/saved_objects/enterprise_search/ @elastic/enterprise-search-frontend
/x-pack/test/functional_enterprise_search/ @elastic/enterprise-search-frontend
# App Search
/x-pack/plugins/enterprise_search/public/applications/app_search/ @elastic/app-search-frontend
/x-pack/plugins/enterprise_search/server/routes/app_search/ @elastic/app-search-frontend
/x-pack/plugins/enterprise_search/server/collectors/app_search/ @elastic/app-search-frontend
/x-pack/plugins/enterprise_search/server/saved_objects/app_search/ @elastic/app-search-frontend
# Workplace Search
/x-pack/plugins/enterprise_search/public/applications/workplace_search/ @elastic/workplace-search-frontend
/x-pack/plugins/enterprise_search/server/routes/workplace_search/ @elastic/workplace-search-frontend
/x-pack/plugins/enterprise_search/server/collectors/workplace_search/ @elastic/workplace-search-frontend
/x-pack/plugins/enterprise_search/server/saved_objects/workplace_search/ @elastic/workplace-search-frontend

# Elasticsearch UI
/src/plugins/dev_tools/ @elastic/es-ui
Expand Down
4 changes: 2 additions & 2 deletions src/core/public/doc_links/doc_links_service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,9 @@ export class DocLinksService {
dashboard: {
guide: `${ELASTIC_WEBSITE_URL}guide/en/kibana/${DOC_LINK_VERSION}/dashboard.html`,
drilldowns: `${ELASTIC_WEBSITE_URL}guide/en/kibana/${DOC_LINK_VERSION}/drilldowns.html`,
drilldownsTriggerPicker: `${ELASTIC_WEBSITE_URL}guide/en/kibana/${DOC_LINK_VERSION}/drilldowns.html#url-drilldown`,
drilldownsTriggerPicker: `${ELASTIC_WEBSITE_URL}guide/en/kibana/${DOC_LINK_VERSION}/drilldowns.html#url-drilldowns`,
urlDrilldownTemplateSyntax: `${ELASTIC_WEBSITE_URL}guide/en/kibana/${DOC_LINK_VERSION}/url_templating-language.html`,
urlDrilldownVariables: `${ELASTIC_WEBSITE_URL}guide/en/kibana/${DOC_LINK_VERSION}/url_templating-language.html#variables`,
urlDrilldownVariables: `${ELASTIC_WEBSITE_URL}guide/en/kibana/${DOC_LINK_VERSION}/url_templating-language.html#url-template-variables`,
},
filebeat: {
base: `${ELASTIC_WEBSITE_URL}guide/en/beats/filebeat/${DOC_LINK_VERSION}`,
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,8 @@ import { getTitle, ControlParams, CONTROL_TYPES, ControlParamsOptions } from '..
import { IIndexPattern } from '../../../../data/public';
import { InputControlVisDependencies } from '../../plugin';

import './control_editor.scss';

interface ControlEditorUiProps {
controlIndex: number;
controlParams: ControlParams;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,16 +21,16 @@ import React from 'react';
import { shallowWithIntl, mountWithIntl } from '@kbn/test/jest';
import { findTestSubject } from '@elastic/eui/lib/test';
import { getDepsMock, getIndexPatternMock } from '../../test_utils';
import { ControlsTab, ControlsTabUiProps } from './controls_tab';
import ControlsTab, { ControlsTabProps } from './controls_tab';
import { Vis } from '../../../../visualizations/public';

const indexPatternsMock = {
get: getIndexPatternMock,
};
let props: ControlsTabUiProps;
let props: ControlsTabProps;

beforeEach(() => {
props = {
props = ({
deps: getDepsMock(),
vis: ({
API: {
Expand Down Expand Up @@ -78,18 +78,18 @@ beforeEach(() => {
},
setValue: jest.fn(),
intl: null as any,
};
} as unknown) as ControlsTabProps;
});

test('renders ControlsTab', () => {
const component = shallowWithIntl(<ControlsTab.WrappedComponent {...props} />);
const component = shallowWithIntl(<ControlsTab {...props} />);

expect(component).toMatchSnapshot();
});

describe('behavior', () => {
test('add control button', () => {
const component = mountWithIntl(<ControlsTab.WrappedComponent {...props} />);
const component = mountWithIntl(<ControlsTab {...props} />);

findTestSubject(component, 'inputControlEditorAddBtn').simulate('click');

Expand All @@ -102,7 +102,7 @@ describe('behavior', () => {
});

test('remove control button', () => {
const component = mountWithIntl(<ControlsTab.WrappedComponent {...props} />);
const component = mountWithIntl(<ControlsTab {...props} />);
findTestSubject(component, 'inputControlEditorRemoveControl0').simulate('click');
const expectedParams = [
'controls',
Expand All @@ -125,7 +125,7 @@ describe('behavior', () => {
});

test('move down control button', () => {
const component = mountWithIntl(<ControlsTab.WrappedComponent {...props} />);
const component = mountWithIntl(<ControlsTab {...props} />);
findTestSubject(component, 'inputControlEditorMoveDownControl0').simulate('click');
const expectedParams = [
'controls',
Expand Down Expand Up @@ -162,7 +162,7 @@ describe('behavior', () => {
});

test('move up control button', () => {
const component = mountWithIntl(<ControlsTab.WrappedComponent {...props} />);
const component = mountWithIntl(<ControlsTab {...props} />);
findTestSubject(component, 'inputControlEditorMoveUpControl1').simulate('click');
const expectedParams = [
'controls',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,8 @@
*/

import React, { PureComponent } from 'react';
import { injectI18n, FormattedMessage, InjectedIntlProps } from '@kbn/i18n/react';
import { FormattedMessage } from '@kbn/i18n/react';
import { i18n } from '@kbn/i18n';

import {
EuiButton,
Expand All @@ -44,22 +45,17 @@ import {
} from '../../editor_utils';
import { getLineageMap, getParentCandidates } from '../../lineage';
import { InputControlVisDependencies } from '../../plugin';
import { InputControlVisParams } from '../../types';

interface ControlsTabUiState {
type: CONTROL_TYPES;
}

interface ControlsTabUiParams {
controls: ControlParams[];
}
type ControlsTabUiInjectedProps = InjectedIntlProps &
Pick<VisOptionsProps<ControlsTabUiParams>, 'vis' | 'stateParams' | 'setValue'> & {
deps: InputControlVisDependencies;
};
export type ControlsTabProps = VisOptionsProps<InputControlVisParams> & {
deps: InputControlVisDependencies;
};

export type ControlsTabUiProps = ControlsTabUiInjectedProps;

class ControlsTabUi extends PureComponent<ControlsTabUiProps, ControlsTabUiState> {
class ControlsTab extends PureComponent<ControlsTabProps, ControlsTabUiState> {
state = {
type: CONTROL_TYPES.LIST,
};
Expand Down Expand Up @@ -161,8 +157,6 @@ class ControlsTabUi extends PureComponent<ControlsTabUiProps, ControlsTabUiState
}

render() {
const { intl } = this.props;

return (
<div>
{this.renderControls()}
Expand All @@ -176,25 +170,31 @@ class ControlsTabUi extends PureComponent<ControlsTabUiProps, ControlsTabUiState
options={[
{
value: CONTROL_TYPES.RANGE,
text: intl.formatMessage({
id: 'inputControl.editor.controlsTab.select.rangeDropDownOptionLabel',
defaultMessage: 'Range slider',
}),
text: i18n.translate(
'inputControl.editor.controlsTab.select.rangeDropDownOptionLabel',
{
defaultMessage: 'Range slider',
}
),
},
{
value: CONTROL_TYPES.LIST,
text: intl.formatMessage({
id: 'inputControl.editor.controlsTab.select.listDropDownOptionLabel',
defaultMessage: 'Options list',
}),
text: i18n.translate(
'inputControl.editor.controlsTab.select.listDropDownOptionLabel',
{
defaultMessage: 'Options list',
}
),
},
]}
value={this.state.type}
onChange={(event) => this.setState({ type: event.target.value as CONTROL_TYPES })}
aria-label={intl.formatMessage({
id: 'inputControl.editor.controlsTab.select.controlTypeAriaLabel',
defaultMessage: 'Select control type',
})}
aria-label={i18n.translate(
'inputControl.editor.controlsTab.select.controlTypeAriaLabel',
{
defaultMessage: 'Select control type',
}
)}
/>
</EuiFormRow>
</EuiFlexItem>
Expand All @@ -205,10 +205,12 @@ class ControlsTabUi extends PureComponent<ControlsTabUiProps, ControlsTabUiState
onClick={this.handleAddControl}
iconType="plusInCircle"
data-test-subj="inputControlEditorAddBtn"
aria-label={intl.formatMessage({
id: 'inputControl.editor.controlsTab.select.addControlAriaLabel',
defaultMessage: 'Add control',
})}
aria-label={i18n.translate(
'inputControl.editor.controlsTab.select.addControlAriaLabel',
{
defaultMessage: 'Add control',
}
)}
>
<FormattedMessage
id="inputControl.editor.controlsTab.addButtonLabel"
Expand All @@ -224,8 +226,6 @@ class ControlsTabUi extends PureComponent<ControlsTabUiProps, ControlsTabUiState
}
}

export const ControlsTab = injectI18n(ControlsTabUi);

export const getControlsTab = (deps: InputControlVisDependencies) => (
props: Omit<ControlsTabUiProps, 'core'>
) => <ControlsTab {...props} deps={deps} />;
// default export required for React.Lazy
// eslint-disable-next-line import/no-default-export
export { ControlsTab as default };
34 changes: 34 additions & 0 deletions src/plugins/input_control_vis/public/components/editor/index.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
/*
* Licensed to Elasticsearch B.V. under one or more contributor
* license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright
* ownership. Elasticsearch B.V. licenses this file to you under
* the Apache License, Version 2.0 (the "License"); you may
* not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/

import React, { lazy } from 'react';
import { VisOptionsProps } from 'src/plugins/vis_default_editor/public';
import { InputControlVisDependencies } from '../../plugin';
import { InputControlVisParams } from '../../types';

const ControlsTab = lazy(() => import('./controls_tab'));
const OptionsTab = lazy(() => import('./options_tab'));

export const getControlsTab = (deps: InputControlVisDependencies) => (
props: VisOptionsProps<InputControlVisParams>
) => <ControlsTab {...props} deps={deps} />;

export const OptionsTabLazy = (props: VisOptionsProps<InputControlVisParams>) => (
<OptionsTab {...props} />
);
Original file line number Diff line number Diff line change
Expand Up @@ -22,21 +22,21 @@ import { shallow } from 'enzyme';
import { mountWithIntl } from '@kbn/test/jest';

import { Vis } from '../../../../visualizations/public';
import { OptionsTab, OptionsTabProps } from './options_tab';
import OptionsTab, { OptionsTabProps } from './options_tab';

describe('OptionsTab', () => {
let props: OptionsTabProps;

beforeEach(() => {
props = {
props = ({
vis: {} as Vis,
stateParams: {
updateFiltersOnChange: false,
useTimeFilter: false,
pinFilters: false,
},
setValue: jest.fn(),
};
} as unknown) as OptionsTabProps;
});

it('should renders OptionsTab', () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,20 +24,11 @@ import { FormattedMessage } from '@kbn/i18n/react';
import { EuiSwitchEvent } from '@elastic/eui';

import { VisOptionsProps } from 'src/plugins/vis_default_editor/public';
import { InputControlVisParams } from '../../types';

interface OptionsTabParams {
updateFiltersOnChange: boolean;
useTimeFilter: boolean;
pinFilters: boolean;
}
type OptionsTabInjectedProps = Pick<
VisOptionsProps<OptionsTabParams>,
'vis' | 'setValue' | 'stateParams'
>;

export type OptionsTabProps = OptionsTabInjectedProps;
export type OptionsTabProps = VisOptionsProps<InputControlVisParams>;

export class OptionsTab extends PureComponent<OptionsTabProps> {
class OptionsTab extends PureComponent<OptionsTabProps> {
handleUpdateFiltersChange = (event: EuiSwitchEvent) => {
this.props.setValue('updateFiltersOnChange', event.target.checked);
};
Expand Down Expand Up @@ -98,3 +89,6 @@ export class OptionsTab extends PureComponent<OptionsTabProps> {
);
}
}
// default export required for React.Lazy
// eslint-disable-next-line import/no-default-export
export { OptionsTab as default };
Loading

0 comments on commit b92d4b8

Please sign in to comment.