diff --git a/frontend/src/components/dirent-detail/detail-list-view.js b/frontend/src/components/dirent-detail/detail-list-view.js index 99f0a10f76c..65985324de1 100644 --- a/frontend/src/components/dirent-detail/detail-list-view.js +++ b/frontend/src/components/dirent-detail/detail-list-view.js @@ -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, canSetExProps } from '../../utils/constants'; import { Utils } from '../../utils/utils'; import EditFileTagPopover from '../popover/edit-filetag-popover'; import ExtraAttributesDialog from '../dialog/extra-attributes-dialog'; @@ -84,7 +84,7 @@ class DetailListView extends React.Component { {gettext('Location')}{position} {gettext('Last Update')}{moment(direntDetail.mtime).format('YYYY-MM-DD')} - {direntDetail.permission === 'rw' && ( + {direntDetail.permission === 'rw' && canSetExProps && ( @@ -126,7 +126,7 @@ class DetailListView extends React.Component { - {direntDetail.permission === 'rw' && ( + {direntDetail.permission === 'rw' && canSetExProps && (
diff --git a/frontend/src/utils/constants.js b/frontend/src/utils/constants.js index 421afa55471..c3fff70cb61 100644 --- a/frontend/src/utils/constants.js +++ b/frontend/src/utils/constants.js @@ -94,6 +94,8 @@ export const enableVideoThumbnail = window.app.pageOptions.enableVideoThumbnail; export const enableOnlyoffice = window.app.pageOptions.enableOnlyoffice || false; export const onlyofficeConverterExtensions = window.app.pageOptions.onlyofficeConverterExtensions || []; +export const canSetExProps = window.app.pageOptions.canSetExProps || false; + // seafile_ai export const enableSeafileAI = window.app.pageOptions.enableSeafileAI || false; diff --git a/seahub/templates/base_for_react.html b/seahub/templates/base_for_react.html index 36d76238541..e6aea3c9b69 100644 --- a/seahub/templates/base_for_react.html +++ b/seahub/templates/base_for_react.html @@ -146,6 +146,7 @@ onlyofficeConverterExtensions: {% if onlyofficeConverterExtensions %} {{onlyofficeConverterExtensions|safe}} {% else %} null {% endif %}, enableSeadoc: {% if enable_seadoc %} true {% else %} false {% endif %}, enableSeafileAI: {% if enable_seafile_ai %} true {% else %} false {% endif %}, + canSetExProps: {% if can_set_ex_props %} true {% else %} false {% endif %}, } }; diff --git a/seahub/views/__init__.py b/seahub/views/__init__.py index 383cbd5106c..d81213bc52a 100644 --- a/seahub/views/__init__.py +++ b/seahub/views/__init__.py @@ -57,7 +57,7 @@ UPLOAD_LINK_EXPIRE_DAYS_MIN, UPLOAD_LINK_EXPIRE_DAYS_MAX, UPLOAD_LINK_EXPIRE_DAYS_DEFAULT, \ SEAFILE_COLLAB_SERVER, ENABLE_RESET_ENCRYPTED_REPO_PASSWORD, \ ADDITIONAL_SHARE_DIALOG_NOTE, ADDITIONAL_APP_BOTTOM_LINKS, ADDITIONAL_ABOUT_DIALOG_LINKS, \ - DTABLE_WEB_SERVER + DTABLE_WEB_SERVER, EX_PROPS_TABLE, SEATABLE_EX_PROPS_BASE_API_TOKEN, EX_EDITABLE_COLUMNS from seahub.wopi.settings import ENABLE_OFFICE_WEB_APP from seahub.ocm.settings import ENABLE_OCM, OCM_REMOTE_SERVERS @@ -1245,4 +1245,5 @@ def react_fake_view(request, **kwargs): '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', ''), 'enable_sso_to_thirdpart_website': settings.ENABLE_SSO_TO_THIRDPART_WEBSITE, + 'can_set_ex_props': DTABLE_WEB_SERVER and SEATABLE_EX_PROPS_BASE_API_TOKEN and EX_PROPS_TABLE and EX_EDITABLE_COLUMNS })