1
0
mirror of https://github.com/haiwen/seahub.git synced 2025-09-17 15:53:28 +00:00

When canGenerateShareLink is equal to false delete share

This commit is contained in:
zxj96
2019-04-25 15:09:28 +08:00
parent be3f3093a8
commit 17dba3e3c7
6 changed files with 42 additions and 13 deletions

View File

@@ -1,7 +1,7 @@
import React, { Fragment } from 'react';
import PropTypes from 'prop-types';
import { Button, ButtonGroup } from 'reactstrap';
import { gettext } from '../../utils/constants';
import { gettext, canGenerateShareLink } from '../../utils/constants';
import { Utils, isPro } from '../../utils/utils';
import { seafileAPI } from '../../utils/seafile-api';
import URLDecorator from '../../utils/url-decorator';
@@ -92,13 +92,17 @@ class MutipleDirOperationToolbar extends React.Component {
const { SHARE, TAGS, RELATED_FILES, HISTORY, OPEN_VIA_CLIENT, LOCK, UNLOCK } = TextTranslation;
let shareBtn = currentRepoInfo.encrypted ? [] : [SHARE];
if (dirent.type === 'dir') {
menuList = [SHARE];
menuList = [...shareBtn];
return menuList;
}
if (dirent.type === 'file') {
menuList = [SHARE, TAGS, RELATED_FILES, 'Divider', HISTORY, 'Divider', OPEN_VIA_CLIENT];
shareBtn = canGenerateShareLink ? [SHARE] : [];
menuList = [...shareBtn, TAGS, RELATED_FILES, 'Divider', HISTORY, 'Divider', OPEN_VIA_CLIENT];
if (!Utils.isMarkdownFile(dirent.name)) {
menuList.splice(2, 1);
}