Skip to content

Commit

Permalink
PullRequest: 194 feat/dev-4.2.2-typeExport-1009
Browse files Browse the repository at this point in the history
Merge branch feat/dev-4.2.2-typeExport-1009 of [email protected]:oceanbase/oceanbase-developer-center.git into dev-4.2.2
https://code.alipay.com/oceanbase/oceanbase-developer-center/pull_requests/194

Signed-off-by: 晓康 <[email protected]>


* feat: data-transfer task should display export objects before completion

* feat: add datasource field to task detail

* fix: clear getDerivedStateFromProps warning

* chore: clear Modal and Drawer warning
  • Loading branch information
bluesky-xyh committed Oct 10, 2023
1 parent bbb2400 commit 40c4b27
Show file tree
Hide file tree
Showing 43 changed files with 79 additions and 57 deletions.
2 changes: 1 addition & 1 deletion src/component/AskEventTrackingModal/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ const AskeventTrackingPermissionModal: React.FC<IProps> = (props: IProps) => {
closable={false}
destroyOnClose
maskClosable={false}
visible={visible}
open={visible}
onOk={save}
okText={
formatMessage({ id: 'odc.component.AskEventTrackingModal.Agree' }) //同意
Expand Down
2 changes: 1 addition & 1 deletion src/component/BatchImportButton/modal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ const BatchImportModal: React.FC<IProps> = (props) => {
</Space>
}
destroyOnClose
visible={visible}
open={visible}
onClose={handleCancel}
footerStyle={{
textAlign: 'right',
Expand Down
2 changes: 1 addition & 1 deletion src/component/ChangePasswordModal/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ class ChangePasswordModal extends Component<IProps> {
width={560}
destroyOnClose
title={title || formatMessage({ id: 'login.button.changePassword' })}
visible={visible}
open={visible}
onOk={this.handleSubmit}
onCancel={onCancel}
confirmLoading={confirmLoading}
Expand Down
2 changes: 1 addition & 1 deletion src/component/CreateFunctionModal/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ const CreateFunctionModal: React.FC<IProps> = inject(
title={formatMessage({
id: 'workspace.window.createFunction.modal.title',
})}
visible={visible}
open={visible}
onOk={save}
onCancel={onCancel}
>
Expand Down
2 changes: 1 addition & 1 deletion src/component/CreatePackageModal/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ function CreatePackageModal(props: IProps) {
title={formatMessage({
id: 'workspace.window.createPackage.modal.title',
})}
visible={modalStore.createPackageModalVisible}
open={modalStore.createPackageModalVisible}
okText={formatMessage({
id: 'odc.component.CreatePackageModal.NextConfirmTheSqlStatement',
})} /* 下一步:确认 SQL */
Expand Down
2 changes: 1 addition & 1 deletion src/component/CreateSynonymModal/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -242,7 +242,7 @@ class CreateSynonymModal extends Component<IProps & { session: SessionStore }, I
title={formatMessage({
id: 'odc.component.CreateSynonymModal.CreateSynonym',
})}
visible={modalStore.createSynonymModalVisible}
open={modalStore.createSynonymModalVisible}
onCancel={this.close}
maskClosable={false}
centered
Expand Down
2 changes: 1 addition & 1 deletion src/component/CreateTypeModal/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ function CreateTypeModal(props: IProps) {
destroyOnClose
title={formatMessage({ id: 'odc.component.CreateTypeModal.NewType' })}
/* 新建类型 */
visible={modalStore.createTypeModalVisible}
open={modalStore.createTypeModalVisible}
onCancel={handleCancel}
maskClosable={false}
centered
Expand Down
2 changes: 1 addition & 1 deletion src/component/ExecuteSQLModal/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ const ExecuteSQLModal: React.FC<IProps> = (props) => {
title={formatMessage({
id: 'workspace.window.session.modal.sql.title',
})}
visible={visible}
open={visible}
onOk={handleSubmit}
onCancel={onCancel}
footer={[
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,7 @@ class SnippetFormDrawer extends PureComponent<IProps> {
width={520}
maskClosable={false}
onClose={this.onClose}
visible={visible}
open={visible}
bodyStyle={{
paddingBottom: 80,
}}
Expand Down
8 changes: 5 additions & 3 deletions src/component/LoginMenus/ChangeLockPwdModal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ const ChangeLockPwd: React.FC<IProps> = function (props: IProps) {
id: 'odc.component.LoginMenus.ChangeLockPwd.SetTheApplicationPassword',
})}
/* 设置应用密码 */
visible={props.visible}
open={props.visible}
onCancel={closeModal}
footer={
<Space>
Expand All @@ -74,7 +74,8 @@ const ChangeLockPwd: React.FC<IProps> = function (props: IProps) {
} else {
message.error(
formatMessage({
id: 'odc.component.LoginMenus.ChangeLockPwdModal.UnableToDeleteCheckWhether',
id:
'odc.component.LoginMenus.ChangeLockPwdModal.UnableToDeleteCheckWhether',
}),
// 删除失败,请确认密码是否正确
);
Expand Down Expand Up @@ -108,7 +109,8 @@ const ChangeLockPwd: React.FC<IProps> = function (props: IProps) {
if (values.password !== values.confirmPassword) {
message.warn(
formatMessage({
id: 'odc.component.LoginMenus.ChangeLockPwdModal.TheTwoPasswordsAreInconsistent',
id:
'odc.component.LoginMenus.ChangeLockPwdModal.TheTwoPasswordsAreInconsistent',
}),
// 两次密码输入不一致!
);
Expand Down
2 changes: 1 addition & 1 deletion src/component/Manage/DeleteModal/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ export const CommonDeleteModal: React.FC<{

return (
<Modal
visible={visible}
open={visible}
title={
formatMessage(
{
Expand Down
2 changes: 1 addition & 1 deletion src/component/Manage/DetailModal/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ const CommonDetailModal: React.FC<IProps> = (props) => {

return (
<Drawer
visible={visible}
open={visible}
width={width}
title={title}
destroyOnClose
Expand Down
2 changes: 1 addition & 1 deletion src/component/PropertyModal/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ class PropertyModal extends Component<IProps> {
title={formatMessage({
id: 'workspace.window.session.modal.title',
})}
visible={visible}
open={visible}
onOk={this.save}
onCancel={onCancel}
>
Expand Down
2 changes: 1 addition & 1 deletion src/component/RecordPopover/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ const RecordPopover: React.FC<{}> = () => {
<SyncOutlined onClick={handleReload} />
</Space>
}
visible={visible}
open={visible}
onClose={handleCloseDrawer}
>
<RecordTable
Expand Down
2 changes: 1 addition & 1 deletion src/component/SQLLintResult/Drawer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ const LintDrawer: React.FC<IProps> = function ({ data, visible, closePage }) {
zIndex={1003}
width={520}
destroyOnClose
visible={visible}
open={visible}
title={formatMessage({
id: 'odc.component.SQLLintResult.Drawer.CheckResult',
})} /*检查结果*/
Expand Down
2 changes: 1 addition & 1 deletion src/component/SaveSQLModal/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ class SaveSQLModal extends Component<IProps> {
title={
formatMessage({ id: 'odc.component.SaveSQLModal.SaveScript' }) //保存脚本
}
visible={visible}
open={visible}
confirmLoading={this.state.saving}
onOk={this.handleSubmit}
onCancel={onCancel}
Expand Down
2 changes: 1 addition & 1 deletion src/component/SelectPackagePLModal/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ class SelectPackagePLModal extends Component<IProps> {
title={formatMessage({
id: 'odc.component.SelectPackagePLModal.SelectPlObject',
})}
visible={visible}
open={visible}
onOk={this.save}
onCancel={onCancel}
>
Expand Down
2 changes: 1 addition & 1 deletion src/component/TableRenameModal/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ class TableRenameModal extends Component<IProps> {
<Modal
destroyOnClose={true}
title={formatMessage({ id: 'workspace.tree.table.rename.modal.title' })}
visible={visible}
open={visible}
onOk={this.save}
onCancel={onCancel}
centered={true}
Expand Down
2 changes: 1 addition & 1 deletion src/component/Task/AlterDdlTask/CreateModal/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@ const CreateDDLTaskModal: React.FC<IProps> = (props) => {
</Button>
</Space>
}
visible={modalStore.createDDLAlterVisible}
open={modalStore.createDDLAlterVisible}
onClose={() => {
handleCancel(hasEdit);
}}
Expand Down
2 changes: 1 addition & 1 deletion src/component/Task/AlterDdlTask/DetailContent/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ export function getItems(
formatMessage({ id: 'odc.AlterDdlTask.DetailContent.Library' }), //所属库
task?.databaseName || '-',
],

['所属数据源', task?.connection?.name || '-'],
hasFlow ? riskItem : null,
[
formatMessage({ id: 'odc.AlterDdlTask.DetailContent.ChangeDefinition' }), //变更定义
Expand Down
2 changes: 1 addition & 1 deletion src/component/Task/AsyncTask/CreateModal/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -457,7 +457,7 @@ const CreateModal: React.FC<IProps> = (props) => {
</Button>
</Space>
}
visible={modalStore.createAsyncTaskVisible}
open={modalStore.createAsyncTaskVisible}
onClose={() => {
handleCancel(hasEdit);
}}
Expand Down
3 changes: 3 additions & 0 deletions src/component/Task/AsyncTask/DetailContent/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,9 @@ const AsyncTaskContent: React.FC<IProps> = (props) => {
>
{task?.databaseName || '-'}
</Descriptions.Item>
<Descriptions.Item span={2} label="所属数据源">
{task?.connection?.name || '-'}
</Descriptions.Item>
<Descriptions.Item
span={2}
label={
Expand Down
2 changes: 1 addition & 1 deletion src/component/Task/DataArchiveTask/CreateModal/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -334,7 +334,7 @@ const CreateModal: React.FC<IProps> = (props) => {
</Button>
</Space>
}
visible={dataArchiveVisible}
open={dataArchiveVisible}
onClose={() => {
handleCancel(hasEdit);
}}
Expand Down
2 changes: 1 addition & 1 deletion src/component/Task/DataClearTask/CreateModal/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -311,7 +311,7 @@ const CreateModal: React.FC<IProps> = (props) => {
</Button>
</Space>
}
visible={dataClearVisible}
open={dataClearVisible}
onClose={() => {
handleCancel(hasEdit);
}}
Expand Down
2 changes: 1 addition & 1 deletion src/component/Task/DataMockerTask/DetailContent/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,7 @@ export function getItems(task: TaskDetail<IMockDataParams>, result: ITaskResult,
//所属数据库
task?.databaseName || '-',
],

['所属数据源', task?.connection?.name || '-'],
[
formatMessage({
id: 'odc.component.DetailModal.dataMocker.TaskType',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,7 @@ const ExportSelecter: React.FC<IProps> = function ({
DbObjectType.trigger,
DbObjectType.synonym,
DbObjectType.public_synonym,
DbObjectType.type,
];
}

Expand Down Expand Up @@ -232,9 +233,8 @@ const ExportSelecter: React.FC<IProps> = function ({
const allTreeDataCount = Object.entries(allTreeData).reduce((prev, current) => {
return prev + current?.[1]?.children.length;
}, 0);
const selectedTreeDataCount = checkedKeys.filter(
(key) => !getObjTypeList().includes(key),
)?.length;
const selectedTreeDataCount = checkedKeys.filter((key) => !getObjTypeList().includes(key))
?.length;
return (
<div className={styles.selecter}>
<div className={styles.content}>
Expand Down Expand Up @@ -328,9 +328,8 @@ const ExportSelecter: React.FC<IProps> = function ({
/**
* 说明这里删除的是根节点
*/
const typeList = selectedTreeData.find(
(d) => d.key === nodeKey,
)?.children;
const typeList = selectedTreeData.find((d) => d.key === nodeKey)
?.children;
const filterAllkeys = typeList?.map((item) => item.key);
setCheckedKeys(
checkedKeys.filter((key) => !filterAllkeys?.includes(key)),
Expand Down
16 changes: 10 additions & 6 deletions src/component/Task/ExportTask/CreateModal/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -111,9 +111,14 @@ class CreateModal extends React.Component<IProps, IState> {
},
];

private handleClose = () => {
this.props.modalStore.changeExportModal(false);
this.resetFormData();
};

private closeSelf = () => {
if (!this.state.isFormChanged) {
this.props.modalStore.changeExportModal(false);
this.handleClose();
return;
}
Modal.confirm({
Expand All @@ -123,8 +128,7 @@ class CreateModal extends React.Component<IProps, IState> {

centered: true,
onOk: () => {
this.props.modalStore.changeExportModal(false);
this.resetFormData();
this.handleClose();
},
});
};
Expand Down Expand Up @@ -199,9 +203,8 @@ class CreateModal extends React.Component<IProps, IState> {
if (this.state.isSaveDefaultConfig) {
this.saveCurrentConfig();
}
this.props.modalStore.changeExportModal(false);
this.handleClose();
openTasksPage(TaskPageType.EXPORT, TaskPageScope.CREATED_BY_CURRENT_USER);
this.resetFormData();
}
} finally {
this.setState({
Expand Down Expand Up @@ -296,6 +299,7 @@ class CreateModal extends React.Component<IProps, IState> {
formData,
};
}
return null;
}

render() {
Expand All @@ -320,7 +324,7 @@ class CreateModal extends React.Component<IProps, IState> {
title={
formatMessage({ id: 'odc.components.ExportDrawer.Export' }) //导出
}
visible={modalStore.exportModalVisible}
open={modalStore.exportModalVisible}
destroyOnClose
width={720}
onClose={this.closeSelf}
Expand Down
3 changes: 2 additions & 1 deletion src/component/Task/ImportTask/CreateModal/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -434,6 +434,7 @@ class CreateModal extends React.Component<IProps, IState> {
},
};
}
return null;
}

private handleSessionChange = (sessionData: { sessionId: string; databaseName: string }) => {
Expand Down Expand Up @@ -477,7 +478,7 @@ class CreateModal extends React.Component<IProps, IState> {
id: 'workspace.tree.table.importSingleTable',
})
}
visible={modalStore.importModalVisible}
open={modalStore.importModalVisible}
destroyOnClose={true}
width={520}
onClose={this.closeSelf}
Expand Down
2 changes: 1 addition & 1 deletion src/component/Task/PartitionTask/CreateModal/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,7 @@ const CreateModal: React.FC<IProps> = inject('modalStore')(
}, [databaseId]);
return (
<Drawer
visible={partitionVisible}
open={partitionVisible}
onClose={closeWithConfirm}
destroyOnClose
width={720}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ const CreateModal: React.FC<IProps> = inject('modalStore')(

return (
<Drawer
visible={sensitiveColumnVisible}
open={sensitiveColumnVisible}
onClose={closeWithConfirm}
destroyOnClose
width={724}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,7 @@ const CreateModal: React.FC<IProps> = (props) => {
</Button>
</Space>
}
visible={modalStore.createResultSetExportTaskVisible}
open={modalStore.createResultSetExportTaskVisible}
onClose={() => {
handleCancel(hasEdit);
}}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@ export const getItems = (
}
content={task?.databaseName || '-'}
/>
<SimpleTextItem label="所属数据源" content={task?.connection?.name || '-'} />
<SimpleTextItem
label={
formatMessage({
Expand Down
2 changes: 1 addition & 1 deletion src/component/Task/SQLPlanTask/CreateModal/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -488,7 +488,7 @@ const CreateModal: React.FC<IProps> = (props) => {
</Button>
</Space>
}
visible={createSQLPlanVisible}
open={createSQLPlanVisible}
onClose={() => {
handleCancel(hasEdit);
}}
Expand Down
Loading

0 comments on commit 40c4b27

Please sign in to comment.