Skip to content

Commit

Permalink
fix lint issues
Browse files Browse the repository at this point in the history
  • Loading branch information
fbaligand committed Dec 8, 2021
1 parent 9972246 commit c9c2b82
Show file tree
Hide file tree
Showing 18 changed files with 37 additions and 231 deletions.
1 change: 1 addition & 0 deletions .eslintrc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ parserOptions:
rules:
"@kbn/eslint/require-license-header": off
"prettier/prettier": off
"import/no-extraneous-dependencies": off
"template-curly-spacing" : 0
indent:
- off
Expand Down
2 changes: 2 additions & 0 deletions public/agg_table/stream_saver.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
/* eslint-disable no-undef */
function initStreamSaver() {
const global = typeof window === 'object' ? window : this;

let mitmTransporter = null;
let supportsTransferable = false;
// eslint-disable-next-line no-empty
const test = fn => { try { fn(); } catch (e) {} };
const isSecureContext = global.isSecureContext;
// TODO: Must come up with a real detection test (#69)
Expand Down
2 changes: 1 addition & 1 deletion public/components/enhanced_table_vis_options.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ function hasSplitColsBucket(aggs: IAggConfigs) {
return some(aggs.aggs, function(agg) {
return agg.schema === 'splitcols' && agg.enabled;
});
};
}

function EnhancedTableOptions({
aggs,
Expand Down
2 changes: 1 addition & 1 deletion public/components/field.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ export interface FieldParamEditorProps {
function createIndexedFields(indexPatternFields: IndexPatternField[]): ComboBoxGroupedOptions<IndexPatternField> {
const indexedFields = [];
indexPatternFields.forEach(field => {
let indexedField = indexedFields.find(indexedField => indexedField.label === field.type);
let indexedField = indexedFields.find(f => f.label === field.type);
if (!indexedField) {
indexedField = { label: field.type, options: [] };
indexedFields.push(indexedField);
Expand Down
2 changes: 1 addition & 1 deletion public/components/field_column.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import { clone } from 'lodash';
import React, { useEffect } from 'react';
import { i18n } from '@kbn/i18n';
import { IndexPatternField } from '../../../../src/plugins/data/public';
import { EuiDraggable, EuiIconTip, EuiSpacer, EuiAccordion, EuiToolTip, EuiButtonIcon, EuiButtonIconProps } from '@elastic/eui';
import { IndexPatternField } from '../../../../src/plugins/data/public';

import { TextInputOption } from './text_input';
import { FieldParamEditor } from './field';
Expand Down

This file was deleted.

12 changes: 2 additions & 10 deletions public/data_load/kibana_cloned_code/courier.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import { hasIn } from 'lodash';
import { i18n } from '@kbn/i18n';

import { calculateObjectHash } from '../../../../../src/plugins/kibana_utils/public';
Expand All @@ -19,11 +18,6 @@ import {
tabifyAggResponse,
TimeRange,
} from '../../../../../src/plugins/data/common';
import { FilterManager } from '../../../../../src/plugins/data/public/query';
import { buildTabularInspectorData } from './build_tabular_inspector_data';
import { search } from '../../../../../src/plugins/data/public';

import { getFormatService as getFieldFormats } from '../../services';

/**
* Clone of: ../../../../../src/plugins/data/public/search/expressions/esaggs.ts
Expand All @@ -38,7 +32,6 @@ interface RequestHandlerParams {
query?: Query;
filters?: Filter[];
forceFetch: boolean;
filterManager: FilterManager;
uiState?: PersistedState;
partialRows?: boolean;
inspectorAdapters: Adapters;
Expand All @@ -61,7 +54,6 @@ export const handleCourierRequest = async ({
metricsAtAllLevels,
inspectorAdapters,
searchSessionId,
filterManager,
abortSignal,
}: RequestHandlerParams) => {
// Create a new search source that inherits the original search source
Expand Down Expand Up @@ -138,9 +130,9 @@ export const handleCourierRequest = async ({
request.stats(getRequestInspectorStats(requestSearchSource));

try {
const response = await requestSearchSource.fetch({
const response = await requestSearchSource.fetch({
abortSignal,
sessionId: searchSessionId
sessionId: searchSessionId
});

(searchSource as any).lastQuery = queryHash;
Expand Down
63 changes: 0 additions & 63 deletions public/data_load/kibana_cloned_code/create_filter.ts

This file was deleted.

4 changes: 2 additions & 2 deletions public/data_load/kibana_cloned_code/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ export function serializeAggConfig(aggConfig) {
const sourceParams = {
indexPatternId: aggConfig.getIndexPattern().id,
...aggConfig.serialize()
}
};

return {
type: aggConfig.type.name,
Expand All @@ -17,7 +17,7 @@ export function serializeAggConfig(aggConfig) {
source: 'esaggs',
sourceParams
};
};
}

/**
* Clone of: '../../../../../src/plugins/data/common/field_formats/utils.ts'
Expand Down
12 changes: 3 additions & 9 deletions public/data_load/visualization_fn.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import { get } from 'lodash';
import { i18n } from '@kbn/i18n';
import { PersistedState } from '../../../../src/plugins/visualizations/public';
import { ExpressionFunctionDefinition, Render } from '../../../../src/plugins/expressions/public';
import { getIndexPatterns, getFilterManager, getSearchService, getVisualization } from '../services';
import { enhancedTableRequestHandler } from './enhanced-table-request-handler';
Expand Down Expand Up @@ -52,7 +51,7 @@ const expressionFunction = (visName: VisName, responseHandler: ResponseHandler):
// TODO: Below `help` keys should be internationalized once this function
// TODO: is moved to visualizations plugin.
index: {
//types: ['string', 'null'],
// types: ['string', 'null'],
types: ['string'],
default: '',
help: 'Index',
Expand Down Expand Up @@ -93,24 +92,19 @@ const expressionFunction = (visName: VisName, responseHandler: ResponseHandler):
const schemas = args.schemas ? JSON.parse(args.schemas) : {};
const indexPattern = args.index ? await getIndexPatterns().get(args.index) : null;

const uiStateParams = args.uiState ? JSON.parse(args.uiState) : {};
const uiState = new PersistedState(uiStateParams);

const aggConfigsState = args.aggConfigs ? JSON.parse(args.aggConfigs) : [];
const aggs = indexPattern
? getSearchService().aggs.createAggConfigs(indexPattern, aggConfigsState)
: undefined;
const visType = getVisualization().get(visName)
const visType = getVisualization().get(visName);

input = await enhancedTableRequestHandler({
partialRows: args.partialRows,
metricsAtAllLevels: args.metricsAtAllLevels,
//index: indexPattern,
visParams: visConfigParams,
timeRange: get(input, 'timeRange', null),
query: get(input, 'query', null),
filters: get(input, 'filters', null),
//uiState,
inspectorAdapters,
queryFilter: getFilterManager(),
aggs,
Expand Down Expand Up @@ -143,7 +137,7 @@ const expressionFunction = (visName: VisName, responseHandler: ResponseHandler):
}

const response = await responseHandler(input);

return {
type: 'render',
as: visName,
Expand Down
4 changes: 1 addition & 3 deletions public/document-table-vis.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
import { i18n } from '@kbn/i18n';

import tableVisTemplate from './enhanced-table-vis.html';
import { getEnhancedTableVisualizationController } from './vis_controller';
import { enhancedTableRequestHandler } from './data_load/enhanced-table-request-handler';
import { documentTableResponseHandler } from './data_load/document-table-response-handler';
import { DocumentTableData } from './components/document_table_vis_data';
import { EnhancedTableOptions } from './components/enhanced_table_vis_options_lazy';
import { VIS_EVENT_TO_TRIGGER } from '../../../src/plugins/visualizations/public';
Expand All @@ -12,6 +9,7 @@ import { DOC_TABLE_VIS_NAME } from './types';


// define the visType object, which kibana will use to display and configure new Vis object of this type.
// eslint-disable-next-line no-unused-vars
export function documentTableVisTypeDefinition (core, context) {
return {
requiresSearch: true,
Expand Down
6 changes: 2 additions & 4 deletions public/enhanced-table-vis.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,15 @@ import { i18n } from '@kbn/i18n';
import { AggGroupNames } from '../../../src/plugins/data/public';

import tableVisTemplate from './enhanced-table-vis.html';
import { getEnhancedTableVisualizationController } from './vis_controller';
import { enhancedTableRequestHandler } from './data_load/enhanced-table-request-handler';
import { enhancedTableResponseHandler } from './data_load/enhanced-table-response-handler';
import { EnhancedTableOptions } from './components/enhanced_table_vis_options_lazy';
import { VIS_EVENT_TO_TRIGGER } from '../../../src/plugins/visualizations/public';

import { ENH_TABLE_VIS_NAME } from './types'
import { ENH_TABLE_VIS_NAME } from './types';
import { enhancedTableToExpressionAst } from './to_ast';


// define the visType object, which kibana will use to display and configure new Vis object of this type.
// eslint-disable-next-line no-unused-vars
export function enhancedTableVisTypeDefinition (core, context) {
return {
requiresSearch: true,
Expand Down
19 changes: 0 additions & 19 deletions public/legacy.ts

This file was deleted.

4 changes: 2 additions & 2 deletions public/plugin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import { documentTableVisTypeDefinition } from './document-table-vis';

import { DataPublicPluginStart } from '../../../src/plugins/data/public';
import { setFilterManager, setFormatService, setIndexPatterns, setKibanaLegacy, setNotifications, setQueryService, setSearchService, setVisualization } from './services';
import { KibanaLegacyStart } from '../../../src/plugins/kibana_legacy/public';
import { KibanaLegacyStart } from '../../../src/plugins/kibana_legacy/public';
import { Plugin as ExpressionsPublicPlugin } from '../../../src/plugins/expressions/public';

import { getEnhancedTableVisLegacyRenderer, getDocumentTableVisLegacyRenderer } from './vis_legacy_renderer';
Expand Down Expand Up @@ -62,6 +62,6 @@ export class EnhancedTablePlugin implements Plugin<Promise<void>, void> {
setSearchService(deps.data.search);
setIndexPatterns(deps.data.indexPatterns);
setFilterManager(deps.data.query.filterManager);
setVisualization(deps.visualizations)
setVisualization(deps.visualizations);
}
}
Loading

0 comments on commit c9c2b82

Please sign in to comment.