Refactor Access List.

- Derive Team Roles without making extra API call.
- Consistent variable naming convention use camelCase.
- More informative error display.
This commit is contained in:
Kia Lam
2019-03-01 10:12:36 -05:00
parent a3a80bc23e
commit bf7e6201a2
5 changed files with 62 additions and 114 deletions

View File

@@ -7,8 +7,6 @@ class OrganizationAccess extends React.Component {
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) {
@@ -21,16 +19,6 @@ class OrganizationAccess extends React.Component {
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,
@@ -42,8 +30,6 @@ class OrganizationAccess extends React.Component {
<AccessList
getAccessList={this.getOrgAccessList}
getUserRoles={this.getUserRoles}
getUserTeams={this.getUserTeams}
getTeamRoles={this.getTeamRoles}
match={match}
location={location}
history={history}