Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/master' into ml-datavisualizer…
Browse files Browse the repository at this point in the history
…-redesign
  • Loading branch information
qn895 committed Dec 15, 2020
2 parents 30c0394 + 507ae79 commit 3305f1a
Show file tree
Hide file tree
Showing 556 changed files with 15,265 additions and 9,241 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -101,12 +101,7 @@ readonly links: {
readonly dateMath: string;
};
readonly management: Record<string, string>;
readonly ml: {
readonly guide: string;
readonly anomalyDetection: string;
readonly anomalyDetectionJobs: string;
readonly dataFrameAnalytics: string;
};
readonly ml: Record<string, string>;
readonly visualize: Record<string, string>;
};
```
Original file line number Diff line number Diff line change
Expand Up @@ -17,5 +17,5 @@ export interface DocLinksStart
| --- | --- | --- |
| [DOC\_LINK\_VERSION](./kibana-plugin-core-public.doclinksstart.doc_link_version.md) | <code>string</code> | |
| [ELASTIC\_WEBSITE\_URL](./kibana-plugin-core-public.doclinksstart.elastic_website_url.md) | <code>string</code> | |
| [links](./kibana-plugin-core-public.doclinksstart.links.md) | <code>{</code><br/><code> readonly dashboard: {</code><br/><code> readonly guide: string;</code><br/><code> readonly drilldowns: string;</code><br/><code> readonly drilldownsTriggerPicker: string;</code><br/><code> readonly urlDrilldownTemplateSyntax: string;</code><br/><code> readonly urlDrilldownVariables: string;</code><br/><code> };</code><br/><code> readonly filebeat: {</code><br/><code> readonly base: string;</code><br/><code> readonly installation: string;</code><br/><code> readonly configuration: string;</code><br/><code> readonly elasticsearchOutput: string;</code><br/><code> readonly startup: string;</code><br/><code> readonly exportedFields: string;</code><br/><code> };</code><br/><code> readonly auditbeat: {</code><br/><code> readonly base: string;</code><br/><code> };</code><br/><code> readonly metricbeat: {</code><br/><code> readonly base: string;</code><br/><code> };</code><br/><code> readonly heartbeat: {</code><br/><code> readonly base: string;</code><br/><code> };</code><br/><code> readonly logstash: {</code><br/><code> readonly base: string;</code><br/><code> };</code><br/><code> readonly functionbeat: {</code><br/><code> readonly base: string;</code><br/><code> };</code><br/><code> readonly winlogbeat: {</code><br/><code> readonly base: string;</code><br/><code> };</code><br/><code> readonly aggs: {</code><br/><code> readonly date_histogram: string;</code><br/><code> readonly date_range: string;</code><br/><code> readonly filter: string;</code><br/><code> readonly filters: string;</code><br/><code> readonly geohash_grid: string;</code><br/><code> readonly histogram: string;</code><br/><code> readonly ip_range: string;</code><br/><code> readonly range: string;</code><br/><code> readonly significant_terms: string;</code><br/><code> readonly terms: string;</code><br/><code> readonly avg: string;</code><br/><code> readonly avg_bucket: string;</code><br/><code> readonly max_bucket: string;</code><br/><code> readonly min_bucket: string;</code><br/><code> readonly sum_bucket: string;</code><br/><code> readonly cardinality: string;</code><br/><code> readonly count: string;</code><br/><code> readonly cumulative_sum: string;</code><br/><code> readonly derivative: string;</code><br/><code> readonly geo_bounds: string;</code><br/><code> readonly geo_centroid: string;</code><br/><code> readonly max: string;</code><br/><code> readonly median: string;</code><br/><code> readonly min: string;</code><br/><code> readonly moving_avg: string;</code><br/><code> readonly percentile_ranks: string;</code><br/><code> readonly serial_diff: string;</code><br/><code> readonly std_dev: string;</code><br/><code> readonly sum: string;</code><br/><code> readonly top_hits: string;</code><br/><code> };</code><br/><code> readonly scriptedFields: {</code><br/><code> readonly scriptFields: string;</code><br/><code> readonly scriptAggs: string;</code><br/><code> readonly painless: string;</code><br/><code> readonly painlessApi: string;</code><br/><code> readonly painlessSyntax: string;</code><br/><code> readonly luceneExpressions: string;</code><br/><code> };</code><br/><code> readonly indexPatterns: {</code><br/><code> readonly loadingData: string;</code><br/><code> readonly introduction: string;</code><br/><code> };</code><br/><code> readonly addData: string;</code><br/><code> readonly kibana: string;</code><br/><code> readonly siem: {</code><br/><code> readonly guide: string;</code><br/><code> readonly gettingStarted: string;</code><br/><code> };</code><br/><code> readonly query: {</code><br/><code> readonly eql: string;</code><br/><code> readonly luceneQuerySyntax: string;</code><br/><code> readonly queryDsl: string;</code><br/><code> readonly kueryQuerySyntax: string;</code><br/><code> };</code><br/><code> readonly date: {</code><br/><code> readonly dateMath: string;</code><br/><code> };</code><br/><code> readonly management: Record&lt;string, string&gt;;</code><br/><code> readonly ml: {</code><br/><code> readonly guide: string;</code><br/><code> readonly anomalyDetection: string;</code><br/><code> readonly anomalyDetectionJobs: string;</code><br/><code> readonly dataFrameAnalytics: string;</code><br/><code> };</code><br/><code> readonly visualize: Record&lt;string, string&gt;;</code><br/><code> }</code> | |
| [links](./kibana-plugin-core-public.doclinksstart.links.md) | <code>{</code><br/><code> readonly dashboard: {</code><br/><code> readonly guide: string;</code><br/><code> readonly drilldowns: string;</code><br/><code> readonly drilldownsTriggerPicker: string;</code><br/><code> readonly urlDrilldownTemplateSyntax: string;</code><br/><code> readonly urlDrilldownVariables: string;</code><br/><code> };</code><br/><code> readonly filebeat: {</code><br/><code> readonly base: string;</code><br/><code> readonly installation: string;</code><br/><code> readonly configuration: string;</code><br/><code> readonly elasticsearchOutput: string;</code><br/><code> readonly startup: string;</code><br/><code> readonly exportedFields: string;</code><br/><code> };</code><br/><code> readonly auditbeat: {</code><br/><code> readonly base: string;</code><br/><code> };</code><br/><code> readonly metricbeat: {</code><br/><code> readonly base: string;</code><br/><code> };</code><br/><code> readonly heartbeat: {</code><br/><code> readonly base: string;</code><br/><code> };</code><br/><code> readonly logstash: {</code><br/><code> readonly base: string;</code><br/><code> };</code><br/><code> readonly functionbeat: {</code><br/><code> readonly base: string;</code><br/><code> };</code><br/><code> readonly winlogbeat: {</code><br/><code> readonly base: string;</code><br/><code> };</code><br/><code> readonly aggs: {</code><br/><code> readonly date_histogram: string;</code><br/><code> readonly date_range: string;</code><br/><code> readonly filter: string;</code><br/><code> readonly filters: string;</code><br/><code> readonly geohash_grid: string;</code><br/><code> readonly histogram: string;</code><br/><code> readonly ip_range: string;</code><br/><code> readonly range: string;</code><br/><code> readonly significant_terms: string;</code><br/><code> readonly terms: string;</code><br/><code> readonly avg: string;</code><br/><code> readonly avg_bucket: string;</code><br/><code> readonly max_bucket: string;</code><br/><code> readonly min_bucket: string;</code><br/><code> readonly sum_bucket: string;</code><br/><code> readonly cardinality: string;</code><br/><code> readonly count: string;</code><br/><code> readonly cumulative_sum: string;</code><br/><code> readonly derivative: string;</code><br/><code> readonly geo_bounds: string;</code><br/><code> readonly geo_centroid: string;</code><br/><code> readonly max: string;</code><br/><code> readonly median: string;</code><br/><code> readonly min: string;</code><br/><code> readonly moving_avg: string;</code><br/><code> readonly percentile_ranks: string;</code><br/><code> readonly serial_diff: string;</code><br/><code> readonly std_dev: string;</code><br/><code> readonly sum: string;</code><br/><code> readonly top_hits: string;</code><br/><code> };</code><br/><code> readonly scriptedFields: {</code><br/><code> readonly scriptFields: string;</code><br/><code> readonly scriptAggs: string;</code><br/><code> readonly painless: string;</code><br/><code> readonly painlessApi: string;</code><br/><code> readonly painlessSyntax: string;</code><br/><code> readonly luceneExpressions: string;</code><br/><code> };</code><br/><code> readonly indexPatterns: {</code><br/><code> readonly loadingData: string;</code><br/><code> readonly introduction: string;</code><br/><code> };</code><br/><code> readonly addData: string;</code><br/><code> readonly kibana: string;</code><br/><code> readonly siem: {</code><br/><code> readonly guide: string;</code><br/><code> readonly gettingStarted: string;</code><br/><code> };</code><br/><code> readonly query: {</code><br/><code> readonly eql: string;</code><br/><code> readonly luceneQuerySyntax: string;</code><br/><code> readonly queryDsl: string;</code><br/><code> readonly kueryQuerySyntax: string;</code><br/><code> };</code><br/><code> readonly date: {</code><br/><code> readonly dateMath: string;</code><br/><code> };</code><br/><code> readonly management: Record&lt;string, string&gt;;</code><br/><code> readonly ml: Record&lt;string, string&gt;;</code><br/><code> readonly visualize: Record&lt;string, string&gt;;</code><br/><code> }</code> | |

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

[Home](./index.md) &gt; [kibana-plugin-plugins-data-public](./kibana-plugin-plugins-data-public.md) &gt; [FieldFormat](./kibana-plugin-plugins-data-public.fieldformat.md) &gt; [allowsNumericalAggregations](./kibana-plugin-plugins-data-public.fieldformat.allowsnumericalaggregations.md)

## FieldFormat.allowsNumericalAggregations property

<b>Signature:</b>

```typescript
allowsNumericalAggregations?: boolean;
```
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ export declare abstract class FieldFormat
| Property | Modifiers | Type | Description |
| --- | --- | --- | --- |
| [\_params](./kibana-plugin-plugins-data-public.fieldformat._params.md) | | <code>any</code> | |
| [allowsNumericalAggregations](./kibana-plugin-plugins-data-public.fieldformat.allowsnumericalaggregations.md) | | <code>boolean</code> | |
| [convertObject](./kibana-plugin-plugins-data-public.fieldformat.convertobject.md) | | <code>FieldFormatConvert &#124; undefined</code> | {<!-- -->FieldFormatConvert<!-- -->} have to remove the private because of https://github.com/Microsoft/TypeScript/issues/17293 |
| [fieldType](./kibana-plugin-plugins-data-public.fieldformat.fieldtype.md) | <code>static</code> | <code>string &#124; string[]</code> | {<!-- -->string<!-- -->} - Field Format Type |
| [getConfig](./kibana-plugin-plugins-data-public.fieldformat.getconfig.md) | | <code>FieldFormatsGetConfigFn &#124; undefined</code> | |
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,5 @@
<b>Signature:</b>

```typescript
export declare type IFieldFormat = PublicMethodsOf<FieldFormat>;
export declare type IFieldFormat = FieldFormat;
```
38 changes: 27 additions & 11 deletions packages/kbn-monaco/src/painless/diagnostics_adapter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,25 +32,41 @@ export class DiagnosticsAdapter {
constructor(private worker: WorkerAccessor) {
const onModelAdd = (model: monaco.editor.IModel): void => {
let handle: any;
model.onDidChangeContent(() => {
// Every time a new change is made, wait 500ms before validating
clearTimeout(handle);
handle = setTimeout(() => this.validate(model.uri), 500);
});

this.validate(model.uri);
if (model.getModeId() === ID) {
model.onDidChangeContent(() => {
// Do not validate if the language ID has changed
if (model.getModeId() !== ID) {
return;
}

// Every time a new change is made, wait 500ms before validating
clearTimeout(handle);
handle = setTimeout(() => this.validate(model.uri), 500);
});

model.onDidChangeLanguage(({ newLanguage }) => {
// Reset the model markers if the language ID has changed and is no longer "painless"
if (newLanguage !== ID) {
return monaco.editor.setModelMarkers(model, ID, []);
}
});

this.validate(model.uri);
}
};
monaco.editor.onDidCreateModel(onModelAdd);
monaco.editor.getModels().forEach(onModelAdd);
}

private async validate(resource: monaco.Uri): Promise<void> {
const worker = await this.worker(resource);
const errorMarkers = await worker.getSyntaxErrors();

const model = monaco.editor.getModel(resource);
const errorMarkers = await worker.getSyntaxErrors(resource.toString());

// Set the error markers and underline them with "Error" severity
monaco.editor.setModelMarkers(model!, ID, errorMarkers.map(toDiagnostics));
if (errorMarkers) {
const model = monaco.editor.getModel(resource);
// Set the error markers and underline them with "Error" severity
monaco.editor.setModelMarkers(model!, ID, errorMarkers.map(toDiagnostics));
}
}
}
16 changes: 10 additions & 6 deletions packages/kbn-monaco/src/painless/worker/painless_worker.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,14 +28,18 @@ export class PainlessWorker {
this._ctx = ctx;
}

private getTextDocument(): string {
const model = this._ctx.getMirrorModels()[0];
return model.getValue();
private getTextDocument(modelUri: string): string | undefined {
const model = this._ctx.getMirrorModels().find((m) => m.uri.toString() === modelUri);

return model?.getValue();
}

public async getSyntaxErrors() {
const code = this.getTextDocument();
return parseAndGetSyntaxErrors(code);
public async getSyntaxErrors(modelUri: string) {
const code = this.getTextDocument(modelUri);

if (code) {
return parseAndGetSyntaxErrors(code);
}
}

public provideAutocompleteSuggestions(
Expand Down
1 change: 1 addition & 0 deletions scripts/functional_tests.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ const alwaysImportedTests = [
require.resolve('../test/ui_capabilities/newsfeed_err/config.ts'),
require.resolve('../test/new_visualize_flow/config.ts'),
require.resolve('../test/security_functional/config.ts'),
require.resolve('../test/functional/config.legacy.ts'),
];
// eslint-disable-next-line no-restricted-syntax
const onlyNotInCoverageTests = [
Expand Down
16 changes: 10 additions & 6 deletions src/core/public/doc_links/doc_links_service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -135,9 +135,18 @@ export class DocLinksService {
},
ml: {
guide: `${ELASTIC_WEBSITE_URL}guide/en/machine-learning/${DOC_LINK_VERSION}/index.html`,
aggregations: `${ELASTIC_WEBSITE_URL}guide/en/machine-learning/${DOC_LINK_VERSION}/ml-configuring-aggregation.html`,
anomalyDetection: `${ELASTIC_WEBSITE_URL}guide/en/machine-learning/${DOC_LINK_VERSION}/xpack-ml.html`,
anomalyDetectionJobs: `${ELASTIC_WEBSITE_URL}guide/en/machine-learning/${DOC_LINK_VERSION}/ml-jobs.html`,
anomalyDetectionJobTips: `${ELASTIC_WEBSITE_URL}guide/en/machine-learning/${DOC_LINK_VERSION}/create-jobs.html#job-tips`,
calendars: `${ELASTIC_WEBSITE_URL}guide/en/machine-learning/${DOC_LINK_VERSION}/ml-calendars.html`,
classificationEvaluation: `${ELASTIC_WEBSITE_URL}guide/en/machine-learning/${DOC_LINK_VERSION}/ml-dfanalytics-evaluate.html#ml-dfanalytics-classification`,
customRules: `${ELASTIC_WEBSITE_URL}guide/en/machine-learning/${DOC_LINK_VERSION}/ml-rules.html`,
customUrls: `${ELASTIC_WEBSITE_URL}guide/en/machine-learning/${DOC_LINK_VERSION}/ml-configuring-url.html`,
dataFrameAnalytics: `${ELASTIC_WEBSITE_URL}guide/en/machine-learning/${DOC_LINK_VERSION}/ml-dfanalytics.html`,
featureImportance: `${ELASTIC_WEBSITE_URL}guide/en/machine-learning/${DOC_LINK_VERSION}/ml-feature-importance.html`,
outlierDetectionRoc: `${ELASTIC_WEBSITE_URL}guide/en/machine-learning/${DOC_LINK_VERSION}/ml-dfanalytics-evaluate.html#ml-dfanalytics-roc`,
regressionEvaluation: `${ELASTIC_WEBSITE_URL}guide/en/machine-learning/${DOC_LINK_VERSION}/ml-dfanalytics-evaluate.html#ml-dfanalytics-regression-evaluation`,
},
visualize: {
guide: `${ELASTIC_WEBSITE_URL}guide/en/kibana/${DOC_LINK_VERSION}/visualize.html`,
Expand Down Expand Up @@ -248,12 +257,7 @@ export interface DocLinksStart {
readonly dateMath: string;
};
readonly management: Record<string, string>;
readonly ml: {
readonly guide: string;
readonly anomalyDetection: string;
readonly anomalyDetectionJobs: string;
readonly dataFrameAnalytics: string;
};
readonly ml: Record<string, string>;
readonly visualize: Record<string, string>;
};
}
7 changes: 1 addition & 6 deletions src/core/public/public.api.md
Original file line number Diff line number Diff line change
Expand Up @@ -573,12 +573,7 @@ export interface DocLinksStart {
readonly dateMath: string;
};
readonly management: Record<string, string>;
readonly ml: {
readonly guide: string;
readonly anomalyDetection: string;
readonly anomalyDetectionJobs: string;
readonly dataFrameAnalytics: string;
};
readonly ml: Record<string, string>;
readonly visualize: Record<string, string>;
};
}
Expand Down
1 change: 1 addition & 0 deletions src/dev/run_find_plugins_with_circular_deps.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ const allowedList: CircularDepList = new Set([
'src/plugins/vis_default_editor -> src/plugins/visualize',
'src/plugins/visualizations -> src/plugins/visualize',
'x-pack/plugins/actions -> x-pack/plugins/case',
'x-pack/plugins/case -> x-pack/plugins/security_solution',
'x-pack/plugins/apm -> x-pack/plugins/infra',
'x-pack/plugins/lists -> x-pack/plugins/security_solution',
'x-pack/plugins/security -> x-pack/plugins/spaces',
Expand Down
1 change: 1 addition & 0 deletions src/plugins/data/common/field_formats/field_format.ts
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,7 @@ export abstract class FieldFormat {
* @private
*/
public type: any = this.constructor;
public allowsNumericalAggregations?: boolean;

protected readonly _params: any;
protected getConfig: FieldFormatsGetConfigFn | undefined;
Expand Down
3 changes: 1 addition & 2 deletions src/plugins/data/common/field_formats/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@
* specific language governing permissions and limitations
* under the License.
*/
import { PublicMethodsOf } from '@kbn/utility-types';
import { GetConfigFn } from '../types';
import { FieldFormat } from './field_format';
import { FieldFormatsRegistry } from './field_formats_registry';
Expand Down Expand Up @@ -77,7 +76,7 @@ export interface FieldFormatConfig {

export type FieldFormatsGetConfigFn = GetConfigFn;

export type IFieldFormat = PublicMethodsOf<FieldFormat>;
export type IFieldFormat = FieldFormat;

/**
* @string id type is needed for creating custom converters.
Expand Down
Loading

0 comments on commit 3305f1a

Please sign in to comment.