unlock relation date fields on dashboards (#16207)
This commit is contained in:
+12
@@ -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]: {
|
||||
|
||||
Reference in New Issue
Block a user