Skip to content

Commit

Permalink
Merge branch 'master' into uptime_remove-eslint-overrides
Browse files Browse the repository at this point in the history
  • Loading branch information
elasticmachine authored Dec 20, 2019
2 parents 95db04f + b8233ad commit 4e0905a
Show file tree
Hide file tree
Showing 871 changed files with 12,314 additions and 5,338 deletions.
10 changes: 10 additions & 0 deletions .github/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,16 @@
/src/plugins/share/ @elastic/kibana-app
/src/legacy/server/url_shortening/ @elastic/kibana-app
/src/legacy/server/sample_data/ @elastic/kibana-app
/src/legacy/core_plugins/kibana/public/dashboard/ @elastic/kibana-app
/src/legacy/core_plugins/kibana/public/discover/ @elastic/kibana-app
/src/legacy/core_plugins/kibana/public/visualize/ @elastic/kibana-app
/src/legacy/core_plugins/kibana/public/local_application_service/ @elastic/kibana-app
/src/legacy/core_plugins/kibana/public/home/ @elastic/kibana-app
/src/legacy/core_plugins/kibana/public/dev_tools/ @elastic/kibana-app
/src/plugins/home/ @elastic/kibana-app
/src/plugins/kibana_legacy/ @elastic/kibana-app
/src/plugins/timelion/ @elastic/kibana-app
/src/plugins/dev_tools/ @elastic/kibana-app

# App Architecture
/src/plugins/data/ @elastic/kibana-app-arch
Expand Down
3 changes: 2 additions & 1 deletion .github/workflows/pr-project-assigner.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ jobs:
[
{ "label": "Team:AppArch", "projectName": "kibana-app-arch", "columnId": 6173897 },
{ "label": "Feature:Lens", "projectName": "Lens", "columnId": 6219362 },
{ "label": "Team:Platform", "projectName": "kibana-platform", "columnId": 5514360 }
{ "label": "Team:Platform", "projectName": "kibana-platform", "columnId": 5514360 },
{"label": "Team:Canvas", "projectName": "canvas", "columnId": 6187580}
]
ghToken: ${{ secrets.GITHUB_TOKEN }}
4 changes: 2 additions & 2 deletions .github/workflows/project-assigner.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ jobs:
uses: elastic/github-actions/project-assigner@v1.0.0
id: project_assigner
with:
issue-mappings: '[{"label": "Team:AppArch", "projectName": "kibana-app-arch", "columnId": 6173895}, {"label": "Feature:Lens", "projectName": "Lens", "columnId": 6219363}]'
issue-mappings: '[{"label": "Team:AppArch", "projectName": "kibana-app-arch", "columnId": 6173895}, {"label": "Feature:Lens", "projectName": "Lens", "columnId": 6219363}, {"label": "Team:Canvas", "projectName": "canvas", "columnId": 6187593}]'
ghToken: ${{ secrets.GITHUB_TOKEN }}


1 change: 1 addition & 0 deletions .i18nrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
"embeddableApi": "src/plugins/embeddable",
"embeddableExamples": "examples/embeddable_examples",
"share": "src/plugins/share",
"home": "src/plugins/home",
"esUi": "src/plugins/es_ui_shared",
"devTools": "src/plugins/dev_tools",
"expressions": "src/plugins/expressions",
Expand Down
56 changes: 26 additions & 30 deletions docs/canvas/canvas-elements.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -20,80 +20,76 @@ When you add elements to your workpad, you can:
[[add-canvas-element]]
=== Add elements to your workpad

Choose the elements to display on your workpad, then familiarize yourself with the element using the preconfigured demo data.
Choose the elements to display on your workpad, then familiarize yourself with the element using the preconfigured demo data. By default, every element you add to a workpad uses demo data until you change the data source. The demo data includes a small sample data set that you can use to experiment with your element.

. Click *Add element*.

. In the *Elements* window, select the element you want to use.
. In the *Elements* window, select the element you want to use.
+
[role="screenshot"]
image::images/canvas-element-select.gif[Canvas elements]

. Play around with the default settings and see what the element can do.
. Play around with the default settings and see what the element can do.

TIP: Want to use a different element? You can delete the element by selecting it, clicking the *Element options* icon in the top right corner, then selecting *Delete*.
TIP: Want to use a different element? You can delete the element by selecting it, clicking the *Element options* icon in the top right, then selecting *Delete*.

[float]
[[connect-element-data]]
=== Connect the element to your data

When you are ready to move on from the demo data, connect the element to your own data.
When you have finished using the demo data, connect the element to a data source.

. Make sure that the element is selected, then select *Data*.

. Click *Change your data source*.

[float]
[[elasticsearch-sql-data-source]]
==== Connect to Elasticsearch SQL
==== Connect to {es} SQL

Access your data in Elasticsearch using the Elasticsearch SQL syntax.
Access your data in {es} using SQL syntax. For information about SQL syntax, refer to {ref}/sql-spec.html[SQL language].

Unfamiliar with writing Elasticsearch SQL queries? For more information, refer to {ref}/sql-spec.html[SQL language].
. Click *{es} SQL*.

. Click *Elasticsearch SQL*.
. In the *{es} SQL query* box, enter your query, then *Preview* it.

. In the *Elasticearch SQL query* box, enter your query, then *Preview* it.

. If everything looks correct, *Save* it.
. If everything looks correct, *Save* it.

[float]
[[elasticsearch-raw-doc-data-source]]
==== Connect to Elasticsearch raw data
==== Connect to {es} raw data

Use the Lucene query syntax to use your raw data in Elasticsearch.
Access your raw data in {es} without the use of aggregations. Use {es} raw data when you have low volume datasets, or to plot exact, non-aggregated values.

For for more information about the Lucene query string sytax, refer to <<lucene-query,Lucene Query Syntax>>.
To use targeted queries, you can enter a query using the <<lucene-query,Lucene Query Syntax>>.

. Click *Elasticsearch raw documents*.
. Click *{es} raw documents*.

. In the *Index* field, enter the index pattern that you want to display.
. In the *Index* field, enter the index pattern that you want to display.

. From the *Fields* dropdown, select the associated fields you want to display.

. To sort the data, select an option from the *Sort Field* and *Sort Order* dropdowns.

. For more targeted queries, enter a *Query* using the Lucene query string syntax.
. For more targeted queries, enter a *Query* using the Lucene query string syntax.

. *Preview* the query.
. *Preview* the query.

. If your query looks correct, *Save* it.
. If your query looks correct, *Save* it.

[float]
[[timelion-data-source]]
==== Connect to Timelion

Use <<timelion,Timelion>> queries to use your time series data.
Access your time series data using <<timelion,Timelion>> queries. To use Timelion queries, you can enter a query using the <<lucene-query,Lucene Query Syntax>>.

. Click *Timelion*.

. Enter a *Query* using the Lucene query string syntax.
+
For for more information about the Lucene query string syntax, refer to <<lucene-query,Lucene Query Syntax>>.
. Enter a *Query* using the Lucene query string syntax.

. Enter the *Interval*, then *Preview* the query.

. If your query looks correct, *Save* it.
. If your query looks correct, *Save* it.

[float]
[[configure-display-options]]
Expand All @@ -109,7 +105,7 @@ When you connect your element to a data source, the element often appears as a w

. Click *Display*

. Change the display options for the element.
. Change the display options for the element.

[float]
[[element-display-container]]
Expand All @@ -122,7 +118,7 @@ Further define the appearance of the element container and border.
. Expand *Container style*.

. Change the *Appearance* and *Border* options.

[float]
[[apply-element-styles]]
==== Apply a set of styles
Expand Down Expand Up @@ -155,7 +151,7 @@ Increase or decrease how often your data refreshes on your workpad.
[role="screenshot"]
image::images/canvas-refresh-interval.png[Element data refresh interval]

TIP: To manually refresh the data, click the *Refresh data* icon.
TIP: To manually refresh the data, click the *Refresh data* icon.

[float]
[[organize-element]]
Expand Down Expand Up @@ -223,7 +219,7 @@ Change the order of how the elements are displayed on your workpad.

. Select an element.

. In the top right corder, click the *Element options* icon.
. In the top right corder, click the *Element options* icon.

. Select *Order*, then select the order that you want the element to appear.

Expand Down Expand Up @@ -262,7 +258,7 @@ When you have run out of room on your workpad page, add more pages.

. Click *Page 1*, then click *+*.

. On the *Page* editor panel on the right, select the page transition from the *Transition* dropdown.
. On the *Page* editor panel on the right, select the page transition from the *Transition* dropdown.
+
[role="screenshot"]
image::images/canvas-add-pages.gif[Add pages]
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,5 @@ returns `basePath` value, specific for an incoming request.
<b>Signature:</b>

```typescript
get: (request: LegacyRequest | KibanaRequest<unknown, unknown, unknown, any>) => string;
get: (request: KibanaRequest<unknown, unknown, unknown, any> | LegacyRequest) => string;
```
4 changes: 2 additions & 2 deletions docs/development/core/server/kibana-plugin-server.basepath.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,11 @@ export declare class BasePath

| Property | Modifiers | Type | Description |
| --- | --- | --- | --- |
| [get](./kibana-plugin-server.basepath.get.md) | | <code>(request: LegacyRequest &#124; KibanaRequest&lt;unknown, unknown, unknown, any&gt;) =&gt; string</code> | returns <code>basePath</code> value, specific for an incoming request. |
| [get](./kibana-plugin-server.basepath.get.md) | | <code>(request: KibanaRequest&lt;unknown, unknown, unknown, any&gt; &#124; LegacyRequest) =&gt; string</code> | returns <code>basePath</code> value, specific for an incoming request. |
| [prepend](./kibana-plugin-server.basepath.prepend.md) | | <code>(path: string) =&gt; string</code> | Prepends <code>path</code> with the basePath. |
| [remove](./kibana-plugin-server.basepath.remove.md) | | <code>(path: string) =&gt; string</code> | Removes the prepended basePath from the <code>path</code>. |
| [serverBasePath](./kibana-plugin-server.basepath.serverbasepath.md) | | <code>string</code> | returns the server's basePath<!-- -->See [BasePath.get](./kibana-plugin-server.basepath.get.md) for getting the basePath value for a specific request |
| [set](./kibana-plugin-server.basepath.set.md) | | <code>(request: LegacyRequest &#124; KibanaRequest&lt;unknown, unknown, unknown, any&gt;, requestSpecificBasePath: string) =&gt; void</code> | sets <code>basePath</code> value, specific for an incoming request. |
| [set](./kibana-plugin-server.basepath.set.md) | | <code>(request: KibanaRequest&lt;unknown, unknown, unknown, any&gt; &#124; LegacyRequest, requestSpecificBasePath: string) =&gt; void</code> | sets <code>basePath</code> value, specific for an incoming request. |

## Remarks

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,5 @@ sets `basePath` value, specific for an incoming request.
<b>Signature:</b>

```typescript
set: (request: LegacyRequest | KibanaRequest<unknown, unknown, unknown, any>, requestSpecificBasePath: string) => void;
set: (request: KibanaRequest<unknown, unknown, unknown, any> | LegacyRequest, requestSpecificBasePath: string) => void;
```
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,5 @@ Wrap a router handler to catch and converts legacy boom errors to proper custom
<b>Signature:</b>

```typescript
handleLegacyErrors: <P extends ObjectType, Q extends ObjectType, B extends ObjectType>(handler: RequestHandler<P, Q, B>) => RequestHandler<P, Q, B>;
handleLegacyErrors: <P, Q, B>(handler: RequestHandler<P, Q, B>) => RequestHandler<P, Q, B>;
```
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ export interface IRouter
| --- | --- | --- |
| [delete](./kibana-plugin-server.irouter.delete.md) | <code>RouteRegistrar&lt;'delete'&gt;</code> | Register a route handler for <code>DELETE</code> request. |
| [get](./kibana-plugin-server.irouter.get.md) | <code>RouteRegistrar&lt;'get'&gt;</code> | Register a route handler for <code>GET</code> request. |
| [handleLegacyErrors](./kibana-plugin-server.irouter.handlelegacyerrors.md) | <code>&lt;P extends ObjectType, Q extends ObjectType, B extends ObjectType&gt;(handler: RequestHandler&lt;P, Q, B&gt;) =&gt; RequestHandler&lt;P, Q, B&gt;</code> | Wrap a router handler to catch and converts legacy boom errors to proper custom errors. |
| [handleLegacyErrors](./kibana-plugin-server.irouter.handlelegacyerrors.md) | <code>&lt;P, Q, B&gt;(handler: RequestHandler&lt;P, Q, B&gt;) =&gt; RequestHandler&lt;P, Q, B&gt;</code> | Wrap a router handler to catch and converts legacy boom errors to proper custom errors. |
| [patch](./kibana-plugin-server.irouter.patch.md) | <code>RouteRegistrar&lt;'patch'&gt;</code> | Register a route handler for <code>PATCH</code> request. |
| [post](./kibana-plugin-server.irouter.post.md) | <code>RouteRegistrar&lt;'post'&gt;</code> | Register a route handler for <code>POST</code> request. |
| [put](./kibana-plugin-server.irouter.put.md) | <code>RouteRegistrar&lt;'put'&gt;</code> | Register a route handler for <code>PUT</code> request. |
Expand Down
8 changes: 7 additions & 1 deletion docs/development/core/server/kibana-plugin-server.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ The plugin integrates with the core system via lifecycle events: `setup`<!-- -->
| [CspConfig](./kibana-plugin-server.cspconfig.md) | CSP configuration for use in Kibana. |
| [ElasticsearchErrorHelpers](./kibana-plugin-server.elasticsearcherrorhelpers.md) | Helpers for working with errors returned from the Elasticsearch service.Since the internal data of errors are subject to change, consumers of the Elasticsearch service should always use these helpers to classify errors instead of checking error internals such as <code>body.error.header[WWW-Authenticate]</code> |
| [KibanaRequest](./kibana-plugin-server.kibanarequest.md) | Kibana specific abstraction for an incoming request. |
| [RouteValidationError](./kibana-plugin-server.routevalidationerror.md) | Error to return when the validation is not successful. |
| [SavedObjectsClient](./kibana-plugin-server.savedobjectsclient.md) | |
| [SavedObjectsErrorHelpers](./kibana-plugin-server.savedobjectserrorhelpers.md) | |
| [SavedObjectsRepository](./kibana-plugin-server.savedobjectsrepository.md) | |
Expand Down Expand Up @@ -94,7 +95,9 @@ The plugin integrates with the core system via lifecycle events: `setup`<!-- -->
| [RouteConfig](./kibana-plugin-server.routeconfig.md) | Route specific configuration. |
| [RouteConfigOptions](./kibana-plugin-server.routeconfigoptions.md) | Additional route options. |
| [RouteConfigOptionsBody](./kibana-plugin-server.routeconfigoptionsbody.md) | Additional body options for a route |
| [RouteSchemas](./kibana-plugin-server.routeschemas.md) | RouteSchemas contains the schemas for validating the different parts of a request. |
| [RouteValidationResultFactory](./kibana-plugin-server.routevalidationresultfactory.md) | Validation result factory to be used in the custom validation function to return the valid data or validation errors<!-- -->See [RouteValidationFunction](./kibana-plugin-server.routevalidationfunction.md)<!-- -->. |
| [RouteValidatorConfig](./kibana-plugin-server.routevalidatorconfig.md) | The configuration object to the RouteValidator class. Set <code>params</code>, <code>query</code> and/or <code>body</code> to specify the validation logic to follow for that property. |
| [RouteValidatorOptions](./kibana-plugin-server.routevalidatoroptions.md) | Additional options for the RouteValidator class to modify its default behaviour. |
| [SavedObject](./kibana-plugin-server.savedobject.md) | |
| [SavedObjectAttributes](./kibana-plugin-server.savedobjectattributes.md) | The data for a Saved Object is stored as an object in the <code>attributes</code> property. |
| [SavedObjectReference](./kibana-plugin-server.savedobjectreference.md) | A reference to another saved object. |
Expand Down Expand Up @@ -200,6 +203,9 @@ The plugin integrates with the core system via lifecycle events: `setup`<!-- -->
| [RouteContentType](./kibana-plugin-server.routecontenttype.md) | The set of supported parseable Content-Types |
| [RouteMethod](./kibana-plugin-server.routemethod.md) | The set of common HTTP methods supported by Kibana routing. |
| [RouteRegistrar](./kibana-plugin-server.routeregistrar.md) | Route handler common definition |
| [RouteValidationFunction](./kibana-plugin-server.routevalidationfunction.md) | The custom validation function if @<!-- -->kbn/config-schema is not a valid solution for your specific plugin requirements. |
| [RouteValidationSpec](./kibana-plugin-server.routevalidationspec.md) | Allowed property validation options: either @<!-- -->kbn/config-schema validations or custom validation functions<!-- -->See [RouteValidationFunction](./kibana-plugin-server.routevalidationfunction.md) for custom validation. |
| [RouteValidatorFullConfig](./kibana-plugin-server.routevalidatorfullconfig.md) | Route validations config and options merged into one object |
| [SavedObjectAttribute](./kibana-plugin-server.savedobjectattribute.md) | Type definition for a Saved Object attribute value |
| [SavedObjectAttributeSingle](./kibana-plugin-server.savedobjectattributesingle.md) | Don't use this type, it's simply a helper type for [SavedObjectAttribute](./kibana-plugin-server.savedobjectattribute.md) |
| [SavedObjectsClientContract](./kibana-plugin-server.savedobjectsclientcontract.md) | Saved Objects is Kibana's data persisentence mechanism allowing plugins to use Elasticsearch for storing plugin state.<!-- -->\#\# SavedObjectsClient errors<!-- -->Since the SavedObjectsClient has its hands in everything we are a little paranoid about the way we present errors back to to application code. Ideally, all errors will be either:<!-- -->1. Caused by bad implementation (ie. undefined is not a function) and as such unpredictable 2. An error that has been classified and decorated appropriately by the decorators in [SavedObjectsErrorHelpers](./kibana-plugin-server.savedobjectserrorhelpers.md)<!-- -->Type 1 errors are inevitable, but since all expected/handle-able errors should be Type 2 the <code>isXYZError()</code> helpers exposed at <code>SavedObjectsErrorHelpers</code> should be used to understand and manage error responses from the <code>SavedObjectsClient</code>.<!-- -->Type 2 errors are decorated versions of the source error, so if the elasticsearch client threw an error it will be decorated based on its type. That means that rather than looking for <code>error.body.error.type</code> or doing substring checks on <code>error.body.error.reason</code>, just use the helpers to understand the meaning of the error:<!-- -->\`\`\`<!-- -->js if (SavedObjectsErrorHelpers.isNotFoundError(error)) { // handle 404 }<!-- -->if (SavedObjectsErrorHelpers.isNotAuthorizedError(error)) { // 401 handling should be automatic, but in case you wanted to know }<!-- -->// always rethrow the error unless you handle it throw error; \`\`\`<!-- -->\#\#\# 404s from missing index<!-- -->From the perspective of application code and APIs the SavedObjectsClient is a black box that persists objects. One of the internal details that users have no control over is that we use an elasticsearch index for persistance and that index might be missing.<!-- -->At the time of writing we are in the process of transitioning away from the operating assumption that the SavedObjects index is always available. Part of this transition is handling errors resulting from an index missing. These used to trigger a 500 error in most cases, and in others cause 404s with different error messages.<!-- -->From my (Spencer) perspective, a 404 from the SavedObjectsApi is a 404; The object the request/call was targeting could not be found. This is why \#14141 takes special care to ensure that 404 errors are generic and don't distinguish between index missing or document missing.<!-- -->\#\#\# 503s from missing index<!-- -->Unlike all other methods, create requests are supposed to succeed even when the Kibana index does not exist because it will be automatically created by elasticsearch. When that is not the case it is because Elasticsearch's <code>action.auto_create_index</code> setting prevents it from being created automatically so we throw a special 503 with the intention of informing the user that their Elasticsearch settings need to be updated.<!-- -->See [SavedObjectsClient](./kibana-plugin-server.savedobjectsclient.md) See [SavedObjectsErrorHelpers](./kibana-plugin-server.savedobjectserrorhelpers.md) |
Expand Down
Loading

0 comments on commit 4e0905a

Please sign in to comment.