mirror of
https://github.com/haiwen/seahub.git
synced 2025-09-21 03:18:23 +00:00
update-file-type
This commit is contained in:
@@ -21,7 +21,7 @@ class CreateFile extends React.Component {
|
|||||||
isMarkdownDraft: false,
|
isMarkdownDraft: false,
|
||||||
isSdocDraft: false,
|
isSdocDraft: false,
|
||||||
errMessage: '',
|
errMessage: '',
|
||||||
isSubmitBtnActive: false,
|
isSubmitBtnActive: props.fileType.slice(0, -5) ? true : false,
|
||||||
};
|
};
|
||||||
this.newInput = React.createRef();
|
this.newInput = React.createRef();
|
||||||
}
|
}
|
||||||
|
@@ -30,6 +30,7 @@ class ExternalOperations extends React.Component {
|
|||||||
isShowShareDialog: false,
|
isShowShareDialog: false,
|
||||||
internalLink: '',
|
internalLink: '',
|
||||||
isShowCreateFileDialog: false,
|
isShowCreateFileDialog: false,
|
||||||
|
fileType: '.sdoc',
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -122,7 +123,10 @@ class ExternalOperations extends React.Component {
|
|||||||
this.props.onNewNotification();
|
this.props.onNewNotification();
|
||||||
};
|
};
|
||||||
|
|
||||||
onCreateSdocFile = () => {
|
onCreateSdocFile = (params) => {
|
||||||
|
if (params?.newFileName) {
|
||||||
|
this.setState({fileType: `${params.newFileName}.sdoc`});
|
||||||
|
}
|
||||||
this.setState({
|
this.setState({
|
||||||
isShowCreateFileDialog: !this.state.isShowCreateFileDialog
|
isShowCreateFileDialog: !this.state.isShowCreateFileDialog
|
||||||
});
|
});
|
||||||
@@ -146,7 +150,7 @@ class ExternalOperations extends React.Component {
|
|||||||
|
|
||||||
render() {
|
render() {
|
||||||
const { repoID, docPath, docName, docPerm, dirPath } = this.props;
|
const { repoID, docPath, docName, docPerm, dirPath } = this.props;
|
||||||
const { isShowInternalLinkDialog, isShowShareDialog, internalLink, isShowCreateFileDialog } = this.state;
|
const { isShowInternalLinkDialog, isShowShareDialog, internalLink, isShowCreateFileDialog, fileType } = this.state;
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
{isShowInternalLinkDialog && (
|
{isShowInternalLinkDialog && (
|
||||||
@@ -170,7 +174,7 @@ class ExternalOperations extends React.Component {
|
|||||||
{isShowCreateFileDialog && (
|
{isShowCreateFileDialog && (
|
||||||
<CreateFile
|
<CreateFile
|
||||||
parentPath={dirPath}
|
parentPath={dirPath}
|
||||||
fileType='.sdoc'
|
fileType={fileType}
|
||||||
onAddFile={this.onAddFile}
|
onAddFile={this.onAddFile}
|
||||||
checkDuplicatedName={this.checkDuplicatedName}
|
checkDuplicatedName={this.checkDuplicatedName}
|
||||||
toggleDialog={this.onCreateSdocFile}
|
toggleDialog={this.onCreateSdocFile}
|
||||||
|
Reference in New Issue
Block a user