+
{{ value }}
diff --git a/packages/nocodb-sdk/src/lib/helperFunctions.ts b/packages/nocodb-sdk/src/lib/helperFunctions.ts
index 8d61d19d62..d9305ebb57 100644
--- a/packages/nocodb-sdk/src/lib/helperFunctions.ts
+++ b/packages/nocodb-sdk/src/lib/helperFunctions.ts
@@ -59,7 +59,16 @@ const stringifyRolesObj = (roles?: RolesObj | null): string => {
};
const getAvailableRollupForUiType = (type: string) => {
- if ([UITypes.Year].includes(type as UITypes)) {
+ if (
+ [
+ UITypes.Year,
+ UITypes.Time,
+ UITypes.Date,
+ UITypes.DateTime,
+ UITypes.CreatedTime,
+ UITypes.LastModifiedTime,
+ ].includes(type as UITypes)
+ ) {
return ['count', 'min', 'max', 'countDistinct'];
}
if (isNumericCol(type as UITypes)) {
@@ -75,16 +84,7 @@ const getAvailableRollupForUiType = (type: string) => {
'avgDistinct',
];
}
- if (
- [
- UITypes.Date,
- UITypes.DateTime,
- UITypes.CreatedTime,
- UITypes.LastModifiedTime,
- ].includes(type as UITypes)
- ) {
- return ['count', 'min', 'max', 'countDistinct'];
- }
+
if (
[
UITypes.SingleLineText,
@@ -119,6 +119,35 @@ const getAvailableRollupForUiType = (type: string) => {
];
};
+const getRenderAsTextFunForUiType = (type: UITypes) => {
+ if (
+ [
+ UITypes.Year,
+ UITypes.Time,
+ UITypes.Date,
+ UITypes.DateTime,
+ UITypes.CreatedTime,
+ UITypes.LastModifiedTime,
+ UITypes.Decimal,
+ UITypes.Currency,
+ UITypes.Duration,
+ ].includes(type)
+ ) {
+ return ['count', 'countDistinct'];
+ }
+
+ return [
+ 'sum',
+ 'count',
+ 'avg',
+ 'min',
+ 'max',
+ 'countDistinct',
+ 'sumDistinct',
+ 'avgDistinct',
+ ];
+};
+
const getFileName = ({ name, count, ext }) =>
`${name}${count ? `(${count})` : ''}${ext ? `${ext}` : ''}`;
@@ -170,6 +199,7 @@ export {
extractRolesObj,
stringifyRolesObj,
getAvailableRollupForUiType,
+ getRenderAsTextFunForUiType,
populateUniqueFileName,
roundUpToPrecision,
};