Skip to content

Commit

Permalink
Fix added flinksqlenv after show bug (#2726)
Browse files Browse the repository at this point in the history
* Spotless Apply

* Spotless Apply

* fix-addedflinksqlenv-after-showbug

* Spotless Apply

---------

Co-authored-by: Zzm0809 <[email protected]>
  • Loading branch information
Zzm0809 and Zzm0809 authored Dec 23, 2023
1 parent 2d54ad7 commit acec1e2
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 @@ -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';
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 acec1e2

Please sign in to comment.