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

[library] added new 'settings' dialog(includes setting panels for (#7002)

'history', 'auto deletion', 'extended properties', and 'face
recognition')

- deleted 'history settings', 'auto deletion setting' in the dropdown
  menu & context menu of 'my library' & 'department library' items.
- fixed bug in the context menu of 'department library' items.
- deleted the 'more' menu(included 'extended properties' & 'face
  recognition') for library 'views'.
- click the 'extended properties' prompt in 'views', the new 'settings'
  dialog will be shown.
This commit is contained in:
llj
2024-11-06 20:12:39 +08:00
committed by GitHub
parent d32ca4e8fd
commit b04cc17872
13 changed files with 262 additions and 220 deletions

View File

@@ -0,0 +1,129 @@
import React, { Fragment, useCallback, useState } from 'react';
import PropTypes from 'prop-types';
import { Modal, ModalHeader, ModalBody, TabContent, TabPane, Nav, NavItem, NavLink } from 'reactstrap';
import { gettext, enableRepoAutoDel } from '../../utils/constants';
import LibHistorySettingPanel from './lib-settings/lib-history-setting-panel';
import LibAutoDelSettingPanel from './lib-settings/lib-old-files-auto-del-setting-panel';
import {
MetadataStatusManagementDialog as LibExtendedPropertiesSettingPanel,
MetadataFaceRecognitionDialog as LibFaceRecognitionSettingPanel,
useMetadata
} from '../../metadata';
import '../../css/lib-settings.css';
const propTypes = {
toggleDialog: PropTypes.func.isRequired,
repoID: PropTypes.string.isRequired,
currentRepoInfo: PropTypes.object.isRequired
};
const LibSettingsDialog = ({ repoID, currentRepoInfo, toggleDialog, tab }) => {
let [activeTab, setActiveTab] = useState(tab || 'historySetting');
const toggleTab = useCallback((tab) => {
setActiveTab(tab);
}, []);
const onTabKeyDown = useCallback((e) => {
if (e.key == 'Enter' || e.key == 'Space') {
e.target.click();
}
}, []);
const { encrypted, is_admin } = currentRepoInfo;
const { enableMetadataManagement } = window.app.pageOptions;
const { enableMetadata, updateEnableMetadata, enableFaceRecognition, updateEnableFaceRecognition } = useMetadata();
const enableHistorySetting = is_admin; // repo owner, admin of the department which the repo belongs to, and ...
const enableAutoDelSetting = is_admin && enableRepoAutoDel;
const enableExtendedPropertiesSetting = !encrypted && is_admin && enableMetadataManagement;
const enableFaceRecognitionSetting = enableExtendedPropertiesSetting && enableMetadata;
return (
<div>
<Modal isOpen={true} className="lib-settings-dialog" toggle={toggleDialog}>
<ModalHeader toggle={toggleDialog}>
{gettext('Settings')}
</ModalHeader>
<ModalBody className="d-md-flex p-md-0" role="tablist">
<Fragment>
<div className="lib-setting-nav p-4">
<Nav pills className="flex-column">
{enableHistorySetting &&
<NavItem role="tab" aria-selected={activeTab === 'historySetting'} aria-controls="history-setting-panel">
<NavLink className={activeTab === 'historySetting' ? 'active' : ''} onClick={(toggleTab.bind(this, 'historySetting'))} tabIndex="0" onKeyDown={onTabKeyDown}>
{gettext('History')}
</NavLink>
</NavItem>
}
{enableAutoDelSetting &&
<NavItem role="tab" aria-selected={activeTab === 'autoDelSetting'} aria-controls="auto-del-setting-panel">
<NavLink className={activeTab === 'autoDelSetting' ? 'active' : ''} onClick={toggleTab.bind(this, 'autoDelSetting')} tabIndex="0" onKeyDown={onTabKeyDown}>
{gettext('Auto deletion')}
</NavLink>
</NavItem>
}
{enableExtendedPropertiesSetting &&
<NavItem role="tab" aria-selected={activeTab === 'extendedPropertiesSetting'} aria-controls="extended-properties-setting-panel">
<NavLink className={activeTab === 'extendedPropertiesSetting' ? 'active' : ''} onClick={toggleTab.bind(this, 'extendedPropertiesSetting')} tabIndex="0" onKeyDown={onTabKeyDown}>
{gettext('Extended properties')}
</NavLink>
</NavItem>
}
{enableFaceRecognitionSetting &&
<NavItem role="tab" aria-selected={activeTab === 'faceRecognitionSetting'} aria-controls="face-recognition-setting-panel">
<NavLink className={activeTab === 'faceRecognitionSetting' ? 'active' : ''} onClick={toggleTab.bind(this, 'faceRecognitionSetting')} tabIndex="0" onKeyDown={onTabKeyDown}>
{gettext('Face recognition')}
</NavLink>
</NavItem>
}
</Nav>
</div>
<TabContent activeTab={activeTab} className="flex-fill">
{(enableHistorySetting && activeTab === 'historySetting') &&
<TabPane tabId="historySetting" role="tabpanel" id="history-setting-panel">
<LibHistorySettingPanel
repoID={repoID}
toggleDialog={toggleDialog}
/>
</TabPane>
}
{(enableAutoDelSetting && activeTab === 'autoDelSetting') &&
<TabPane tabId="autoDelSetting" role="tabpanel" id="auto-del-setting-panel">
<LibAutoDelSettingPanel
repoID={repoID}
toggleDialog={toggleDialog}
/>
</TabPane>
}
{(enableExtendedPropertiesSetting && activeTab === 'extendedPropertiesSetting') &&
<TabPane tabId="extendedPropertiesSetting" role="tabpanel" id="extended-properties-setting-panel">
<LibExtendedPropertiesSettingPanel
repoID={repoID}
value={enableMetadata}
submit={(value) => { updateEnableMetadata(value); }}
toggleDialog={toggleDialog}
/>
</TabPane>
}
{(enableFaceRecognitionSetting && activeTab === 'faceRecognitionSetting') &&
<TabPane tabId="faceRecognitionSetting" role="tabpanel" id="face-recognition-setting-panel">
<LibFaceRecognitionSettingPanel
repoID={repoID}
value={enableFaceRecognition}
submit={(value) => { updateEnableFaceRecognition(true); }}
toggleDialog={toggleDialog}
/>
</TabPane>
}
</TabContent>
</Fragment>
</ModalBody>
</Modal>
</div>
);
};
LibSettingsDialog.propTypes = propTypes;
export default LibSettingsDialog;

View File

@@ -1,13 +1,12 @@
import React from 'react'; import React from 'react';
import PropTypes from 'prop-types'; import PropTypes from 'prop-types';
import { Button, Modal, ModalHeader, ModalBody, ModalFooter, Form, FormGroup, Label, Input, Alert } from 'reactstrap'; import { Button, ModalBody, ModalFooter, Form, FormGroup, Label, Input, Alert } from 'reactstrap';
import { gettext, enableRepoHistorySetting } from '../../utils/constants'; import { gettext, enableRepoHistorySetting } from '../../../utils/constants';
import { seafileAPI } from '../../utils/seafile-api'; import { seafileAPI } from '../../../utils/seafile-api';
import { Utils } from '../../utils/utils'; import { Utils } from '../../../utils/utils';
import toaster from '../toast'; import toaster from '../../toast';
const propTypes = { const propTypes = {
itemName: PropTypes.string.isRequired,
toggleDialog: PropTypes.func.isRequired, toggleDialog: PropTypes.func.isRequired,
repoID: PropTypes.string.isRequired, repoID: PropTypes.string.isRequired,
}; };
@@ -108,14 +107,8 @@ class LibHistorySetting extends React.Component {
}; };
render() { render() {
const { itemName: repoName } = this.props;
let title = gettext('{placeholder} History Setting');
title = title.replace('{placeholder}', '<span class="op-target text-truncate mx-1">' + Utils.HTMLescape(repoName) + '</span>');
return ( return (
<Modal isOpen={true} toggle={this.props.toggleDialog}> <>
<ModalHeader toggle={this.props.toggleDialog}>
<span dangerouslySetInnerHTML={{ __html: title }} className="d-flex mw-100"></span>
</ModalHeader>
<ModalBody> <ModalBody>
<Form> <Form>
{!enableRepoHistorySetting && {!enableRepoHistorySetting &&
@@ -151,7 +144,7 @@ class LibHistorySetting extends React.Component {
<Button color="secondary" onClick={this.props.toggleDialog}>{gettext('Cancel')}</Button> <Button color="secondary" onClick={this.props.toggleDialog}>{gettext('Cancel')}</Button>
<Button color="primary" onClick={this.submit}>{gettext('Submit')}</Button> <Button color="primary" onClick={this.submit}>{gettext('Submit')}</Button>
</ModalFooter> </ModalFooter>
</Modal> </>
); );
} }
} }

View File

@@ -1,17 +1,17 @@
import React from 'react'; import React from 'react';
import PropTypes from 'prop-types'; import PropTypes from 'prop-types';
import { Button, Modal, ModalHeader, ModalBody, ModalFooter, Form, FormGroup, Label, Input, Alert } from 'reactstrap'; import { Button, ModalBody, ModalFooter, Form, FormGroup, Label, Input, Alert } from 'reactstrap';
import { gettext } from '../../utils/constants'; import { gettext } from '../../../utils/constants';
import { seafileAPI } from '../../utils/seafile-api'; import { seafileAPI } from '../../../utils/seafile-api';
import { Utils } from '../../utils/utils'; import { Utils } from '../../../utils/utils';
import toaster from '../toast'; import toaster from '../../toast';
const propTypes = { const propTypes = {
toggleDialog: PropTypes.func.isRequired, toggleDialog: PropTypes.func.isRequired,
repoID: PropTypes.string.isRequired, repoID: PropTypes.string.isRequired,
}; };
class LibOldFilesAutoDelDialog extends React.Component { class LibOldFilesAutoDelSetting extends React.Component {
constructor(props) { constructor(props) {
super(props); super(props);
@@ -93,10 +93,7 @@ class LibOldFilesAutoDelDialog extends React.Component {
render() { render() {
return ( return (
<Modal isOpen={true} toggle={this.props.toggleDialog}> <>
<ModalHeader toggle={this.props.toggleDialog}>
{gettext('Auto deletion')}
</ModalHeader>
<ModalBody> <ModalBody>
<Form> <Form>
<FormGroup check> <FormGroup check>
@@ -123,11 +120,11 @@ class LibOldFilesAutoDelDialog extends React.Component {
<Button color="secondary" onClick={this.props.toggleDialog}>{gettext('Cancel')}</Button> <Button color="secondary" onClick={this.props.toggleDialog}>{gettext('Cancel')}</Button>
<Button color="primary" onClick={this.submit}>{gettext('Submit')}</Button> <Button color="primary" onClick={this.submit}>{gettext('Submit')}</Button>
</ModalFooter> </ModalFooter>
</Modal> </>
); );
} }
} }
LibOldFilesAutoDelDialog.propTypes = propTypes; LibOldFilesAutoDelSetting.propTypes = propTypes;
export default LibOldFilesAutoDelDialog; export default LibOldFilesAutoDelSetting;

View File

@@ -4,9 +4,17 @@ import { gettext, siteRoot } from '../../utils/constants';
import { Utils } from '../../utils/utils'; import { Utils } from '../../utils/utils';
import TreeSection from '../tree-section'; import TreeSection from '../tree-section';
import TrashDialog from '../dialog/trash-dialog'; import TrashDialog from '../dialog/trash-dialog';
import LibSettingsDialog from '../dialog/lib-settings';
import './dir-others.css'; import './dir-others.css';
const DirOthers = ({ userPerm, repoID, currentRepoInfo }) => { const DirOthers = ({ userPerm, repoID, currentRepoInfo }) => {
const showSettings = currentRepoInfo.is_admin; // repo owner, department admin, shared with 'Admin' permission
let [isSettingsDialogOpen, setSettingsDialogOpen] = useState(false);
const toggleSettingsDialog = () => {
setSettingsDialogOpen(!isSettingsDialogOpen);
};
const [showTrashDialog, setShowTrashDialog] = useState(false); const [showTrashDialog, setShowTrashDialog] = useState(false);
let trashUrl = null; let trashUrl = null;
const historyUrl = siteRoot + 'repo/history/' + repoID + '/'; const historyUrl = siteRoot + 'repo/history/' + repoID + '/';
@@ -18,6 +26,12 @@ const DirOthers = ({ userPerm, repoID, currentRepoInfo }) => {
}; };
return ( return (
<TreeSection title={gettext('Others')} className="dir-others"> <TreeSection title={gettext('Others')} className="dir-others">
{showSettings &&
<div className='dir-others-item text-nowrap' title={gettext('Settings')} onClick={toggleSettingsDialog}>
<span className="sf3-font-set-up sf3-font"></span>
<span className="dir-others-item-text">{gettext('Settings')}</span>
</div>
}
{trashUrl && {trashUrl &&
<div className='dir-others-item text-nowrap' title={gettext('Trash')} onClick={toggleTrashDialog}> <div className='dir-others-item text-nowrap' title={gettext('Trash')} onClick={toggleTrashDialog}>
<span className="sf3-font-trash sf3-font"></span> <span className="sf3-font-trash sf3-font"></span>
@@ -38,6 +52,13 @@ const DirOthers = ({ userPerm, repoID, currentRepoInfo }) => {
toggleTrashDialog={toggleTrashDialog} toggleTrashDialog={toggleTrashDialog}
/> />
)} )}
{isSettingsDialogOpen && (
<LibSettingsDialog
repoID={repoID}
currentRepoInfo={currentRepoInfo}
toggleDialog={toggleSettingsDialog}
/>
)}
</TreeSection> </TreeSection>
); );
}; };

View File

@@ -2,8 +2,9 @@ import React, { useCallback, useMemo, useState } from 'react';
import PropTypes from 'prop-types'; import PropTypes from 'prop-types';
import { gettext } from '../../utils/constants'; import { gettext } from '../../utils/constants';
import TreeSection from '../tree-section'; import TreeSection from '../tree-section';
import { MetadataStatusManagementDialog, MetadataFaceRecognitionDialog, MetadataTreeView, useMetadata } from '../../metadata'; import { MetadataTreeView, useMetadata } from '../../metadata';
import ExtensionPrompts from './extension-prompts'; import ExtensionPrompts from './extension-prompts';
import LibSettingsDialog from '../dialog/lib-settings';
const DirViews = ({ userPerm, repoID, currentPath, currentRepoInfo }) => { const DirViews = ({ userPerm, repoID, currentPath, currentRepoInfo }) => {
const enableMetadataManagement = useMemo(() => { const enableMetadataManagement = useMemo(() => {
@@ -12,53 +13,14 @@ const DirViews = ({ userPerm, repoID, currentPath, currentRepoInfo }) => {
// eslint-disable-next-line react-hooks/exhaustive-deps // eslint-disable-next-line react-hooks/exhaustive-deps
}, [window.app.pageOptions.enableMetadataManagement, currentRepoInfo]); }, [window.app.pageOptions.enableMetadataManagement, currentRepoInfo]);
const [showMetadataStatusManagementDialog, setShowMetadataStatusManagementDialog] = useState(false); const { enableMetadata, navigation } = useMetadata();
const [showMetadataFaceRecognitionDialog, setShowMetadataFaceRecognitionDialog] = useState(false);
const { enableMetadata, updateEnableMetadata, enableFaceRecognition, updateEnableFaceRecognition, navigation } = useMetadata();
const moreOperations = useMemo(() => {
if (!enableMetadataManagement || !currentRepoInfo.is_admin) return [];
let operations = [
{ key: 'extended-properties', value: gettext('Extended properties') }
];
if (enableMetadata) {
operations.push({ key: 'face-recognition', value: gettext('Face recognition') });
}
return operations;
}, [enableMetadataManagement, enableMetadata, currentRepoInfo]);
const moreOperationClick = useCallback((operationKey) => {
switch (operationKey) {
case 'extended-properties': {
setShowMetadataStatusManagementDialog(true);
break;
}
case 'face-recognition': {
setShowMetadataFaceRecognitionDialog(true);
break;
}
default:
break;
}
}, []);
const closeMetadataManagementDialog = useCallback(() => {
setShowMetadataStatusManagementDialog(false);
}, []);
const closeMetadataFaceRecognitionDialog = useCallback(() => {
setShowMetadataFaceRecognitionDialog(false);
}, []);
const openMetadataFaceRecognition = useCallback(() => {
updateEnableFaceRecognition(true);
}, [updateEnableFaceRecognition]);
const toggleMetadataStatus = useCallback((value) => {
updateEnableMetadata(value);
}, [updateEnableMetadata]);
let [isSettingsDialogOpen, setSettingsDialogOpen] = useState(false);
const toggleSettingsDialog = () => {
setSettingsDialogOpen(!isSettingsDialogOpen);
};
const onExtendedProperties = useCallback(() => { const onExtendedProperties = useCallback(() => {
setShowMetadataStatusManagementDialog(true); setSettingsDialogOpen(true);
}, []); }, []);
if (!enableMetadataManagement) return null; if (!enableMetadataManagement) return null;
@@ -67,9 +29,6 @@ const DirViews = ({ userPerm, repoID, currentPath, currentRepoInfo }) => {
<> <>
<TreeSection <TreeSection
title={gettext('Views')} title={gettext('Views')}
moreKey={{ name: 'views' }}
moreOperations={moreOperations}
moreOperationClick={moreOperationClick}
> >
{!enableMetadata ? ( {!enableMetadata ? (
<ExtensionPrompts onExtendedProperties={onExtendedProperties} /> <ExtensionPrompts onExtendedProperties={onExtendedProperties} />
@@ -77,20 +36,12 @@ const DirViews = ({ userPerm, repoID, currentPath, currentRepoInfo }) => {
<MetadataTreeView userPerm={userPerm} currentPath={currentPath} /> <MetadataTreeView userPerm={userPerm} currentPath={currentPath} />
) : null} ) : null}
</TreeSection> </TreeSection>
{showMetadataStatusManagementDialog && ( {isSettingsDialogOpen && (
<MetadataStatusManagementDialog <LibSettingsDialog
value={enableMetadata}
repoID={repoID} repoID={repoID}
toggle={closeMetadataManagementDialog} currentRepoInfo={currentRepoInfo}
submit={toggleMetadataStatus} tab="extendedPropertiesSetting"
/> toggleDialog={toggleSettingsDialog}
)}
{showMetadataFaceRecognitionDialog && (
<MetadataFaceRecognitionDialog
value={enableFaceRecognition}
repoID={repoID}
toggle={closeMetadataFaceRecognitionDialog}
submit={openMetadataFaceRecognition}
/> />
)} )}
</> </>
@@ -101,7 +52,7 @@ DirViews.propTypes = {
userPerm: PropTypes.string, userPerm: PropTypes.string,
repoID: PropTypes.string, repoID: PropTypes.string,
currentPath: PropTypes.string, currentPath: PropTypes.string,
onNodeClick: PropTypes.func, currentRepoInfo: PropTypes.object.isRequired,
}; };
export default DirViews; export default DirViews;

View File

@@ -5,18 +5,16 @@ import relativeTime from 'dayjs/plugin/relativeTime';
import { Dropdown, DropdownMenu, DropdownToggle, DropdownItem } from 'reactstrap'; import { Dropdown, DropdownMenu, DropdownToggle, DropdownItem } from 'reactstrap';
import { Link, navigate } from '@gatsbyjs/reach-router'; import { Link, navigate } from '@gatsbyjs/reach-router';
import { Utils } from '../../utils/utils'; import { Utils } from '../../utils/utils';
import { gettext, siteRoot, isPro, username, folderPermEnabled, isSystemStaff, enableResetEncryptedRepoPassword, isEmailConfigured, enableRepoAutoDel } from '../../utils/constants'; import { gettext, siteRoot, isPro, username, folderPermEnabled, isSystemStaff, enableResetEncryptedRepoPassword, isEmailConfigured } from '../../utils/constants';
import ModalPortal from '../../components/modal-portal'; import ModalPortal from '../../components/modal-portal';
import ShareDialog from '../../components/dialog/share-dialog'; import ShareDialog from '../../components/dialog/share-dialog';
import LibSubFolderPermissionDialog from '../../components/dialog/lib-sub-folder-permission-dialog'; import LibSubFolderPermissionDialog from '../../components/dialog/lib-sub-folder-permission-dialog';
import DeleteRepoDialog from '../../components/dialog/delete-repo-dialog'; import DeleteRepoDialog from '../../components/dialog/delete-repo-dialog';
import ChangeRepoPasswordDialog from '../../components/dialog/change-repo-password-dialog'; import ChangeRepoPasswordDialog from '../../components/dialog/change-repo-password-dialog';
import ResetEncryptedRepoPasswordDialog from '../../components/dialog/reset-encrypted-repo-password-dialog'; import ResetEncryptedRepoPasswordDialog from '../../components/dialog/reset-encrypted-repo-password-dialog';
import LibOldFilesAutoDelDialog from '../../components/dialog/lib-old-files-auto-del-dialog';
import Rename from '../rename'; import Rename from '../rename';
import { seafileAPI } from '../../utils/seafile-api'; import { seafileAPI } from '../../utils/seafile-api';
import { userAPI } from '../../utils/user-api'; import { userAPI } from '../../utils/user-api';
import LibHistorySettingDialog from '../dialog/lib-history-setting-dialog';
import toaster from '../toast'; import toaster from '../toast';
import RepoAPITokenDialog from '../dialog/repo-api-token-dialog'; import RepoAPITokenDialog from '../dialog/repo-api-token-dialog';
import RepoShareAdminDialog from '../dialog/repo-share-admin-dialog'; import RepoShareAdminDialog from '../dialog/repo-share-admin-dialog';
@@ -55,7 +53,6 @@ class SharedRepoListItem extends React.Component {
isRenaming: false, isRenaming: false,
isStarred: this.props.repo.starred, isStarred: this.props.repo.starred,
isFolderPermissionDialogOpen: false, isFolderPermissionDialogOpen: false,
isHistorySettingDialogShow: false,
isDeleteDialogShow: false, isDeleteDialogShow: false,
isAPITokenDialogShow: false, isAPITokenDialogShow: false,
isTransferDialogShow: false, isTransferDialogShow: false,
@@ -63,7 +60,6 @@ class SharedRepoListItem extends React.Component {
isRepoDeleted: false, isRepoDeleted: false,
isChangePasswordDialogShow: false, isChangePasswordDialogShow: false,
isResetPasswordDialogShow: false, isResetPasswordDialogShow: false,
isOldFilesAutoDelDialogOpen: false
}; };
this.isDeparementOnwerGroupMember = false; this.isDeparementOnwerGroupMember = false;
} }
@@ -182,9 +178,6 @@ class SharedRepoListItem extends React.Component {
case 'Unshare': case 'Unshare':
this.onItemUnshare(); this.onItemUnshare();
break; break;
case 'History Setting':
this.onHistorySettingToggle();
break;
case 'API Token': case 'API Token':
this.onAPITokenToggle(); this.onAPITokenToggle();
break; break;
@@ -203,9 +196,6 @@ class SharedRepoListItem extends React.Component {
case 'Unwatch File Changes': case 'Unwatch File Changes':
this.unwatchFileChanges(); this.unwatchFileChanges();
break; break;
case 'Old Files Auto Delete':
this.toggleOldFilesAutoDelDialog();
break;
// no default // no default
} }
}; };
@@ -273,10 +263,6 @@ class SharedRepoListItem extends React.Component {
this.setState({ isFolderPermissionDialogOpen: !this.state.isFolderPermissionDialogOpen }); this.setState({ isFolderPermissionDialogOpen: !this.state.isFolderPermissionDialogOpen });
}; };
onHistorySettingToggle = () => {
this.setState({ isHistorySettingDialogShow: !this.state.isHistorySettingDialogShow });
};
onItemShare = () => { onItemShare = () => {
this.setState({ isShowSharedDialog: true }); this.setState({ isShowSharedDialog: true });
}; };
@@ -328,10 +314,6 @@ class SharedRepoListItem extends React.Component {
this.setState({ isRepoShareAdminDialogOpen: !this.state.isRepoShareAdminDialogOpen }); this.setState({ isRepoShareAdminDialogOpen: !this.state.isRepoShareAdminDialogOpen });
}; };
toggleOldFilesAutoDelDialog = () => {
this.setState({ isOldFilesAutoDelDialogOpen: !this.state.isOldFilesAutoDelDialogOpen });
};
onAPITokenToggle = () => { onAPITokenToggle = () => {
this.setState({ isAPITokenDialogShow: !this.state.isAPITokenDialogShow }); this.setState({ isAPITokenDialogShow: !this.state.isAPITokenDialogShow });
}; };
@@ -362,9 +344,6 @@ class SharedRepoListItem extends React.Component {
case 'Share': case 'Share':
translateResult = gettext('Share'); translateResult = gettext('Share');
break; break;
case 'History Setting':
translateResult = gettext('History Setting');
break;
case 'Share Admin': case 'Share Admin':
translateResult = gettext('Share Admin'); translateResult = gettext('Share Admin');
break; break;
@@ -380,9 +359,6 @@ class SharedRepoListItem extends React.Component {
case 'Unwatch File Changes': case 'Unwatch File Changes':
translateResult = gettext('Unwatch File Changes'); translateResult = gettext('Unwatch File Changes');
break; break;
case 'Old Files Auto Delete':
translateResult = gettext('Auto Deletion Setting');
break;
case 'API Token': case 'API Token':
translateResult = 'API Token'; // translation is not needed here translateResult = 'API Token'; // translation is not needed here
break; break;
@@ -401,9 +377,6 @@ class SharedRepoListItem extends React.Component {
getAdvancedOperations = () => { getAdvancedOperations = () => {
const operations = []; const operations = [];
operations.push('API Token'); operations.push('API Token');
if (enableRepoAutoDel) {
operations.push('Old Files Auto Delete');
}
return operations; return operations;
}; };
@@ -435,9 +408,8 @@ class SharedRepoListItem extends React.Component {
const monitorOp = repo.monitored ? 'Unwatch File Changes' : 'Watch File Changes'; const monitorOp = repo.monitored ? 'Unwatch File Changes' : 'Watch File Changes';
operations.push(monitorOp); operations.push(monitorOp);
} }
operations.push('Divider', 'History Setting');
if (Utils.isDesktop()) { if (Utils.isDesktop()) {
operations.push('Advanced'); operations.push('Divider', 'Advanced');
} }
return operations; return operations;
} else { } else {
@@ -803,15 +775,6 @@ class SharedRepoListItem extends React.Component {
/> />
</ModalPortal> </ModalPortal>
} }
{this.state.isHistorySettingDialogShow && (
<ModalPortal>
<LibHistorySettingDialog
repoID={repo.repo_id}
itemName={repo.repo_name}
toggleDialog={this.onHistorySettingToggle}
/>
</ModalPortal>
)}
{this.state.isAPITokenDialogShow && ( {this.state.isAPITokenDialogShow && (
<ModalPortal> <ModalPortal>
<RepoAPITokenDialog <RepoAPITokenDialog
@@ -845,14 +808,6 @@ class SharedRepoListItem extends React.Component {
/> />
</ModalPortal> </ModalPortal>
)} )}
{this.state.isOldFilesAutoDelDialogOpen && (
<ModalPortal>
<LibOldFilesAutoDelDialog
repoID={repo.repo_id}
toggleDialog={this.toggleOldFilesAutoDelDialog}
/>
</ModalPortal>
)}
{this.state.isTransferDialogShow && ( {this.state.isTransferDialogShow && (
<ModalPortal> <ModalPortal>
<TransferDialog <TransferDialog

View File

@@ -0,0 +1,53 @@
.lib-settings-dialog {
max-width: 760px;
}
@media (min-width: 768px) {
.lib-settings-dialog .modal-content {
min-height: 534px;
}
}
.lib-setting-nav {
border-bottom: 1px solid rgba(0,40,100,0.12) !important;
}
@media (min-width: 768px) {
.lib-setting-nav {
min-width: 240px;
border-bottom: none;
border-right: 1px solid rgba(0,40,100,0.12) !important;
}
}
.lib-setting-nav .nav-pills .nav-item .nav-link {
margin: 0;
padding: 0 10px;
height: 32px;
flex: 1 1 auto;
}
.lib-setting-nav .nav-pills .nav-item .nav-link.active {
background: #f5f5f5;
color: inherit;
position: relative;
}
.lib-setting-nav .nav-pills .nav-item .nav-link.active::before {
content: '';
display: block;
width: 4px;
height: 24px;
background-color: #ff8000;
border-radius: 2px;
position: absolute;
top: 4px;
left: -8px;
z-index: 0;
}
.lib-settings-dialog .tab-pane {
height: 100%;
display: flex;
flex-direction: column;
}

View File

@@ -1,6 +1,6 @@
import React, { useState, useCallback } from 'react'; import React, { useState, useCallback } from 'react';
import PropTypes from 'prop-types'; import PropTypes from 'prop-types';
import { Modal, ModalHeader, ModalBody, ModalFooter, Button } from 'reactstrap'; import { ModalBody, ModalFooter, Button } from 'reactstrap';
import classnames from 'classnames'; import classnames from 'classnames';
import Switch from '../../../../components/common/switch'; import Switch from '../../../../components/common/switch';
import { gettext } from '../../../../utils/constants'; import { gettext } from '../../../../utils/constants';
@@ -10,7 +10,7 @@ import { Utils } from '../../../../utils/utils';
import './index.css'; import './index.css';
const MetadataFaceRecognitionDialog = ({ value: oldValue, repoID, toggle, submit }) => { const MetadataFaceRecognitionDialog = ({ value: oldValue, repoID, toggleDialog: toggle, submit }) => {
const [value, setValue] = useState(oldValue); const [value, setValue] = useState(oldValue);
const [submitting, setSubmitting] = useState(false); const [submitting, setSubmitting] = useState(false);
@@ -36,9 +36,8 @@ const MetadataFaceRecognitionDialog = ({ value: oldValue, repoID, toggle, submit
}, [value]); }, [value]);
return ( return (
<Modal className="metadata-face-recognition-dialog" isOpen={true} toggle={onToggle}> <>
<ModalHeader toggle={onToggle}>{gettext('Face recognition management')}</ModalHeader> <ModalBody className="metadata-face-recognition-dialog">
<ModalBody>
<Switch <Switch
checked={value} checked={value}
disabled={submitting || oldValue} disabled={submitting || oldValue}
@@ -48,9 +47,9 @@ const MetadataFaceRecognitionDialog = ({ value: oldValue, repoID, toggle, submit
onChange={onValueChange} onChange={onValueChange}
placeholder={gettext('Face recognition')} placeholder={gettext('Face recognition')}
/> />
<div className="tip"> <p className="tip m-0">
{gettext('Enable face recognition to identify people in your photos.')} {gettext('Enable face recognition to identify people in your photos.')}
</div> </p>
</ModalBody> </ModalBody>
{!oldValue && ( {!oldValue && (
<ModalFooter> <ModalFooter>
@@ -58,14 +57,14 @@ const MetadataFaceRecognitionDialog = ({ value: oldValue, repoID, toggle, submit
<Button color="primary" disabled={oldValue === value || submitting} onClick={onSubmit}>{gettext('Submit')}</Button> <Button color="primary" disabled={oldValue === value || submitting} onClick={onSubmit}>{gettext('Submit')}</Button>
</ModalFooter> </ModalFooter>
)} )}
</Modal> </>
); );
}; };
MetadataFaceRecognitionDialog.propTypes = { MetadataFaceRecognitionDialog.propTypes = {
value: PropTypes.bool.isRequired, value: PropTypes.bool.isRequired,
repoID: PropTypes.string.isRequired, repoID: PropTypes.string.isRequired,
toggle: PropTypes.func.isRequired, toggleDialog: PropTypes.func.isRequired,
submit: PropTypes.func.isRequired, submit: PropTypes.func.isRequired,
}; };

View File

@@ -1,7 +1,7 @@
import React, { useCallback, useState } from 'react'; import React, { useCallback, useState } from 'react';
import PropTypes from 'prop-types'; import PropTypes from 'prop-types';
import classnames from 'classnames'; import classnames from 'classnames';
import { Modal, ModalHeader, ModalBody, ModalFooter, Button } from 'reactstrap'; import { ModalBody, ModalFooter, Button } from 'reactstrap';
import Switch from '../../../../components/common/switch'; import Switch from '../../../../components/common/switch';
import toaster from '../../../../components/toast'; import toaster from '../../../../components/toast';
import TurnOffConfirmDialog from './turn-off-confirm'; import TurnOffConfirmDialog from './turn-off-confirm';
@@ -11,7 +11,7 @@ import { gettext } from '../../../../utils/constants';
import './index.css'; import './index.css';
const MetadataStatusManagementDialog = ({ value: oldValue, repoID, toggle, submit }) => { const MetadataStatusManagementDialog = ({ value: oldValue, repoID, toggleDialog: toggle, submit }) => {
const [value, setValue] = useState(oldValue); const [value, setValue] = useState(oldValue);
const [submitting, setSubmitting] = useState(false); const [submitting, setSubmitting] = useState(false);
const [showTurnOffConfirmDialog, setShowTurnOffConfirmDialog] = useState(false); const [showTurnOffConfirmDialog, setShowTurnOffConfirmDialog] = useState(false);
@@ -62,9 +62,8 @@ const MetadataStatusManagementDialog = ({ value: oldValue, repoID, toggle, submi
return ( return (
<> <>
{!showTurnOffConfirmDialog && ( {!showTurnOffConfirmDialog && (
<Modal className="metadata-status-management-dialog" isOpen={true} toggle={onToggle}> <>
<ModalHeader toggle={onToggle}>{gettext('Extended properties management')}</ModalHeader> <ModalBody className="metadata-status-management-dialog">
<ModalBody>
<Switch <Switch
checked={value} checked={value}
disabled={submitting} disabled={submitting}
@@ -74,15 +73,15 @@ const MetadataStatusManagementDialog = ({ value: oldValue, repoID, toggle, submi
onChange={onValueChange} onChange={onValueChange}
placeholder={gettext('Enable extended properties')} placeholder={gettext('Enable extended properties')}
/> />
<div className="tip"> <p className="tip m-0">
{gettext('After enable extended properties for files, you can add different properties to files, like collaborators, file expiring time, file description. You can also create different views for files based extended properties.')} {gettext('After enable extended properties for files, you can add different properties to files, like collaborators, file expiring time, file description. You can also create different views for files based extended properties.')}
</div> </p>
</ModalBody> </ModalBody>
<ModalFooter> <ModalFooter>
<Button color="secondary" onClick={onToggle}>{gettext('Cancel')}</Button> <Button color="secondary" onClick={onToggle}>{gettext('Cancel')}</Button>
<Button color="primary" disabled={oldValue === value || submitting} onClick={onSubmit}>{gettext('Submit')}</Button> <Button color="primary" disabled={oldValue === value || submitting} onClick={onSubmit}>{gettext('Submit')}</Button>
</ModalFooter> </ModalFooter>
</Modal> </>
)} )}
{showTurnOffConfirmDialog && ( {showTurnOffConfirmDialog && (
<TurnOffConfirmDialog toggle={turnOffConfirmToggle} submit={turnOffConfirmSubmit} /> <TurnOffConfirmDialog toggle={turnOffConfirmToggle} submit={turnOffConfirmSubmit} />
@@ -94,7 +93,7 @@ const MetadataStatusManagementDialog = ({ value: oldValue, repoID, toggle, submi
MetadataStatusManagementDialog.propTypes = { MetadataStatusManagementDialog.propTypes = {
value: PropTypes.bool, value: PropTypes.bool,
repoID: PropTypes.string.isRequired, repoID: PropTypes.string.isRequired,
toggle: PropTypes.func.isRequired, toggleDialog: PropTypes.func.isRequired,
submit: PropTypes.func.isRequired, submit: PropTypes.func.isRequired,
}; };

View File

@@ -12,7 +12,6 @@ import ShareDialog from '../../components/dialog/share-dialog';
import toaster from '../../components/toast'; import toaster from '../../components/toast';
import DeleteRepoDialog from '../../components/dialog/delete-repo-dialog'; import DeleteRepoDialog from '../../components/dialog/delete-repo-dialog';
import TransferDialog from '../../components/dialog/transfer-dialog'; import TransferDialog from '../../components/dialog/transfer-dialog';
import LibHistorySettingDialog from '../../components/dialog/lib-history-setting-dialog';
import ChangeRepoPasswordDialog from '../../components/dialog/change-repo-password-dialog'; import ChangeRepoPasswordDialog from '../../components/dialog/change-repo-password-dialog';
import ResetEncryptedRepoPasswordDialog from '../../components/dialog/reset-encrypted-repo-password-dialog'; import ResetEncryptedRepoPasswordDialog from '../../components/dialog/reset-encrypted-repo-password-dialog';
import LabelRepoStateDialog from '../../components/dialog/label-repo-state-dialog'; import LabelRepoStateDialog from '../../components/dialog/label-repo-state-dialog';
@@ -21,7 +20,6 @@ import Rename from '../../components/rename';
import MylibRepoMenu from './mylib-repo-menu'; import MylibRepoMenu from './mylib-repo-menu';
import RepoAPITokenDialog from '../../components/dialog/repo-api-token-dialog'; import RepoAPITokenDialog from '../../components/dialog/repo-api-token-dialog';
import RepoShareAdminDialog from '../../components/dialog/repo-share-admin-dialog'; import RepoShareAdminDialog from '../../components/dialog/repo-share-admin-dialog';
import LibOldFilesAutoDelDialog from '../../components/dialog/lib-old-files-auto-del-dialog';
import RepoMonitoredIcon from '../../components/repo-monitored-icon'; import RepoMonitoredIcon from '../../components/repo-monitored-icon';
import { GRID_MODE, LIST_MODE } from '../../components/dir-view-mode/constants'; import { GRID_MODE, LIST_MODE } from '../../components/dir-view-mode/constants';
import { userAPI } from '../../utils/user-api'; import { userAPI } from '../../utils/user-api';
@@ -52,7 +50,6 @@ class MylibRepoListItem extends React.Component {
isShareDialogShow: false, isShareDialogShow: false,
isDeleteDialogShow: false, isDeleteDialogShow: false,
isTransferDialogShow: false, isTransferDialogShow: false,
isHistorySettingDialogShow: false,
isChangePasswordDialogShow: false, isChangePasswordDialogShow: false,
isResetPasswordDialogShow: false, isResetPasswordDialogShow: false,
isLabelRepoStateDialogOpen: false, isLabelRepoStateDialogOpen: false,
@@ -60,7 +57,6 @@ class MylibRepoListItem extends React.Component {
isAPITokenDialogShow: false, isAPITokenDialogShow: false,
isRepoShareAdminDialogOpen: false, isRepoShareAdminDialogOpen: false,
isRepoDeleted: false, isRepoDeleted: false,
isOldFilesAutoDelDialogOpen: false,
}; };
} }
@@ -108,9 +104,6 @@ class MylibRepoListItem extends React.Component {
case 'Transfer': case 'Transfer':
this.onTransferToggle(); this.onTransferToggle();
break; break;
case 'History Setting':
this.onHistorySettingToggle();
break;
case 'Change Password': case 'Change Password':
this.onChangePasswordToggle(); this.onChangePasswordToggle();
break; break;
@@ -135,9 +128,6 @@ class MylibRepoListItem extends React.Component {
case 'Share Admin': case 'Share Admin':
this.toggleRepoShareAdminDialog(); this.toggleRepoShareAdminDialog();
break; break;
case 'Old Files Auto Delete':
this.toggleOldFilesAutoDelDialog();
break;
default: default:
break; break;
} }
@@ -211,10 +201,6 @@ class MylibRepoListItem extends React.Component {
this.setState({ isTransferDialogShow: !this.state.isTransferDialogShow }); this.setState({ isTransferDialogShow: !this.state.isTransferDialogShow });
}; };
onHistorySettingToggle = () => {
this.setState({ isHistorySettingDialogShow: !this.state.isHistorySettingDialogShow });
};
onChangePasswordToggle = () => { onChangePasswordToggle = () => {
this.setState({ isChangePasswordDialogShow: !this.state.isChangePasswordDialogShow }); this.setState({ isChangePasswordDialogShow: !this.state.isChangePasswordDialogShow });
}; };
@@ -239,10 +225,6 @@ class MylibRepoListItem extends React.Component {
this.setState({ isRepoShareAdminDialogOpen: !this.state.isRepoShareAdminDialogOpen }); this.setState({ isRepoShareAdminDialogOpen: !this.state.isRepoShareAdminDialogOpen });
}; };
toggleOldFilesAutoDelDialog = () => {
this.setState({ isOldFilesAutoDelDialogOpen: !this.state.isOldFilesAutoDelDialogOpen });
};
onUnfreezedItem = () => { onUnfreezedItem = () => {
this.setState({ this.setState({
highlight: false, highlight: false,
@@ -510,15 +492,6 @@ class MylibRepoListItem extends React.Component {
/> />
</ModalPortal> </ModalPortal>
)} )}
{this.state.isHistorySettingDialogShow && (
<ModalPortal>
<LibHistorySettingDialog
repoID={repo.repo_id}
itemName={repo.repo_name}
toggleDialog={this.onHistorySettingToggle}
/>
</ModalPortal>
)}
{this.state.isChangePasswordDialogShow && ( {this.state.isChangePasswordDialogShow && (
<ModalPortal> <ModalPortal>
<ChangeRepoPasswordDialog <ChangeRepoPasswordDialog
@@ -574,14 +547,6 @@ class MylibRepoListItem extends React.Component {
/> />
</ModalPortal> </ModalPortal>
)} )}
{this.state.isOldFilesAutoDelDialogOpen && (
<ModalPortal>
<LibOldFilesAutoDelDialog
repoID={repo.repo_id}
toggleDialog={this.toggleOldFilesAutoDelDialog}
/>
</ModalPortal>
)}
</Fragment> </Fragment>
); );

View File

@@ -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, isPro, folderPermEnabled, enableRepoSnapshotLabel, enableResetEncryptedRepoPassword, isEmailConfigured, enableRepoAutoDel } from '../../utils/constants'; import { gettext, isPro, folderPermEnabled, enableRepoSnapshotLabel, enableResetEncryptedRepoPassword, isEmailConfigured } from '../../utils/constants';
import { Utils } from '../../utils/utils'; import { Utils } from '../../utils/utils';
const propTypes = { const propTypes = {
@@ -103,7 +103,7 @@ class MylibRepoMenu extends React.Component {
operations.push(monitorOp); operations.push(monitorOp);
} }
operations.push('Divider', 'History Setting', 'Advanced'); operations.push('Divider', 'Advanced');
// Remove adjacent excess 'Divider' // Remove adjacent excess 'Divider'
for (let i = 0; i < operations.length; i++) { for (let i = 0; i < operations.length; i++) {
if (operations[i] === 'Divider' && operations[i + 1] === 'Divider') { if (operations[i] === 'Divider' && operations[i + 1] === 'Divider') {
@@ -120,9 +120,6 @@ class MylibRepoMenu extends React.Component {
if (this.props.isPC && enableRepoSnapshotLabel) { if (this.props.isPC && enableRepoSnapshotLabel) {
operations.push('Label Current State'); operations.push('Label Current State');
} }
if (enableRepoAutoDel) {
operations.push('Old Files Auto Delete');
}
return operations; return operations;
}; };
@@ -147,9 +144,6 @@ class MylibRepoMenu extends React.Component {
case 'Transfer': case 'Transfer':
translateResult = gettext('Transfer'); translateResult = gettext('Transfer');
break; break;
case 'History Setting':
translateResult = gettext('History Setting');
break;
case 'Change Password': case 'Change Password':
translateResult = gettext('Change Password'); translateResult = gettext('Change Password');
break; break;
@@ -174,9 +168,6 @@ class MylibRepoMenu extends React.Component {
case 'Share Admin': case 'Share Admin':
translateResult = gettext('Share Admin'); translateResult = gettext('Share Admin');
break; break;
case 'Old Files Auto Delete':
translateResult = gettext('Auto Deletion Setting');
break;
case 'Advanced': case 'Advanced':
translateResult = gettext('Advanced'); translateResult = gettext('Advanced');
break; break;

View File

@@ -165,10 +165,6 @@ const TextTranslation = {
key: 'Watch File Changes', key: 'Watch File Changes',
value: gettext('Watch File Changes') value: gettext('Watch File Changes')
}, },
'HISTORY_SETTING': {
key: 'History Setting',
value: gettext('History Setting')
},
'ADVANCED': { 'ADVANCED': {
key: 'advanced', key: 'advanced',
value: gettext('Advanced') value: gettext('Advanced')
@@ -183,10 +179,6 @@ const TextTranslation = {
key: 'Label Current State', key: 'Label Current State',
value: gettext('Label Current State') value: gettext('Label Current State')
}, },
'OLD_FILES_AUTO_DELETE': {
key: 'Old Files Auto Delete',
value: gettext('Old Files Auto Delete')
},
'UNSHARE': { 'UNSHARE': {
key: 'Unshare', key: 'Unshare',

View File

@@ -1,4 +1,5 @@
import { mediaUrl, gettext, serviceURL, siteRoot, isPro, fileAuditEnabled, canGenerateShareLink, canGenerateUploadLink, shareLinkPasswordMinLength, username, folderPermEnabled, onlyofficeConverterExtensions, enableOnlyoffice, enableSeadoc, enableFileTags, enableRepoSnapshotLabel, enableRepoAutoDel, enableResetEncryptedRepoPassword, isEmailConfigured, isSystemStaff } from './constants'; import { mediaUrl, gettext, serviceURL, siteRoot, isPro, fileAuditEnabled, canGenerateShareLink, canGenerateUploadLink, shareLinkPasswordMinLength, username, folderPermEnabled, onlyofficeConverterExtensions, enableOnlyoffice, enableSeadoc, enableFileTags, enableRepoSnapshotLabel,
enableResetEncryptedRepoPassword, isEmailConfigured, isSystemStaff } 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';
@@ -720,7 +721,7 @@ export const Utils = {
const showResetPasswordMenuItem = isPro && repo.encrypted && enableResetEncryptedRepoPassword && isEmailConfigured; const showResetPasswordMenuItem = isPro && repo.encrypted && enableResetEncryptedRepoPassword && isEmailConfigured;
const operations = []; const operations = [];
const DIVIDER = 'Divider'; const DIVIDER = 'Divider';
const { SHARE, DELETE, RENAME, TRANSFER, FOLDER_PERMISSION, SHARE_ADMIN, CHANGE_PASSWORD, RESET_PASSWORD, UNWATCH_FILE_CHANGES, WATCH_FILE_CHANGES, HISTORY_SETTING, ADVANCED } = TextTranslation; const { SHARE, DELETE, RENAME, TRANSFER, FOLDER_PERMISSION, SHARE_ADMIN, CHANGE_PASSWORD, RESET_PASSWORD, UNWATCH_FILE_CHANGES, WATCH_FILE_CHANGES, ADVANCED } = TextTranslation;
operations.push(SHARE, DELETE, DIVIDER, RENAME, TRANSFER); operations.push(SHARE, DELETE, DIVIDER, RENAME, TRANSFER);
@@ -742,7 +743,7 @@ export const Utils = {
operations.push(monitorOp); operations.push(monitorOp);
} }
operations.push(DIVIDER, HISTORY_SETTING); operations.push(DIVIDER);
const subOpList = Utils.getAdvancedOperations(); const subOpList = Utils.getAdvancedOperations();
operations.push({ ...ADVANCED, subOpList }); operations.push({ ...ADVANCED, subOpList });
@@ -752,7 +753,7 @@ export const Utils = {
getAdvancedOperations: function () { getAdvancedOperations: function () {
const operations = []; const operations = [];
const { API_TOKEN, LABEL_CURRENT_STATE, OLD_FILES_AUTO_DELETE } = TextTranslation; const { API_TOKEN, LABEL_CURRENT_STATE } = TextTranslation;
operations.push(API_TOKEN); operations.push(API_TOKEN);
@@ -760,10 +761,6 @@ export const Utils = {
operations.push(LABEL_CURRENT_STATE); operations.push(LABEL_CURRENT_STATE);
} }
if (enableRepoAutoDel) {
operations.push(OLD_FILES_AUTO_DELETE);
}
return operations; return operations;
}, },
@@ -796,7 +793,7 @@ export const Utils = {
getSharedRepoOperationList: function (repo, currentGroup, isPublic) { getSharedRepoOperationList: function (repo, currentGroup, isPublic) {
const operations = []; const operations = [];
const { SHARE, UNSHARE, DELETE, RENAME, FOLDER_PERMISSION, SHARE_ADMIN, UNWATCH_FILE_CHANGES, WATCH_FILE_CHANGES, HISTORY_SETTING, ADVANCED, CHANGE_PASSWORD, RESET_PASSWORD } = TextTranslation; const { SHARE, UNSHARE, DELETE, RENAME, FOLDER_PERMISSION, SHARE_ADMIN, UNWATCH_FILE_CHANGES, WATCH_FILE_CHANGES, ADVANCED, CHANGE_PASSWORD, RESET_PASSWORD, API_TOKEN } = TextTranslation;
const isStaff = currentGroup && currentGroup.admins && currentGroup.admins.indexOf(username) > -1; const isStaff = currentGroup && currentGroup.admins && currentGroup.admins.indexOf(username) > -1;
const isRepoOwner = repo.owner_email === username; const isRepoOwner = repo.owner_email === username;
@@ -830,9 +827,9 @@ export const Utils = {
const monitorOp = repo.monitored ? UNWATCH_FILE_CHANGES : WATCH_FILE_CHANGES; const monitorOp = repo.monitored ? UNWATCH_FILE_CHANGES : WATCH_FILE_CHANGES;
operations.push(monitorOp); operations.push(monitorOp);
} }
operations.push(DIVIDER, HISTORY_SETTING);
if (Utils.isDesktop()) { if (Utils.isDesktop()) {
const subOpList = Utils.getAdvancedOperations(); operations.push(DIVIDER);
const subOpList = [API_TOKEN];
operations.push({ ...ADVANCED, subOpList }); operations.push({ ...ADVANCED, subOpList });
} }
return operations; return operations;