Unverified Commit 055bd177 authored by Licho's avatar Licho Committed by GitHub

Fix warning (#2299)

* fix: warnning * Spotless Apply * fix: warnning menu * Spotless Apply --------- Co-authored-by: 's avatarleechor <leechor@users.noreply.github.com>
parent be77c51b
......@@ -131,7 +131,7 @@ export default defineConfig({
default: 'zh-CN',
antd: true,
// default true, when it is true, will use `navigator.language` overwrite default
baseNavigator: true,
baseNavigator: false,
useLocalStorage: true
},
......
......@@ -17,7 +17,7 @@
*
*/
import { Dropdown, Menu } from 'antd';
import { Dropdown } from 'antd';
import { MenuItemType } from 'antd/es/menu/hooks/useItems';
import { MenuInfo } from 'rc-menu/es/interface';
import React from 'react';
......@@ -33,21 +33,18 @@ type RightContextMenuProps = {
const RightContextMenu: React.FC<RightContextMenuProps> = (props) => {
const { onClick, items, openChange, open, contextMenuPosition } = props;
const menu = <Menu onClick={onClick} items={items} />;
return (
<>
<Dropdown
arrow
trigger={['contextMenu']}
overlayStyle={{ ...contextMenuPosition }}
overlay={menu}
open={open}
onOpenChange={openChange}
>
{/*占位*/}
<div style={{ ...contextMenuPosition }} />
</Dropdown>
</>
<Dropdown
arrow
trigger={['contextMenu']}
overlayStyle={{ ...contextMenuPosition }}
menu={{ onClick: onClick, items: items }}
open={open}
onOpenChange={openChange}
>
{/*占位*/}
<div style={{ ...contextMenuPosition }} />
</Dropdown>
);
};
......
......@@ -87,6 +87,7 @@ export default {
//-------------------------------- devops --------------------------------
// devops
'pages.devops.jobinfo.localenv': '本地环境',
'devops.joblist.joblist': '任务列表',
'devops.joblist.history': '历史',
'devops.joblist.detail': '详情',
......@@ -1196,5 +1197,7 @@ export default {
'catalog.udf.templateId': 'UDF 模板',
'catalog.udf.templateId.placeholder': '请选择 UDF 模板',
'catalog.udf.className': '类或方法名',
'catalog.udf.className.placeholder': '请输入类或方法名'
'catalog.udf.className.placeholder': '请输入类或方法名',
'button.push': '提交'
};
......@@ -79,17 +79,15 @@ const RoleModalForm: React.FC<RoleModalProps> = (props) => {
* render
*/
return (
<>
<Modal
{...NORMAL_MODAL_OPTIONS}
title={values.id ? l('role.update') : l('role.create')}
open={modalVisible}
onCancel={() => handleCancel()}
onOk={() => submitForm()}
>
<RoleProForm form={form} values={values} />
</Modal>
</>
<Modal
{...NORMAL_MODAL_OPTIONS}
title={values.id ? l('role.update') : l('role.create')}
open={modalVisible}
onCancel={() => handleCancel()}
onOk={() => submitForm()}
>
<RoleProForm form={form} values={values} />
</Modal>
);
};
export default RoleModalForm;
......@@ -40,19 +40,17 @@ const TenantModalTransfer: React.FC<TableTransferFromProps> = (props) => {
};
return (
<>
<Modal
title={l('tenant.AssignUser')}
open={modalVisible}
destroyOnClose
maskClosable={false}
width={'75%'}
onCancel={() => onCancel()}
onOk={() => handleSubmit(targetKeys)}
>
<TenantTransfer tenant={tenant} onChange={(value) => handleValueChange(value)} />
</Modal>
</>
<Modal
title={l('tenant.AssignUser')}
open={modalVisible}
destroyOnClose
maskClosable={false}
width={'75%'}
onCancel={() => onCancel()}
onOk={() => handleSubmit(targetKeys)}
>
<TenantTransfer tenant={tenant} onChange={(value) => handleValueChange(value)} />
</Modal>
);
};
export default TenantModalTransfer;
......@@ -85,17 +85,15 @@ const PasswordModal: React.FC<PasswordModalFormProps> = (props) => {
* render
*/
return (
<>
<Modal
{...NORMAL_MODAL_OPTIONS}
title={l('button.changePassword')}
open={modalVisible}
onCancel={() => handleCancel()}
onOk={() => submitForm()}
>
<PasswordForm values={values as any} form={form} />
</Modal>
</>
<Modal
{...NORMAL_MODAL_OPTIONS}
title={l('button.changePassword')}
open={modalVisible}
onCancel={() => handleCancel()}
onOk={() => submitForm()}
>
<PasswordForm values={values as any} form={form} />
</Modal>
);
};
......
......@@ -44,19 +44,17 @@ const RoleModalTransfer = (props: RoleTransferFromProps) => {
};
return (
<>
<Modal
title={l('user.assignRole')}
open={modalVisible}
destroyOnClose
maskClosable={false}
width={'75%'}
onCancel={() => handleCancel()}
onOk={() => handleSubmit(targetKeys)}
>
<RoleTransfer role={user} onChange={(value) => handleValueChange(value)} />
</Modal>
</>
<Modal
title={l('user.assignRole')}
open={modalVisible}
destroyOnClose
maskClosable={false}
width={'75%'}
onCancel={() => handleCancel()}
onOk={() => handleSubmit(targetKeys)}
>
<RoleTransfer role={user} onChange={(value) => handleValueChange(value)} />
</Modal>
);
};
export default RoleModalTransfer;
......@@ -76,17 +76,15 @@ const UserModalForm: React.FC<UserModalFormProps> = (props) => {
};
return (
<>
<Modal
{...NORMAL_MODAL_OPTIONS}
title={values.id ? l('user.update') : l('user.create')}
open={modalVisible}
onCancel={() => handleCancel()}
onOk={() => submitForm()}
>
<UserForm values={values} form={form} />
</Modal>
</>
<Modal
{...NORMAL_MODAL_OPTIONS}
title={values.id ? l('user.update') : l('user.create')}
open={modalVisible}
onCancel={() => handleCancel()}
onOk={() => submitForm()}
>
<UserForm values={values} form={form} />
</Modal>
);
};
......
......@@ -32,34 +32,32 @@ const JobRunningModal: React.FC<JobRunningModalProps> = (props) => {
const { visible, onCancel, onOk, value } = props;
return (
<>
<Modal
title={`Job ${value?.jobName} is running`}
open={visible}
onOk={onOk}
width={'50%'}
centered
onCancel={onCancel}
footer={null}
>
<Space direction='vertical' style={{ width: '100%' }}>
<Row gutter={[12, 12]}>
<Col span={23}>
<Progress
showInfo
strokeLinecap={'round'}
percent={100}
status='active'
strokeColor={{ from: '#108ee9', to: '#87d068' }}
/>
</Col>
<Col span={1}>
<StopTwoTone />
</Col>
</Row>
</Space>
</Modal>
</>
<Modal
title={`Job ${value?.jobName} is running`}
open={visible}
onOk={onOk}
width={'50%'}
centered
onCancel={onCancel}
footer={null}
>
<Space direction='vertical' style={{ width: '100%' }}>
<Row gutter={[12, 12]}>
<Col span={23}>
<Progress
showInfo
strokeLinecap={'round'}
percent={100}
status='active'
strokeColor={{ from: '#108ee9', to: '#87d068' }}
/>
</Col>
<Col span={1}>
<StopTwoTone />
</Col>
</Row>
</Space>
</Modal>
);
};
......
......@@ -59,47 +59,45 @@ const HistoryVersion = (props: any) => {
let currentValue = current?.statement;
return (
<>
<Modal
title={l('pages.datastudio.label.version.diff')}
open={versionDiffVisible}
destroyOnClose={true}
width={'85%'}
bodyStyle={{ height: '70vh' }}
onCancel={() => setVersionDiffVisible(false)}
footer={[
<Button key='back' onClick={() => setVersionDiffVisible(false)}>
{l('button.close')}
</Button>
]}
>
<div style={{ display: 'flex', flexDirection: 'row', justifyContent: 'space-between' }}>
<Tag color='green' style={{ height: '20px' }}>
<RocketOutlined /> {leftTitle}
</Tag>
<Tag color='blue' style={{ height: '20px' }}>
<SyncOutlined spin /> {rightTitle}
</Tag>
</div>
<br />
<React.StrictMode>
<DiffEditor
height={'95%'}
options={{
readOnly: true,
selectOnLineNumbers: true,
lineDecorationsWidth: 20,
mouseWheelZoom: true,
automaticLayout: true
}}
language={'sql'}
theme={'vs-dark'}
original={originalValue}
modified={currentValue}
/>
</React.StrictMode>
</Modal>
</>
<Modal
title={l('pages.datastudio.label.version.diff')}
open={versionDiffVisible}
destroyOnClose={true}
width={'85%'}
bodyStyle={{ height: '70vh' }}
onCancel={() => setVersionDiffVisible(false)}
footer={[
<Button key='back' onClick={() => setVersionDiffVisible(false)}>
{l('button.close')}
</Button>
]}
>
<div style={{ display: 'flex', flexDirection: 'row', justifyContent: 'space-between' }}>
<Tag color='green' style={{ height: '20px' }}>
<RocketOutlined /> {leftTitle}
</Tag>
<Tag color='blue' style={{ height: '20px' }}>
<SyncOutlined spin /> {rightTitle}
</Tag>
</div>
<br />
<React.StrictMode>
<DiffEditor
height={'95%'}
options={{
readOnly: true,
selectOnLineNumbers: true,
lineDecorationsWidth: 20,
mouseWheelZoom: true,
automaticLayout: true
}}
language={'sql'}
theme={'vs-dark'}
original={originalValue}
modified={currentValue}
/>
</React.StrictMode>
</Modal>
);
};
......
......@@ -193,7 +193,6 @@ const JobConfig = (props: any) => {
tooltip={l('pages.datastudio.label.jobConfig.flinksql.env.tip1')}
options={buildEnvOptions(env)}
showSearch
initialValue={0}
/>
<ProFormGroup>
......@@ -243,7 +242,6 @@ const JobConfig = (props: any) => {
name='savePointStrategy'
tooltip={l('pages.datastudio.label.jobConfig.savePointStrategy.tip')}
options={SAVE_POINT_TYPE}
initialValue={0}
/>
{current?.savePointStrategy === 3 && (
......
......@@ -368,14 +368,14 @@ const Model: ModelType = {
*queryProject({ payload }, { call, put }) {
const response: [] = yield call(getTaskData, payload);
yield put({
type: STUDIO_MODEL.saveProject,
type: 'saveProject',
payload: response
});
},
*queryFlinkConfigOptions({ payload }, { call, put }) {
const response: [] = yield call(getFlinkConfigs, payload);
yield put({
type: STUDIO_MODEL.saveFlinkConfigOptions,
type: 'saveFlinkConfigOptions',
payload: response
});
}
......
......@@ -52,22 +52,20 @@ const ChooseModal: React.FC<ChooseModalProps> = (props) => {
};
return (
<>
<Modal
title={l('login.chooseTenant')}
open={tenantVisible}
{...NORMAL_MODAL_OPTIONS}
onCancel={handleTenantVisible}
onOk={() => handleChooseTenant(checkedTenantId)}
okText={l('button.confirm')}
okButtonProps={{
disabled: check,
loading: submitting
}}
>
<TenantCard tenant={tenant} handleChangeTenant={tenantChange} />
</Modal>
</>
<Modal
title={l('login.chooseTenant')}
open={tenantVisible}
{...NORMAL_MODAL_OPTIONS}
onCancel={handleTenantVisible}
onOk={() => handleChooseTenant(checkedTenantId)}
okText={l('button.confirm')}
okButtonProps={{
disabled: check,
loading: submitting
}}
>
<TenantCard tenant={tenant} handleChangeTenant={tenantChange} />
</Modal>
);
};
......
......@@ -38,18 +38,16 @@ const ResultShow: React.FC<ResultShowProps> = (props) => {
} = props;
return (
<>
<Modal
title={l('global.result')}
open={open}
{...NORMAL_MODAL_OPTIONS}
onCancel={onCancel}
okButtonProps={{ hidden: true }}
cancelText={l('button.close')}
>
<CodeShow language={'json'} height={'60vh'} code={data} />
</Modal>
</>
<Modal
title={l('global.result')}
open={open}
{...NORMAL_MODAL_OPTIONS}
onCancel={onCancel}
okButtonProps={{ hidden: true }}
cancelText={l('button.close')}
>
<CodeShow language={'json'} height={'60vh'} code={data} />
</Modal>
);
};
......
......@@ -68,17 +68,15 @@ const DocumentModalForm: React.FC<DocumentModalProps> = (props) => {
};
return (
<>
<Modal
{...NORMAL_MODAL_OPTIONS}
title={values.id ? l('rc.doc.modify') : l('rc.doc.create')}
open={modalVisible}
onOk={() => submitForm()}
onCancel={() => handleModalVisible()}
>
<DocumentForm values={values} form={form} />
</Modal>
</>
<Modal
{...NORMAL_MODAL_OPTIONS}
title={values.id ? l('rc.doc.modify') : l('rc.doc.create')}
open={modalVisible}
onOk={() => submitForm()}
onCancel={() => handleModalVisible()}
>
<DocumentForm values={values} form={form} />
</Modal>
);
};
......
......@@ -175,24 +175,22 @@ export const BuildSteps: React.FC<BuildStepsProps> = (props) => {
* render
*/
return (
<>
<Modal
title={title}
width={'85%'}
open={true}
maskClosable={false}
onCancel={() => handleCancel()}
okButtonProps={{ style: { display: 'none' } }}
>
<AutoSteps
steps={steps}
percent={percent}
currentStep={currentStep}
values={values}
log={log}
showList={showList}
/>
</Modal>
</>
<Modal
title={title}
width={'85%'}
open={true}
maskClosable={false}
onCancel={() => handleCancel()}
okButtonProps={{ style: { display: 'none' } }}
>
<AutoSteps
steps={steps}
percent={percent}
currentStep={currentStep}
values={values}
log={log}
showList={showList}
/>
</Modal>
);
};
......@@ -32,18 +32,16 @@ export const CodeTree: React.FC<CodeTreeProps> = (props) => {
const { values, modalVisible, onCancel } = props;
return (
<>
<Modal
title={l('rc.gp.codeTree')}
width={'95%'}
open={modalVisible}
maskClosable={false}
onCancel={() => onCancel()}
cancelText={l('button.close')}
okButtonProps={{ style: { display: 'none' } }}
>
<CodeTreeShow values={values} />
</Modal>
</>
<Modal
title={l('rc.gp.codeTree')}
width={'95%'}
open={modalVisible}
maskClosable={false}
onCancel={() => onCancel()}
cancelText={l('button.close')}
okButtonProps={{ style: { display: 'none' } }}
>
<CodeTreeShow values={values} />
</Modal>
);
};
......@@ -75,17 +75,15 @@ const GlobalVarModal: React.FC<GlobalVarModalProps> = (props) => {
};
return (
<>
<Modal
{...NORMAL_MODAL_OPTIONS}
title={values.id ? l('rc.gv.modify') : l('rc.gv.create')}
open={modalVisible}
onOk={() => submitForm()}
onCancel={() => handleModalVisible()}
>
<GlobalVarForm form={form} values={values} />
</Modal>
</>
<Modal
{...NORMAL_MODAL_OPTIONS}
title={values.id ? l('rc.gv.modify') : l('rc.gv.create')}
open={modalVisible}
onOk={() => submitForm()}
onCancel={() => handleModalVisible()}
>
<GlobalVarForm form={form} values={values} />
</Modal>
);
};
......
......@@ -40,17 +40,15 @@ const ShowLog: React.FC<ShowLogProps> = (props) => {
const { type, log, visibleViewLog, cancelViewLog } = props;
return (
<>
<Modal
{...NORMAL_MODAL_OPTIONS}
title={type}
open={visibleViewLog}
onCancel={cancelViewLog}
okButtonProps={{ style: { display: 'none' } }}
>
<CodeShow {...CodeEditProps} code={log} showFloatButton />
</Modal>
</>
<Modal
{...NORMAL_MODAL_OPTIONS}
title={type}
open={visibleViewLog}
onCancel={cancelViewLog}
okButtonProps={{ style: { display: 'none' } }}
>
<CodeShow {...CodeEditProps} code={log} showFloatButton />
</Modal>
);
};
......
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