diff --git a/frontend/src/pages/sys-admin/institutions/institution-admins.js b/frontend/src/pages/sys-admin/institutions/institution-admins.js index 994ab8d76e..0ac24c1a12 100644 --- a/frontend/src/pages/sys-admin/institutions/institution-admins.js +++ b/frontend/src/pages/sys-admin/institutions/institution-admins.js @@ -119,19 +119,13 @@ class Item extends Component { } revokeAdmin = () => { - this.props.revokeAdmin(this.props.item.email); + this.props.revokeAdmin(this.props.item); } onMenuItemClick = (operation) => { switch (operation) { - case 'Delete': - this.props.deleteUser(this.props.item.email); - break; - case 'Set Admin': - this.props.setAdmin(this.props.item.email); - break; case 'Revoke Admin': - this.props.revokeAdmin(this.props.item.email); + this.toggleRevokeAdminDialog(); break; } } @@ -150,6 +144,9 @@ class Item extends Component { const { item } = this.props; const { isOpIconShown, isRevokeAdminDialogOpen } = this.state; + const itemName = '' + Utils.HTMLescape(item.name) + ''; + const revokeAdminDialogMsg = gettext('Are you sure you want to revoke the admin permission of {placeholder} ?').replace('{placeholder}', itemName); + return ( @@ -178,8 +175,9 @@ class Item extends Component { {isRevokeAdminDialogOpen && } @@ -235,13 +233,15 @@ class InstitutionAdmins extends Component { }); } - revokeAdmin = (email) => { + revokeAdmin = (item) => { + const email = item.email; + const name = item.name; seafileAPI.sysAdminUpdateInstitutionUser(this.props.institutionID, email, false).then(res => { let userList = this.state.userList.filter(user => { return user.email != email; }); this.setState({userList: userList}); - toaster.success(gettext('Success')); + toaster.success(gettext('Successfully revoked the admin permission of {placeholder}'.replace('{placeholder}', name))); }).catch((error) => { let errMessage = Utils.getErrorMsg(error); toaster.danger(errMessage); diff --git a/frontend/src/pages/sys-admin/statistic/statistic-file.js b/frontend/src/pages/sys-admin/statistic/statistic-file.js index c67a253aad..296450ce1c 100644 --- a/frontend/src/pages/sys-admin/statistic/statistic-file.js +++ b/frontend/src/pages/sys-admin/statistic/statistic-file.js @@ -41,22 +41,22 @@ class StatisticFile extends React.Component { visited.push(item.visited); }); let addedData = { - label: gettext('added'), + label: gettext('Added'), data: added, borderColor: '#57cd6b', backgroundColor: '#57cd6b'}; let visitedData = { - label: gettext('visited'), + label: gettext('Visited'), data: visited, borderColor: '#fd913a', backgroundColor: '#fd913a'}; let modifiedData = { - label: gettext('modified'), + label: gettext('Modified'), data: modified, borderColor: '#72c3fc', backgroundColor: '#72c3fc'}; let deletedData = { - label: gettext('deleted'), + label: gettext('Deleted'), data: deleted, borderColor: '#f75356', backgroundColor: '#f75356'}; @@ -100,4 +100,4 @@ class StatisticFile extends React.Component { } } -export default StatisticFile; \ No newline at end of file +export default StatisticFile; diff --git a/frontend/src/pages/sys-admin/statistic/statistic-storage.js b/frontend/src/pages/sys-admin/statistic/statistic-storage.js index e969981c78..20544b4042 100644 --- a/frontend/src/pages/sys-admin/statistic/statistic-storage.js +++ b/frontend/src/pages/sys-admin/statistic/statistic-storage.js @@ -33,7 +33,7 @@ class StatisticStorage extends React.Component { totalStorage.push(item.total_storage); }); let total_storage = { - label: gettext('Total storage space'), + label: gettext('Total Storage'), data: totalStorage, borderColor: '#fd913a', backgroundColor: '#fd913a'}; @@ -78,4 +78,4 @@ class StatisticStorage extends React.Component { } } -export default StatisticStorage; \ No newline at end of file +export default StatisticStorage; diff --git a/frontend/src/pages/sys-admin/statistic/traffic-table.js b/frontend/src/pages/sys-admin/statistic/traffic-table.js index a7c185df13..762708fd4f 100644 --- a/frontend/src/pages/sys-admin/statistic/traffic-table.js +++ b/frontend/src/pages/sys-admin/statistic/traffic-table.js @@ -22,20 +22,6 @@ class TrafficTable extends React.Component { this.props.sortBySize(showIconName, sortOrder); } - getTrafficTypeName = () => { - let { type } = this.props; - let trafficTypeName; - switch(type) { - case 'user': - trafficTypeName = 'User'; - break; - case 'org': - trafficTypeName = 'Org'; - break; - } - return trafficTypeName; - } - sortBySize = (sortByType) => { let { sortOrder } = this.props; let newSortOrder = sortOrder === 'asc' ? 'desc' : 'asc'; @@ -47,24 +33,21 @@ class TrafficTable extends React.Component { } render() { - let { sortOrder } = this.props; - let { showIconName } = this.state; - - let trafficTypeName = this.getTrafficTypeName(); - + const { type, sortOrder } = this.props; + const { showIconName } = this.state; const sortIcon = sortOrder == 'asc' ? : ; return ( - + - - + + @@ -77,4 +60,4 @@ class TrafficTable extends React.Component { TrafficTable.propTypes = propTypes; -export default TrafficTable; \ No newline at end of file +export default TrafficTable;
{gettext('{trafficTypeName}').replace('{trafficTypeName}', trafficTypeName)}{type == 'user' ? gettext('User') : gettext('Organization')}
{gettext('Sync Upload')} {showIconName === 'sync_file_upload' && sortIcon}
{gettext('Sync Download')} {showIconName === 'sync_file_donwload' && sortIcon}
{gettext('Web Upload')} {showIconName === 'web_file_upload' && sortIcon}
{gettext('Web Download')} {showIconName === 'web_file_download' && sortIcon}
{gettext('Link Upload')} {showIconName === 'link_file_upload' && sortIcon}
{gettext('Link Download')} {showIconName === 'link_file_download' && sortIcon}
{gettext('Share link upload')} {showIconName === 'link_file_upload' && sortIcon}
{gettext('Share link download')} {showIconName === 'link_file_download' && sortIcon}