Skip to content

Commit

Permalink
Merge branch 'master' into fixes-searchbar-test
Browse files Browse the repository at this point in the history
  • Loading branch information
elasticmachine authored Jun 26, 2020
2 parents e727790 + f486801 commit d3d827c
Show file tree
Hide file tree
Showing 111 changed files with 1,484 additions and 1,426 deletions.
1 change: 1 addition & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ target
/x-pack/plugins/canvas/shareable_runtime/build
/x-pack/plugins/canvas/storybook
/x-pack/plugins/monitoring/public/lib/jquery_flot
/x-pack/plugins/reporting/server/export_types/printable_pdf/server/lib/pdf/assets/**
/x-pack/legacy/plugins/infra/common/graphql/types.ts
/x-pack/legacy/plugins/infra/public/graphql/types.ts
/x-pack/legacy/plugins/infra/server/graphql/types.ts
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<!-- Do not edit this file. It is automatically generated by API Documenter. -->

[Home](./index.md) &gt; [kibana-plugin-core-public](./kibana-plugin-core-public.md) &gt; [ChromeStart](./kibana-plugin-core-public.chromestart.md) &gt; [getCustomNavLink$](./kibana-plugin-core-public.chromestart.getcustomnavlink_.md)

## ChromeStart.getCustomNavLink$() method

Get an observable of the current custom nav link

<b>Signature:</b>

```typescript
getCustomNavLink$(): Observable<Partial<ChromeNavLink> | undefined>;
```
<b>Returns:</b>

`Observable<Partial<ChromeNavLink> | undefined>`

Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ core.chrome.setHelpExtension(elem => {
| [getBadge$()](./kibana-plugin-core-public.chromestart.getbadge_.md) | Get an observable of the current badge |
| [getBrand$()](./kibana-plugin-core-public.chromestart.getbrand_.md) | Get an observable of the current brand information. |
| [getBreadcrumbs$()](./kibana-plugin-core-public.chromestart.getbreadcrumbs_.md) | Get an observable of the current list of breadcrumbs |
| [getCustomNavLink$()](./kibana-plugin-core-public.chromestart.getcustomnavlink_.md) | Get an observable of the current custom nav link |
| [getHelpExtension$()](./kibana-plugin-core-public.chromestart.gethelpextension_.md) | Get an observable of the current custom help conttent |
| [getIsNavDrawerLocked$()](./kibana-plugin-core-public.chromestart.getisnavdrawerlocked_.md) | Get an observable of the current locked state of the nav drawer. |
| [getIsVisible$()](./kibana-plugin-core-public.chromestart.getisvisible_.md) | Get an observable of the current visibility state of the chrome. |
Expand All @@ -64,6 +65,7 @@ core.chrome.setHelpExtension(elem => {
| [setBadge(badge)](./kibana-plugin-core-public.chromestart.setbadge.md) | Override the current badge |
| [setBrand(brand)](./kibana-plugin-core-public.chromestart.setbrand.md) | Set the brand configuration. |
| [setBreadcrumbs(newBreadcrumbs)](./kibana-plugin-core-public.chromestart.setbreadcrumbs.md) | Override the current set of breadcrumbs |
| [setCustomNavLink(newCustomNavLink)](./kibana-plugin-core-public.chromestart.setcustomnavlink.md) | Override the current set of custom nav link |
| [setHelpExtension(helpExtension)](./kibana-plugin-core-public.chromestart.sethelpextension.md) | Override the current set of custom help content |
| [setHelpSupportUrl(url)](./kibana-plugin-core-public.chromestart.sethelpsupporturl.md) | Override the default support URL shown in the help menu |
| [setIsVisible(isVisible)](./kibana-plugin-core-public.chromestart.setisvisible.md) | Set the temporary visibility for the chrome. This does nothing if the chrome is hidden by default and should be used to hide the chrome for things like full-screen modes with an exit button. |
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
<!-- Do not edit this file. It is automatically generated by API Documenter. -->

[Home](./index.md) &gt; [kibana-plugin-core-public](./kibana-plugin-core-public.md) &gt; [ChromeStart](./kibana-plugin-core-public.chromestart.md) &gt; [setCustomNavLink](./kibana-plugin-core-public.chromestart.setcustomnavlink.md)

## ChromeStart.setCustomNavLink() method

Override the current set of custom nav link

<b>Signature:</b>

```typescript
setCustomNavLink(newCustomNavLink?: Partial<ChromeNavLink>): void;
```

## Parameters

| Parameter | Type | Description |
| --- | --- | --- |
| newCustomNavLink | <code>Partial&lt;ChromeNavLink&gt;</code> | |

<b>Returns:</b>

`void`

2 changes: 1 addition & 1 deletion docs/development/core/server/kibana-plugin-core-server.md
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ The plugin integrates with the core system via lifecycle events: `setup`<!-- -->
| [SavedObjectsBulkUpdateResponse](./kibana-plugin-core-server.savedobjectsbulkupdateresponse.md) | |
| [SavedObjectsClientProviderOptions](./kibana-plugin-core-server.savedobjectsclientprovideroptions.md) | Options to control the creation of the Saved Objects Client. |
| [SavedObjectsClientWrapperOptions](./kibana-plugin-core-server.savedobjectsclientwrapperoptions.md) | Options passed to each SavedObjectsClientWrapperFactory to aid in creating the wrapper instance. |
| [SavedObjectsComplexFieldMapping](./kibana-plugin-core-server.savedobjectscomplexfieldmapping.md) | See [SavedObjectsFieldMapping](./kibana-plugin-core-server.savedobjectsfieldmapping.md) for documentation. |
| [SavedObjectsComplexFieldMapping](./kibana-plugin-core-server.savedobjectscomplexfieldmapping.md) | See [SavedObjectsFieldMapping](./kibana-plugin-core-server.savedobjectsfieldmapping.md) for documentation.<!-- -->Note: this type intentially doesn't include a type definition for defining the <code>dynamic</code> mapping parameter. Saved Object fields should always inherit the <code>dynamic: 'strict'</code> paramater. If you are unsure of the shape of your data use <code>type: 'object', enabled: false</code> instead. |
| [SavedObjectsCoreFieldMapping](./kibana-plugin-core-server.savedobjectscorefieldmapping.md) | See [SavedObjectsFieldMapping](./kibana-plugin-core-server.savedobjectsfieldmapping.md) for documentation. |
| [SavedObjectsCreateOptions](./kibana-plugin-core-server.savedobjectscreateoptions.md) | |
| [SavedObjectsDeleteByNamespaceOptions](./kibana-plugin-core-server.savedobjectsdeletebynamespaceoptions.md) | |
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@

See [SavedObjectsFieldMapping](./kibana-plugin-core-server.savedobjectsfieldmapping.md) for documentation.

Note: this type intentially doesn't include a type definition for defining the `dynamic` mapping parameter. Saved Object fields should always inherit the `dynamic: 'strict'` paramater. If you are unsure of the shape of your data use `type: 'object', enabled: false` instead.

<b>Signature:</b>

```typescript
Expand All @@ -16,7 +18,6 @@ export interface SavedObjectsComplexFieldMapping

| Property | Type | Description |
| --- | --- | --- |
| [dynamic](./kibana-plugin-core-server.savedobjectscomplexfieldmapping.dynamic.md) | <code>string</code> | |
| [properties](./kibana-plugin-core-server.savedobjectscomplexfieldmapping.properties.md) | <code>SavedObjectsMappingProperties</code> | |
| [type](./kibana-plugin-core-server.savedobjectscomplexfieldmapping.type.md) | <code>string</code> | |

4 changes: 2 additions & 2 deletions docs/setup/connect-to-elasticsearch.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@ experimental[]
To visualize data in a CSV, JSON, or log file, you can upload it using the File
Data Visualizer. On the home page, click *Import a CSV, NDSON, or log file*, and
then drag your file into the File Data Visualizer. Alternatively, you can open
it by navigating to the Machine Learning app page from the sidebar menu and
selecting the Data Visualizer from the top navigation bar on the opening page.
it by navigating to *Machine Learning* from the side navigation and selecting
*Data Visualizer*.

[role="screenshot"]
image::images/data-viz-homepage.jpg[File Data Visualizer on the home page]
Expand Down
3 changes: 2 additions & 1 deletion scripts/backport.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,5 @@
*/

require('../src/setup_node_env/node_version_validator');
require('backport');
var backport = require('backport');
backport.run();
6 changes: 5 additions & 1 deletion src/core/server/saved_objects/mappings/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -145,10 +145,14 @@ export interface SavedObjectsCoreFieldMapping {
/**
* See {@link SavedObjectsFieldMapping} for documentation.
*
* Note: this type intentially doesn't include a type definition for defining
* the `dynamic` mapping parameter. Saved Object fields should always inherit
* the `dynamic: 'strict'` paramater. If you are unsure of the shape of your
* data use `type: 'object', enabled: false` instead.
*
* @public
*/
export interface SavedObjectsComplexFieldMapping {
dynamic?: string;
type?: string;
properties: SavedObjectsMappingProperties;
}
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,8 @@ function defaultMapping(): IndexMapping {
dynamic: 'strict',
properties: {
migrationVersion: {
// Saved Objects can't redefine dynamic, but we cheat here to support migrations
// @ts-expect-error
dynamic: 'true',
type: 'object',
},
Expand Down
2 changes: 0 additions & 2 deletions src/core/server/server.api.md
Original file line number Diff line number Diff line change
Expand Up @@ -1970,8 +1970,6 @@ export interface SavedObjectsClientWrapperOptions {

// @public
export interface SavedObjectsComplexFieldMapping {
// (undocumented)
dynamic?: string;
// (undocumented)
properties: SavedObjectsMappingProperties;
// (undocumented)
Expand Down
2 changes: 0 additions & 2 deletions src/dev/build/tasks/copy_source_task.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,7 @@ export const CopySourceTask = {
'!src/test_utils/**',
'!src/fixtures/**',
'!src/legacy/core_plugins/tests_bundle/**',
'!src/legacy/core_plugins/testbed/**',
'!src/legacy/core_plugins/console/public/tests/**',
'!src/plugins/testbed/**',
'!src/cli/cluster/**',
'!src/cli/repl/**',
'!src/es_archiver/**',
Expand Down
8 changes: 0 additions & 8 deletions src/legacy/core_plugins/testbed/README.md

This file was deleted.

30 changes: 0 additions & 30 deletions src/legacy/core_plugins/testbed/index.js

This file was deleted.

4 changes: 0 additions & 4 deletions src/legacy/core_plugins/testbed/package.json

This file was deleted.

20 changes: 0 additions & 20 deletions src/legacy/core_plugins/testbed/public/index.js

This file was deleted.

12 changes: 0 additions & 12 deletions src/legacy/core_plugins/testbed/public/testbed.html

This file was deleted.

29 changes: 0 additions & 29 deletions src/legacy/core_plugins/testbed/public/testbed.js

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -323,6 +323,7 @@ export class DiscoverHistogram extends Component<DiscoverHistogramProps, Discove
/>
<HistogramBarSeries
id="discover-histogram"
minBarHeight={2}
xScaleType={ScaleType.Time}
yScaleType={ScaleType.Linear}
xAccessor="x"
Expand Down
15 changes: 12 additions & 3 deletions src/plugins/discover/public/application/angular/discover.js
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ const {
} = getServices();

import { getRootBreadcrumbs, getSavedSearchBreadcrumbs } from '../helpers/breadcrumbs';
import { validateTimeRange } from '../helpers/validate_time_range';
import {
esFilters,
indexPatterns as indexPatternsUtils,
Expand Down Expand Up @@ -784,6 +785,10 @@ function discoverController(
if (!init.complete) return;
$scope.fetchCounter++;
$scope.fetchError = undefined;
if (!validateTimeRange(timefilter.getTime(), toastNotifications)) {
$scope.resultState = 'none';
return;
}

// Abort any in-progress requests before fetching again
if (abortController) abortController.abort();
Expand Down Expand Up @@ -916,14 +921,18 @@ function discoverController(
}

$scope.updateTime = function () {
//this is the timerange for the histogram, should be refactored
const { from, to } = timefilter.getTime();
// this is the timerange for the histogram, should be refactored
$scope.timeRange = {
from: dateMath.parse(timefilter.getTime().from),
to: dateMath.parse(timefilter.getTime().to, { roundUp: true }),
from: dateMath.parse(from),
to: dateMath.parse(to, { roundUp: true }),
};
};

$scope.toMoment = function (datetime) {
if (!datetime) {
return;
}
return moment(datetime).format(config.get('dateFormat'));
};

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
/*
* 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 { validateTimeRange } from './validate_time_range';
import { notificationServiceMock } from '../../../../../core/public/mocks';

describe('Discover validateTimeRange', () => {
test('validates given time ranges correctly', async () => {
const { toasts } = notificationServiceMock.createStartContract();
[
{ from: '', to: '', result: false },
{ from: 'now', to: 'now+1h', result: true },
{ from: 'now', to: 'lala+1h', result: false },
{ from: '', to: 'now', result: false },
{ from: 'now', to: '', result: false },
{ from: ' 2020-06-02T13:36:13.689Z', to: 'now', result: true },
{ from: ' 2020-06-02T13:36:13.689Z', to: '2020-06-02T13:36:13.690Z', result: true },
].map((test) => {
expect(validateTimeRange({ from: test.from, to: test.to }, toasts)).toEqual(test.result);
});
});

test('displays a toast when invalid data is entered', async () => {
const { toasts } = notificationServiceMock.createStartContract();
expect(validateTimeRange({ from: 'now', to: 'null' }, toasts)).toEqual(false);
expect(toasts.addDanger).toHaveBeenCalledWith({
title: 'Invalid time range',
text: "The provided time range is invalid. (from: 'now', to: 'null')",
});
});
});
Loading

0 comments on commit d3d827c

Please sign in to comment.