mirror of
https://github.com/haiwen/seahub.git
synced 2025-09-05 08:53:14 +00:00
add enable file tags config (#6456)
Co-authored-by: 孙永强 <11704063+s-yongqiang@user.noreply.gitee.com>
This commit is contained in:
@@ -1,7 +1,7 @@
|
|||||||
import React from 'react';
|
import React from 'react';
|
||||||
import PropTypes from 'prop-types';
|
import PropTypes from 'prop-types';
|
||||||
import { Dropdown, DropdownMenu, DropdownToggle, DropdownItem } from 'reactstrap';
|
import { Dropdown, DropdownMenu, DropdownToggle, DropdownItem } from 'reactstrap';
|
||||||
import { gettext } from '../../utils/constants';
|
import { gettext, enableFileTags } from '../../utils/constants';
|
||||||
import { Utils } from '../../utils/utils';
|
import { Utils } from '../../utils/utils';
|
||||||
import TextTranslation from '../../utils/text-translation';
|
import TextTranslation from '../../utils/text-translation';
|
||||||
import SeahubPopover from '../common/seahub-popover';
|
import SeahubPopover from '../common/seahub-popover';
|
||||||
@@ -71,7 +71,9 @@ class DirTool extends React.Component {
|
|||||||
return list;
|
return list;
|
||||||
}
|
}
|
||||||
const { TAGS } = TextTranslation;
|
const { TAGS } = TextTranslation;
|
||||||
list.push(TAGS);
|
if (enableFileTags) {
|
||||||
|
list.push(TAGS);
|
||||||
|
}
|
||||||
return list;
|
return list;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@@ -3,7 +3,7 @@ import PropTypes from 'prop-types';
|
|||||||
import moment from 'moment';
|
import moment from 'moment';
|
||||||
import { v4 as uuidv4 } from 'uuid';
|
import { v4 as uuidv4 } from 'uuid';
|
||||||
import Icon from '../icon';
|
import Icon from '../icon';
|
||||||
import { gettext } from '../../utils/constants';
|
import { gettext, enableFileTags } from '../../utils/constants';
|
||||||
import { Utils } from '../../utils/utils';
|
import { Utils } from '../../utils/utils';
|
||||||
import EditFileTagPopover from '../popover/edit-filetag-popover';
|
import EditFileTagPopover from '../popover/edit-filetag-popover';
|
||||||
import FileTagList from '../file-tag-list';
|
import FileTagList from '../file-tag-list';
|
||||||
@@ -107,7 +107,9 @@ class DetailListView extends React.Component {
|
|||||||
<th>{gettext('Tags')}</th>
|
<th>{gettext('Tags')}</th>
|
||||||
<td>
|
<td>
|
||||||
<FileTagList fileTagList={this.props.fileTagList} />
|
<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>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
{direntDetail.permission === 'rw' && window.app.pageOptions.enableMetadataManagement && (
|
{direntDetail.permission === 'rw' && window.app.pageOptions.enableMetadataManagement && (
|
||||||
|
@@ -98,6 +98,8 @@ export const enablePDFThumbnail = window.app.pageOptions.enablePDFThumbnail;
|
|||||||
export const enableOnlyoffice = window.app.pageOptions.enableOnlyoffice || false;
|
export const enableOnlyoffice = window.app.pageOptions.enableOnlyoffice || false;
|
||||||
export const onlyofficeConverterExtensions = window.app.pageOptions.onlyofficeConverterExtensions || [];
|
export const onlyofficeConverterExtensions = window.app.pageOptions.onlyofficeConverterExtensions || [];
|
||||||
|
|
||||||
|
export const enableFileTags = window.app.pageOptions.enableFileTags || false;
|
||||||
|
|
||||||
// search
|
// search
|
||||||
export const enableElasticsearch = window.app.pageOptions.enableElasticsearch || false;
|
export const enableElasticsearch = window.app.pageOptions.enableElasticsearch || false;
|
||||||
export const enableSeasearch = window.app.pageOptions.enableSeasearch || false;
|
export const enableSeasearch = window.app.pageOptions.enableSeasearch || false;
|
||||||
|
@@ -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 TextTranslation from './text-translation';
|
||||||
import React from 'react';
|
import React from 'react';
|
||||||
import toaster from '../components/toast';
|
import toaster from '../components/toast';
|
||||||
@@ -600,7 +600,9 @@ export const Utils = {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (permission == 'rw') {
|
if (permission == 'rw') {
|
||||||
list.push(TAGS);
|
if (enableFileTags) {
|
||||||
|
list.push(TAGS);
|
||||||
|
}
|
||||||
if (isPro) {
|
if (isPro) {
|
||||||
if (dirent.is_locked) {
|
if (dirent.is_locked) {
|
||||||
if (dirent.locked_by_me || dirent.lock_owner == 'OnlineOffice' || isRepoOwner || currentRepoInfo.is_admin) {
|
if (dirent.locked_by_me || dirent.lock_owner == 'OnlineOffice' || isRepoOwner || currentRepoInfo.is_admin) {
|
||||||
|
@@ -888,6 +888,9 @@ ENABLE_METADATA_MANAGEMENT = False
|
|||||||
METADATA_SERVER_URL = ''
|
METADATA_SERVER_URL = ''
|
||||||
METADATA_SERVER_SECRET_KEY = ''
|
METADATA_SERVER_SECRET_KEY = ''
|
||||||
|
|
||||||
|
# file tags
|
||||||
|
ENABLE_FILE_TAGS = True
|
||||||
|
|
||||||
METADATA_FILE_TYPES = {
|
METADATA_FILE_TYPES = {
|
||||||
'_picture': ('gif', 'jpeg', 'jpg', 'png', 'ico', 'bmp', 'tif', 'tiff', 'psd', 'webp', 'jfif', 'mpo', 'jpe', 'xbm',
|
'_picture': ('gif', 'jpeg', 'jpg', 'png', 'ico', 'bmp', 'tif', 'tiff', 'psd', 'webp', 'jfif', 'mpo', 'jpe', 'xbm',
|
||||||
'svg', 'ppm', 'pcx', 'xcf', 'xpm', 'mgn', 'ufo'),
|
'svg', 'ppm', 'pcx', 'xcf', 'xpm', 'mgn', 'ufo'),
|
||||||
|
@@ -155,6 +155,7 @@
|
|||||||
enableSeaTableIntegration: {% if enable_seatable_integration %} true {% else %} false {% endif %},
|
enableSeaTableIntegration: {% if enable_seatable_integration %} true {% else %} false {% endif %},
|
||||||
isOrgContext: {% if org is not None %} true {% else %} false {% endif %},
|
isOrgContext: {% if org is not None %} true {% else %} false {% endif %},
|
||||||
enableMetadataManagement: {% if enable_metadata_management %} true {% else %} false {% endif %},
|
enableMetadataManagement: {% if enable_metadata_management %} true {% else %} false {% endif %},
|
||||||
|
enableFileTags: {% if enable_file_tags %} true {% else %} false {% endif %}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
|
@@ -1115,5 +1115,6 @@ def react_fake_view(request, **kwargs):
|
|||||||
'group_import_members_extra_msg': GROUP_IMPORT_MEMBERS_EXTRA_MSG,
|
'group_import_members_extra_msg': GROUP_IMPORT_MEMBERS_EXTRA_MSG,
|
||||||
'request_from_onlyoffice_desktop_editor': ONLYOFFICE_DESKTOP_EDITOR_HTTP_USER_AGENT in request.headers.get('user-agent', ''),
|
'request_from_onlyoffice_desktop_editor': ONLYOFFICE_DESKTOP_EDITOR_HTTP_USER_AGENT in request.headers.get('user-agent', ''),
|
||||||
'enable_sso_to_thirdpart_website': settings.ENABLE_SSO_TO_THIRDPART_WEBSITE,
|
'enable_sso_to_thirdpart_website': settings.ENABLE_SSO_TO_THIRDPART_WEBSITE,
|
||||||
'enable_metadata_management': settings.ENABLE_METADATA_MANAGEMENT
|
'enable_metadata_management': settings.ENABLE_METADATA_MANAGEMENT,
|
||||||
|
'enable_file_tags': settings.ENABLE_FILE_TAGS
|
||||||
})
|
})
|
||||||
|
Reference in New Issue
Block a user