Unverified Commit acec1e20 authored by Zzm0809's avatar Zzm0809 Committed by GitHub

Fix added flinksqlenv after show bug (#2726)

* Spotless Apply * Spotless Apply * fix-addedflinksqlenv-after-showbug * Spotless Apply --------- Co-authored-by: 's avatarZzm0809 <Zzm0809@users.noreply.github.com>
parent 2d54ad79
......@@ -46,6 +46,7 @@ import {
handlePutDataByParams,
handleRemoveById
} from '@/services/BusinessCrud';
import { DIALECT } from '@/services/constants';
import { API_CONSTANTS } from '@/services/endpoints';
import { Catalogue } from '@/types/Studio/data.d';
import { InitProjectState } from '@/types/Studio/init.d';
......@@ -222,6 +223,9 @@ const Project: React.FC = (props: connect) => {
...prevState
}));
dispatch({ type: STUDIO_MODEL_ASYNC.queryProject });
if (values.type && values.type.toLowerCase() === DIALECT.FLINKSQLENV) {
dispatch({ type: STUDIO_MODEL_ASYNC.queryEnv });
}
if (projectState.isEdit) {
const { id } = values;
const currentTabs = getTabByTaskId(panes, id);
......
......@@ -20,6 +20,7 @@
import { getFooterValue, isDataStudioTabsItemType } from '@/pages/DataStudio/function';
import { getTaskData } from '@/pages/DataStudio/LeftContainer/Project/service';
import {
getEnvData,
getFlinkConfigs,
querySuggessionData
} from '@/pages/DataStudio/RightContainer/JobConfig/service';
......@@ -303,6 +304,7 @@ export type ModelType = {
queryProject: Effect;
queryFlinkConfigOptions: Effect;
querySuggestions: Effect;
queryEnv: Effect;
};
reducers: {
updateToolContentHeight: Reducer<StateType>;
......@@ -411,6 +413,14 @@ const Model: ModelType = {
payload: response
});
},
*queryEnv({ payload }, { call, put }) {
const response: EnvType[] = yield call(getEnvData, payload);
console.log(response);
yield put({
type: 'saveEnv',
payload: response
});
},
*queryFlinkConfigOptions({ payload }, { call, put }) {
const response: [] = yield call(getFlinkConfigs, payload);
yield put({
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment