Merge pull request #14501 from Budibase/budi-8606-view-calculation-typing
Types for new view calculation feature.
This commit is contained in:
commit
1005b83fd5
|
@ -37,6 +37,19 @@ export type ViewUIFieldMetadata = UIFieldMetadata & {
|
||||||
readonly?: boolean
|
readonly?: boolean
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export enum CalculationType {
|
||||||
|
SUM = "sum",
|
||||||
|
AVG = "avg",
|
||||||
|
COUNT = "count",
|
||||||
|
MIN = "min",
|
||||||
|
MAX = "max",
|
||||||
|
}
|
||||||
|
|
||||||
|
export type ViewCalculationFieldMetadata = ViewUIFieldMetadata & {
|
||||||
|
calculationType: CalculationType
|
||||||
|
field: string
|
||||||
|
}
|
||||||
|
|
||||||
export interface ViewV2 {
|
export interface ViewV2 {
|
||||||
version: 2
|
version: 2
|
||||||
id: string
|
id: string
|
||||||
|
@ -49,7 +62,7 @@ export interface ViewV2 {
|
||||||
order?: SortOrder
|
order?: SortOrder
|
||||||
type?: SortType
|
type?: SortType
|
||||||
}
|
}
|
||||||
schema?: Record<string, ViewUIFieldMetadata>
|
schema?: Record<string, ViewUIFieldMetadata | ViewCalculationFieldMetadata>
|
||||||
}
|
}
|
||||||
|
|
||||||
export type ViewSchema = ViewCountOrSumSchema | ViewStatisticsSchema
|
export type ViewSchema = ViewCountOrSumSchema | ViewStatisticsSchema
|
||||||
|
|
Loading…
Reference in New Issue