unlock relation date fields on dashboards (#16207)

This commit is contained in:
nitin
2025-12-01 22:18:52 +05:30
committed by GitHub
parent 32f387a966
commit a8e7d4dfc3
22 changed files with 818 additions and 25 deletions
@@ -20,11 +20,13 @@ export const buildGroupByFieldObject = ({
subFieldName,
dateGranularity,
firstDayOfTheWeek,
isNestedDateField,
}: {
field: FieldMetadataItem;
subFieldName?: string | null;
dateGranularity?: ObjectRecordGroupByDateGranularity;
firstDayOfTheWeek?: number | null;
isNestedDateField?: boolean;
}): GroupByFieldObject => {
const isRelation = isFieldRelation(field) || isFieldMorphRelation(field);
const isComposite = isCompositeFieldType(field.type);
@@ -39,6 +41,16 @@ export const buildGroupByFieldObject = ({
const nestedFieldName = parts[0];
const nestedSubFieldName = parts[1];
if (isNestedDateField === true || isDefined(dateGranularity)) {
return {
[field.name]: {
[nestedFieldName]: {
granularity: dateGranularity ?? GRAPH_DEFAULT_DATE_GRANULARITY,
},
},
};
}
if (isDefined(nestedSubFieldName)) {
return {
[field.name]: {