mirror of
https://github.com/haiwen/seahub.git
synced 2025-09-02 07:27:04 +00:00
@@ -43,6 +43,7 @@ class DirGridView extends React.Component {
|
|||||||
path={this.props.path}
|
path={this.props.path}
|
||||||
isDirentListLoading={this.props.isDirentListLoading}
|
isDirentListLoading={this.props.isDirentListLoading}
|
||||||
onAddFile={this.props.onAddFile}
|
onAddFile={this.props.onAddFile}
|
||||||
|
currentRepoInfo={this.props.currentRepoInfo}
|
||||||
/>
|
/>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
@@ -53,6 +53,7 @@ class DirListView extends React.Component {
|
|||||||
path={this.props.path}
|
path={this.props.path}
|
||||||
isDirentListLoading={this.props.isDirentListLoading}
|
isDirentListLoading={this.props.isDirentListLoading}
|
||||||
onAddFile={this.props.onAddFile}
|
onAddFile={this.props.onAddFile}
|
||||||
|
currentRepoInfo={this.props.currentRepoInfo}
|
||||||
/>
|
/>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
@@ -449,7 +449,8 @@ class DirentGridView extends React.Component {
|
|||||||
NEW_POWERPOINT_FILE,
|
NEW_POWERPOINT_FILE,
|
||||||
NEW_WORD_FILE
|
NEW_WORD_FILE
|
||||||
];
|
];
|
||||||
if (enableSeadoc) {
|
const { currentRepoInfo } = this.props;
|
||||||
|
if (enableSeadoc && !currentRepoInfo.encrypted) {
|
||||||
menuList.push(NEW_SEADOC_FILE);
|
menuList.push(NEW_SEADOC_FILE);
|
||||||
}
|
}
|
||||||
this.handleContextClick(event, id, menuList);
|
this.handleContextClick(event, id, menuList);
|
||||||
|
@@ -340,7 +340,8 @@ class DirentListView extends React.Component {
|
|||||||
NEW_POWERPOINT_FILE,
|
NEW_POWERPOINT_FILE,
|
||||||
NEW_WORD_FILE
|
NEW_WORD_FILE
|
||||||
];
|
];
|
||||||
if (enableSeadoc) {
|
const { currentRepoInfo } = this.props;
|
||||||
|
if (enableSeadoc && !currentRepoInfo.encrypted) {
|
||||||
direntsContainerMenuList.push(NEW_SEADOC_FILE);
|
direntsContainerMenuList.push(NEW_SEADOC_FILE);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -10,6 +10,7 @@ import '../../css/tip-for-new-file.css';
|
|||||||
const propTypes = {
|
const propTypes = {
|
||||||
path: PropTypes.string.isRequired,
|
path: PropTypes.string.isRequired,
|
||||||
isDirentListLoading: PropTypes.bool.isRequired,
|
isDirentListLoading: PropTypes.bool.isRequired,
|
||||||
|
currentRepoInfo: PropTypes.object.isRequired,
|
||||||
onAddFile: PropTypes.func.isRequired
|
onAddFile: PropTypes.func.isRequired
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -45,6 +46,7 @@ class DirentNodeView extends React.Component {
|
|||||||
if (this.props.isDirentListLoading) {
|
if (this.props.isDirentListLoading) {
|
||||||
return (<Loading />);
|
return (<Loading />);
|
||||||
}
|
}
|
||||||
|
const { currentRepoInfo } = this.props;
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Fragment>
|
<Fragment>
|
||||||
@@ -61,7 +63,7 @@ class DirentNodeView extends React.Component {
|
|||||||
<button className="big-new-file-button" onClick={this.onCreateNewFile.bind(this, '.xlsx')}>
|
<button className="big-new-file-button" onClick={this.onCreateNewFile.bind(this, '.xlsx')}>
|
||||||
{'+ Excel'}</button>
|
{'+ Excel'}</button>
|
||||||
<br />
|
<br />
|
||||||
{enableSeadoc && <button className="big-new-file-button" onClick={this.onCreateNewFile.bind(this, '.sdoc')}>
|
{enableSeadoc && !currentRepoInfo.encrypted && <button className="big-new-file-button" onClick={this.onCreateNewFile.bind(this, '.sdoc')}>
|
||||||
{'+ SeaDoc'}</button>}
|
{'+ SeaDoc'}</button>}
|
||||||
</div>
|
</div>
|
||||||
{this.state.isCreateFileDialogShow && (
|
{this.state.isCreateFileDialogShow && (
|
||||||
|
@@ -179,7 +179,7 @@ class DirOperationToolbar extends React.Component {
|
|||||||
|
|
||||||
let content = null;
|
let content = null;
|
||||||
if (Utils.isDesktop()) {
|
if (Utils.isDesktop()) {
|
||||||
let { showShareBtn } = this.props;
|
const { showShareBtn, repoEncrypted } = this.props;
|
||||||
content = (
|
content = (
|
||||||
<Fragment>
|
<Fragment>
|
||||||
{canUpload && (
|
{canUpload && (
|
||||||
@@ -210,7 +210,7 @@ class DirOperationToolbar extends React.Component {
|
|||||||
<button className="dropdown-item" onClick={this.onCreateExcelToggle} role="menuitem">{gettext('New Excel File')}</button>
|
<button className="dropdown-item" onClick={this.onCreateExcelToggle} role="menuitem">{gettext('New Excel File')}</button>
|
||||||
<button className="dropdown-item" onClick={this.onCreatePPTToggle} role="menuitem">{gettext('New PowerPoint File')}</button>
|
<button className="dropdown-item" onClick={this.onCreatePPTToggle} role="menuitem">{gettext('New PowerPoint File')}</button>
|
||||||
<button className="dropdown-item" onClick={this.onCreateWordToggle} role="menuitem">{gettext('New Word File')}</button>
|
<button className="dropdown-item" onClick={this.onCreateWordToggle} role="menuitem">{gettext('New Word File')}</button>
|
||||||
{enableSeadoc && <button className="dropdown-item" onClick={this.onCreateSeaDocToggle} role="menuitem">{gettext('New SeaDoc File')} (beta)</button>}
|
{enableSeadoc && !repoEncrypted && <button className="dropdown-item" onClick={this.onCreateSeaDocToggle} role="menuitem">{gettext('New SeaDoc File')} (beta)</button>}
|
||||||
</div>
|
</div>
|
||||||
)}
|
)}
|
||||||
</Fragment>
|
</Fragment>
|
||||||
|
@@ -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')) {
|
if (dirent.name.endsWith('.md') || dirent.name.endsWith('.docx')) {
|
||||||
list.push(CONVERT_TO_SDOC);
|
list.push(CONVERT_TO_SDOC);
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user