Skip to content

Commit

Permalink
optimize code (#7302)
Browse files Browse the repository at this point in the history
  • Loading branch information
shuntian authored Jan 4, 2025
1 parent 155d303 commit 27a881a
Show file tree
Hide file tree
Showing 7 changed files with 11 additions and 11 deletions.
4 changes: 2 additions & 2 deletions frontend/src/components/dirent-grid-view/dirent-grid-view.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import React, { Fragment } from 'react';
import PropTypes from 'prop-types';
import { siteRoot, username, enableSeadoc, thumbnailDefaultSize, thumbnailSizeForOriginal, gettext, fileServerRoot, enableTldraw } from '../../utils/constants';
import { siteRoot, username, enableSeadoc, thumbnailDefaultSize, thumbnailSizeForOriginal, gettext, fileServerRoot, enableWhiteboard } from '../../utils/constants';
import { Utils } from '../../utils/utils';
import { seafileAPI } from '../../utils/seafile-api';
import URLDecorator from '../../utils/url-decorator';
Expand Down Expand Up @@ -747,7 +747,7 @@ class DirentGridView extends React.Component {
NEW_WORD_FILE
);

if (enableTldraw) {
if (enableWhiteboard) {
direntsContainerMenuList.push(NEW_TLDRAW_FILE);
}

Expand Down
4 changes: 2 additions & 2 deletions frontend/src/components/dirent-list-view/dirent-list-view.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import React, { Fragment } from 'react';
import PropTypes from 'prop-types';
import classnames from 'classnames';
import { siteRoot, gettext, username, enableSeadoc, thumbnailSizeForOriginal, thumbnailDefaultSize, fileServerRoot, enableTldraw } from '../../utils/constants';
import { siteRoot, gettext, username, enableSeadoc, thumbnailSizeForOriginal, thumbnailDefaultSize, fileServerRoot, enableWhiteboard } from '../../utils/constants';
import { Utils } from '../../utils/utils';
import TextTranslation from '../../utils/text-translation';
import URLDecorator from '../../utils/url-decorator';
Expand Down Expand Up @@ -436,7 +436,7 @@ class DirentListView extends React.Component {
NEW_WORD_FILE,
);

if (enableTldraw) {
if (enableWhiteboard) {
direntsContainerMenuList.push(NEW_TLDRAW_FILE);
}

Expand Down
4 changes: 2 additions & 2 deletions frontend/src/components/toolbar/dir-operation-toolbar.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import React, { Fragment } from 'react';
import PropTypes from 'prop-types';
import { Dropdown, DropdownToggle, DropdownMenu, DropdownItem } from 'reactstrap';
import { Utils } from '../../utils/utils';
import { enableSeadoc, enableTldraw, gettext } from '../../utils/constants';
import { enableSeadoc, enableWhiteboard, gettext } from '../../utils/constants';
import ModalPortal from '../modal-portal';
import CreateFolder from '../../components/dialog/create-folder-dialog';
import CreateFile from '../../components/dialog/create-file-dialog';
Expand Down Expand Up @@ -255,7 +255,7 @@ class DirOperationToolbar extends React.Component {
{ 'text': gettext('New PowerPoint File'), 'onClick': this.onCreatePPTToggle },
{ 'text': gettext('New Word File'), 'onClick': this.onCreateWordToggle },
);
if (enableTldraw) {
if (enableWhiteboard) {
newSubOpList.push({ 'text': gettext('New Whiteboard File'), 'onClick': this.onCreateTldrawToggle });
}
opList.push({
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/utils/constants.js
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ export const ocmRemoteServers = window.app.pageOptions.ocmRemoteServers;
export const enableOCMViaWebdav = window.app.pageOptions.enableOCMViaWebdav;
export const enableSSOToThirdpartWebsite = window.app.pageOptions.enableSSOToThirdpartWebsite;
export const enableSeadoc = window.app.pageOptions.enableSeadoc;
export const enableTldraw = window.app.pageOptions.enableTldraw;
export const enableWhiteboard = window.app.pageOptions.enableWhiteboard;
export const enableMultipleOfficeSuite = window.app.pageOptions.enableMultipleOfficeSuite;

export const curNoteMsg = window.app.pageOptions.curNoteMsg;
Expand Down
4 changes: 2 additions & 2 deletions seahub/base/context_processors.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
ENABLE_SEAFILE_DOCS, LOGIN_BG_IMAGE_PATH, THUMBNAIL_DEFAULT_SIZE, \
CUSTOM_LOGIN_BG_PATH, ENABLE_SHARE_LINK_REPORT_ABUSE, \
PRIVACY_POLICY_LINK, TERMS_OF_SERVICE_LINK, ENABLE_SEADOC, THUMBNAIL_SIZE_FOR_GRID, \
FILE_SERVER_ROOT, ENABLE_TLDRAW
FILE_SERVER_ROOT, ENABLE_WHITEBOARD

from seahub.organizations.models import OrgAdminSettings
from seahub.organizations.settings import ORG_ENABLE_ADMIN_CUSTOM_LOGO
Expand Down Expand Up @@ -174,7 +174,7 @@ def base(request):
'about_dialog_custom_html': ABOUT_DIALOG_CUSTOM_HTML,
'enable_repo_auto_del': ENABLE_REPO_AUTO_DEL,
'enable_seadoc': ENABLE_SEADOC,
'enable_tldraw': ENABLE_TLDRAW,
'enable_whiteboard': ENABLE_WHITEBOARD,
}

if request.user.is_staff:
Expand Down
2 changes: 1 addition & 1 deletion seahub/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -921,7 +921,7 @@ def genpassword():
# Settings for tldraw #
##########################

ENABLE_TLDRAW = False
ENABLE_WHITEBOARD = False

############################
# Settings for Seahub Priv #
Expand Down
2 changes: 1 addition & 1 deletion seahub/templates/base_for_react.html
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@
enableOnlyoffice: {% if enableOnlyoffice %} true {% else %} false {% endif %},
onlyofficeConverterExtensions: {% if onlyofficeConverterExtensions %} {{onlyofficeConverterExtensions|safe}} {% else %} null {% endif %},
enableSeadoc: {% if enable_seadoc %} true {% else %} false {% endif %},
enableTldraw: {% if enable_tldraw %} true {% else %} false {% endif %},
enableWhiteboard: {% if enable_whiteboard %} true {% else %} false {% endif %},
isOrgContext: {% if org is not None %} true {% else %} false {% endif %},
enableMetadataManagement: {% if enable_metadata_management %} true {% else %} false {% endif %},
enableFileTags: {% if enable_file_tags %} true {% else %} false {% endif %},
Expand Down

0 comments on commit 27a881a

Please sign in to comment.