Skip to content

Commit

Permalink
[maps] convert vector style properties to TS (#74553)
Browse files Browse the repository at this point in the history
* [maps] convert vector style properties to TS

* more conversionts

* tslint cleanup

* final tslint fixes

* update snapshots for bug fix

* review feedback

Co-authored-by: Elastic Machine <[email protected]>
  • Loading branch information
nreese and elasticmachine committed Aug 10, 2020
1 parent e07b87f commit 8a2697d
Show file tree
Hide file tree
Showing 19 changed files with 302 additions and 146 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ export function getColorRampCenterColor(colorPaletteId: string): string | null {
// Returns an array of color stops
// [ stop_input_1: number, stop_output_1: color, stop_input_n: number, stop_output_n: color ]
export function getOrdinalMbColorRampStops(
colorPaletteId: string,
colorPaletteId: string | null,
min: number,
max: number
): Array<number | string> | null {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ const EMPTY_VALUE = '';

interface Break {
color: string;
label: ReactElement<any> | string;
symbolId: string;
label: ReactElement<any> | string | number;
symbolId?: string;
}

interface Props {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,11 @@ import { VectorIcon } from './vector_icon';

interface Props {
styleName: VECTOR_STYLES;
label: ReactElement<any> | string;
label: ReactElement<any> | string | number;
color: string;
isLinesOnly: boolean;
isPointsOnly: boolean;
symbolId: string;
symbolId?: string;
}

export function Category({ styleName, label, color, isLinesOnly, isPointsOnly, symbolId }: Props) {
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -25,21 +25,6 @@ class MockField extends AbstractField {
}
}

export class MockMbMap {
_paintPropertyCalls: unknown[];

constructor() {
this._paintPropertyCalls = [];
}
setPaintProperty(...args: unknown[]) {
this._paintPropertyCalls.push([...args]);
}

getPaintPropertyCalls(): unknown[] {
return this._paintPropertyCalls;
}
}

export const mockField: IField = new MockField({
fieldName: 'foobar',
origin: FIELD_ORIGIN.SOURCE,
Expand Down
Loading

0 comments on commit 8a2697d

Please sign in to comment.