Skip to content

Commit

Permalink
Merge branch 'master' into newplatform/query-string-input/cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
Liza Katz authored Nov 26, 2019
2 parents ee8db3c + 75d261d commit 70aea61
Show file tree
Hide file tree
Showing 76 changed files with 1,596 additions and 388 deletions.
1 change: 1 addition & 0 deletions .github/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@
/config/kibana.yml @elastic/kibana-platform
/x-pack/plugins/features/ @elastic/kibana-platform
/x-pack/plugins/licensing/ @elastic/kibana-platform
/packages/kbn-config-schema/ @elastic/kibana-platform

# Security
/x-pack/legacy/plugins/security/ @elastic/kibana-security
Expand Down
7 changes: 5 additions & 2 deletions docs/settings/security-settings.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ are enabled.
Do not set this to `false`; it disables the login form, user and role management
screens, and authorization using <<kibana-privileges>>. To disable
{security-features} entirely, see
{ref}/security-settings.html[{es} security settings].
{ref}/security-settings.html[{es} security settings].

`xpack.security.audit.enabled`::
Set to `true` to enable audit logging for security events. By default, it is set
Expand All @@ -40,7 +40,7 @@ An arbitrary string of 32 characters or more that is used to encrypt credentials
in a cookie. It is crucial that this key is not exposed to users of {kib}. By
default, a value is automatically generated in memory. If you use that default
behavior, all sessions are invalidated when {kib} restarts.
In addition, high-availability deployments of {kib} will behave unexpectedly
In addition, high-availability deployments of {kib} will behave unexpectedly
if this setting isn't the same for all instances of {kib}.

`xpack.security.secureCookies`::
Expand All @@ -53,3 +53,6 @@ routing requests through a load balancer or proxy).
Sets the session duration (in milliseconds). By default, sessions stay active
until the browser is closed. When this is set to an explicit timeout, closing the
browser still requires the user to log back in to {kib}.

`xpack.security.loginAssistanceMessage`::
Adds a message to the login screen. Useful for displaying information about maintenance windows, links to corporate sign up pages etc.
511 changes: 511 additions & 0 deletions packages/kbn-config-schema/README.md

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion scripts/functional_tests.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,6 @@ require('@kbn/test').runTestsCli([
require.resolve('../test/functional/config.js'),
require.resolve('../test/api_integration/config.js'),
require.resolve('../test/plugin_functional/config.js'),
require.resolve('../test/interpreter_functional/config.js'),
require.resolve('../test/interpreter_functional/config.ts'),
require.resolve('../test/ui_capabilities/newsfeed_err/config.ts'),
]);
Original file line number Diff line number Diff line change
Expand Up @@ -180,6 +180,7 @@ kibana_vars=(
xpack.security.encryptionKey
xpack.security.secureCookies
xpack.security.sessionTimeout
xpack.security.loginAssistanceMessage
telemetry.enabled
telemetry.sendUsageFrom
)
Expand Down
3 changes: 3 additions & 0 deletions src/legacy/core_plugins/console/public/quarantined/_app.scss
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
// TODO: Move all of the styles here (should be modularised by, e.g., CSS-in-JS or CSS modules).
@import '@elastic/eui/src/components/header/variables';

#consoleRoot {
height: calc(100vh - calc(#{$euiHeaderChildSize} * 2));
display: flex;
flex: 1 1 auto;
// Make sure the editor actions don't create scrollbars on this container
Expand Down
1 change: 0 additions & 1 deletion src/legacy/core_plugins/data/public/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,6 @@ export {
CONTAINS_SPACES,
getFromSavedObject,
getRoutes,
IndexPatternSelect,
validateIndexPattern,
ILLEGAL_CHARACTERS,
INDEX_PATTERN_ILLEGAL_CHARACTERS,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@ const createSetupContractMock = () => {
flattenHitWrapper: jest.fn().mockImplementation(flattenHitWrapper),
formatHitProvider: jest.fn(),
indexPatterns: jest.fn() as any,
IndexPatternSelect: jest.fn(),
__LEGACY: {
// For BWC we must temporarily export the class implementation of Field,
// which is only used externally by the Index Pattern UI.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ import {
} from 'src/core/public';
import { FieldFormatsStart } from '../../../../../plugins/data/public';
import { Field, FieldList, FieldListInterface, FieldType } from './fields';
import { createIndexPatternSelect } from './components';
import { setNotifications, setFieldFormats } from './services';

import {
Expand Down Expand Up @@ -79,7 +78,6 @@ export class IndexPatternsService {
return {
...this.setupApi,
indexPatterns: new IndexPatterns(uiSettings, savedObjectsClient, http),
IndexPatternSelect: createIndexPatternSelect(savedObjectsClient),
};
}

Expand All @@ -91,7 +89,6 @@ export class IndexPatternsService {
// static code

/** @public */
export { IndexPatternSelect } from './components';
export {
CONTAINS_SPACES,
getFromSavedObject,
Expand Down Expand Up @@ -120,4 +117,4 @@ export type IndexPatternsStart = ReturnType<IndexPatternsService['start']>;
export { IndexPattern, IndexPatterns, StaticIndexPattern, Field, FieldType, FieldListInterface };

/** @public */
export { getIndexPatternTitle, findIndexPatternByTitle } from './utils';
export { findIndexPatternByTitle } from './utils';
13 changes: 0 additions & 13 deletions src/legacy/core_plugins/data/public/index_patterns/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -71,19 +71,6 @@ export async function findIndexPatternByTitle(
);
}

export async function getIndexPatternTitle(
client: SavedObjectsClientContract,
indexPatternId: string
): Promise<SimpleSavedObject<any>> {
const savedObject = (await client.get('index-pattern', indexPatternId)) as SimpleSavedObject<any>;

if (savedObject.error) {
throw new Error(`Unable to get index-pattern title: ${savedObject.error.message}`);
}

return savedObject.attributes.title;
}

function indexPatternContainsSpaces(indexPattern: string): boolean {
return indexPattern.includes(' ');
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,27 @@
* under the License.
*/

jest.mock('ui/new_platform');
jest.mock('ui/index_patterns');
jest.mock('../../../../../core_plugins/data/public/legacy', () => ({
indexPatterns: {
indexPatterns: {
get: jest.fn(),
}
}
}));

jest.mock('ui/new_platform', () => ({
npStart: {
plugins: {
data: {
ui: {
IndexPatternSelect: () => {
return <div/>;
}
}
}
},
},
}));

import React from 'react';
import { shallowWithIntl, mountWithIntl } from 'test_utils/enzyme_helpers';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,13 @@
import PropTypes from 'prop-types';
import React from 'react';
import { injectI18n } from '@kbn/i18n/react';
import { IndexPatternSelect } from 'ui/index_patterns';

import {
EuiFormRow,
} from '@elastic/eui';

import { npStart } from 'ui/new_platform';
const { IndexPatternSelect } = npStart.plugins.data.ui;

function IndexPatternSelectFormRowUi(props) {
const {
controlIndex,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,24 @@
* under the License.
*/

jest.mock('ui/new_platform');
jest.mock('ui/index_patterns');
jest.mock('ui/new_platform', () => ({
npStart: {
plugins: {
data: {
ui: {
IndexPatternSelect: () => {
return <div/>;
}
}
}
},
},
}));

import React from 'react';
import sinon from 'sinon';
import { shallow } from 'enzyme';

import { mountWithIntl, shallowWithIntl } from 'test_utils/enzyme_helpers';
import { findTestSubject } from '@elastic/eui/lib/test';
import { getIndexPatternMock } from './__tests__/get_index_pattern_mock';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,19 +17,30 @@
* under the License.
*/

jest.mock('ui/new_platform');
jest.mock('ui/index_patterns');

import React from 'react';
import sinon from 'sinon';
import { shallow } from 'enzyme';
import { mountWithIntl } from 'test_utils/enzyme_helpers';

jest.mock('ui/new_platform', () => ({
npStart: {
plugins: {
data: {
ui: {
IndexPatternSelect: () => {
return <div/>;
}
}
}
},
},
}));

import { findTestSubject } from '@elastic/eui/lib/test';
import { getIndexPatternMock } from './__tests__/get_index_pattern_mock';

import {
RangeControlEditor,
} from './range_control_editor';
import { RangeControlEditor } from './range_control_editor';

const controlParams = {
id: '1',
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
/*
* 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 { i18n } from '@kbn/i18n';
import { TUTORIAL_CATEGORY } from '../../../common/tutorials/tutorial_category';
import { onPremInstructions, cloudInstructions, onPremCloudInstructions } from '../../../common/tutorials/metricbeat_instructions';

export function activemqMetricsSpecProvider(context) {
const moduleName = 'activemq';
return {
id: 'activemqMetrics',
name: i18n.translate('kbn.server.tutorials.activemqMetrics.nameTitle', {
defaultMessage: 'ActiveMQ metrics',
}),
category: TUTORIAL_CATEGORY.METRICS,
shortDescription: i18n.translate('kbn.server.tutorials.activemqMetrics.shortDescription', {
defaultMessage: 'Fetch monitoring metrics from ActiveMQ instances.',
}),
longDescription: i18n.translate('kbn.server.tutorials.activemqMetrics.longDescription', {
defaultMessage: 'The `activemq` Metricbeat module fetches monitoring metrics from ActiveMQ instances \
[Learn more]({learnMoreLink}).',
values: {
learnMoreLink: '{config.docs.beats.metricbeat}/metricbeat-module-activemq.html',
},
}),
euiIconType: '/plugins/kibana/home/tutorial_resources/logos/activemq.svg',
isBeta: true,
artifacts: {
application: {
label: i18n.translate('kbn.server.tutorials.corednsMetrics.artifacts.application.label', {
defaultMessage: 'Discover',
}),
path: '/app/kibana#/discover'
},
dashboards: [],
exportedFields: {
documentationUrl: '{config.docs.beats.metricbeat}/exported-fields-activemq.html'
}
},
completionTimeMinutes: 10,
onPrem: onPremInstructions(moduleName, null, null, null, context),
elasticCloud: cloudInstructions(moduleName),
onPremElasticCloud: onPremCloudInstructions(moduleName)
};
}
2 changes: 2 additions & 0 deletions src/legacy/core_plugins/kibana/server/tutorials/register.js
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,7 @@ import { consulMetricsSpecProvider } from './consul_metrics';
import { cockroachdbMetricsSpecProvider } from './cockroachdb_metrics';
import { traefikMetricsSpecProvider } from './traefik_metrics';
import { awsLogsSpecProvider } from './aws_logs';
import { activemqMetricsSpecProvider } from './activemq_metrics';

export function registerTutorials(server) {
server.newPlatform.setup.plugins.home.tutorials.registerTutorial(systemLogsSpecProvider);
Expand Down Expand Up @@ -146,4 +147,5 @@ export function registerTutorials(server) {
server.newPlatform.setup.plugins.home.tutorials.registerTutorial(cockroachdbMetricsSpecProvider);
server.newPlatform.setup.plugins.home.tutorials.registerTutorial(traefikMetricsSpecProvider);
server.newPlatform.setup.plugins.home.tutorials.registerTutorial(awsLogsSpecProvider);
server.newPlatform.setup.plugins.home.tutorials.registerTutorial(activemqMetricsSpecProvider);
}
1 change: 0 additions & 1 deletion src/legacy/ui/public/index_patterns/__mocks__/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@ export {
CONTAINS_SPACES,
getFromSavedObject,
getRoutes,
IndexPatternSelect,
validateIndexPattern,
ILLEGAL_CHARACTERS,
INDEX_PATTERN_ILLEGAL_CHARACTERS,
Expand Down
1 change: 0 additions & 1 deletion src/legacy/ui/public/index_patterns/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@ export const {
FieldList, // only used in Discover and StubIndexPattern
flattenHitWrapper,
formatHitProvider,
IndexPatternSelect, // only used in x-pack/plugin/maps and input control vis
} = data.indexPatterns;

// static code
Expand Down
7 changes: 7 additions & 0 deletions src/legacy/ui/public/new_platform/new_platform.karma_mock.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,10 @@ const mockObservable = () => {
};
};

const mockComponent = () => {
return null;
};

export const mockUiSettings = {
get: (item) => {
return mockUiSettings[item];
Expand Down Expand Up @@ -139,6 +143,9 @@ export const npStart = {
getProvider: sinon.fake(),
},
getSuggestions: sinon.fake(),
ui: {
IndexPatternSelect: mockComponent,
},
query: {
filterManager: {
getFetches$: sinon.fake(),
Expand Down
Loading

0 comments on commit 70aea61

Please sign in to comment.