Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix some types #9

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ export class PhraseFilterManager extends FilterManager {
// bool filter - multiple phrase filters
if (_.has(kbnFilter, 'query.bool.should')) {
return _.get(kbnFilter, 'query.bool.should')
.map((kbnQueryFilter: any) => {
.map((kbnQueryFilter: PhraseFilter) => {
return this.getValueFromFilter(kbnQueryFilter);
})
.filter((value: any) => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ function validateValueUnique(
}

function getNextModel(list: NumberRowModel[], range: NumberListRange): NumberRowModel {
const lastValue = (last(list) as any).value;
const lastValue = (last(list) as NumberRowModel).value;
let next = Number(lastValue) ? Number(lastValue) + 1 : 1;

if (next >= range.max) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ import { getHeatmapColors } from '../../../charts/public';
import { VisParams, MetricVisMetric } from '../types';
import { getFormatService } from '../services';
import { SchemaConfig, ExprVis } from '../../../visualizations/public';
import { Range } from '../../../expressions/public';

export interface MetricVisComponentProps {
visParams: VisParams;
Expand All @@ -41,7 +42,7 @@ export class MetricVisComponent extends Component<MetricVisComponentProps> {
const config = this.props.visParams.metric;
const isPercentageMode = config.percentageMode;
const colorsRange = config.colorsRange;
const max = (last(colorsRange) as any).to;
const max = (last(colorsRange) as Range).to;
const labels: string[] = [];

colorsRange.forEach((range: any) => {
Expand Down Expand Up @@ -111,7 +112,7 @@ export class MetricVisComponent extends Component<MetricVisComponentProps> {
const dimensions = this.props.visParams.dimensions;
const isPercentageMode = config.percentageMode;
const min = config.colorsRange[0].from;
const max = (last(config.colorsRange) as any).to;
const max = (last(config.colorsRange) as Range).to;
const colors = this.getColors();
const labels = this.getLabels();
const metrics: MetricVisMetric[] = [];
Expand Down
5 changes: 3 additions & 2 deletions src/plugins/vis_type_vega/public/vega_fn.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ import { i18n } from '@kbn/i18n';
import { ExpressionFunctionDefinition, KibanaContext, Render } from '../../expressions/public';
import { VegaVisualizationDependencies } from './plugin';
import { createVegaRequestHandler } from './vega_request_handler';
import { TimeRange, Query } from '../../data/public';

type Input = KibanaContext | null;
type Output = Promise<Render<RenderValue>>;
Expand Down Expand Up @@ -58,8 +59,8 @@ export const createVegaFn = (
const vegaRequestHandler = createVegaRequestHandler(dependencies, context.abortSignal);

const response = await vegaRequestHandler({
timeRange: get(input, 'timeRange') as any,
query: get(input, 'query') as any,
timeRange: get(input, 'timeRange') as TimeRange,
query: get(input, 'query') as Query,
filters: get(input, 'filters') as any,
visParams: { spec: args.spec },
});
Expand Down
2 changes: 1 addition & 1 deletion x-pack/plugins/graph/server/routes/explore.ts
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ export function registerExploreRoute({
error,
'body.error.root_cause',
[] as Array<{ type: string; reason: string }>
).find((cause: any) => {
).find((cause: { type: string; reason: string }) => {
return (
cause.reason.includes('Fielddata is disabled on text fields') ||
cause.reason.includes('No support for examining floating point') ||
Expand Down