Skip to content

Commit

Permalink
[BugFix][Web] Fix the data development page and enable system configu…
Browse files Browse the repository at this point in the history
…ration (#3936)

Co-authored-by: zackyoungh <[email protected]>
  • Loading branch information
zackyoungh and zackyoungh authored Nov 22, 2024
1 parent 6cff319 commit acf0525
Show file tree
Hide file tree
Showing 6 changed files with 24 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,6 @@ const PasswordModal: React.FC<PasswordFormProps> = (props) => {
<ProForm
{...FORM_LAYOUT_PUBLIC}
form={form}
initialValues={values}
layout={'horizontal'}
submitter={{
render: (submitProps, doms) => {
Expand Down
5 changes: 5 additions & 0 deletions dinky-web/src/pages/DataStudio/DvaFunction.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,11 @@ export const mapDispatchToProps = (dispatch: Dispatch) => {
dispatch({
type: CONFIG_MODEL_ASYNC.queryTaskOwnerLockingStrategy,
payload: params
}),
queryDsConfig: (params: string) =>
dispatch({
type: CONFIG_MODEL_ASYNC.queryDsConfig,
payload: params
})
};
};
6 changes: 5 additions & 1 deletion dinky-web/src/pages/DataStudio/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,9 @@ const DataStudio: React.FC = (props: any) => {
queryFlinkUdfOptions,
queryDataSourceDataList,
querySuggestions,
queryUserData
queryUserData,
queryDsConfig,
queryTaskOwnerLockingStrategy
} = props;
const [_, token] = useToken();

Expand Down Expand Up @@ -133,6 +135,8 @@ const DataStudio: React.FC = (props: any) => {
await queryDataSourceDataList();
await querySuggestions();
await queryUserData({ id: getTenantByLocalStorage() });
await queryDsConfig();
await queryTaskOwnerLockingStrategy();
}, []);
useEffect(() => {
const { actionType, params } = dataStudioState.action;
Expand Down
2 changes: 1 addition & 1 deletion dinky-web/src/pages/DevOps/JobList/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,7 @@ const JobList = (props: connect) => {
useEffect(() => {
setInterval(() => tableRef.current?.reload(false), 5 * 1000);
queryUserData({ id: getTenantByLocalStorage() });
queryTaskOwnerLockingStrategy(SettingConfigKeyEnum.ENV.toLowerCase());
queryTaskOwnerLockingStrategy();
}, []);

const onChangeSearch = (e: any) => {
Expand Down
8 changes: 4 additions & 4 deletions dinky-web/src/pages/SettingCenter/GlobalSetting/model.ts
Original file line number Diff line number Diff line change
Expand Up @@ -69,8 +69,8 @@ const ConfigModel: ConfigModelType = {
},

effects: {
*queryTaskOwnerLockingStrategy({ payload }, { call, put }) {
const response: BaseConfigProperties[] = yield call(queryTaskOwnerLockingStrategy, payload);
*queryTaskOwnerLockingStrategy({}, { call, put }) {
const response: BaseConfigProperties[] = yield call(queryTaskOwnerLockingStrategy);
if (response && response.length > 0) {
const taskOwnerLockingStrategy = response.find(
(item) => item.key === GLOBAL_SETTING_KEYS.SYS_ENV_SETTINGS_TASK_OWNER_LOCK_STRATEGY
Expand All @@ -84,8 +84,8 @@ const ConfigModel: ConfigModelType = {
});
}
},
*queryDsConfig({ payload }, { call, put }) {
const response: BaseConfigProperties[] = yield call(queryDsConfig, payload);
*queryDsConfig({}, { call, put }) {
const response: BaseConfigProperties[] = yield call(queryDsConfig);
yield put({
type: 'saveDsConfig',
payload: response || []
Expand Down
13 changes: 9 additions & 4 deletions dinky-web/src/pages/SettingCenter/GlobalSetting/service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,15 +19,20 @@

import { queryDataByParams } from '@/services/BusinessCrud';
import { API_CONSTANTS } from '@/services/endpoints';
import { SettingConfigKeyEnum } from '@/pages/SettingCenter/GlobalSetting/SettingOverView/constants';

export async function queryDsConfig(keyword: string) {
return await queryDataByParams(API_CONSTANTS.SYSTEM_GET_ONE_TYPE_CONFIG, { type: keyword });
export async function queryDsConfig() {
return await queryDataByParams(API_CONSTANTS.SYSTEM_GET_ONE_TYPE_CONFIG, {
type: SettingConfigKeyEnum.DOLPHIN_SCHEDULER.toLowerCase()
});
}

export async function queryResourceConfig(keyword: string) {
return await queryDataByParams(API_CONSTANTS.SYSTEM_GET_ONE_TYPE_CONFIG, { type: keyword });
}

export async function queryTaskOwnerLockingStrategy(keyword: string) {
return await queryDataByParams(API_CONSTANTS.SYSTEM_GET_ONE_TYPE_CONFIG, { type: keyword });
export async function queryTaskOwnerLockingStrategy() {
return await queryDataByParams(API_CONSTANTS.SYSTEM_GET_ONE_TYPE_CONFIG, {
type: SettingConfigKeyEnum.ENV.toLowerCase()
});
}

0 comments on commit acf0525

Please sign in to comment.