Browse Source

fix: coderabbit suggestion

pull/8900/head
Raju Udava 5 months ago
parent
commit
c984055bb1
  1. 23
      packages/nocodb-sdk/src/lib/helperFunctions.ts

23
packages/nocodb-sdk/src/lib/helperFunctions.ts

@ -61,7 +61,8 @@ const stringifyRolesObj = (roles?: RolesObj | null): string => {
const getAvailableRollupForUiType = (type: string) => {
if ([UITypes.Year].includes(type as UITypes)) {
return ['count', 'min', 'max', 'countDistinct'];
} else if (isNumericCol(type as UITypes)) {
}
if (isNumericCol(type as UITypes)) {
// Number, Currency, Percent, Duration, Rating, Decimal
return [
'sum',
@ -73,7 +74,8 @@ const getAvailableRollupForUiType = (type: string) => {
'sumDistinct',
'avgDistinct',
];
} else if (
}
if (
[
UITypes.Date,
UITypes.DateTime,
@ -82,7 +84,8 @@ const getAvailableRollupForUiType = (type: string) => {
].includes(type as UITypes)
) {
return ['count', 'min', 'max', 'countDistinct'];
} else if (
}
if (
[
UITypes.SingleLineText,
UITypes.LongText,
@ -94,15 +97,16 @@ const getAvailableRollupForUiType = (type: string) => {
].includes(type as UITypes)
) {
return ['count', 'countDistinct'];
} else if ([UITypes.Checkbox].includes(type as UITypes)) {
}
if ([UITypes.Checkbox].includes(type as UITypes)) {
return ['count', 'sum'];
} else if ([UITypes.Attachment].includes(type as UITypes)) {
}
if ([UITypes.Attachment].includes(type as UITypes)) {
return [];
} else if (
[UITypes.SingleSelect, UITypes.MultiSelect].includes(type as UITypes)
) {
}
if ([UITypes.SingleSelect, UITypes.MultiSelect].includes(type as UITypes)) {
return ['count', 'countDistinct'];
} else {
}
return [
'sum',
'count',
@ -113,7 +117,6 @@ const getAvailableRollupForUiType = (type: string) => {
'sumDistinct',
'avgDistinct',
];
}
};
const getFileName = ({ name, count, ext }) =>

Loading…
Cancel
Save