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

@@ -45,9 +45,9 @@ export default class EchartsAreaChartPlugin extends EchartsChartPlugin<
loadChart: () => import('../EchartsTimeseries'),
metadata: {
behaviors: [
Behavior.INTERACTIVE_CHART,
Behavior.DRILL_TO_DETAIL,
Behavior.DRILL_BY,
Behavior.InteractiveChart,
Behavior.DrillToDetail,
Behavior.DrillBy,
],
category: t('Evolution'),
credits: ['https://echarts.apache.org'],

View File

@@ -173,7 +173,7 @@ export default function EchartsTimeseries({
...(eventParams.name ? [eventParams.name] : []),
...(labelMap[seriesName] ?? []),
];
if (data && xAxis.type === AxisType.time) {
if (data && xAxis.type === AxisType.Time) {
drillToDetailFilters.push({
col:
// if the xAxis is '__timestamp', granularity_sqla will be the column of filter
@@ -187,7 +187,7 @@ export default function EchartsTimeseries({
});
}
[
...(xAxis.type === AxisType.category && data ? [xAxis.label] : []),
...(xAxis.type === AxisType.Category && data ? [xAxis.label] : []),
...formData.groupby,
].forEach((dimension, i) =>
drillToDetailFilters.push({

View File

@@ -59,9 +59,9 @@ const {
function createAxisTitleControl(axis: 'x' | 'y'): ControlSetRow[] {
const isXAxis = axis === 'x';
const isVertical = (controls: ControlStateMapping) =>
Boolean(controls?.orientation.value === OrientationType.vertical);
Boolean(controls?.orientation.value === OrientationType.Vertical);
const isHorizontal = (controls: ControlStateMapping) =>
Boolean(controls?.orientation.value === OrientationType.horizontal);
Boolean(controls?.orientation.value === OrientationType.Horizontal);
return [
[
{
@@ -148,9 +148,9 @@ function createAxisTitleControl(axis: 'x' | 'y'): ControlSetRow[] {
function createAxisControl(axis: 'x' | 'y'): ControlSetRow[] {
const isXAxis = axis === 'x';
const isVertical = (controls: ControlStateMapping) =>
Boolean(controls?.orientation.value === OrientationType.vertical);
Boolean(controls?.orientation.value === OrientationType.Vertical);
const isHorizontal = (controls: ControlStateMapping) =>
Boolean(controls?.orientation.value === OrientationType.horizontal);
Boolean(controls?.orientation.value === OrientationType.Horizontal);
return [
[
{
@@ -272,8 +272,8 @@ const config: ControlPanelConfig = {
label: t('Bar orientation'),
default: orientation,
options: [
[OrientationType.vertical, t('Vertical')],
[OrientationType.horizontal, t('Horizontal')],
[OrientationType.Vertical, t('Vertical')],
[OrientationType.Horizontal, t('Horizontal')],
],
description: t('Orientation of bar chart'),
},

View File

@@ -51,9 +51,9 @@ export default class EchartsTimeseriesBarChartPlugin extends EchartsChartPlugin<
loadChart: () => import('../../EchartsTimeseries'),
metadata: {
behaviors: [
Behavior.INTERACTIVE_CHART,
Behavior.DRILL_TO_DETAIL,
Behavior.DRILL_BY,
Behavior.InteractiveChart,
Behavior.DrillToDetail,
Behavior.DrillBy,
],
category: t('Evolution'),
credits: ['https://echarts.apache.org'],

View File

@@ -50,9 +50,9 @@ export default class EchartsTimeseriesLineChartPlugin extends EchartsChartPlugin
loadChart: () => import('../../EchartsTimeseries'),
metadata: {
behaviors: [
Behavior.INTERACTIVE_CHART,
Behavior.DRILL_TO_DETAIL,
Behavior.DRILL_BY,
Behavior.InteractiveChart,
Behavior.DrillToDetail,
Behavior.DrillBy,
],
category: t('Evolution'),
credits: ['https://echarts.apache.org'],

View File

@@ -49,9 +49,9 @@ export default class EchartsTimeseriesScatterChartPlugin extends EchartsChartPlu
loadChart: () => import('../../EchartsTimeseries'),
metadata: {
behaviors: [
Behavior.INTERACTIVE_CHART,
Behavior.DRILL_TO_DETAIL,
Behavior.DRILL_BY,
Behavior.InteractiveChart,
Behavior.DrillToDetail,
Behavior.DrillBy,
],
category: t('Evolution'),
credits: ['https://echarts.apache.org'],

View File

@@ -49,9 +49,9 @@ export default class EchartsTimeseriesSmoothLineChartPlugin extends EchartsChart
loadChart: () => import('../../EchartsTimeseries'),
metadata: {
behaviors: [
Behavior.INTERACTIVE_CHART,
Behavior.DRILL_TO_DETAIL,
Behavior.DRILL_BY,
Behavior.InteractiveChart,
Behavior.DrillToDetail,
Behavior.DrillBy,
],
category: t('Evolution'),
credits: ['https://echarts.apache.org'],

View File

@@ -40,9 +40,9 @@ export default class EchartsTimeseriesStepChartPlugin extends EchartsChartPlugin
loadChart: () => import('../EchartsTimeseries'),
metadata: {
behaviors: [
Behavior.INTERACTIVE_CHART,
Behavior.DRILL_TO_DETAIL,
Behavior.DRILL_BY,
Behavior.InteractiveChart,
Behavior.DrillToDetail,
Behavior.DrillBy,
],
category: t('Evolution'),
credits: ['https://echarts.apache.org'],

View File

@@ -69,7 +69,7 @@ export const DEFAULT_FORM_DATA: EchartsTimeseriesFormData = {
showValue: false,
onlyTotal: false,
percentageThreshold: 0,
orientation: OrientationType.vertical,
orientation: OrientationType.Vertical,
sort_series_type: 'sum',
sort_series_ascending: false,
};

View File

@@ -39,9 +39,9 @@ export default class EchartsTimeseriesChartPlugin extends EchartsChartPlugin<
loadChart: () => import('./EchartsTimeseries'),
metadata: {
behaviors: [
Behavior.INTERACTIVE_CHART,
Behavior.DRILL_TO_DETAIL,
Behavior.DRILL_BY,
Behavior.InteractiveChart,
Behavior.DrillToDetail,
Behavior.DrillBy,
],
category: t('Evolution'),
credits: ['https://echarts.apache.org'],

View File

@@ -204,7 +204,7 @@ export default function transformProps(
) {
xAxisLabel = verboseMap[xAxisLabel];
}
const isHorizontal = orientation === OrientationType.horizontal;
const isHorizontal = orientation === OrientationType.Horizontal;
const { totalStackedValues, thresholdValues } = extractDataTotalValues(
rebasedData,
{
@@ -410,11 +410,11 @@ export default function transformProps(
}
const tooltipFormatter =
xAxisDataType === GenericDataType.TEMPORAL
xAxisDataType === GenericDataType.Temporal
? getTooltipTimeFormatter(tooltipTimeFormat)
: String;
const xAxisFormatter =
xAxisDataType === GenericDataType.TEMPORAL
xAxisDataType === GenericDataType.Temporal
? getXAxisFormatter(xAxisTimeFormat)
: String;
@@ -461,7 +461,7 @@ export default function transformProps(
},
minorTick: { show: minorTicks },
minInterval:
xAxisType === AxisType.time && timeGrainSqla
xAxisType === AxisType.Time && timeGrainSqla
? TIMEGRAIN_TO_TIMESTAMP[timeGrainSqla]
: 0,
...getMinAndMaxFromBounds(
@@ -475,7 +475,7 @@ export default function transformProps(
let yAxis: any = {
...defaultYAxis,
type: logAxis ? AxisType.log : AxisType.value,
type: logAxis ? AxisType.Log : AxisType.Value,
min: yAxisMin,
max: yAxisMax,
minorTick: { show: minorTicks },

View File

@@ -38,8 +38,8 @@ import {
} from '../types';
export enum OrientationType {
vertical = 'vertical',
horizontal = 'horizontal',
Vertical = 'vertical',
Horizontal = 'horizontal',
}
export enum EchartsTimeseriesSeriesType {