mirror of
https://github.com/haiwen/seahub.git
synced 2025-09-09 19:01:42 +00:00
update codes
fix warnings
This commit is contained in:
@@ -56,20 +56,11 @@ class Org extends React.Component {
|
||||
let { isSidePanelClosed, currentTab } = this.state;
|
||||
return (
|
||||
<div id="main">
|
||||
<SidePanel
|
||||
isSidePanelClosed={isSidePanelClosed}
|
||||
onCloseSidePanel={this.onCloseSidePanel}
|
||||
currentTab={currentTab}
|
||||
tabItemClick={this.tabItemClick}
|
||||
/>
|
||||
<SidePanel isSidePanelClosed={isSidePanelClosed} onCloseSidePanel={this.onCloseSidePanel} currentTab={currentTab} tabItemClick={this.tabItemClick}/>
|
||||
<div className="main-panel o-hidden">
|
||||
<Router className="reach-router">
|
||||
<OrgInfo path={siteRoot + 'org/orgmanage'}/>
|
||||
<OrgUsers
|
||||
path={siteRoot + 'org/useradmin'}
|
||||
currentTab={currentTab}
|
||||
tabItemClick={this.tabItemClick}
|
||||
/>
|
||||
<OrgUsers path={siteRoot + 'org/useradmin'} currentTab={currentTab} tabItemClick={this.tabItemClick}/>
|
||||
<OrgGroups path={siteRoot + 'org/groupadmin'}/>
|
||||
<OrgLibraries path={siteRoot + 'org/repoadmin'}/>
|
||||
<OrgLinks path={siteRoot + 'org/publinkadmin'}/>
|
||||
@@ -77,11 +68,7 @@ class Org extends React.Component {
|
||||
<OrgDepartmentsList path='/'/>
|
||||
<OrgDepartmentItem path='groups/:groupID'/>
|
||||
</OrgDepartments>
|
||||
<OrgLogs
|
||||
path={siteRoot + 'org/logadmin'}
|
||||
currentTab={currentTab}
|
||||
tabItemClick={this.tabItemClick}
|
||||
>
|
||||
<OrgLogs path={siteRoot + 'org/logadmin'} currentTab={currentTab} tabItemClick={this.tabItemClick}>
|
||||
<OrgLogsFileAudit path='/'/>
|
||||
<OrgLogsFileUpdate path={siteRoot + 'file-update'}/>
|
||||
<OrgLogsPermAudit path={siteRoot + 'perm-audit'}/>
|
||||
|
@@ -1,4 +1,4 @@
|
||||
import React, { Component, Fragment } from 'react';
|
||||
import React, { Component } from 'react';
|
||||
import PropTypes from 'prop-types';
|
||||
import Account from '../../components/common/account';
|
||||
|
||||
|
@@ -26,10 +26,6 @@ class OrgAdminList extends React.Component {
|
||||
this.props.initOrgAdmin();
|
||||
}
|
||||
|
||||
componentWillReceiveProps(nextProps) {
|
||||
this.props.initOrgAdmin();
|
||||
}
|
||||
|
||||
onFreezedItem = () => {
|
||||
this.setState({isItemFreezed: true});
|
||||
}
|
||||
|
@@ -1,4 +1,4 @@
|
||||
import React, { Component, Fragment } from 'react';
|
||||
import React, { Fragment } from 'react';
|
||||
import PropTypes from 'prop-types';
|
||||
import { Link } from '@reach/router';
|
||||
import { seafileAPI } from '../../utils/seafile-api';
|
||||
@@ -32,6 +32,7 @@ class OrgDepartmentItem extends React.Component {
|
||||
isShowAddMemberDialog: false,
|
||||
isShowAddDepartDialog: false,
|
||||
isItemFreezed: false,
|
||||
isSubdepartChanged: false,
|
||||
groupName: '',
|
||||
};
|
||||
}
|
||||
@@ -79,9 +80,7 @@ class OrgDepartmentItem extends React.Component {
|
||||
}
|
||||
|
||||
toggleItemFreezed = (isFreezed) => {
|
||||
this.setState({
|
||||
isItemFreezed: isFreezed
|
||||
});
|
||||
this.setState({ isItemFreezed: isFreezed });
|
||||
}
|
||||
|
||||
toggleAddRepoDialog = () => {
|
||||
@@ -96,6 +95,10 @@ class OrgDepartmentItem extends React.Component {
|
||||
this.setState({ isShowAddDepartDialog: !this.state.isShowAddDepartDialog});
|
||||
}
|
||||
|
||||
onDepartChanged = () => {
|
||||
this.setState({ isSubdepartChanged: !this.state.isSubdepartChanged });
|
||||
}
|
||||
|
||||
componentWillMount() {
|
||||
const groupID = this.props.groupID;
|
||||
this.listOrgGroupRepo(groupID);
|
||||
@@ -115,14 +118,14 @@ class OrgDepartmentItem extends React.Component {
|
||||
const topBtn = 'btn btn-secondary operation-item';
|
||||
const topbarChildren = (
|
||||
<Fragment>
|
||||
{groupID && <button className={topBtn} title={gettext('New Sub-department')}
|
||||
onClick={this.toggleAddDepartDialog}>{gettext('New Sub-department')}</button>
|
||||
{groupID &&
|
||||
<button className={topBtn} title={gettext('New Sub-department')} onClick={this.toggleAddDepartDialog}>{gettext('New Sub-department')}</button>
|
||||
}
|
||||
{groupID && <button className={topBtn} title={gettext('Add Member')}
|
||||
onClick={this.toggleAddMemberDialog}>{gettext('Add Member')}</button>
|
||||
{groupID &&
|
||||
<button className={topBtn} title={gettext('Add Member')} onClick={this.toggleAddMemberDialog}>{gettext('Add Member')}</button>
|
||||
}
|
||||
{groupID && <button className={topBtn} onClick={this.toggleAddRepoDialog}
|
||||
title={gettext('New Library')}>{gettext('New Library')}</button>
|
||||
{groupID &&
|
||||
<button className={topBtn} onClick={this.toggleAddRepoDialog} title={gettext('New Library')}>{gettext('New Library')}</button>
|
||||
}
|
||||
{this.state.isShowAddMemberDialog && (
|
||||
<ModalPortal>
|
||||
@@ -145,7 +148,7 @@ class OrgDepartmentItem extends React.Component {
|
||||
{this.state.isShowAddDepartDialog && (
|
||||
<ModalPortal>
|
||||
<AddDepartDialog
|
||||
onDepartChanged={window.onDepartChanged}
|
||||
onDepartChanged={this.onDepartChanged}
|
||||
parentGroupID={groupID}
|
||||
toggle={this.toggleAddDepartDialog}
|
||||
/>
|
||||
@@ -176,7 +179,7 @@ class OrgDepartmentItem extends React.Component {
|
||||
</div>
|
||||
|
||||
<div className="cur-view-subcontainer org-groups">
|
||||
<OrgDepartmentsList groupID={groupID} />
|
||||
<OrgDepartmentsList groupID={groupID} isSubdepartChanged={this.state.isSubdepartChanged}/>
|
||||
</div>
|
||||
|
||||
<div className="cur-view-subcontainer org-members">
|
||||
|
@@ -1,9 +1,9 @@
|
||||
import React, { Component, Fragment } from 'react';
|
||||
import React, { Fragment } from 'react';
|
||||
import PropTypes from 'prop-types';
|
||||
import moment from 'moment';
|
||||
import { Link } from '@reach/router';
|
||||
import { seafileAPI } from '../../utils/seafile-api';
|
||||
import { serviceURL, siteRoot, gettext, orgID, lang } from '../../utils/constants';
|
||||
import { siteRoot, gettext, orgID, lang } from '../../utils/constants';
|
||||
import { Utils } from '../../utils/utils.js';
|
||||
import ModalPortal from '../../components/modal-portal';
|
||||
import AddDepartDialog from '../../components/dialog/org-add-department-dialog';
|
||||
@@ -63,13 +63,12 @@ class OrgDepartmentsList extends React.Component {
|
||||
this.setState({ isShowAddDepartDialog: !this.state.isShowAddDepartDialog});
|
||||
}
|
||||
|
||||
componentWillMount() {
|
||||
componentDidMount() {
|
||||
this.listDepartGroups(this.props.groupID);
|
||||
window.onDepartChanged = this.onDepartChanged;
|
||||
}
|
||||
|
||||
componentWillReceiveProps(nextProps) {
|
||||
if (this.props.groupID !== nextProps.groupID) {
|
||||
if (this.props.groupID !== nextProps.groupID || this.props.isSubdepartChanged !== nextProps.isSubdepartChanged) {
|
||||
this.listDepartGroups(nextProps.groupID);
|
||||
}
|
||||
}
|
||||
@@ -82,8 +81,9 @@ class OrgDepartmentsList extends React.Component {
|
||||
|
||||
const topbarChildren = (
|
||||
<Fragment>
|
||||
{!this.props.groupID && <button className='btn btn-secondary operation-item' title={gettext('New Department')}
|
||||
onClick={this.toggleAddDepartDialog}>{gettext('New Department')}</button>
|
||||
{!this.props.groupID &&
|
||||
<button className='btn btn-secondary operation-item' title={gettext('New Department')} onClick={this.toggleAddDepartDialog}>{gettext('New Department')}
|
||||
</button>
|
||||
}
|
||||
{this.state.isShowAddDepartDialog && (
|
||||
<ModalPortal>
|
||||
@@ -104,7 +104,9 @@ class OrgDepartmentsList extends React.Component {
|
||||
<div className="main-panel-center flex-row h-100">
|
||||
<div className="cur-view-container o-auto">
|
||||
<div className="cur-view-path">
|
||||
<div className="fleft"><h3 className="sf-heading">{header}</h3></div>
|
||||
<div className="fleft">
|
||||
<h3 className="sf-heading">{header}</h3>
|
||||
</div>
|
||||
</div>
|
||||
<div className="cur-view-content">
|
||||
{groups && groups.length > 0 ?
|
||||
@@ -204,6 +206,7 @@ const GroupItemPropTypes = {
|
||||
group: PropTypes.object.isRequired,
|
||||
showSetGroupQuotaDialog: PropTypes.func.isRequired,
|
||||
showDeleteDepartDialog: PropTypes.func.isRequired,
|
||||
isSubdepartChanged: PropTypes.bool,
|
||||
};
|
||||
|
||||
GroupItem.propTypes = GroupItemPropTypes;
|
||||
|
@@ -1,5 +1,4 @@
|
||||
import React from 'react';
|
||||
import PropTypes from 'prop-types';
|
||||
import '../../css/org-department-item.css';
|
||||
|
||||
class OrgDepartments extends React.Component {
|
||||
|
@@ -1,4 +1,5 @@
|
||||
import React, { Component, Fragment } from 'react';
|
||||
import PropTypes from 'prop-types';
|
||||
import { Dropdown, DropdownToggle, DropdownMenu, DropdownItem } from 'reactstrap';
|
||||
import OrgGroupInfo from '../../models/org-group';
|
||||
import Toast from '../../components/toast';
|
||||
@@ -100,7 +101,8 @@ class OrgGroups extends Component {
|
||||
onUnfreezedItem={this.onUnfreezedItem}
|
||||
deleteGroupItem={this.deleteGroupItem}
|
||||
/>
|
||||
)})}
|
||||
);
|
||||
})}
|
||||
</tbody>
|
||||
</table>
|
||||
<div className="paginator">
|
||||
@@ -116,6 +118,14 @@ class OrgGroups extends Component {
|
||||
}
|
||||
}
|
||||
|
||||
const GroupItemPropTypes = {
|
||||
group: PropTypes.object.isRequired,
|
||||
isItemFreezed: PropTypes.bool.isRequired,
|
||||
onFreezedItem: PropTypes.func.isRequired,
|
||||
onUnfreezedItem: PropTypes.func.isRequired,
|
||||
deleteGroupItem: PropTypes.func.isRequired,
|
||||
};
|
||||
|
||||
class GroupItem extends React.Component {
|
||||
|
||||
constructor(props) {
|
||||
@@ -230,4 +240,6 @@ class GroupItem extends React.Component {
|
||||
|
||||
}
|
||||
|
||||
GroupItem.propTypes = GroupItemPropTypes;
|
||||
|
||||
export default OrgGroups;
|
||||
|
@@ -1,4 +1,4 @@
|
||||
import React, { Component, Fragment } from 'react';
|
||||
import React, { Fragment } from 'react';
|
||||
import PropTypes from 'prop-types';
|
||||
import moment from 'moment';
|
||||
import { seafileAPI } from '../../utils/seafile-api';
|
||||
|
@@ -129,6 +129,9 @@ const propTypes = {
|
||||
filterUser: PropTypes.func.isRequired,
|
||||
filterRepo: PropTypes.func.isRequired,
|
||||
isItemFreezed: PropTypes.bool.isRequired,
|
||||
fileEvent: PropTypes.object.isRequired,
|
||||
userSelected: PropTypes.string,
|
||||
repoSelected: PropTypes.string,
|
||||
};
|
||||
|
||||
class FileAuditItem extends React.Component {
|
||||
|
@@ -111,6 +111,7 @@ const propTypes = {
|
||||
filterUser: PropTypes.func.isRequired,
|
||||
isItemFreezed: PropTypes.bool.isRequired,
|
||||
userSelected: PropTypes.string.isRequired,
|
||||
permEvent: PropTypes.object.isRequired,
|
||||
};
|
||||
|
||||
class PermAuditItem extends React.Component {
|
||||
|
@@ -1,4 +1,5 @@
|
||||
import React, { Component, Fragment } from 'react';
|
||||
import PropTypes from 'prop-types';
|
||||
import { Link } from '@reach/router';
|
||||
import { siteRoot, gettext } from '../../utils/constants';
|
||||
import MainPanelTopbar from './main-panel-topbar';
|
||||
@@ -22,13 +23,22 @@ class OrgLogs extends Component {
|
||||
<div className="cur-view-path org-user-nav">
|
||||
<ul className="nav">
|
||||
<li className="nav-item" onClick={() => this.tabItemClick('logadmin')}>
|
||||
<Link className={`nav-link ${this.props.currentTab === 'logadmin' ? 'active': ''}`} to={siteRoot + 'org/logadmin/'} title={gettext('File Access')}>{gettext('File Access')}</Link>
|
||||
<Link
|
||||
className={`nav-link ${this.props.currentTab === 'logadmin' ? 'active': ''}`}
|
||||
to={siteRoot + 'org/logadmin/'} title={gettext('File Access')}>{gettext('File Access')}
|
||||
</Link>
|
||||
</li>
|
||||
<li className="nav-item" onClick={() => this.tabItemClick('file-update')}>
|
||||
<Link className={`nav-link ${this.props.currentTab === 'file-update' ? 'active': ''}`} to={siteRoot + 'org/logadmin/file-update/'} title={gettext('File Update')}>{gettext('File Update')}</Link>
|
||||
<Link
|
||||
className={`nav-link ${this.props.currentTab === 'file-update' ? 'active': ''}`}
|
||||
to={siteRoot + 'org/logadmin/file-update/'} title={gettext('File Update')}>{gettext('File Update')}
|
||||
</Link>
|
||||
</li>
|
||||
<li className="nav-item" onClick={() => this.tabItemClick('perm-audit')}>
|
||||
<Link className={`nav-link ${this.props.currentTab === 'perm-audit' ? 'active': ''}`} to={siteRoot + 'org/logadmin/perm-audit/'} title={gettext('Permission')}>{gettext('Permission')}</Link>
|
||||
<Link
|
||||
className={`nav-link ${this.props.currentTab === 'perm-audit' ? 'active': ''}`}
|
||||
to={siteRoot + 'org/logadmin/perm-audit/'} title={gettext('Permission')}>{gettext('Permission')}
|
||||
</Link>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
@@ -40,4 +50,11 @@ class OrgLogs extends Component {
|
||||
}
|
||||
}
|
||||
|
||||
const propTypes = {
|
||||
currentTab: PropTypes.string.isRequired,
|
||||
tabItemClick: PropTypes.func.isRequired,
|
||||
};
|
||||
|
||||
OrgLogs.propTypes = propTypes;
|
||||
|
||||
export default OrgLogs;
|
||||
|
@@ -7,6 +7,7 @@ import Toast from '../../components/toast';
|
||||
import UserStatusEditor from '../../components/select-editor/user-status-editor';
|
||||
|
||||
const propTypes = {
|
||||
user: PropTypes.object,
|
||||
currentTab: PropTypes.string,
|
||||
toggleRevokeAdmin: PropTypes.func,
|
||||
isItemFreezed: PropTypes.bool.isRequired,
|
||||
|
@@ -1,4 +1,5 @@
|
||||
import React, { Component, Fragment } from 'react';
|
||||
import PropTypes from 'prop-types';
|
||||
import OrgUsersList from './org-users-list';
|
||||
import OrgAdminList from './org-admin-list';
|
||||
import MainPanelTopbar from './main-panel-topbar';
|
||||
@@ -9,7 +10,7 @@ import InviteUserDialog from '../../components/dialog/org-admin-invite-user-dial
|
||||
import Toast from '../../components/toast';
|
||||
import { seafileAPI } from '../../utils/seafile-api';
|
||||
import OrgUserInfo from '../../models/org-user';
|
||||
import { siteRoot, gettext, invitationLink, orgID } from '../../utils/constants';
|
||||
import { gettext, invitationLink, orgID } from '../../utils/constants';
|
||||
|
||||
class OrgUsers extends Component {
|
||||
|
||||
@@ -206,4 +207,11 @@ class OrgUsers extends Component {
|
||||
}
|
||||
}
|
||||
|
||||
const propTypes = {
|
||||
currentTab: PropTypes.string.isRequired,
|
||||
tabItemClick: PropTypes.func.isRequired,
|
||||
};
|
||||
|
||||
OrgUsers.propTypes = propTypes;
|
||||
|
||||
export default OrgUsers;
|
||||
|
Reference in New Issue
Block a user