1
0
mirror of https://github.com/haiwen/seahub.git synced 2025-09-09 10:50:24 +00:00

add enable file tags config (#6456)

Co-authored-by: 孙永强 <11704063+s-yongqiang@user.noreply.gitee.com>
This commit is contained in:
awu0403
2024-08-02 13:27:20 +08:00
committed by GitHub
parent f50ba4c5f9
commit b24be2e812
7 changed files with 20 additions and 7 deletions

View File

@@ -1,7 +1,7 @@
import React from 'react';
import PropTypes from 'prop-types';
import { Dropdown, DropdownMenu, DropdownToggle, DropdownItem } from 'reactstrap';
import { gettext } from '../../utils/constants';
import { gettext, enableFileTags } from '../../utils/constants';
import { Utils } from '../../utils/utils';
import TextTranslation from '../../utils/text-translation';
import SeahubPopover from '../common/seahub-popover';
@@ -71,7 +71,9 @@ class DirTool extends React.Component {
return list;
}
const { TAGS } = TextTranslation;
list.push(TAGS);
if (enableFileTags) {
list.push(TAGS);
}
return list;
};

View File

@@ -3,7 +3,7 @@ import PropTypes from 'prop-types';
import moment from 'moment';
import { v4 as uuidv4 } from 'uuid';
import Icon from '../icon';
import { gettext } from '../../utils/constants';
import { gettext, enableFileTags } from '../../utils/constants';
import { Utils } from '../../utils/utils';
import EditFileTagPopover from '../popover/edit-filetag-popover';
import FileTagList from '../file-tag-list';
@@ -107,7 +107,9 @@ class DetailListView extends React.Component {
<th>{gettext('Tags')}</th>
<td>
<FileTagList fileTagList={this.props.fileTagList} />
<span onClick={this.onEditFileTagToggle} id={this.tagListTitleID}><Icon symbol='tag' /></span>
{enableFileTags &&
<span onClick={this.onEditFileTagToggle} id={this.tagListTitleID}><Icon symbol='tag' /></span>
}
</td>
</tr>
{direntDetail.permission === 'rw' && window.app.pageOptions.enableMetadataManagement && (

View File

@@ -98,6 +98,8 @@ export const enablePDFThumbnail = window.app.pageOptions.enablePDFThumbnail;
export const enableOnlyoffice = window.app.pageOptions.enableOnlyoffice || false;
export const onlyofficeConverterExtensions = window.app.pageOptions.onlyofficeConverterExtensions || [];
export const enableFileTags = window.app.pageOptions.enableFileTags || false;
// search
export const enableElasticsearch = window.app.pageOptions.enableElasticsearch || false;
export const enableSeasearch = window.app.pageOptions.enableSeasearch || false;

View File

@@ -1,4 +1,4 @@
import { mediaUrl, gettext, serviceURL, siteRoot, isPro, fileAuditEnabled, canGenerateShareLink, canGenerateUploadLink, shareLinkPasswordMinLength, username, folderPermEnabled, onlyofficeConverterExtensions, enableOnlyoffice, enableSeadoc } from './constants';
import { mediaUrl, gettext, serviceURL, siteRoot, isPro, fileAuditEnabled, canGenerateShareLink, canGenerateUploadLink, shareLinkPasswordMinLength, username, folderPermEnabled, onlyofficeConverterExtensions, enableOnlyoffice, enableSeadoc, enableFileTags } from './constants';
import TextTranslation from './text-translation';
import React from 'react';
import toaster from '../components/toast';
@@ -600,7 +600,9 @@ export const Utils = {
}
if (permission == 'rw') {
list.push(TAGS);
if (enableFileTags) {
list.push(TAGS);
}
if (isPro) {
if (dirent.is_locked) {
if (dirent.locked_by_me || dirent.lock_owner == 'OnlineOffice' || isRepoOwner || currentRepoInfo.is_admin) {