diff --git a/frontend/src/app/pages/ChartWorkbenchPage/slice/thunks.ts b/frontend/src/app/pages/ChartWorkbenchPage/slice/thunks.ts index 7e579f118..d58fe0f68 100644 --- a/frontend/src/app/pages/ChartWorkbenchPage/slice/thunks.ts +++ b/frontend/src/app/pages/ChartWorkbenchPage/slice/thunks.ts @@ -29,7 +29,10 @@ import { buildUpdateChartRequest, convertToChartDto, } from 'app/utils/ChartDtoHelper'; -import { filterCurrentUsedComputedFields } from 'app/utils/chartHelper'; +import { + createDateLevelComputedFieldForConfigComputedFields, + filterCurrentUsedComputedFields +} from 'app/utils/chartHelper'; import { fetchAvailableSourceFunctionsAsync } from 'app/utils/fetch'; import { filterSqlOperatorName } from 'app/utils/internalChartHelper'; import { request2 } from 'utils/request'; @@ -208,6 +211,19 @@ export const fetchChartAction = createAsyncThunk< }); return convertToChartDto(response?.data); } + + if (arg.backendChart?.config) { + return { + ...arg.backendChart, + config: { + ...arg.backendChart.config, + computedFields: createDateLevelComputedFieldForConfigComputedFields( + arg.backendChart?.view.meta, + arg.backendChart?.config.computedFields, + ) + } + } + } return arg.backendChart as any; });