From f4d7a6d869cb1cefb5dfbf93b8a5646ac32445eb Mon Sep 17 00:00:00 2001 From: Marcos Vinicius Date: Mon, 26 Sep 2022 11:53:25 -0300 Subject: [PATCH] Elasticsearch: Rename public/app/plugins/datasource/elasticsearch/elastic_response.ts to follow convention (#55533) * Elasticsearch: Rename public/app/plugins/datasource/elasticsearch/elastic_response.ts to follow convention * undo changes in this file * fix import types --- .betterer.results | 120 ++++++++++-------- ...sponse.test.ts => ElasticResponse.test.ts} | 6 +- ...elastic_response.ts => ElasticResponse.ts} | 0 .../datasource/elasticsearch/datasource.ts | 2 +- 4 files changed, 74 insertions(+), 54 deletions(-) rename public/app/plugins/datasource/elasticsearch/{specs/elastic_response.test.ts => ElasticResponse.test.ts} (99%) rename public/app/plugins/datasource/elasticsearch/{elastic_response.ts => ElasticResponse.ts} (100%) diff --git a/.betterer.results b/.betterer.results index d284969f193..30dc5bb914b 100644 --- a/.betterer.results +++ b/.betterer.results @@ -5970,6 +5970,76 @@ exports[`better eslint`] = { [0, 0, 0, "Do not use any type assertions.", "0"], [0, 0, 0, "Do not use any type assertions.", "1"] ], + "public/app/plugins/datasource/elasticsearch/ElasticResponse.test.ts:5381": [ + [0, 0, 0, "Unexpected any. Specify a different type.", "0"], + [0, 0, 0, "Unexpected any. Specify a different type.", "1"], + [0, 0, 0, "Unexpected any. Specify a different type.", "2"], + [0, 0, 0, "Unexpected any. Specify a different type.", "3"], + [0, 0, 0, "Unexpected any. Specify a different type.", "4"], + [0, 0, 0, "Unexpected any. Specify a different type.", "5"], + [0, 0, 0, "Unexpected any. Specify a different type.", "6"], + [0, 0, 0, "Unexpected any. Specify a different type.", "7"], + [0, 0, 0, "Unexpected any. Specify a different type.", "8"], + [0, 0, 0, "Unexpected any. Specify a different type.", "9"], + [0, 0, 0, "Unexpected any. Specify a different type.", "10"], + [0, 0, 0, "Unexpected any. Specify a different type.", "11"], + [0, 0, 0, "Unexpected any. Specify a different type.", "12"], + [0, 0, 0, "Unexpected any. Specify a different type.", "13"], + [0, 0, 0, "Unexpected any. Specify a different type.", "14"], + [0, 0, 0, "Unexpected any. Specify a different type.", "15"], + [0, 0, 0, "Unexpected any. Specify a different type.", "16"], + [0, 0, 0, "Unexpected any. Specify a different type.", "17"] + ], + "public/app/plugins/datasource/elasticsearch/ElasticResponse.ts:5381": [ + [0, 0, 0, "Unexpected any. Specify a different type.", "0"], + [0, 0, 0, "Unexpected any. Specify a different type.", "1"], + [0, 0, 0, "Unexpected any. Specify a different type.", "2"], + [0, 0, 0, "Unexpected any. Specify a different type.", "3"], + [0, 0, 0, "Unexpected any. Specify a different type.", "4"], + [0, 0, 0, "Do not use any type assertions.", "5"], + [0, 0, 0, "Do not use any type assertions.", "6"], + [0, 0, 0, "Unexpected any. Specify a different type.", "7"], + [0, 0, 0, "Unexpected any. Specify a different type.", "8"], + [0, 0, 0, "Unexpected any. Specify a different type.", "9"], + [0, 0, 0, "Unexpected any. Specify a different type.", "10"], + [0, 0, 0, "Unexpected any. Specify a different type.", "11"], + [0, 0, 0, "Do not use any type assertions.", "12"], + [0, 0, 0, "Do not use any type assertions.", "13"], + [0, 0, 0, "Do not use any type assertions.", "14"], + [0, 0, 0, "Unexpected any. Specify a different type.", "15"], + [0, 0, 0, "Unexpected any. Specify a different type.", "16"], + [0, 0, 0, "Unexpected any. Specify a different type.", "17"], + [0, 0, 0, "Unexpected any. Specify a different type.", "18"], + [0, 0, 0, "Unexpected any. Specify a different type.", "19"], + [0, 0, 0, "Unexpected any. Specify a different type.", "20"], + [0, 0, 0, "Unexpected any. Specify a different type.", "21"], + [0, 0, 0, "Unexpected any. Specify a different type.", "22"], + [0, 0, 0, "Unexpected any. Specify a different type.", "23"], + [0, 0, 0, "Unexpected any. Specify a different type.", "24"], + [0, 0, 0, "Unexpected any. Specify a different type.", "25"], + [0, 0, 0, "Unexpected any. Specify a different type.", "26"], + [0, 0, 0, "Do not use any type assertions.", "27"], + [0, 0, 0, "Unexpected any. Specify a different type.", "28"], + [0, 0, 0, "Unexpected any. Specify a different type.", "29"], + [0, 0, 0, "Unexpected any. Specify a different type.", "30"], + [0, 0, 0, "Unexpected any. Specify a different type.", "31"], + [0, 0, 0, "Unexpected any. Specify a different type.", "32"], + [0, 0, 0, "Unexpected any. Specify a different type.", "33"], + [0, 0, 0, "Unexpected any. Specify a different type.", "34"], + [0, 0, 0, "Unexpected any. Specify a different type.", "35"], + [0, 0, 0, "Unexpected any. Specify a different type.", "36"], + [0, 0, 0, "Unexpected any. Specify a different type.", "37"], + [0, 0, 0, "Unexpected any. Specify a different type.", "38"], + [0, 0, 0, "Unexpected any. Specify a different type.", "39"], + [0, 0, 0, "Unexpected any. Specify a different type.", "40"], + [0, 0, 0, "Unexpected any. Specify a different type.", "41"], + [0, 0, 0, "Unexpected any. Specify a different type.", "42"], + [0, 0, 0, "Unexpected any. Specify a different type.", "43"], + [0, 0, 0, "Unexpected any. Specify a different type.", "44"], + [0, 0, 0, "Unexpected any. Specify a different type.", "45"], + [0, 0, 0, "Unexpected any. Specify a different type.", "46"], + [0, 0, 0, "Unexpected any. Specify a different type.", "47"] + ], "public/app/plugins/datasource/elasticsearch/LanguageProvider.ts:5381": [ [0, 0, 0, "Unexpected any. Specify a different type.", "0"], [0, 0, 0, "Unexpected any. Specify a different type.", "1"], @@ -6083,56 +6153,6 @@ exports[`better eslint`] = { [0, 0, 0, "Unexpected any. Specify a different type.", "29"], [0, 0, 0, "Unexpected any. Specify a different type.", "30"] ], - "public/app/plugins/datasource/elasticsearch/elastic_response.ts:5381": [ - [0, 0, 0, "Unexpected any. Specify a different type.", "0"], - [0, 0, 0, "Unexpected any. Specify a different type.", "1"], - [0, 0, 0, "Unexpected any. Specify a different type.", "2"], - [0, 0, 0, "Unexpected any. Specify a different type.", "3"], - [0, 0, 0, "Unexpected any. Specify a different type.", "4"], - [0, 0, 0, "Do not use any type assertions.", "5"], - [0, 0, 0, "Do not use any type assertions.", "6"], - [0, 0, 0, "Unexpected any. Specify a different type.", "7"], - [0, 0, 0, "Unexpected any. Specify a different type.", "8"], - [0, 0, 0, "Unexpected any. Specify a different type.", "9"], - [0, 0, 0, "Unexpected any. Specify a different type.", "10"], - [0, 0, 0, "Unexpected any. Specify a different type.", "11"], - [0, 0, 0, "Do not use any type assertions.", "12"], - [0, 0, 0, "Do not use any type assertions.", "13"], - [0, 0, 0, "Do not use any type assertions.", "14"], - [0, 0, 0, "Unexpected any. Specify a different type.", "15"], - [0, 0, 0, "Unexpected any. Specify a different type.", "16"], - [0, 0, 0, "Unexpected any. Specify a different type.", "17"], - [0, 0, 0, "Unexpected any. Specify a different type.", "18"], - [0, 0, 0, "Unexpected any. Specify a different type.", "19"], - [0, 0, 0, "Unexpected any. Specify a different type.", "20"], - [0, 0, 0, "Unexpected any. Specify a different type.", "21"], - [0, 0, 0, "Unexpected any. Specify a different type.", "22"], - [0, 0, 0, "Unexpected any. Specify a different type.", "23"], - [0, 0, 0, "Unexpected any. Specify a different type.", "24"], - [0, 0, 0, "Unexpected any. Specify a different type.", "25"], - [0, 0, 0, "Unexpected any. Specify a different type.", "26"], - [0, 0, 0, "Do not use any type assertions.", "27"], - [0, 0, 0, "Unexpected any. Specify a different type.", "28"], - [0, 0, 0, "Unexpected any. Specify a different type.", "29"], - [0, 0, 0, "Unexpected any. Specify a different type.", "30"], - [0, 0, 0, "Unexpected any. Specify a different type.", "31"], - [0, 0, 0, "Unexpected any. Specify a different type.", "32"], - [0, 0, 0, "Unexpected any. Specify a different type.", "33"], - [0, 0, 0, "Unexpected any. Specify a different type.", "34"], - [0, 0, 0, "Unexpected any. Specify a different type.", "35"], - [0, 0, 0, "Unexpected any. Specify a different type.", "36"], - [0, 0, 0, "Unexpected any. Specify a different type.", "37"], - [0, 0, 0, "Unexpected any. Specify a different type.", "38"], - [0, 0, 0, "Unexpected any. Specify a different type.", "39"], - [0, 0, 0, "Unexpected any. Specify a different type.", "40"], - [0, 0, 0, "Unexpected any. Specify a different type.", "41"], - [0, 0, 0, "Unexpected any. Specify a different type.", "42"], - [0, 0, 0, "Unexpected any. Specify a different type.", "43"], - [0, 0, 0, "Unexpected any. Specify a different type.", "44"], - [0, 0, 0, "Unexpected any. Specify a different type.", "45"], - [0, 0, 0, "Unexpected any. Specify a different type.", "46"], - [0, 0, 0, "Unexpected any. Specify a different type.", "47"] - ], "public/app/plugins/datasource/elasticsearch/hooks/useStatelessReducer.ts:5381": [ [0, 0, 0, "Do not use any type assertions.", "0"] ], diff --git a/public/app/plugins/datasource/elasticsearch/specs/elastic_response.test.ts b/public/app/plugins/datasource/elasticsearch/ElasticResponse.test.ts similarity index 99% rename from public/app/plugins/datasource/elasticsearch/specs/elastic_response.test.ts rename to public/app/plugins/datasource/elasticsearch/ElasticResponse.test.ts index dd447f68778..2005a0a5c66 100644 --- a/public/app/plugins/datasource/elasticsearch/specs/elastic_response.test.ts +++ b/public/app/plugins/datasource/elasticsearch/ElasticResponse.test.ts @@ -1,9 +1,9 @@ import { Column, DataFrameView, Field, FieldCache, KeyValue, MutableDataFrame } from '@grafana/data'; import flatten from 'app/core/utils/flatten'; -import { ElasticResponse } from '../elastic_response'; -import { highlightTags } from '../queryDef'; -import { ElasticsearchQuery } from '../types'; +import { ElasticResponse } from './ElasticResponse'; +import { highlightTags } from './queryDef'; +import { ElasticsearchQuery } from './types'; describe('ElasticResponse', () => { let targets: ElasticsearchQuery[]; diff --git a/public/app/plugins/datasource/elasticsearch/elastic_response.ts b/public/app/plugins/datasource/elasticsearch/ElasticResponse.ts similarity index 100% rename from public/app/plugins/datasource/elasticsearch/elastic_response.ts rename to public/app/plugins/datasource/elasticsearch/ElasticResponse.ts diff --git a/public/app/plugins/datasource/elasticsearch/datasource.ts b/public/app/plugins/datasource/elasticsearch/datasource.ts index 6ee43f713bc..8f57bdd3fa6 100644 --- a/public/app/plugins/datasource/elasticsearch/datasource.ts +++ b/public/app/plugins/datasource/elasticsearch/datasource.ts @@ -33,6 +33,7 @@ import { getTemplateSrv, TemplateSrv } from 'app/features/templating/template_sr import { RowContextOptions } from '../../../features/logs/components/LogRowContextProvider'; +import { ElasticResponse } from './ElasticResponse'; import { IndexPattern } from './IndexPattern'; import LanguageProvider from './LanguageProvider'; import { ElasticQueryBuilder } from './QueryBuilder'; @@ -48,7 +49,6 @@ import { Logs, } from './components/QueryEditor/MetricAggregationsEditor/aggregations'; import { metricAggregationConfig } from './components/QueryEditor/MetricAggregationsEditor/utils'; -import { ElasticResponse } from './elastic_response'; import { defaultBucketAgg, hasMetricOfType } from './queryDef'; import { DataLinkConfig, ElasticsearchOptions, ElasticsearchQuery, TermsQuery } from './types'; import { coerceESVersion, getScriptValue, isSupportedVersion } from './utils';