Skip to content

Commit

Permalink
Merge branch 'master' into deangularize-navbar-2
Browse files Browse the repository at this point in the history
  • Loading branch information
elasticmachine authored Apr 12, 2020
2 parents c106db9 + 2be6b7f commit ff6504f
Show file tree
Hide file tree
Showing 256 changed files with 3,760 additions and 1,684 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,12 @@

## ScopedHistory.createHref property

Creates an href (string) to the location.
Creates an href (string) to the location. If `prependBasePath` is true (default), it will prepend the location's path with the scoped history basePath.

<b>Signature:</b>

```typescript
createHref: (location: LocationDescriptorObject<HistoryLocationState>) => string;
createHref: (location: LocationDescriptorObject<HistoryLocationState>, { prependBasePath }?: {
prependBasePath?: boolean | undefined;
}) => string;
```
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ export declare class ScopedHistory<HistoryLocationState = unknown> implements Hi
| --- | --- | --- | --- |
| [action](./kibana-plugin-core-public.scopedhistory.action.md) | | <code>Action</code> | The last action dispatched on the history stack. |
| [block](./kibana-plugin-core-public.scopedhistory.block.md) | | <code>(prompt?: string &#124; boolean &#124; History.TransitionPromptHook&lt;HistoryLocationState&gt; &#124; undefined) =&gt; UnregisterCallback</code> | Not supported. Use [AppMountParameters.onAppLeave](./kibana-plugin-core-public.appmountparameters.onappleave.md)<!-- -->. |
| [createHref](./kibana-plugin-core-public.scopedhistory.createhref.md) | | <code>(location: LocationDescriptorObject&lt;HistoryLocationState&gt;) =&gt; string</code> | Creates an href (string) to the location. |
| [createHref](./kibana-plugin-core-public.scopedhistory.createhref.md) | | <code>(location: LocationDescriptorObject&lt;HistoryLocationState&gt;, { prependBasePath }?: {</code><br/><code> prependBasePath?: boolean &#124; undefined;</code><br/><code> }) =&gt; string</code> | Creates an href (string) to the location. If <code>prependBasePath</code> is true (default), it will prepend the location's path with the scoped history basePath. |
| [createSubHistory](./kibana-plugin-core-public.scopedhistory.createsubhistory.md) | | <code>&lt;SubHistoryLocationState = unknown&gt;(basePath: string) =&gt; ScopedHistory&lt;SubHistoryLocationState&gt;</code> | Creates a <code>ScopedHistory</code> for a subpath of this <code>ScopedHistory</code>. Useful for applications that may have sub-apps that do not need access to the containing application's history. |
| [go](./kibana-plugin-core-public.scopedhistory.go.md) | | <code>(n: number) =&gt; void</code> | Send the user forward or backwards in the history stack. |
| [goBack](./kibana-plugin-core-public.scopedhistory.goback.md) | | <code>() =&gt; void</code> | Send the user one location back in the history stack. Equivalent to calling [ScopedHistory.go(-1)](./kibana-plugin-core-public.scopedhistory.go.md)<!-- -->. If no more entries are available backwards, this is a no-op. |
Expand Down
4 changes: 2 additions & 2 deletions docs/settings/alert-action-settings.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ Alerts and actions are enabled by default in {kib}, but require you configure th

. <<using-kibana-with-security,Set up {kib} to work with {stack} {security-features}>>.
. <<configuring-tls-kib-es,Set up TLS encryption between {kib} and {es}>>.
. <<general-alert-action-settings,Specify a value for `xpack.encrypted_saved_objects.encryptionKey`>>.
. <<general-alert-action-settings,Specify a value for `xpack.encryptedSavedObjects.encryptionKey`>>.

You can configure the following settings in the `kibana.yml` file.

Expand All @@ -18,7 +18,7 @@ You can configure the following settings in the `kibana.yml` file.
[[general-alert-action-settings]]
==== General settings

`xpack.encrypted_saved_objects.encryptionKey`::
`xpack.encryptedSavedObjects.encryptionKey`::

A string of 32 or more characters used to encrypt sensitive properties on alerts and actions before they're stored in {es}. Third party credentials &mdash; such as the username and password used to connect to an SMTP service &mdash; are an example of encrypted properties.
+
Expand Down
2 changes: 1 addition & 1 deletion docs/user/alerting/index.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ Pre-packaged *alert types* simplify setup, hide the details complex domain-speci
If you are using an *on-premises* Elastic Stack deployment with <<using-kibana-with-security, *security*>>:

* TLS must be configured for communication <<configuring-tls-kib-es, between {es} and {kib}>>. {kib} alerting uses <<api-keys, API keys>> to secure background alert checks and actions, and API keys require {ref}/configuring-tls.html#tls-http[TLS on the HTTP interface].
* In the kibana.yml configuration file, add the <<alert-action-settings-kb,`xpack.encrypted_saved_objects.encryptionKey` setting>>
* In the kibana.yml configuration file, add the <<alert-action-settings-kb,`xpack.encryptedSavedObjects.encryptionKey` setting>>

[float]
[[alerting-security]]
Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@
"@elastic/filesaver": "1.1.2",
"@elastic/good": "8.1.1-kibana2",
"@elastic/numeral": "2.4.0",
"@elastic/request-crypto": "1.1.2",
"@elastic/request-crypto": "1.1.4",
"@elastic/ui-ace": "0.2.3",
"@hapi/good-squeeze": "5.2.1",
"@hapi/wreck": "^15.0.2",
Expand Down Expand Up @@ -401,7 +401,7 @@
"chai": "3.5.0",
"chance": "1.0.18",
"cheerio": "0.22.0",
"chromedriver": "^80.0.1",
"chromedriver": "^81.0.0",
"classnames": "2.2.6",
"dedent": "^0.7.0",
"delete-empty": "^2.0.0",
Expand Down
2 changes: 1 addition & 1 deletion rfcs/text/0002_encrypted_attributes.md
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@ take a look at the source code of this library to know how encryption is perform
parameters are used, but in short it's AES Encryption with AES-256-GCM that uses random initialization vector and salt.

As with encryption key for Kibana's session cookie, master encryption key used by `encrypted_saved_objects` plugin can be
defined as a configuration value (`xpack.encrypted_saved_objects.encryptionKey`) via `kibana.yml`, but it's **highly
defined as a configuration value (`xpack.encryptedSavedObjects.encryptionKey`) via `kibana.yml`, but it's **highly
recommended** to define this key in the [Kibana Keystore](https://www.elastic.co/guide/en/kibana/current/secure-settings.html)
instead. The master key should be cryptographically safe and be equal or greater than 32 bytes.

Expand Down
25 changes: 23 additions & 2 deletions src/core/public/application/scoped_history.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -268,11 +268,32 @@ describe('ScopedHistory', () => {
const gh = createMemoryHistory();
gh.push('/app/wow');
const h = new ScopedHistory(gh, '/app/wow');
expect(h.createHref({ pathname: '' })).toEqual(`/`);
expect(h.createHref({ pathname: '' })).toEqual(`/app/wow`);
expect(h.createHref({})).toEqual(`/app/wow`);
expect(h.createHref({ pathname: '/new-page', search: '?alpha=true' })).toEqual(
`/new-page?alpha=true`
`/app/wow/new-page?alpha=true`
);
});

it('behave correctly with slash-ending basePath', () => {
const gh = createMemoryHistory();
gh.push('/app/wow/');
const h = new ScopedHistory(gh, '/app/wow/');
expect(h.createHref({ pathname: '' })).toEqual(`/app/wow/`);
expect(h.createHref({ pathname: '/new-page', search: '?alpha=true' })).toEqual(
`/app/wow/new-page?alpha=true`
);
});

it('skips the scoped history path when `prependBasePath` is false', () => {
const gh = createMemoryHistory();
gh.push('/app/wow');
const h = new ScopedHistory(gh, '/app/wow');
expect(h.createHref({ pathname: '' }, { prependBasePath: false })).toEqual(`/`);
expect(
h.createHref({ pathname: '/new-page', search: '?alpha=true' }, { prependBasePath: false })
).toEqual(`/new-page?alpha=true`);
});
});

describe('action', () => {
Expand Down
20 changes: 17 additions & 3 deletions src/core/public/application/scoped_history.ts
Original file line number Diff line number Diff line change
Expand Up @@ -219,11 +219,26 @@ export class ScopedHistory<HistoryLocationState = unknown>

/**
* Creates an href (string) to the location.
* If `prependBasePath` is true (default), it will prepend the location's path with the scoped history basePath.
*
* @param location
* @param prependBasePath
*/
public createHref = (location: LocationDescriptorObject<HistoryLocationState>): Href => {
public createHref = (
location: LocationDescriptorObject<HistoryLocationState>,
{ prependBasePath = true }: { prependBasePath?: boolean } = {}
): Href => {
this.verifyActive();
if (prependBasePath) {
location = this.prependBasePath(location);
if (location.pathname === undefined) {
// we always want to create an url relative to the basePath
// so if pathname is not present, we use the history's basePath as default
// we are doing that here because `prependBasePath` should not
// alter pathname for other method calls
location.pathname = this.basePath;
}
}
return this.parentHistory.createHref(location);
};

Expand Down Expand Up @@ -254,8 +269,7 @@ export class ScopedHistory<HistoryLocationState = unknown>
* Prepends the base path to string.
*/
private prependBasePathToString(path: string): string {
path = path.startsWith('/') ? path.slice(1) : path;
return path.length ? `${this.basePath}/${path}` : this.basePath;
return path.length ? `${this.basePath}/${path}`.replace(/\/{2,}/g, '/') : this.basePath;
}

/**
Expand Down
4 changes: 3 additions & 1 deletion src/core/public/public.api.md
Original file line number Diff line number Diff line change
Expand Up @@ -1196,7 +1196,9 @@ export class ScopedHistory<HistoryLocationState = unknown> implements History<Hi
constructor(parentHistory: History, basePath: string);
get action(): Action;
block: (prompt?: string | boolean | History.TransitionPromptHook<HistoryLocationState> | undefined) => UnregisterCallback;
createHref: (location: LocationDescriptorObject<HistoryLocationState>) => string;
createHref: (location: LocationDescriptorObject<HistoryLocationState>, { prependBasePath }?: {
prependBasePath?: boolean | undefined;
}) => string;
createSubHistory: <SubHistoryLocationState = unknown>(basePath: string) => ScopedHistory<SubHistoryLocationState>;
go: (n: number) => void;
goBack: () => void;
Expand Down
1 change: 1 addition & 0 deletions src/dev/jest/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ export default {
'\\.(jpg|jpeg|png|gif|eot|otf|webp|svg|ttf|woff|woff2|mp4|webm|wav|mp3|m4a|aac|oga)$':
'<rootDir>/src/dev/jest/mocks/file_mock.js',
'\\.(css|less|scss)$': '<rootDir>/src/dev/jest/mocks/style_mock.js',
'\\.ace\\.worker.js$': '<rootDir>/src/dev/jest/mocks/ace_worker_module_mock.js',
},
setupFiles: [
'<rootDir>/src/dev/jest/setup/babel_polyfill.js',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,4 @@
* under the License.
*/

export { XJsonMode } from './x_json_mode';
module.exports = '';
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,11 @@ import { FormattedMessage } from '@kbn/i18n/react';

import { FileLayerField, VectorLayer, ServiceSettings } from 'ui/vis/map/service_settings';
import { VisOptionsProps } from 'src/plugins/vis_default_editor/public';
import { NumberInputOption, SelectOption, SwitchOption } from '../../../vis_type_vislib/public';
import {
NumberInputOption,
SelectOption,
SwitchOption,
} from '../../../../../plugins/charts/public';
import { WmsOptions } from '../../../tile_map/public/components/wms_options';
import { RegionMapVisParams } from '../types';

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ import {
RangeOption,
SelectOption,
SwitchOption,
} from '../../../vis_type_vislib/public';
} from '../../../../../plugins/charts/public';
import { WmsOptions } from './wms_options';
import { TileMapVisParams } from '../types';
import { MapTypes } from '../map_types';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ import React from 'react';
import { EuiLink, EuiSpacer, EuiText, EuiScreenReaderOnly } from '@elastic/eui';
import { FormattedMessage } from '@kbn/i18n/react';

import { TextInputOption } from '../../../vis_type_vislib/public';
import { TextInputOption } from '../../../../../plugins/charts/public';
import { WMSOptions } from '../types';

interface WmsInternalOptions {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ import { FormattedMessage } from '@kbn/i18n/react';
import { TmsLayer } from 'ui/vis/map/service_settings';
import { Vis } from '../../../../../plugins/visualizations/public';
import { RegionMapVisParams } from '../../../region_map/public/types';
import { SelectOption, SwitchOption } from '../../../vis_type_vislib/public';
import { SelectOption, SwitchOption } from '../../../../../plugins/charts/public';
import { WmsInternalOptions } from './wms_internal_options';
import { WMSOptions, TileMapVisParams } from '../types';

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ import { EuiPanel } from '@elastic/eui';
import { i18n } from '@kbn/i18n';

import { VisOptionsProps } from 'src/plugins/vis_default_editor/public';
import { RangeOption, SwitchOption } from '../../vis_type_vislib/public';
import { RangeOption, SwitchOption } from '../../../../plugins/charts/public';
import { MarkdownVisParams } from './types';

function SettingsOptions({ stateParams, setValue }: VisOptionsProps<MarkdownVisParams>) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,9 @@ import {
SwitchOption,
RangeOption,
SetColorSchemaOptionsValue,
} from '../../../vis_type_vislib/public';
SetColorRangeValue,
} from '../../../../../plugins/charts/public';
import { MetricVisParam, VisParams } from '../types';
import { SetColorRangeValue } from '../../../vis_type_vislib/public/components/common/color_ranges';

function MetricVisOptions({
stateParams,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,8 @@ import {
Render,
Style,
} from '../../../../plugins/expressions/public';
import { ColorModes } from '../../vis_type_vislib/public';
import { visType, DimensionsVisParam, VisParams } from './types';
import { ColorSchemas, vislibColorMaps } from '../../../../plugins/charts/public';
import { ColorSchemas, vislibColorMaps, ColorModes } from '../../../../plugins/charts/public';

export type Input = KibanaDatatable;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,7 @@ import { i18n } from '@kbn/i18n';

import { MetricVisComponent } from './components/metric_vis_component';
import { MetricVisOptions } from './components/metric_vis_options';
import { ColorModes } from '../../vis_type_vislib/public';
import { ColorSchemas, colorSchemas } from '../../../../plugins/charts/public';
import { ColorSchemas, colorSchemas, ColorModes } from '../../../../plugins/charts/public';
import { AggGroupNames } from '../../../../plugins/data/public';
import { Schemas } from '../../../../plugins/vis_default_editor/public';

Expand Down
3 changes: 1 addition & 2 deletions src/legacy/core_plugins/vis_type_metric/public/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,7 @@

import { Range } from '../../../../plugins/expressions/public';
import { SchemaConfig } from '../../../../plugins/visualizations/public';
import { ColorModes, Labels, Style } from '../../vis_type_vislib/public';
import { ColorSchemas } from '../../../../plugins/charts/public';
import { ColorModes, ColorSchemas, Labels, Style } from '../../../../plugins/charts/public';

export const visType = 'metric';

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,11 @@ import { FormattedMessage } from '@kbn/i18n/react';

import { VisOptionsProps } from 'src/plugins/vis_default_editor/public';
import { search } from '../../../../../plugins/data/public';
import { NumberInputOption, SwitchOption, SelectOption } from '../../../vis_type_vislib/public';
import {
SwitchOption,
SelectOption,
NumberInputOption,
} from '../../../../../plugins/charts/public';
import { TableVisParams } from '../types';
import { totalAggregations } from './utils';

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ import { EuiPanel } from '@elastic/eui';
import { i18n } from '@kbn/i18n';
import { VisOptionsProps } from 'src/plugins/vis_default_editor/public';
import { ValidatedDualRange } from '../../../../../../src/plugins/kibana_react/public';
import { SelectOption, SwitchOption } from '../../../vis_type_vislib/public';
import { SelectOption, SwitchOption } from '../../../../../plugins/charts/public';
import { TagCloudVisParams } from '../types';

function TagCloudOptions({ stateParams, setValue, vis }: VisOptionsProps<TagCloudVisParams>) {
Expand Down
2 changes: 1 addition & 1 deletion src/legacy/core_plugins/vis_type_vislib/public/area.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,13 +33,13 @@ import {
AxisTypes,
ScaleTypes,
AxisModes,
Rotates,
ThresholdLineStyles,
getConfigCollections,
} from './utils/collections';
import { getAreaOptionTabs, countLabel } from './utils/common_config';
import { createVislibVisController } from './vis_controller';
import { VisTypeVislibDependencies } from './plugin';
import { Rotates } from '../../../../plugins/charts/public';

export const createAreaVisTypeDefinition = (deps: VisTypeVislibDependencies) => ({
name: 'area',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,5 @@
* under the License.
*/

export { BasicOptions } from './basic_options';
export { ColorRanges } from './color_ranges';
export { ColorSchemaOptions, SetColorSchemaOptionsValue } from './color_schema';
export { NumberInputOption } from './number_input';
export { RangeOption } from './range';
export { SelectOption } from './select';
export { SwitchOption } from './switch';
export { TextInputOption } from './text_input';
export { TruncateLabelsOption } from './truncate_labels';
export { ValidationWrapper, ValidationVisOptionsProps } from './validation_wrapper';
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ import { EuiPanel, EuiSpacer, EuiTitle } from '@elastic/eui';
import { i18n } from '@kbn/i18n';
import { FormattedMessage } from '@kbn/i18n/react';

import { SwitchOption, TextInputOption } from '../../common';
import { SwitchOption, TextInputOption } from '../../../../../../../plugins/charts/public';
import { GaugeOptionsInternalProps } from '.';

function LabelsPanel({ stateParams, setValue, setGaugeValue }: GaugeOptionsInternalProps) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,16 @@ import { EuiPanel, EuiSpacer, EuiTitle } from '@elastic/eui';
import { i18n } from '@kbn/i18n';
import { FormattedMessage } from '@kbn/i18n/react';

import { ColorRanges, ColorSchemaOptions, SwitchOption } from '../../common';
import {
ColorRanges,
ColorSchemaOptions,
ColorSchemaParams,
SetColorRangeValue,
SwitchOption,
ColorSchemas,
} from '../../../../../../../plugins/charts/public';
import { GaugeOptionsInternalProps } from '.';
import { ColorSchemaVislibParams } from '../../../types';
import { Gauge } from '../../../gauge';
import { SetColorRangeValue } from '../../common/color_ranges';
import { ColorSchemas } from '../../../../../../../plugins/charts/public';

function RangesPanel({
setGaugeValue,
Expand All @@ -39,7 +43,7 @@ function RangesPanel({
vis,
}: GaugeOptionsInternalProps) {
const setColorSchemaOptions = useCallback(
<T extends keyof ColorSchemaVislibParams>(paramName: T, value: ColorSchemaVislibParams[T]) => {
<T extends keyof ColorSchemaParams>(paramName: T, value: ColorSchemaParams[T]) => {
setGaugeValue(paramName, value as Gauge[T]);
// set outline if color schema is changed to greys
// if outline wasn't set explicitly yet
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ import { EuiPanel, EuiSpacer, EuiTitle } from '@elastic/eui';
import { i18n } from '@kbn/i18n';
import { FormattedMessage } from '@kbn/i18n/react';

import { SelectOption } from '../../common';
import { SelectOption } from '../../../../../../../plugins/charts/public';
import { GaugeOptionsInternalProps } from '.';
import { AggGroupNames } from '../../../../../../../plugins/data/public';

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,12 +31,12 @@ import {
NumberInputOption,
SelectOption,
SwitchOption,
} from '../../common';
import { SetColorSchemaOptionsValue } from '../../common/color_schema';
SetColorSchemaOptionsValue,
SetColorRangeValue,
} from '../../../../../../../plugins/charts/public';
import { HeatmapVisParams } from '../../../heatmap';
import { ValueAxis } from '../../../types';
import { LabelsPanel } from './labels_panel';
import { SetColorRangeValue } from '../../common/color_ranges';

function HeatmapOptions(props: VisOptionsProps<HeatmapVisParams>) {
const { stateParams, vis, uiState, setValue, setValidity, setTouched } = props;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ import { FormattedMessage } from '@kbn/i18n/react';
import { VisOptionsProps } from 'src/plugins/vis_default_editor/public';
import { ValueAxis } from '../../../types';
import { HeatmapVisParams } from '../../../heatmap';
import { SwitchOption } from '../../common';
import { SwitchOption } from '../../../../../../../plugins/charts/public';

const VERTICAL_ROTATION = 270;

Expand Down
Loading

0 comments on commit ff6504f

Please sign in to comment.