Skip to content

Commit ba34d56

Browse files
committed
fix: getViewOption by beginViewModelMigration
1 parent bb8941e commit ba34d56

File tree

1 file changed

+10
-7
lines changed
  • frontend/src/app/pages/DashBoardPage/pages/BoardEditor/components/ControllerWidgetPanel/ControllerConfig/ValuesSetter/ValuesOptionsSetter

1 file changed

+10
-7
lines changed

frontend/src/app/pages/DashBoardPage/pages/BoardEditor/components/ControllerWidgetPanel/ControllerConfig/ValuesSetter/ValuesOptionsSetter/ValuesOptionsSetter.tsx

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
import { Form, FormInstance, Radio, Select, Space } from 'antd';
2020
import { CascaderOptionType } from 'antd/lib/cascader';
2121
import useI18NPrefix from 'app/hooks/useI18NPrefix';
22+
import beginViewModelMigration from 'app/migration/ViewConfig/migrationViewModelConfig';
2223
import {
2324
OPERATOR_TYPE_OPTION,
2425
ValueOptionType,
@@ -69,13 +70,15 @@ const ValuesOptionsSetter: FC<{
6970
if (!viewId) return [];
7071
try {
7172
const { data } = await request2<View>(`/views/${viewId}`);
72-
const model = JSON.parse(data.model);
73-
const option: CascaderOptionType[] = Object.keys(model).map(key => {
74-
return {
75-
value: key,
76-
label: key,
77-
};
78-
});
73+
let model = JSON.parse(beginViewModelMigration(data?.model));
74+
const option: CascaderOptionType[] = Object.keys(model.columns).map(
75+
key => {
76+
return {
77+
value: key,
78+
label: key,
79+
};
80+
},
81+
);
7982
return option;
8083
} catch (error) {
8184
errorHandle(error);

0 commit comments

Comments
 (0)