Skip to content

Commit

Permalink
Merge branch 'master' of github.com:elastic/kibana into feature/lensB…
Browse files Browse the repository at this point in the history
…yValue
  • Loading branch information
ThomThomson committed Aug 25, 2020
2 parents 719d67c + 75232a7 commit 3470c63
Show file tree
Hide file tree
Showing 238 changed files with 4,985 additions and 1,567 deletions.
69 changes: 61 additions & 8 deletions docs/canvas/canvas-function-reference.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ A *** denotes a required argument.

A † denotes an argument can be passed multiple times.

<<a_fns>> | B | <<c_fns>> | <<d_fns>> | <<e_fns>> | <<f_fns>> | <<g_fns>> | <<h_fns>> | <<i_fns>> | <<j_fns>> | K | <<l_fns>> | <<m_fns>> | <<n_fns>> | O | <<p_fns>> | Q | <<r_fns>> | <<s_fns>> | <<t_fns>> | <<u_fns>> | V | W | X | Y | Z
<<a_fns>> | B | <<c_fns>> | <<d_fns>> | <<e_fns>> | <<f_fns>> | <<g_fns>> | <<h_fns>> | <<i_fns>> | <<j_fns>> | K | <<l_fns>> | <<m_fns>> | <<n_fns>> | O | <<p_fns>> | Q | <<r_fns>> | <<s_fns>> | <<t_fns>> | <<u_fns>> | <<v_fns>> | W | X | Y | Z

[float]
[[a_fns]]
Expand Down Expand Up @@ -897,7 +897,7 @@ Default: `"-_index:.kibana"`
|`string`
|An index or index pattern. For example, `"logstash-*"`.

Default: `_all`
Default: `"_all"`
|===

*Returns:* `number`
Expand Down Expand Up @@ -965,7 +965,7 @@ Default: `1000`
|`string`
|An index or index pattern. For example, `"logstash-*"`.

Default: `_all`
Default: `"_all"`

|`metaFields`
|`string`
Expand Down Expand Up @@ -1026,7 +1026,7 @@ Alias: `tz`
|`string`
|The timezone to use for date operations. Valid ISO8601 formats and UTC offsets both work.

Default: `UTC`
Default: `"UTC"`
|===

*Returns:* `datatable`
Expand Down Expand Up @@ -1238,7 +1238,7 @@ filters
|`string`
|The horizontal text alignment.

Default: `left`
Default: `"left"`

|`color`
|`string`
Expand Down Expand Up @@ -1280,7 +1280,7 @@ Default: `false`
|`string`
|The font weight. For example, `"normal"`, `"bold"`, `"bolder"`, `"lighter"`, `"100"`, `"200"`, `"300"`, `"400"`, `"500"`, `"600"`, `"700"`, `"800"`, or `"900"`.

Default: `normal`
Default: `"normal"`
|===

*Returns:* `style`
Expand Down Expand Up @@ -2469,7 +2469,7 @@ Alias: `shape`
|`string`
|Pick a shape.

Default: `square`
Default: `"square"`

|`border`

Expand Down Expand Up @@ -2732,7 +2732,7 @@ Aliases: `c`, `field`
|`string`
|The column or field that you want to filter.

Default: `@timestamp`
Default: `"@timestamp"`

|`compact`
|`boolean`
Expand Down Expand Up @@ -2871,3 +2871,56 @@ Default: `""`
|===

*Returns:* `string`

[float]
[[v_fns]]
== V

[float]
[[var_fn]]
=== `var`

Updates the Kibana global context.

*Accepts:* `any`

[cols="3*^<"]
|===
|Argument |Type |Description

|_Unnamed_ ***

Alias: `name`
|`string`
|Specify the name of the variable.
|===

*Returns:* Depends on your input and arguments


[float]
[[var_set_fn]]
=== `var_set`

Updates the Kibana global context.

*Accepts:* `any`

[cols="3*^<"]
|===
|Argument |Type |Description

|_Unnamed_ ***

Alias: `name`
|`string`
|Specify the name of the variable.

|`value`

Alias: `val`
|`any`
|Specify the value for the variable. When unspecified, the input context is used.
|===

*Returns:* Depends on your input and arguments
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,13 @@ Constructs a new instance of the `IndexPattern` class
<b>Signature:</b>

```typescript
constructor(id: string | undefined, { getConfig, savedObjectsClient, apiClient, patternCache, fieldFormats, onNotification, onError, uiSettingsValues, }: IndexPatternDeps);
constructor(id: string | undefined, { savedObjectsClient, apiClient, patternCache, fieldFormats, onNotification, onError, shortDotsEnable, metaFields, }: IndexPatternDeps);
```

## Parameters

| Parameter | Type | Description |
| --- | --- | --- |
| id | <code>string &#124; undefined</code> | |
| { getConfig, savedObjectsClient, apiClient, patternCache, fieldFormats, onNotification, onError, uiSettingsValues, } | <code>IndexPatternDeps</code> | |
| { savedObjectsClient, apiClient, patternCache, fieldFormats, onNotification, onError, shortDotsEnable, metaFields, } | <code>IndexPatternDeps</code> | |

Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ export declare class IndexPattern implements IIndexPattern
| Constructor | Modifiers | Description |
| --- | --- | --- |
| [(constructor)(id, { getConfig, savedObjectsClient, apiClient, patternCache, fieldFormats, onNotification, onError, uiSettingsValues, })](./kibana-plugin-plugins-data-public.indexpattern._constructor_.md) | | Constructs a new instance of the <code>IndexPattern</code> class |
| [(constructor)(id, { savedObjectsClient, apiClient, patternCache, fieldFormats, onNotification, onError, shortDotsEnable, metaFields, })](./kibana-plugin-plugins-data-public.indexpattern._constructor_.md) | | Constructs a new instance of the <code>IndexPattern</code> class |
## Properties
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@

```typescript
setup(core: CoreSetup<DataPluginStartDependencies, DataPluginStart>, { expressions, usageCollection }: DataPluginSetupDependencies): {
__enhance: (enhancements: DataEnhancements) => void;
search: ISearchSetup;
fieldFormats: {
register: (customFieldFormat: import("../public").FieldFormatInstanceType) => number;
Expand All @@ -25,6 +26,7 @@ setup(core: CoreSetup<DataPluginStartDependencies, DataPluginStart>, { expressio
<b>Returns:</b>

`{
__enhance: (enhancements: DataEnhancements) => void;
search: ISearchSetup;
fieldFormats: {
register: (customFieldFormat: import("../public").FieldFormatInstanceType) => number;
Expand Down
4 changes: 2 additions & 2 deletions examples/embeddable_examples/public/book/edit_book_action.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -65,8 +65,8 @@ export const createEditBookAction = (getStartServices: () => Promise<StartServic
const onSave = async (attributes: BookSavedObjectAttributes, useRefType: boolean) => {
const newInput = await attributeService.wrapAttributes(attributes, useRefType, embeddable);
if (!useRefType && (embeddable.getInput() as SavedObjectEmbeddableInput).savedObjectId) {
// Remove the savedObejctId when un-linking
newInput.savedObjectId = null;
// Set the saved object ID to null so that update input will remove the existing savedObjectId...
(newInput as BookByValueInput & { savedObjectId: unknown }).savedObjectId = null;
}
embeddable.updateInput(newInput);
if (useRefType) {
Expand Down
21 changes: 10 additions & 11 deletions examples/embeddable_explorer/public/list_container_example.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -29,18 +29,17 @@ import {
EuiText,
EuiTitle,
} from '@elastic/eui';
import {
EmbeddableInput,
EmbeddableRenderer,
ViewMode,
} from '../../../src/plugins/embeddable/public';
import { EmbeddableRenderer, ViewMode } from '../../../src/plugins/embeddable/public';
import {
HELLO_WORLD_EMBEDDABLE,
MULTI_TASK_TODO_EMBEDDABLE,
TODO_EMBEDDABLE,
ListContainerFactory,
SearchableListContainerFactory,
} from '../../embeddable_examples/public';
import { SearchableContainerInput } from '../../embeddable_examples/public/searchable_list_container/searchable_list_container';
import { TodoInput } from '../../embeddable_examples/public/todo';
import { MultiTaskTodoInput } from '../../embeddable_examples/public/multi_task_todo';

interface Props {
listContainerEmbeddableFactory: ListContainerFactory;
Expand All @@ -51,7 +50,7 @@ export function ListContainerExample({
listContainerEmbeddableFactory,
searchableListContainerEmbeddableFactory,
}: Props) {
const listInput: EmbeddableInput = {
const listInput: SearchableContainerInput = {
id: 'hello',
title: 'My todo list',
viewMode: ViewMode.VIEW,
Expand All @@ -69,20 +68,20 @@ export function ListContainerExample({
task: 'Goes out on Wednesdays!',
icon: 'broom',
title: 'Take out the trash',
},
} as TodoInput,
},
'3': {
type: TODO_EMBEDDABLE,
explicitInput: {
id: '3',
icon: 'broom',
title: 'Vaccum the floor',
},
} as TodoInput,
},
},
};

const searchableInput: EmbeddableInput = {
const searchableInput: SearchableContainerInput = {
id: '1',
title: 'My searchable todo list',
viewMode: ViewMode.VIEW,
Expand All @@ -101,7 +100,7 @@ export function ListContainerExample({
task: 'Goes out on Wednesdays!',
icon: 'broom',
title: 'Take out the trash',
},
} as TodoInput,
},
'3': {
type: MULTI_TASK_TODO_EMBEDDABLE,
Expand All @@ -110,7 +109,7 @@ export function ListContainerExample({
icon: 'searchProfilerApp',
title: 'Learn more',
tasks: ['Go to school', 'Watch planet earth', 'Read the encyclopedia'],
},
} as MultiTaskTodoInput,
},
},
};
Expand Down
6 changes: 3 additions & 3 deletions src/dev/build/tasks/os_packages/docker_generator/run.ts
Original file line number Diff line number Diff line change
Expand Up @@ -58,8 +58,8 @@ export async function runDockerGenerator(
'kibana-docker',
build.isOss() ? `oss` : `default${ubiImageFlavor}`
);
const dockerOutputDir = config.resolveFromTarget(
`kibana${imageFlavor}${ubiImageFlavor}-${version}-docker.tar.gz`
const dockerTargetFilename = config.resolveFromTarget(
`kibana${imageFlavor}${ubiImageFlavor}-${version}-docker-image.tar.gz`
);
const scope: TemplateContext = {
artifactTarball,
Expand All @@ -69,7 +69,7 @@ export async function runDockerGenerator(
artifactsDir,
imageTag,
dockerBuildDir,
dockerOutputDir,
dockerTargetFilename,
baseOSImage,
ubiImageFlavor,
dockerBuildDate,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ export interface TemplateContext {
artifactsDir: string;
imageTag: string;
dockerBuildDir: string;
dockerOutputDir: string;
dockerTargetFilename: string;
baseOSImage: string;
ubiImageFlavor: string;
dockerBuildDate: string;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ function generator({
imageTag,
imageFlavor,
version,
dockerOutputDir,
dockerTargetFilename,
baseOSImage,
ubiImageFlavor,
}: TemplateContext) {
Expand All @@ -41,7 +41,7 @@ function generator({
echo "Building: kibana${imageFlavor}${ubiImageFlavor}-docker"; \\
docker build -t ${imageTag}${imageFlavor}${ubiImageFlavor}:${version} -f Dockerfile . || exit 1;
docker save ${imageTag}${imageFlavor}${ubiImageFlavor}:${version} | gzip -c > ${dockerOutputDir}
docker save ${imageTag}${imageFlavor}${ubiImageFlavor}:${version} | gzip -c > ${dockerTargetFilename}
exit 0
`);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,12 @@
* specific language governing permissions and limitations
* under the License.
*/
import { isErrorEmbeddable, IContainer, ReferenceOrValueEmbeddable } from '../../embeddable_plugin';
import {
isErrorEmbeddable,
IContainer,
ReferenceOrValueEmbeddable,
EmbeddableInput,
} from '../../embeddable_plugin';
import { DashboardContainer } from '../embeddable';
import { getSampleDashboardInput } from '../test_helpers';
import {
Expand Down Expand Up @@ -145,7 +150,7 @@ test('Add to library returns reference type input', async () => {

embeddable = embeddablePluginMock.mockRefOrValEmbeddable<ContactCardEmbeddable>(embeddable, {
mockedByReferenceInput: { savedObjectId: 'testSavedObjectId', id: embeddable.id },
mockedByValueInput: { attributes: complicatedAttributes, id: embeddable.id },
mockedByValueInput: { attributes: complicatedAttributes, id: embeddable.id } as EmbeddableInput,
});
const dashboard = embeddable.getRoot() as IContainer;
const originalPanelKeySet = new Set(Object.keys(dashboard.getInput().panels));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,11 @@ import _ from 'lodash';
import { ActionByType, IncompatibleActionError } from '../../ui_actions_plugin';
import { ViewMode, PanelState, IEmbeddable } from '../../embeddable_plugin';
import { SavedObject } from '../../../../saved_objects/public';
import { PanelNotFoundError, EmbeddableInput } from '../../../../embeddable/public';
import {
PanelNotFoundError,
EmbeddableInput,
SavedObjectEmbeddableInput,
} from '../../../../embeddable/public';
import {
placePanelBeside,
IPanelPlacementBesideArgs,
Expand Down Expand Up @@ -143,7 +147,7 @@ export class ClonePanelAction implements ActionByType<typeof ACTION_CLONE_PANEL>
},
{ references: _.cloneDeep(savedObjectToClone.references) }
);
panelState.explicitInput.savedObjectId = clonedSavedObject.id;
(panelState.explicitInput as SavedObjectEmbeddableInput).savedObjectId = clonedSavedObject.id;
}
this.core.notifications.toasts.addSuccess({
title: i18n.translate('dashboard.panel.clonedToast', {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ import { coreMock } from '../../../../../core/public/mocks';
import { CoreStart } from 'kibana/public';
import { UnlinkFromLibraryAction } from '.';
import { embeddablePluginMock } from 'src/plugins/embeddable/public/mocks';
import { ViewMode } from '../../../../embeddable/public';
import { ViewMode, SavedObjectEmbeddableInput } from '../../../../embeddable/public';

const { setup, doStart } = embeddablePluginMock.createInstance();
setup.registerEmbeddableFactory(
Expand Down Expand Up @@ -142,7 +142,11 @@ test('Unlink unwraps all attributes from savedObject', async () => {
attribute4: { nestedattribute: 'hello from the nest' },
};

embeddable = embeddablePluginMock.mockRefOrValEmbeddable<ContactCardEmbeddable>(embeddable, {
embeddable = embeddablePluginMock.mockRefOrValEmbeddable<
ContactCardEmbeddable,
{ attributes: unknown; id: string },
SavedObjectEmbeddableInput
>(embeddable, {
mockedByReferenceInput: { savedObjectId: 'testSavedObjectId', id: embeddable.id },
mockedByValueInput: { attributes: complicatedAttributes, id: embeddable.id },
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ import {
} from './embeddable_saved_object_converters';
import { SavedDashboardPanel } from '../../types';
import { DashboardPanelState } from '../embeddable';
import { EmbeddableInput } from '../../../../embeddable/public';

test('convertSavedDashboardPanelToPanelState', () => {
const savedDashboardPanel: SavedDashboardPanel = {
Expand Down Expand Up @@ -93,7 +94,7 @@ test('convertPanelStateToSavedDashboardPanel', () => {
something: 'hi!',
id: '123',
savedObjectId: 'savedObjectId',
},
} as EmbeddableInput,
type: 'search',
};

Expand Down Expand Up @@ -127,7 +128,7 @@ test('convertPanelStateToSavedDashboardPanel will not add an undefined id when n
explicitInput: {
id: '123',
something: 'hi!',
},
} as EmbeddableInput,
type: 'search',
};

Expand Down
Loading

0 comments on commit 3470c63

Please sign in to comment.