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