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 { ...@@ -46,6 +46,7 @@ import {
handlePutDataByParams, handlePutDataByParams,
handleRemoveById handleRemoveById
} from '@/services/BusinessCrud'; } from '@/services/BusinessCrud';
import { DIALECT } from '@/services/constants';
import { API_CONSTANTS } from '@/services/endpoints'; import { API_CONSTANTS } from '@/services/endpoints';
import { Catalogue } from '@/types/Studio/data.d'; import { Catalogue } from '@/types/Studio/data.d';
import { InitProjectState } from '@/types/Studio/init.d'; import { InitProjectState } from '@/types/Studio/init.d';
...@@ -222,6 +223,9 @@ const Project: React.FC = (props: connect) => { ...@@ -222,6 +223,9 @@ const Project: React.FC = (props: connect) => {
...prevState ...prevState
})); }));
dispatch({ type: STUDIO_MODEL_ASYNC.queryProject }); dispatch({ type: STUDIO_MODEL_ASYNC.queryProject });
if (values.type && values.type.toLowerCase() === DIALECT.FLINKSQLENV) {
dispatch({ type: STUDIO_MODEL_ASYNC.queryEnv });
}
if (projectState.isEdit) { if (projectState.isEdit) {
const { id } = values; const { id } = values;
const currentTabs = getTabByTaskId(panes, id); const currentTabs = getTabByTaskId(panes, id);
......
...@@ -20,6 +20,7 @@ ...@@ -20,6 +20,7 @@
import { getFooterValue, isDataStudioTabsItemType } from '@/pages/DataStudio/function'; import { getFooterValue, isDataStudioTabsItemType } from '@/pages/DataStudio/function';
import { getTaskData } from '@/pages/DataStudio/LeftContainer/Project/service'; import { getTaskData } from '@/pages/DataStudio/LeftContainer/Project/service';
import { import {
getEnvData,
getFlinkConfigs, getFlinkConfigs,
querySuggessionData querySuggessionData
} from '@/pages/DataStudio/RightContainer/JobConfig/service'; } from '@/pages/DataStudio/RightContainer/JobConfig/service';
...@@ -303,6 +304,7 @@ export type ModelType = { ...@@ -303,6 +304,7 @@ export type ModelType = {
queryProject: Effect; queryProject: Effect;
queryFlinkConfigOptions: Effect; queryFlinkConfigOptions: Effect;
querySuggestions: Effect; querySuggestions: Effect;
queryEnv: Effect;
}; };
reducers: { reducers: {
updateToolContentHeight: Reducer<StateType>; updateToolContentHeight: Reducer<StateType>;
...@@ -411,6 +413,14 @@ const Model: ModelType = { ...@@ -411,6 +413,14 @@ const Model: ModelType = {
payload: response 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 }) { *queryFlinkConfigOptions({ payload }, { call, put }) {
const response: [] = yield call(getFlinkConfigs, payload); const response: [] = yield call(getFlinkConfigs, payload);
yield put({ 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