Skip to content

Commit

Permalink
only EX-PORPS set display ex-props (#5820)
Browse files Browse the repository at this point in the history
  • Loading branch information
AlexCXC authored Dec 11, 2023
1 parent 880ee4b commit 38f70dc
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 4 deletions.
6 changes: 3 additions & 3 deletions frontend/src/components/dirent-detail/detail-list-view.js
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down Expand Up @@ -84,7 +84,7 @@ class DetailListView extends React.Component {
<tbody>
<tr><th>{gettext('Location')}</th><td>{position}</td></tr>
<tr><th>{gettext('Last Update')}</th><td>{moment(direntDetail.mtime).format('YYYY-MM-DD')}</td></tr>
{direntDetail.permission === 'rw' && (
{direntDetail.permission === 'rw' && canSetExProps && (
<Fragment>
<tr className="file-extra-attributes">
<th colSpan={2}>
Expand Down Expand Up @@ -126,7 +126,7 @@ class DetailListView extends React.Component {
<span onClick={this.onEditFileTagToggle} id={this.tagListTitleID}><Icon symbol='tag' /></span>
</td>
</tr>
{direntDetail.permission === 'rw' && (
{direntDetail.permission === 'rw' && canSetExProps && (
<tr className="file-extra-attributes">
<th colSpan={2}>
<div className="edit-file-extra-attributes-btn" onClick={this.toggleExtraPropertiesDialog}>
Expand Down
2 changes: 2 additions & 0 deletions frontend/src/utils/constants.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down
1 change: 1 addition & 0 deletions seahub/templates/base_for_react.html
Original file line number Diff line number Diff line change
Expand Up @@ -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 %},
}
};
</script>
Expand Down
3 changes: 2 additions & 1 deletion seahub/views/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
})

0 comments on commit 38f70dc

Please sign in to comment.