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