@@ -20,7 +20,7 @@ export default class FileListItem extends React.Component {
2020 this . state = {
2121 title : props . title ,
2222 description : props . description ,
23- userIds : props . userIds ,
23+ allowedUsers : props . allowedUsers ,
2424 isEditing : false
2525 }
2626 this . handleSave = this . handleSave . bind ( this )
@@ -37,11 +37,11 @@ export default class FileListItem extends React.Component {
3737 }
3838
3939 startEdit ( ) {
40- const { title, description, userIds } = this . props
40+ const { title, description, allowedUsers } = this . props
4141 this . setState ( {
4242 title,
4343 description,
44- userIds ,
44+ allowedUsers ,
4545 isEditing : true
4646 } )
4747 }
@@ -52,7 +52,7 @@ export default class FileListItem extends React.Component {
5252 if ( ! _ . isEmpty ( errors ) ) {
5353 this . setState ( { errors } )
5454 } else {
55- this . props . onSave ( this . props . id , { title, description : this . refs . desc . value , userIds : this . state . userIds } , e )
55+ this . props . onSave ( this . props . id , { title, description : this . refs . desc . value , allowedUsers : this . state . allowedUsers } , e )
5656 this . setState ( { isEditing : false } )
5757 }
5858 }
@@ -80,14 +80,14 @@ export default class FileListItem extends React.Component {
8080
8181 onUserIdChange ( selectedHandles = '' ) {
8282 this . setState ( {
83- userIds : this . handlesToUserIds ( selectedHandles . split ( ',' ) )
83+ allowedUsers : this . handlesToUserIds ( selectedHandles . split ( ',' ) )
8484 } )
8585 }
8686
87- userIdsToHandles ( userIds ) {
87+ userIdsToHandles ( allowedUsers ) {
8888 const { projectMembers } = this . props
89- userIds = userIds || [ ]
90- return userIds . map ( userId => _ . get ( projectMembers [ userId ] , 'handle' ) )
89+ allowedUsers = allowedUsers || [ ]
90+ return allowedUsers . map ( userId => _ . get ( projectMembers [ userId ] , 'handle' ) )
9191 }
9292
9393 handlesToUserIds ( handles ) {
@@ -99,7 +99,7 @@ export default class FileListItem extends React.Component {
9999
100100 renderEditing ( ) {
101101 const { title, description, projectMembers, loggedInUser } = this . props
102- const { errors, userIds } = this . state
102+ const { errors, allowedUsers } = this . state
103103 const onExitEdit = ( ) => this . setState ( { isEditing : false , errors : { } } )
104104 return (
105105 < div >
@@ -116,7 +116,7 @@ export default class FileListItem extends React.Component {
116116 < UserAutoComplete onUpdate = { this . onUserIdChange }
117117 projectMembers = { projectMembers }
118118 loggedInUser = { loggedInUser }
119- selectedUsers = { this . userIdsToHandles ( userIds ) . join ( ',' ) }
119+ selectedUsers = { this . userIdsToHandles ( allowedUsers ) . join ( ',' ) }
120120 />
121121 </ div >
122122 )
@@ -186,7 +186,7 @@ FileListItem.propTypes = {
186186 createdByUser : PropTypes . object . isRequired ,
187187 projectMembers : PropTypes . object . isRequired ,
188188 loggedInUser : PropTypes . object . isRequired ,
189- userIds : PropTypes . array ,
189+ allowedUsers : PropTypes . array ,
190190
191191 /**
192192 * Callback fired when a save button is clicked
0 commit comments