1
0
mirror of https://github.com/haiwen/seahub.git synced 2025-09-22 20:08:19 +00:00

update-file-type

This commit is contained in:
yinjianfei
2024-01-08 10:55:34 +08:00
parent 4bb038656f
commit 6ee3992064
2 changed files with 8 additions and 4 deletions

View File

@@ -21,7 +21,7 @@ class CreateFile extends React.Component {
isMarkdownDraft: false,
isSdocDraft: false,
errMessage: '',
isSubmitBtnActive: false,
isSubmitBtnActive: props.fileType.slice(0, -5) ? true : false,
};
this.newInput = React.createRef();
}

View File

@@ -30,6 +30,7 @@ class ExternalOperations extends React.Component {
isShowShareDialog: false,
internalLink: '',
isShowCreateFileDialog: false,
fileType: '.sdoc',
};
}
@@ -122,7 +123,10 @@ class ExternalOperations extends React.Component {
this.props.onNewNotification();
};
onCreateSdocFile = () => {
onCreateSdocFile = (params) => {
if (params?.newFileName) {
this.setState({fileType: `${params.newFileName}.sdoc`});
}
this.setState({
isShowCreateFileDialog: !this.state.isShowCreateFileDialog
});
@@ -146,7 +150,7 @@ class ExternalOperations extends React.Component {
render() {
const { repoID, docPath, docName, docPerm, dirPath } = this.props;
const { isShowInternalLinkDialog, isShowShareDialog, internalLink, isShowCreateFileDialog } = this.state;
const { isShowInternalLinkDialog, isShowShareDialog, internalLink, isShowCreateFileDialog, fileType } = this.state;
return (
<>
{isShowInternalLinkDialog && (
@@ -170,7 +174,7 @@ class ExternalOperations extends React.Component {
{isShowCreateFileDialog && (
<CreateFile
parentPath={dirPath}
fileType='.sdoc'
fileType={fileType}
onAddFile={this.onAddFile}
checkDuplicatedName={this.checkDuplicatedName}
toggleDialog={this.onCreateSdocFile}