diff --git a/frontend/src/components/dir-view-mode/dir-grid-view.js b/frontend/src/components/dir-view-mode/dir-grid-view.js index b086e5feca..740917db40 100644 --- a/frontend/src/components/dir-view-mode/dir-grid-view.js +++ b/frontend/src/components/dir-view-mode/dir-grid-view.js @@ -43,6 +43,7 @@ class DirGridView extends React.Component { path={this.props.path} isDirentListLoading={this.props.isDirentListLoading} onAddFile={this.props.onAddFile} + currentRepoInfo={this.props.currentRepoInfo} /> ); } diff --git a/frontend/src/components/dir-view-mode/dir-list-view.js b/frontend/src/components/dir-view-mode/dir-list-view.js index aa8d7ab1b4..ca3ad5919f 100644 --- a/frontend/src/components/dir-view-mode/dir-list-view.js +++ b/frontend/src/components/dir-view-mode/dir-list-view.js @@ -53,6 +53,7 @@ class DirListView extends React.Component { path={this.props.path} isDirentListLoading={this.props.isDirentListLoading} onAddFile={this.props.onAddFile} + currentRepoInfo={this.props.currentRepoInfo} /> ); } diff --git a/frontend/src/components/dirent-grid-view/dirent-grid-view.js b/frontend/src/components/dirent-grid-view/dirent-grid-view.js index c26ded6c38..effc9732e4 100644 --- a/frontend/src/components/dirent-grid-view/dirent-grid-view.js +++ b/frontend/src/components/dirent-grid-view/dirent-grid-view.js @@ -449,7 +449,8 @@ class DirentGridView extends React.Component { NEW_POWERPOINT_FILE, NEW_WORD_FILE ]; - if (enableSeadoc) { + const { currentRepoInfo } = this.props; + if (enableSeadoc && !currentRepoInfo.encrypted) { menuList.push(NEW_SEADOC_FILE); } this.handleContextClick(event, id, menuList); diff --git a/frontend/src/components/dirent-list-view/dirent-list-view.js b/frontend/src/components/dirent-list-view/dirent-list-view.js index f460b74d72..10a97aafba 100644 --- a/frontend/src/components/dirent-list-view/dirent-list-view.js +++ b/frontend/src/components/dirent-list-view/dirent-list-view.js @@ -340,7 +340,8 @@ class DirentListView extends React.Component { NEW_POWERPOINT_FILE, NEW_WORD_FILE ]; - if (enableSeadoc) { + const { currentRepoInfo } = this.props; + if (enableSeadoc && !currentRepoInfo.encrypted) { direntsContainerMenuList.push(NEW_SEADOC_FILE); } diff --git a/frontend/src/components/dirent-list-view/dirent-none-view.js b/frontend/src/components/dirent-list-view/dirent-none-view.js index c268cb0d2f..538e6d3616 100644 --- a/frontend/src/components/dirent-list-view/dirent-none-view.js +++ b/frontend/src/components/dirent-list-view/dirent-none-view.js @@ -10,6 +10,7 @@ import '../../css/tip-for-new-file.css'; const propTypes = { path: PropTypes.string.isRequired, isDirentListLoading: PropTypes.bool.isRequired, + currentRepoInfo: PropTypes.object.isRequired, onAddFile: PropTypes.func.isRequired }; @@ -45,6 +46,7 @@ class DirentNodeView extends React.Component { if (this.props.isDirentListLoading) { return (); } + const { currentRepoInfo } = this.props; return ( @@ -61,7 +63,7 @@ class DirentNodeView extends React.Component {
- {enableSeadoc && } {this.state.isCreateFileDialogShow && ( diff --git a/frontend/src/components/toolbar/dir-operation-toolbar.js b/frontend/src/components/toolbar/dir-operation-toolbar.js index 871d0c1044..bcf692c5c2 100644 --- a/frontend/src/components/toolbar/dir-operation-toolbar.js +++ b/frontend/src/components/toolbar/dir-operation-toolbar.js @@ -179,7 +179,7 @@ class DirOperationToolbar extends React.Component { let content = null; if (Utils.isDesktop()) { - let { showShareBtn } = this.props; + const { showShareBtn, repoEncrypted } = this.props; content = ( {canUpload && ( @@ -210,7 +210,7 @@ class DirOperationToolbar extends React.Component { - {enableSeadoc && } + {enableSeadoc && !repoEncrypted && } )} diff --git a/frontend/src/utils/utils.js b/frontend/src/utils/utils.js index 2d5c1d63b9..d095236a61 100644 --- a/frontend/src/utils/utils.js +++ b/frontend/src/utils/utils.js @@ -612,7 +612,7 @@ export const Utils = { } - if ((permission == 'rw' || permission == 'cloud-edit') && enableSeadoc) { + if ((permission == 'rw' || permission == 'cloud-edit') && enableSeadoc && !currentRepoInfo.encrypted) { if (dirent.name.endsWith('.md') || dirent.name.endsWith('.docx')) { list.push(CONVERT_TO_SDOC); }