fixes: loosen up front validation, add resolveEntityRelationUniversalIdentifiers to update and restore (#18015)

closes https://github.com/twentyhq/private-issues/issues/419
This commit is contained in:
nitin
2026-02-18 16:05:08 +05:30
committed by GitHub
parent 08a3d983cb
commit 477fbc0865
14 changed files with 97 additions and 364 deletions
@@ -4,6 +4,7 @@ import {
} from '~/generated-metadata/graphql';
export type BarLineChartConvertibleFields = {
aggregateFieldMetadataId?: string;
primaryAxisGroupByFieldMetadataId?: string;
primaryAxisGroupBySubFieldName?: string | null;
primaryAxisDateGranularity?: ObjectRecordGroupByDateGranularity | null;
@@ -4,6 +4,7 @@ import {
} from '~/generated-metadata/graphql';
export type PieChartConvertibleFields = {
aggregateFieldMetadataId?: string;
groupByFieldMetadataId?: string;
groupBySubFieldName?: string | null;
dateGranularity?: ObjectRecordGroupByDateGranularity | null;
@@ -19,6 +19,9 @@ describe('convertBarOrLineChartConfigToPieChart', () => {
TEST_BAR_CHART_CONFIGURATION.primaryAxisGroupBySubFieldName,
dateGranularity: TEST_BAR_CHART_CONFIGURATION.primaryAxisDateGranularity,
orderBy: TEST_BAR_CHART_CONFIGURATION.primaryAxisOrderBy,
splitMultiValueFields: TEST_BAR_CHART_CONFIGURATION.splitMultiValueFields,
aggregateFieldMetadataId:
TEST_BAR_CHART_CONFIGURATION.aggregateFieldMetadataId,
});
});
@@ -34,6 +37,10 @@ describe('convertBarOrLineChartConfigToPieChart', () => {
TEST_LINE_CHART_CONFIGURATION.primaryAxisGroupBySubFieldName,
dateGranularity: TEST_LINE_CHART_CONFIGURATION.primaryAxisDateGranularity,
orderBy: TEST_LINE_CHART_CONFIGURATION.primaryAxisOrderBy,
splitMultiValueFields:
TEST_LINE_CHART_CONFIGURATION.splitMultiValueFields,
aggregateFieldMetadataId:
TEST_LINE_CHART_CONFIGURATION.aggregateFieldMetadataId,
});
});
@@ -12,12 +12,15 @@ describe('convertPieChartConfigToBarOrLineChart', () => {
);
expect(result).toEqual({
aggregateFieldMetadataId:
TEST_PIE_CHART_CONFIGURATION.aggregateFieldMetadataId,
primaryAxisGroupByFieldMetadataId:
TEST_PIE_CHART_CONFIGURATION.groupByFieldMetadataId,
primaryAxisGroupBySubFieldName:
TEST_PIE_CHART_CONFIGURATION.groupBySubFieldName,
primaryAxisDateGranularity: TEST_PIE_CHART_CONFIGURATION.dateGranularity,
primaryAxisOrderBy: TEST_PIE_CHART_CONFIGURATION.orderBy,
splitMultiValueFields: TEST_PIE_CHART_CONFIGURATION.splitMultiValueFields,
});
});
@@ -33,10 +36,13 @@ describe('convertPieChartConfigToBarOrLineChart', () => {
const result = convertPieChartConfigToBarOrLineChart(minimalPieConfig);
expect(result).toEqual({
aggregateFieldMetadataId:
TEST_PIE_CHART_CONFIGURATION.aggregateFieldMetadataId,
primaryAxisGroupByFieldMetadataId: undefined,
primaryAxisGroupBySubFieldName: null,
primaryAxisDateGranularity: null,
primaryAxisOrderBy: null,
splitMultiValueFields: TEST_PIE_CHART_CONFIGURATION.splitMultiValueFields,
});
});
@@ -15,6 +15,7 @@ export const convertBarOrLineChartConfigToPieChart = (
}
return {
aggregateFieldMetadataId: configuration.aggregateFieldMetadataId,
groupByFieldMetadataId: configuration.primaryAxisGroupByFieldMetadataId,
groupBySubFieldName: configuration.primaryAxisGroupBySubFieldName,
dateGranularity: configuration.primaryAxisDateGranularity,
@@ -10,6 +10,7 @@ export const convertPieChartConfigToBarOrLineChart = (
}
return {
aggregateFieldMetadataId: configuration.aggregateFieldMetadataId,
primaryAxisGroupByFieldMetadataId: configuration.groupByFieldMetadataId,
primaryAxisGroupBySubFieldName: configuration.groupBySubFieldName,
primaryAxisDateGranularity: configuration.dateGranularity,