Unverified Commit 53e72f12 authored by Zzm0809's avatar Zzm0809 Committed by GitHub

[Fix] fix modal cannot close (#3264)

parent 1129b69f
......@@ -239,7 +239,17 @@ export const BuildSteps: React.FC<BuildStepsProps> = (props) => {
* render
*/
return (
<Modal title={title} width={'85%'} open={true} maskClosable={false} footer={footerButtons}>
<Modal
title={title}
width={'85%'}
open={true}
maskClosable={false}
destroyOnClose
centered
closable={false}
onCancel={() => handleCancel()}
footer={footerButtons}
>
<AutoSteps
steps={steps}
percent={percent}
......
......@@ -24,8 +24,8 @@ import { folderSeparator, renderIcon } from '@/utils/function';
* @param data
* @returns {any}
*/
export const buildTreeData = (data: any): any =>
data?.map((item: any) => {
export const buildTreeData = (data: any[] = []): any =>
data.map((item: any) => {
// build key
let buildKey = item.path + folderSeparator() + item.name;
......
......@@ -24,7 +24,7 @@ import { Modal } from 'antd';
import React from 'react';
type CodeTreeProps = {
onCancel: (flag?: boolean) => void;
onCancel: () => void;
modalVisible: boolean;
values: Partial<GitProject>;
};
......@@ -41,9 +41,12 @@ export const CodeTree: React.FC<CodeTreeProps> = (props) => {
overflow: 'auto'
}
}}
centered
closable={false}
open={modalVisible}
maskClosable={false}
onCancel={() => onCancel()}
destroyOnClose
maskClosable={false}
cancelText={l('button.close')}
okButtonProps={{ style: { display: 'none' } }}
>
......
......@@ -103,6 +103,7 @@ const TemplateModal: React.FC<TemplateModalProps> = (props) => {
title={values.id ? l('rc.template.modify') : l('rc.template.create')}
open={visible}
form={form}
modalProps={{ onCancel: handleCancel }}
submitter={{ render: () => [...renderFooter()] }}
initialValues={values}
>
......
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