forked from apache/superset
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Remove unnecessary export types and reorganize types (apache#99)
* fix re-export types in translation * Fix more types * reorganize type in chart package * Fix unit tests * remove Array<> in favor of []
- Loading branch information
Showing
36 changed files
with
234 additions
and
209 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
58 changes: 3 additions & 55 deletions
58
...ges/superset-ui-chart/src/query/Metric.ts → ...es/superset-ui-chart/src/query/Metrics.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
/* eslint-disable import/prefer-default-export */ | ||
|
||
export type AnnotationLayerMetadata = { | ||
name: string; | ||
sourceType?: string; | ||
}; |
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
/* eslint-disable import/prefer-default-export */ | ||
|
||
export enum DatasourceType { | ||
Table = 'table', | ||
Druid = 'druid', | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
import { Column } from './Column'; | ||
|
||
// Note that the values of MetricKeys are lower_snake_case because they're | ||
// used as keys of form data jsons. | ||
export enum MetricKey { | ||
METRIC = 'metric', | ||
METRICS = 'metrics', | ||
PERCENT_METRICS = 'percent_metrics', | ||
RIGHT_AXIS_METRIC = 'metric_2', | ||
SECONDARY_METRIC = 'secondary_metric', | ||
X = 'x', | ||
Y = 'y', | ||
SIZE = 'size', | ||
} | ||
|
||
export enum Aggregate { | ||
AVG = 'AVG', | ||
COUNT = 'COUNT ', | ||
COUNT_DISTINCT = 'COUNT_DISTINCT', | ||
MAX = 'MAX', | ||
MIN = 'MIN', | ||
SUM = 'SUM', | ||
} | ||
|
||
export enum ExpressionType { | ||
SIMPLE = 'SIMPLE', | ||
SQL = 'SQL', | ||
} | ||
|
||
interface AdhocMetricSimple { | ||
expressionType: ExpressionType.SIMPLE; | ||
column: Column; | ||
aggregate: Aggregate; | ||
} | ||
|
||
interface AdhocMetricSQL { | ||
expressionType: ExpressionType.SQL; | ||
sqlExpression: string; | ||
} | ||
|
||
export type AdhocMetric = { | ||
label?: string; | ||
optionName?: string; | ||
} & (AdhocMetricSimple | AdhocMetricSQL); | ||
|
||
// Type of metrics in form data | ||
export type FormDataMetric = string | AdhocMetric; | ||
|
||
// Type of Metric the client provides to server after unifying various forms | ||
// of metrics in form data | ||
export type Metric = { | ||
label: string; | ||
} & Partial<AdhocMetric>; |
Oops, something went wrong.