chore: make TS enums strictly PascalCase (#26875)

This commit is contained in:
Ville Brofeldt
2024-01-31 17:40:44 -08:00
committed by GitHub
parent 959a5a5ad6
commit 19f8405bc0
362 changed files with 2002 additions and 2032 deletions

View File

@@ -25,13 +25,13 @@ import {
AnnotationLayer,
AnnotationOpacity,
AnnotationType,
AxisType,
DataRecord,
evalExpression,
FormulaAnnotationLayer,
isRecordAnnotationResult,
isTableAnnotationLayer,
isTimeseriesAnnotationResult,
AxisType,
} from '@superset-ui/core';
import { EchartsTimeseriesChartProps } from '../types';
import { EchartsMixedTimeseriesProps } from '../MixedTimeseries/types';
@@ -46,7 +46,7 @@ export function evalFormula(
return data.map(row => {
let value = row[xAxis];
if (xAxisType === 'time') {
if (xAxisType === AxisType.Time) {
value = new Date(value as string).getTime();
}
return [value, evalExpression(expression, (value || 0) as number)];

View File

@@ -364,7 +364,7 @@ export function formatSeriesName(
if (typeof name === 'boolean') {
return name.toString();
}
if (name instanceof Date || coltype === GenericDataType.TEMPORAL) {
if (name instanceof Date || coltype === GenericDataType.Temporal) {
const normalizedName =
typeof name === 'string' ? normalizeTimestamp(name) : name;
const d =
@@ -535,15 +535,15 @@ export function getAxisType(
dataType?: GenericDataType,
): AxisType {
if (forceCategorical) {
return AxisType.category;
return AxisType.Category;
}
if (dataType === GenericDataType.TEMPORAL) {
return AxisType.time;
if (dataType === GenericDataType.Temporal) {
return AxisType.Time;
}
if (dataType === GenericDataType.NUMERIC && !stack) {
return AxisType.value;
if (dataType === GenericDataType.Numeric && !stack) {
return AxisType.Value;
}
return AxisType.category;
return AxisType.Category;
}
export function getOverMaxHiddenFormatter(
@@ -585,7 +585,7 @@ export function getMinAndMaxFromBounds(
max?: number,
seriesType?: EchartsTimeseriesSeriesType,
): BoundsType | {} {
if (axisType === AxisType.value && truncateAxis) {
if (axisType === AxisType.Value && truncateAxis) {
const ret: BoundsType = {};
if (seriesType === EchartsTimeseriesSeriesType.Bar) {
ret.scale = true;