Remove old autobind. Teams page tweaks

This commit is contained in:
John Lyon-Smith
2018-03-27 08:15:01 -07:00
parent c08d8d6937
commit 83ca3cba31
7 changed files with 10 additions and 10 deletions

View File

@@ -221,7 +221,8 @@
"auto-bind2": { "auto-bind2": {
"version": "1.0.3", "version": "1.0.3",
"resolved": "https://registry.npmjs.org/auto-bind2/-/auto-bind2-1.0.3.tgz", "resolved": "https://registry.npmjs.org/auto-bind2/-/auto-bind2-1.0.3.tgz",
"integrity": "sha512-+br9nya9M8ayHjai7m9rdpRxuEr8xcYRDrIp7HybNe0ixUHbc1kDiWXKMb0ldsfWb9Zi+SqJ9JfjW8nTkYD0QQ==" "integrity": "sha512-+br9nya9M8ayHjai7m9rdpRxuEr8xcYRDrIp7HybNe0ixUHbc1kDiWXKMb0ldsfWb9Zi+SqJ9JfjW8nTkYD0QQ==",
"dev": true
}, },
"autobind-decorator": { "autobind-decorator": {
"version": "2.1.0", "version": "2.1.0",

View File

@@ -21,7 +21,6 @@
"dependencies": { "dependencies": {
"amqplib": "^0.5.1", "amqplib": "^0.5.1",
"app-root-path": "^2.0.1", "app-root-path": "^2.0.1",
"auto-bind2": "^1.0.3",
"autobind-decorator": "^2.1.0", "autobind-decorator": "^2.1.0",
"aws-sdk": "^2.98.0", "aws-sdk": "^2.98.0",
"body-parser": "^1.17.1", "body-parser": "^1.17.1",

View File

@@ -32,15 +32,15 @@ export class TeamList extends React.Component {
return ( return (
<Column fillParent> <Column fillParent>
<Column.Item grow> <Column.Item grow>
<List items={teams} render={(user, index) => { <List items={teams} render={(team, index) => {
return ( return (
<List.Item key={user._id || '0'} onClick={(e) => (this.props.onTeamListClick(e, index))} <List.Item key={team._id || '0'} onClick={(e) => (this.props.onTeamListClick(e, index))}
active={user === this.props.selectedTeam}> active={team === selectedTeam}>
<List.Icon name={user.administrator ? 'admin' : 'profile'} size={sizeInfo.listIcon} /> <List.Icon name='team' size={sizeInfo.listIcon} />
<List.Text> <List.Text>
{ user._id ? user.firstName + ' ' + user.lastName : '[New Team]' } { team._id ? team.name : '[New Team]' }
</List.Text> </List.Text>
{ user === selectedTeam && selectionModified ? <List.Icon name='edit' size={sizeInfo.listIcon} /> : null } { team === selectedTeam && selectionModified ? <List.Icon name='edit' size={sizeInfo.listIcon} /> : null }
</List.Item> </List.Item>
) )
}} /> }} />

View File

@@ -32,7 +32,7 @@ export class Teams extends Component {
api.listTeams().then((list) => { api.listTeams().then((list) => {
list.items.sort((teamA, teamB) => (teamA.lastName.localeCompare(teamB.lastName))) list.items.sort((teamA, teamB) => (teamA.lastName.localeCompare(teamB.lastName)))
this.setState({ teams: list.items, selectedTeam: list.items[0] }) // TODO: <- Remove this.setState({ teams: list.items }) // TODO: <- Remove
}).catch((error) => { }).catch((error) => {
this.setState({ this.setState({
messageModal: { messageModal: {

View File

@@ -32,7 +32,7 @@ export class Users extends Component {
api.listUsers().then((list) => { api.listUsers().then((list) => {
list.items.sort((userA, userB) => (userA.lastName.localeCompare(userB.lastName))) list.items.sort((userA, userB) => (userA.lastName.localeCompare(userB.lastName)))
this.setState({ users: list.items, selectedUser: list.items[0] }) // TODO: <- Remove this.setState({ users: list.items })
}).catch((error) => { }).catch((error) => {
this.setState({ this.setState({
messageModal: { messageModal: {

View File

View File