mirror of
https://github.com/haiwen/seahub.git
synced 2025-09-16 07:08:55 +00:00
add check condition to send file info api
This commit is contained in:
@@ -41,6 +41,7 @@ class GenerateShareLink extends React.Component {
|
|||||||
'can_download': true
|
'can_download': true
|
||||||
};
|
};
|
||||||
this.isExpireDaysNoLimit = (parseInt(shareLinkExpireDaysMin) === 0 && parseInt(shareLinkExpireDaysMax) === 0);
|
this.isExpireDaysNoLimit = (parseInt(shareLinkExpireDaysMin) === 0 && parseInt(shareLinkExpireDaysMax) === 0);
|
||||||
|
this.isOfficeFile = Utils.isOfficeFile(this.props.itemPath);
|
||||||
}
|
}
|
||||||
|
|
||||||
componentDidMount() {
|
componentDidMount() {
|
||||||
@@ -57,12 +58,13 @@ class GenerateShareLink extends React.Component {
|
|||||||
this.setState({isLoading: false});
|
this.setState({isLoading: false});
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
if (this.isOfficeFile) {
|
||||||
seafileAPI.getFileInfo(repoID, path).then((res) => {
|
seafileAPI.getFileInfo(repoID, path).then((res) => {
|
||||||
if (res.data) {
|
if (res.data) {
|
||||||
this.setState({fileInfo: res.data});
|
this.setState({fileInfo: res.data});
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
onPasswordInputChecked = () => {
|
onPasswordInputChecked = () => {
|
||||||
@@ -402,7 +404,7 @@ class GenerateShareLink extends React.Component {
|
|||||||
<Input type="radio" name="radio1" onChange={() => this.setPermission('preview')} />{' '}{gettext('Preview only')}
|
<Input type="radio" name="radio1" onChange={() => this.setPermission('preview')} />{' '}{gettext('Preview only')}
|
||||||
</Label>
|
</Label>
|
||||||
</FormGroup>
|
</FormGroup>
|
||||||
{(Utils.isOfficeFile(this.props.itemPath) && fileInfo && fileInfo.can_edit) &&
|
{(this.isOfficeFile && fileInfo && fileInfo.can_edit) &&
|
||||||
<FormGroup check className="permission">
|
<FormGroup check className="permission">
|
||||||
<Label className="form-check-label">
|
<Label className="form-check-label">
|
||||||
<Input type="radio" name="radio1" onChange={() => this.setPermission('editOnCloudAndDownload')} />{' '}{gettext('Edit on cloud and download')}
|
<Input type="radio" name="radio1" onChange={() => this.setPermission('editOnCloudAndDownload')} />{' '}{gettext('Edit on cloud and download')}
|
||||||
|
Reference in New Issue
Block a user