Allow counting on non-numeric fields
This commit is contained in:
parent
e3b499885f
commit
c85dd1f6f8
|
@ -90,8 +90,15 @@
|
||||||
const getFieldOptions = (self, calculations, schema) => {
|
const getFieldOptions = (self, calculations, schema) => {
|
||||||
return Object.entries(schema)
|
return Object.entries(schema)
|
||||||
.filter(([field, fieldSchema]) => {
|
.filter(([field, fieldSchema]) => {
|
||||||
// Only allow numeric fields that are not calculations themselves
|
// Don't allow other calculation columns
|
||||||
if (fieldSchema.calculationType || !isNumeric(fieldSchema.type)) {
|
if (fieldSchema.calculationType) {
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
// Only allow numeric columns for most calculation types
|
||||||
|
if (
|
||||||
|
self.type !== CalculationType.COUNT &&
|
||||||
|
!isNumeric(fieldSchema.type)
|
||||||
|
) {
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
// Don't allow duplicates
|
// Don't allow duplicates
|
||||||
|
@ -257,6 +264,4 @@
|
||||||
.group-by {
|
.group-by {
|
||||||
grid-column: 2 / 5;
|
grid-column: 2 / 5;
|
||||||
}
|
}
|
||||||
span {
|
|
||||||
}
|
|
||||||
</style>
|
</style>
|
||||||
|
|
Loading…
Reference in New Issue