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:
@@ -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();
|
||||
}
|
||||
|
@@ -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}
|
||||
|
Reference in New Issue
Block a user