Skip to content

Commit

Permalink
fix-addedflinksqlenv-after-showbug
Browse files Browse the repository at this point in the history
  • Loading branch information
Zzm0809 committed Dec 23, 2023
1 parent fd5cd9c commit 1188792
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ import { Modal, Typography } from 'antd';
import { MenuInfo } from 'rc-menu/es/interface';
import React, { Key, useEffect, useState } from 'react';
import { connect } from 'umi';
import {DIALECT} from "@/services/constants";

const { Text } = Typography;

Expand Down Expand Up @@ -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);
Expand Down
10 changes: 10 additions & 0 deletions dinky-web/src/pages/DataStudio/model.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down Expand Up @@ -303,6 +304,7 @@ export type ModelType = {
queryProject: Effect;
queryFlinkConfigOptions: Effect;
querySuggestions: Effect;
queryEnv: Effect;
};
reducers: {
updateToolContentHeight: Reducer<StateType>;
Expand Down Expand Up @@ -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({
Expand Down

0 comments on commit 1188792

Please sign in to comment.