Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/master' into fix/mocha-tests
Browse files Browse the repository at this point in the history
  • Loading branch information
kobelb committed Nov 15, 2019
2 parents ba81d22 + 7ad6827 commit 51e54e5
Show file tree
Hide file tree
Showing 194 changed files with 5,189 additions and 1,307 deletions.
5 changes: 0 additions & 5 deletions .github/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,6 @@
# Canvas
/x-pack/legacy/plugins/canvas/ @elastic/kibana-canvas

# Code
/x-pack/legacy/plugins/code/ @teams/code
/x-pack/test/functional/apps/code/ @teams/code
/x-pack/test/api_integration/apis/code/ @teams/code

# Logs & Metrics UI
/x-pack/legacy/plugins/infra/ @elastic/logs-metrics-ui
/x-pack/legacy/plugins/integrations_manager/ @elastic/epm
Expand Down
1 change: 1 addition & 0 deletions STYLEGUIDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,7 @@ You should prefer modern language features in a lot of cases, e.g.:
* Prefer arrow function over storing `this` (no `const self = this;`)
* Prefer template strings over string concatenation
* Prefer the spread operator for copying arrays (`[...arr]`) over `arr.slice()`
* Use optional chaining (`?.`) and nullish Coalescing (`??`) over `lodash.get` (and similar utilities)
### Avoid mutability and state
Expand Down
122 changes: 61 additions & 61 deletions docs/management/advanced-options.asciidoc

Large diffs are not rendered by default.

15 changes: 14 additions & 1 deletion docs/setup/settings.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,8 @@ strongly recommend that you keep the default CSP rules that ship with Kibana.

`csp.strict:`:: *Default: `true`* Blocks access to Kibana to any browser that
does not enforce even rudimentary CSP rules. In practice, this will disable
support for older, less safe browsers like Internet Explorer.
support for older, less safe browsers like Internet Explorer.
See <<csp-strict-mode, Content Security Policy>> for more information.

`csp.warnLegacyBrowsers:`:: *Default: `true`* Shows a warning message after
loading Kibana to any browser that does not enforce even rudimentary CSP rules,
Expand Down Expand Up @@ -319,6 +320,18 @@ supported protocols with versions. Valid protocols: `TLSv1`, `TLSv1.1`, `TLSv1.2
setting this to `true` enables unauthenticated users to access the Kibana
server status API and status page.

`telemetry.allowChangingOptInStatus`:: *Default: true*. If `true`,
users are able to change the telemetry setting at a later time in
<<advanced-options, Advanced Settings>>. If `false`,
{kib} looks at the value of `telemetry.optIn` to determine whether to send
telemetry data or not. `telemetry.allowChangingOptInStatus` and `telemetry.optIn`
cannot be `false` at the same time.

`telemetry.optIn`:: *Default: true* If `true`, telemetry data is sent to Elastic.
If `false`, collection of telemetry data is disabled.
To enable telemetry and prevent users from disabling it,
set `telemetry.allowChangingOptInStatus` to `false` and `telemetry.optIn` to `true`.

`vega.enableExternalUrls:`:: *Default: false* Set this value to true to allow Vega to use any URL to access external data sources and images. If false, Vega can only get data from Elasticsearch.

`xpack.license_management.enabled`:: *Default: true* Set this value to false to
Expand Down
12 changes: 10 additions & 2 deletions docs/setup/upgrade.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,15 @@
== Upgrading {kib}

Depending on the {kib} version you're upgrading from, the upgrade process to 7.0
varies.
varies.

NOTE: {kib} upgrades automatically when starting a new version, as described in
<<upgrade-migrations, this document>>.
Although you do not need to manually back up {kib} before upgrading, we recommend
that you have a backup on hand. You can use
<<snapshot-repositories, Snapshot and Restore>> to back up {kib}
data by targeting `.kibana*` indices. If you are using the Reporting plugin,
you can also target `.reporting*` indices.

[float]
[[upgrade-before-you-begin]]
Expand All @@ -12,7 +20,7 @@ Before you upgrade {kib}:

* Consult the <<breaking-changes,breaking changes>>.
* Before you upgrade production servers, test the upgrades in a dev environment.
* Backup your data with {es} {ref}/modules-snapshots.html[snapshots].
* Back up your data with {es} {ref}/modules-snapshots.html[snapshots].
To roll back to an earlier version, you **must** have a backup of your data.
* If you are using custom plugins, check that a compatible version is
available.
Expand Down
10 changes: 5 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@
"**/@types/react": "16.8.3",
"**/@types/hapi": "^17.0.18",
"**/@types/angular": "^1.6.56",
"**/typescript": "3.5.3",
"**/typescript": "3.7.2",
"**/graphql-toolkit/lodash": "^4.17.13",
"**/isomorphic-git/**/base64-js": "^1.2.1",
"**/image-diff/gm/debug": "^2.6.9"
Expand Down Expand Up @@ -346,8 +346,8 @@
"@types/uuid": "^3.4.4",
"@types/vinyl-fs": "^2.4.11",
"@types/zen-observable": "^0.8.0",
"@typescript-eslint/eslint-plugin": "^2.5.0",
"@typescript-eslint/parser": "^2.5.0",
"@typescript-eslint/eslint-plugin": "^2.7.0",
"@typescript-eslint/parser": "^2.7.0",
"angular-mocks": "^1.7.8",
"archiver": "^3.1.1",
"axe-core": "^3.3.2",
Expand All @@ -360,7 +360,7 @@
"chance": "1.0.18",
"cheerio": "0.22.0",
"chokidar": "3.2.1",
"chromedriver": "^77.0.0",
"chromedriver": "78.0.1",
"classnames": "2.2.6",
"dedent": "^0.7.0",
"delete-empty": "^2.0.0",
Expand Down Expand Up @@ -444,7 +444,7 @@
"supertest": "^3.1.0",
"supertest-as-promised": "^4.0.2",
"tree-kill": "^1.2.1",
"typescript": "3.5.3",
"typescript": "3.7.2",
"typings-tester": "^0.3.2",
"vinyl-fs": "^3.0.3",
"xml2js": "^0.4.22",
Expand Down
4 changes: 2 additions & 2 deletions packages/eslint-config-kibana/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@
},
"homepage": "https://github.com/elastic/eslint-config-kibana#readme",
"peerDependencies": {
"@typescript-eslint/eslint-plugin": "^2.5.0",
"@typescript-eslint/parser": "^2.5.0",
"@typescript-eslint/eslint-plugin": "^2.7.0",
"@typescript-eslint/parser": "^2.7.0",
"babel-eslint": "^10.0.3",
"eslint": "^6.5.1",
"eslint-plugin-babel": "^5.3.0",
Expand Down
2 changes: 1 addition & 1 deletion packages/kbn-analytics/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,6 @@
"@babel/cli": "7.5.5",
"@kbn/dev-utils": "1.0.0",
"@kbn/babel-preset": "1.0.0",
"typescript": "3.5.3"
"typescript": "3.7.2"
}
}
2 changes: 1 addition & 1 deletion packages/kbn-config-schema/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
"kbn:bootstrap": "yarn build"
},
"devDependencies": {
"typescript": "3.5.3"
"typescript": "3.7.2"
},
"peerDependencies": {
"joi": "^13.5.2",
Expand Down

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

2 changes: 1 addition & 1 deletion packages/kbn-config-schema/src/types/uri_type.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ export class URIType extends Type<string> {
case 'string.base':
return `expected value of type [string] but got [${typeDetect(value)}].`;
case 'string.uriCustomScheme':
return `expected URI with scheme [${scheme}] but but got [${value}].`;
return `expected URI with scheme [${scheme}] but got [${value}].`;
case 'string.uri':
return `value is [${value}] but it must be a valid URI (see RFC 3986).`;
}
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 @@ -21,7 +21,7 @@
"tslib": "^1.9.3"
},
"devDependencies": {
"typescript": "3.5.3",
"typescript": "3.7.2",
"@kbn/expect": "1.0.0",
"chance": "1.0.18"
}
Expand Down
2 changes: 1 addition & 1 deletion packages/kbn-elastic-idx/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
"@babel/core": "^7.5.5",
"@babel/plugin-transform-async-to-generator": "^7.5.0",
"jest": "^24.9.0",
"typescript": "3.5.3"
"typescript": "3.7.2"
},
"jest": {
"testEnvironment": "node"
Expand Down
2 changes: 1 addition & 1 deletion packages/kbn-i18n/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
"del": "^5.1.0",
"getopts": "^2.2.4",
"supports-color": "^7.0.0",
"typescript": "3.5.3"
"typescript": "3.7.2"
},
"dependencies": {
"intl-format-cache": "^2.1.0",
Expand Down
2 changes: 1 addition & 1 deletion packages/kbn-pm/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@
"strip-ansi": "^4.0.0",
"strong-log-transformer": "^2.1.0",
"tempy": "^0.3.0",
"typescript": "3.5.3",
"typescript": "3.7.2",
"unlazy-loader": "^0.1.3",
"webpack": "^4.41.0",
"webpack-cli": "^3.3.9",
Expand Down
4 changes: 2 additions & 2 deletions src/core/public/chrome/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,6 @@
*/

export const ELASTIC_SUPPORT_LINK = 'https://support.elastic.co/';
export const KIBANA_FEEDBACK_LINK = 'https://www.elastic.co/kibana/feedback';
export const KIBANA_ASK_ELASTIC_LINK = 'https://www.elastic.co/kibana/ask-elastic';
export const KIBANA_FEEDBACK_LINK = 'https://www.elastic.co/products/kibana/feedback';
export const KIBANA_ASK_ELASTIC_LINK = 'https://www.elastic.co/products/kibana/ask-elastic';
export const GITHUB_CREATE_ISSUE_LINK = 'https://github.com/elastic/kibana/issues/new/choose';
4 changes: 2 additions & 2 deletions src/legacy/core_plugins/console/server/request.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,15 +16,15 @@
* specific language governing permissions and limitations
* under the License.
*/
import http from 'http';
import http, { ClientRequest } from 'http';
import * as sinon from 'sinon';
import { sendRequest } from './request';
import { URL } from 'url';
import { fail } from 'assert';

describe(`Console's send request`, () => {
let sandbox: sinon.SinonSandbox;
let stub: sinon.SinonStub;
let stub: sinon.SinonStub<Parameters<typeof http['request']>, ClientRequest>;
let fakeRequest: http.ClientRequest;

beforeEach(() => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -82,8 +82,11 @@ function QueryBarTopRowUI(props: Props) {

const queryLanguage = props.query && props.query.language;
const persistedLog: PersistedLog | undefined = React.useMemo(
() => (queryLanguage ? getQueryLog(uiSettings!, storage, appName, queryLanguage) : undefined),
[queryLanguage]
() =>
queryLanguage && uiSettings && storage && appName
? getQueryLog(uiSettings!, storage, appName, queryLanguage)
: undefined,
[appName, queryLanguage, uiSettings, storage]
);

function onClickSubmitButton(event: React.MouseEvent<HTMLButtonElement>) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@ export interface SearchBarOwnProps {
// Show when user has privileges to save
showSaveQuery?: boolean;
savedQuery?: SavedQuery;
onQueryChange?: (payload: { dateRange: TimeRange; query?: Query }) => void;
onQuerySubmit?: (payload: { dateRange: TimeRange; query?: Query }) => void;
// User has saved the current state as a saved query
onSaved?: (savedQuery: SavedQuery) => void;
Expand Down Expand Up @@ -206,6 +207,18 @@ class SearchBarUI extends Component<SearchBarProps, State> {
);
}

/*
* This Function is here to show the toggle in saved query form
* in case you the date range (from/to)
*/
private shouldRenderTimeFilterInSavedQueryForm() {
const { dateRangeFrom, dateRangeTo, showDatePicker } = this.props;
return (
showDatePicker ||
(!showDatePicker && dateRangeFrom !== undefined && dateRangeTo !== undefined)
);
}

public setFilterBarHeight = () => {
requestAnimationFrame(() => {
const height =
Expand Down Expand Up @@ -299,6 +312,9 @@ class SearchBarUI extends Component<SearchBarProps, State> {
dateRangeFrom: queryAndDateRange.dateRange.from,
dateRangeTo: queryAndDateRange.dateRange.to,
});
if (this.props.onQueryChange) {
this.props.onQueryChange(queryAndDateRange);
}
};

public onQueryBarSubmit = (queryAndDateRange: { dateRange?: TimeRange; query?: Query }) => {
Expand Down Expand Up @@ -440,7 +456,7 @@ class SearchBarUI extends Component<SearchBarProps, State> {
onSave={this.onSave}
onClose={() => this.setState({ showSaveQueryModal: false })}
showFilterOption={this.props.showFilterBar}
showTimeFilterOption={this.props.showDatePicker}
showTimeFilterOption={this.shouldRenderTimeFilterInSavedQueryForm()}
/>
) : null}
{this.state.showSaveNewQueryModal ? (
Expand All @@ -449,7 +465,7 @@ class SearchBarUI extends Component<SearchBarProps, State> {
onSave={savedQueryMeta => this.onSave(savedQueryMeta, true)}
onClose={() => this.setState({ showSaveNewQueryModal: false })}
showFilterOption={this.props.showFilterBar}
showTimeFilterOption={this.props.showDatePicker}
showTimeFilterOption={this.shouldRenderTimeFilterInSavedQueryForm()}
/>
) : null}
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ export function TopNavMenuItem(props: TopNavMenuData) {
isDisabled={isDisabled()}
onClick={handleClick}
data-test-subj={props.testId}
className={props.className}
>
{capitalize(props.label || props.id!)}
</EuiButtonEmpty>
Expand Down
19 changes: 11 additions & 8 deletions src/legacy/core_plugins/tile_map/public/components/wms_options.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -23,23 +23,26 @@ import { i18n } from '@kbn/i18n';
import { FormattedMessage } from '@kbn/i18n/react';

import { TmsLayer } from 'ui/vis/map/service_settings';
import { Vis } from 'ui/vis';
import { RegionMapVisParams } from '../../../region_map/public/types';
import { SelectOption, SwitchOption } from '../../../kbn_vislib_vis_types/public/components';
import { RegionMapOptionsProps } from '../../../region_map/public/components/region_map_options';
import { WmsInternalOptions } from './wms_internal_options';
import { TileMapOptionsProps } from './tile_map_options';
import { TileMapVisParams } from '../types';
import { WMSOptions, TileMapVisParams } from '../types';

interface Props {
stateParams: TileMapVisParams | RegionMapVisParams;
setValue: (title: 'wms', options: WMSOptions) => void;
vis: Vis;
}

const mapLayerForOption = ({ id }: TmsLayer) => ({ text: id, value: id });

function WmsOptions({ stateParams, setValue, vis }: TileMapOptionsProps | RegionMapOptionsProps) {
function WmsOptions({ stateParams, setValue, vis }: Props) {
const { wms } = stateParams;
const { tmsLayers } = vis.type.editorConfig.collections;
const tmsLayerOptions = useMemo(() => tmsLayers.map(mapLayerForOption), [tmsLayers]);

const setWmsOption = <T extends keyof TileMapVisParams['wms']>(
paramName: T,
value: TileMapVisParams['wms'][T]
) =>
const setWmsOption = <T extends keyof WMSOptions>(paramName: T, value: WMSOptions[T]) =>
setValue('wms', {
...wms,
[paramName]: value,
Expand Down
27 changes: 23 additions & 4 deletions src/legacy/ui/public/vis/editors/default/controls/ranges.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@ import {
EuiSpacer,
EuiButtonEmpty,
EuiFormRow,
EuiToolTip,
EuiText,
} from '@elastic/eui';
import { FormattedMessage } from '@kbn/i18n/react';
import { i18n } from '@kbn/i18n';
Expand Down Expand Up @@ -154,15 +156,24 @@ function RangesParamEditor({
[isFromValid, isToValid] = validateRange({ from, to }, index);
}

const fromPrepend = i18n.translate(
const gtePrependLabel = i18n.translate(
'common.ui.aggTypes.ranges.greaterThanOrEqualPrepend',
{
defaultMessage: '\u2265',
}
);
const toPrepend = i18n.translate('common.ui.aggTypes.ranges.lessThanPrepend', {
const gteTooltipContent = i18n.translate(
'common.ui.aggTypes.ranges.greaterThanOrEqualTooltip',
{
defaultMessage: 'Greater than or equal to',
}
);
const ltPrependLabel = i18n.translate('common.ui.aggTypes.ranges.lessThanPrepend', {
defaultMessage: '\u003c',
});
const ltTooltipContent = i18n.translate('common.ui.aggTypes.ranges.lessThanTooltip', {
defaultMessage: 'Less than',
});

return (
<Fragment key={id}>
Expand All @@ -179,7 +190,11 @@ function RangesParamEditor({
fullWidth={true}
compressed={true}
isInvalid={!isFromValid}
prepend={fromPrepend}
prepend={
<EuiToolTip content={gteTooltipContent}>
<EuiText size="s">{gtePrependLabel}</EuiText>
</EuiToolTip>
}
/>
</EuiFlexItem>
<EuiFlexItem grow={false}>
Expand All @@ -197,7 +212,11 @@ function RangesParamEditor({
fullWidth={true}
compressed={true}
isInvalid={!isToValid}
prepend={toPrepend}
prepend={
<EuiToolTip content={ltTooltipContent}>
<EuiText size="s">{ltPrependLabel}</EuiText>
</EuiToolTip>
}
/>
</EuiFlexItem>
<EuiFlexItem grow={false}>
Expand Down
Loading

0 comments on commit 51e54e5

Please sign in to comment.