Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/master' into nls/ttype
Browse files Browse the repository at this point in the history
  • Loading branch information
ogupte committed Dec 17, 2020
2 parents 5e74652 + 755dc7e commit e2de0f7
Show file tree
Hide file tree
Showing 208 changed files with 2,638 additions and 1,767 deletions.
Empty file removed data/.empty
Empty file.
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,15 @@
<b>Signature:</b>

```typescript
setup(core: CoreSetup<DataStartDependencies, DataPublicPluginStart>, { bfetch, expressions, uiActions, usageCollection }: DataSetupDependencies): DataPublicPluginSetup;
setup(core: CoreSetup<DataStartDependencies, DataPublicPluginStart>, { bfetch, expressions, uiActions, usageCollection, inspector }: DataSetupDependencies): DataPublicPluginSetup;
```

## Parameters

| Parameter | Type | Description |
| --- | --- | --- |
| core | <code>CoreSetup&lt;DataStartDependencies, DataPublicPluginStart&gt;</code> | |
| { bfetch, expressions, uiActions, usageCollection } | <code>DataSetupDependencies</code> | |
| { bfetch, expressions, uiActions, usageCollection, inspector } | <code>DataSetupDependencies</code> | |

<b>Returns:</b>

Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,5 @@ export interface Adapters

| Property | Type | Description |
| --- | --- | --- |
| [data](./kibana-plugin-plugins-embeddable-public.adapters.data.md) | <code>DataAdapter</code> | |
| [requests](./kibana-plugin-plugins-embeddable-public.adapters.requests.md) | <code>RequestAdapter</code> | |

Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
| [ExpressionsService](./kibana-plugin-plugins-expressions-public.expressionsservice.md) | <code>ExpressionsService</code> class is used for multiple purposes:<!-- -->1. It implements the same Expressions service that can be used on both: (1) server-side and (2) browser-side. 2. It implements the same Expressions service that users can fork/clone, thus have their own instance of the Expressions plugin. 3. <code>ExpressionsService</code> defines the public contracts of \*setup\* and \*start\* Kibana Platform life-cycles for ease-of-use on server-side and browser-side. 4. <code>ExpressionsService</code> creates a bound version of all exported contract functions. 5. Functions are bound the way there are:<!-- -->\`\`\`<!-- -->ts registerFunction = (...args: Parameters<!-- -->&lt;<!-- -->Executor\['registerFunction'\]<!-- -->&gt; ): ReturnType<!-- -->&lt;<!-- -->Executor\['registerFunction'\]<!-- -->&gt; =<!-- -->&gt; this.executor.registerFunction(...args); \`\`\`<!-- -->so that JSDoc appears in developers IDE when they use those <code>plugins.expressions.registerFunction(</code>. |
| [ExpressionType](./kibana-plugin-plugins-expressions-public.expressiontype.md) | |
| [FunctionsRegistry](./kibana-plugin-plugins-expressions-public.functionsregistry.md) | |
| [TablesAdapter](./kibana-plugin-plugins-expressions-public.tablesadapter.md) | |
| [TypesRegistry](./kibana-plugin-plugins-expressions-public.typesregistry.md) | |

## Enumerations
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
<!-- Do not edit this file. It is automatically generated by API Documenter. -->

[Home](./index.md) &gt; [kibana-plugin-plugins-expressions-public](./kibana-plugin-plugins-expressions-public.md) &gt; [TablesAdapter](./kibana-plugin-plugins-expressions-public.tablesadapter.md) &gt; [logDatatable](./kibana-plugin-plugins-expressions-public.tablesadapter.logdatatable.md)

## TablesAdapter.logDatatable() method

<b>Signature:</b>

```typescript
logDatatable(name: string, datatable: Datatable): void;
```

## Parameters

| Parameter | Type | Description |
| --- | --- | --- |
| name | <code>string</code> | |
| datatable | <code>Datatable</code> | |

<b>Returns:</b>

`void`

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-plugins-expressions-public](./kibana-plugin-plugins-expressions-public.md) &gt; [TablesAdapter](./kibana-plugin-plugins-expressions-public.tablesadapter.md)

## TablesAdapter class

<b>Signature:</b>

```typescript
export declare class TablesAdapter extends EventEmitter
```
## Properties
| Property | Modifiers | Type | Description |
| --- | --- | --- | --- |
| [tables](./kibana-plugin-plugins-expressions-public.tablesadapter.tables.md) | | <code>{</code><br/><code> [key: string]: Datatable;</code><br/><code> }</code> | |
## Methods
| Method | Modifiers | Description |
| --- | --- | --- |
| [logDatatable(name, datatable)](./kibana-plugin-plugins-expressions-public.tablesadapter.logdatatable.md) | | |
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<!-- Do not edit this file. It is automatically generated by API Documenter. -->

[Home](./index.md) &gt; [kibana-plugin-plugins-expressions-public](./kibana-plugin-plugins-expressions-public.md) &gt; [TablesAdapter](./kibana-plugin-plugins-expressions-public.tablesadapter.md) &gt; [tables](./kibana-plugin-plugins-expressions-public.tablesadapter.tables.md)

## TablesAdapter.tables property

<b>Signature:</b>

```typescript
get tables(): {
[key: string]: Datatable;
};
```
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/management/images/tags/create-tag.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
75 changes: 75 additions & 0 deletions docs/management/managing-tags.asciidoc
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
[role="xpack"]
[[managing-tags]]
== Tags

Tags enable you to categorize your saved objects. You can then easily filter for related objects based on shared tags.

To begin, open the main menu, click *Stack Management*, then click *Tags*.

[role="screenshot"]
image::images/tags/tag-management-section.png[Tags management section]

[float]
=== Required permissions

Access to *Tags* requires the `Tag Management` {kib} privilege. To add the privilege, open the menu,
click *Stack Management*, then click *Roles*.

In addition:

* The `read` privilege allows you to assign tags to the saved objects for which you have write permission.
* The `write` privilege enables you to create, edit, and delete tags.


NOTE: Having the `Tag Management` {kib} privilege is not required to
view tags assigned on objects the user has `read` access to, or to filter objects by tags
in {kib} applications or from the navigational search.

[float]
[[settings-create-tag]]
=== Create a tag

Create a tag to assign to your saved objects.

. Click *Create tag*.
+
[role="screenshot"]
image::images/tags/create-tag.png[Tag creation popin]
. Enter a name and select a color for the new tag.
+
The name can include alphanumeric characters (English letters and digits), `:`, `-`, `_` and the space character,
and cannot be longer than 50 characters.
. Click *Create tag*.

[float]
[[settings-assign-tag]]
=== Assign a tag to saved objects

Assign or remove tags to one or more saved objects. You must have `write` permission
on the objects to which you assign the tags.

. Click the action (...) icon in the tag row, and then select the *Manage assignments* action.
+
[role="screenshot"]
image::images/tags/manage-assignments-flyout.png[Assign flyout]
. Select the objects to which you want to assign or remove tags.
. Click on *Save tag assignments*.

TIP: To assign multiple tags to objects at once, select their checkboxes
and then select *Manage tag assignments* from the *selected tags* menu.

[role="screenshot"]
image::images/tags/bulk-assign-selection.png[Bulk assign tags]

[float]
[[settings-delete-tag]]
=== Delete a tag

Delete a tag and remove it from any saved objects.

. Click the action (...) icon in the tag row, and then select the *Delete* action.

. Click *Delete tag*.

TIP: To delete multiple tags at once, select their checkboxes in the list view,
and then select *Delete* action from the *selected tags* menu.
5 changes: 5 additions & 0 deletions docs/user/management.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,9 @@ a| <<index-patterns, Index Patterns>>
| Copy, edit, delete, import, and export your saved objects.
These include dashboards, visualizations, maps, index patterns, Canvas workpads, and more.

| <<managing-tags, Tags>>
|Create, manage, and assign tags to your saved objects.

| <<xpack-spaces, Spaces>>
| Create spaces to organize your dashboards and other saved objects into categories.
A space is isolated from all other spaces,
Expand Down Expand Up @@ -196,6 +199,8 @@ include::{kib-repo-dir}/management/rollups/create_and_manage_rollups.asciidoc[]

include::{kib-repo-dir}/management/managing-saved-objects.asciidoc[]

include::{kib-repo-dir}/management/managing-tags.asciidoc[]

include::security/index.asciidoc[]

include::{kib-repo-dir}/management/snapshot-restore/index.asciidoc[]
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -609,7 +609,7 @@
"cpy": "^8.1.1",
"cronstrue": "^1.51.0",
"css-loader": "^3.4.2",
"cypress": "^6.0.1",
"cypress": "^6.1.0",
"cypress-cucumber-preprocessor": "^2.5.2",
"cypress-multi-reporters": "^1.4.0",
"d3": "3.5.17",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -226,7 +226,7 @@ describe('migration actions', () => {
}
`);
});
it('resolves right after waiting for index status to be green if clone target already existed', async () => {
it.skip('resolves right after waiting for index status to be green if clone target already existed', async () => {
// Create a yellow index
await client.indices.create({
index: 'yellow_then_green_index',
Expand Down Expand Up @@ -872,7 +872,7 @@ describe('migration actions', () => {
afterAll(async () => {
await client.indices.delete({ index: 'yellow_then_green_index' });
});
it('resolves right after waiting for an index status to be green if the index already existed', async () => {
it.skip('resolves right after waiting for an index status to be green if the index already existed', async () => {
// Create a yellow index
await client.indices.create(
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ case $1 in
--gid "<%= group %>" \
--shell /sbin/nologin \
--comment "kibana service user" \
"<%= user %>" \
"<%= user %>"
echo " OK"
fi

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ export class ExportCSVAction implements ActionByType<typeof ACTION_EXPORT_CSV> {
}

private hasDatatableContent = (adapters: Adapters | undefined) => {
return Object.keys(adapters?.tables || {}).length > 0;
return Object.keys(adapters?.tables || {}).length > 0 && adapters!.tables.allowCsvExport;
};

private getFormatter = (): FormatFactory | undefined => {
Expand All @@ -76,7 +76,7 @@ export class ExportCSVAction implements ActionByType<typeof ACTION_EXPORT_CSV> {

private getDataTableContent = (adapters: Adapters | undefined) => {
if (this.hasDatatableContent(adapters)) {
return adapters?.tables;
return adapters?.tables.tables;
}
return;
};
Expand Down
2 changes: 1 addition & 1 deletion src/plugins/dashboard/public/dashboard_strings.ts
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ export const dashboardExportCsvAction = {
}),
getUntitledFilename: () =>
i18n.translate('dashboard.actions.downloadOptionsUnsavedFilename', {
defaultMessage: 'unsaved',
defaultMessage: 'untitled',
}),
};

Expand Down
2 changes: 1 addition & 1 deletion src/plugins/data/common/es_query/kuery/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
*/

export { KQLSyntaxError } from './kuery_syntax_error';
export { nodeTypes } from './node_types';
export { nodeTypes, nodeBuilder } from './node_types';
export * from './ast';

export * from './types';
1 change: 1 addition & 0 deletions src/plugins/data/common/es_query/kuery/node_types/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ import * as wildcard from './wildcard';
import { NodeTypes } from './types';

export { NodeTypes };
export { nodeBuilder } from './node_builder';

export const nodeTypes: NodeTypes = {
// This requires better typing of the different typings and their return types.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,24 +16,23 @@
* specific language governing permissions and limitations
* under the License.
*/
import { lazy } from 'react';
import { i18n } from '@kbn/i18n';

import { InspectorViewDescription } from '../../types';
import { Adapters } from '../../../common';
import { KueryNode, nodeTypes } from '../types';

const DataViewComponent = lazy(() => import('./components/data_view'));

export const getDataViewDescription = (): InspectorViewDescription => ({
title: i18n.translate('inspector.data.dataTitle', {
defaultMessage: 'Data',
}),
order: 10,
help: i18n.translate('inspector.data.dataDescriptionTooltip', {
defaultMessage: 'View the data behind the visualization',
}),
shouldShow(adapters: Adapters) {
return Boolean(adapters.data);
export const nodeBuilder = {
is: (fieldName: string, value: string | KueryNode) => {
return nodeTypes.function.buildNodeWithArgumentNodes('is', [
nodeTypes.literal.buildNode(fieldName),
typeof value === 'string' ? nodeTypes.literal.buildNode(value) : value,
nodeTypes.literal.buildNode(false),
]);
},
or: ([first, ...args]: KueryNode[]): KueryNode => {
return args.length ? nodeTypes.function.buildNode('or', [first, nodeBuilder.or(args)]) : first;
},
and: ([first, ...args]: KueryNode[]): KueryNode => {
return args.length
? nodeTypes.function.buildNode('and', [first, nodeBuilder.and(args)])
: first;
},
component: DataViewComponent,
});
};
3 changes: 2 additions & 1 deletion src/plugins/data/common/search/aggs/aggs_service.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -203,11 +203,12 @@ describe('Aggs service', () => {
describe('start()', () => {
test('exposes proper contract', () => {
const start = service.start(startDeps);
expect(Object.keys(start).length).toBe(4);
expect(Object.keys(start).length).toBe(5);
expect(start).toHaveProperty('calculateAutoTimeExpression');
expect(start).toHaveProperty('getDateMetaByDatatableColumn');
expect(start).toHaveProperty('createAggConfigs');
expect(start).toHaveProperty('types');
expect(start).toHaveProperty('datatableUtilities');
});

test('types registry returns uninitialized type providers', () => {
Expand Down
23 changes: 17 additions & 6 deletions src/plugins/data/common/search/aggs/aggs_service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
*/

import { ExpressionsServiceSetup } from 'src/plugins/expressions/common';
import { IndexPattern, UI_SETTINGS } from '../../../common';
import { CreateAggConfigParams, IndexPattern, UI_SETTINGS } from '../../../common';
import { GetConfigFn } from '../../types';
import {
AggConfigs,
Expand All @@ -29,6 +29,7 @@ import {
} from './';
import { AggsCommonSetup, AggsCommonStart } from './types';
import { getDateMetaByDatatableColumn } from './utils/time_column_meta';
import { getDatatableColumnUtilities } from './utils/datatable_column_meta';

/** @internal */
export const aggsRequiredUiSettings = [
Expand Down Expand Up @@ -88,6 +89,15 @@ export class AggsCommonService {
const aggTypesStart = this.aggTypesRegistry.start();
const calculateAutoTimeExpression = getCalculateAutoTimeExpression(getConfig);

const createAggConfigs = (
indexPattern: IndexPattern,
configStates?: CreateAggConfigParams[]
) => {
return new AggConfigs(indexPattern, configStates, {
typesRegistry: aggTypesStart,
});
};

return {
calculateAutoTimeExpression,
getDateMetaByDatatableColumn: getDateMetaByDatatableColumn({
Expand All @@ -96,11 +106,12 @@ export class AggsCommonService {
getConfig,
isDefaultTimezone,
}),
createAggConfigs: (indexPattern, configStates = [], schemas) => {
return new AggConfigs(indexPattern, configStates, {
typesRegistry: aggTypesStart,
});
},
datatableUtilities: getDatatableColumnUtilities({
getIndexPattern,
createAggConfigs,
aggTypesStart,
}),
createAggConfigs,
types: aggTypesStart,
};
}
Expand Down
Loading

0 comments on commit e2de0f7

Please sign in to comment.