Abstract out Access List as shared component.

This commit is contained in:
Kia Lam
2019-02-26 13:23:34 -05:00
parent 3cd54c45eb
commit 1443625d89
6 changed files with 451 additions and 25 deletions

View File

@@ -0,0 +1,55 @@
import React from 'react';
import AccessList from '../../../../components/AccessList/Access.list';
class OrganizationAccess extends React.Component {
constructor (props) {
super(props);
this.getOrgAccessList = this.getOrgAccessList.bind(this);
this.getUserRoles = this.getUserRoles.bind(this);
this.getUserTeams = this.getUserTeams.bind(this);
this.getTeamRoles = this.getTeamRoles.bind(this);
}
getOrgAccessList (id, params) {
const { api } = this.props;
return api.getOrganzationAccessList(id, params);
}
getUserRoles (id) {
const { api } = this.props;
return api.getUserRoles(id);
}
getUserTeams (id) {
const { api } = this.props;
return api.getUserTeams(id);
}
getTeamRoles (id) {
const { api } = this.props;
return api.getTeamRoles(id);
}
render () {
const {
location,
match,
history,
} = this.props;
return (
<AccessList
getAccessList={this.getOrgAccessList}
getUserRoles={this.getUserRoles}
getUserTeams={this.getUserTeams}
getTeamRoles={this.getTeamRoles}
match={match}
location={location}
history={history}
/>
);
}
}
export default OrganizationAccess;