@@ -11,6 +11,7 @@ import OrgStore from '../stores/org_store.js';
1111import SpaceStore from '../stores/space_store.js' ;
1212import UserList from './user_list.jsx' ;
1313import UsersInvite from './users_invite.jsx' ;
14+ import Notification from './notification.jsx' ;
1415import UserStore from '../stores/user_store.js' ;
1516
1617const SPACE_NAME = 'space_users' ;
@@ -50,6 +51,7 @@ function stateSetter() {
5051 loading : UserStore . loading ,
5152 empty : ! UserStore . loading && ! users . length ,
5253 users,
54+ inviteNotices : UserStore . _inviteNotification ,
5355 userInviteError : UserStore . getInviteError ( )
5456 } ;
5557}
@@ -74,13 +76,9 @@ export default class Users extends React.Component {
7476 UserStore . removeChangeListener ( this . _onChange ) ;
7577 }
7678
77- _onChange ( ) {
78- this . setState ( stateSetter ( ) ) ;
79- }
80-
81- handleRemove ( userGuid , ev ) {
79+ onNotificationDismiss ( ev ) {
8280 ev . preventDefault ( ) ;
83- userActions . deleteUser ( userGuid , this . state . currentOrgGuid ) ;
81+ userActions . clearInviteNotifications ( ) ;
8482 }
8583
8684 handleAddPermissions ( roleKey , apiKey , userGuid ) {
@@ -99,6 +97,11 @@ export default class Users extends React.Component {
9997 this . entityType ) ;
10098 }
10199
100+ handleRemove ( userGuid , ev ) {
101+ ev . preventDefault ( ) ;
102+ userActions . deleteUser ( userGuid , this . state . currentOrgGuid ) ;
103+ }
104+
102105 get entityType ( ) {
103106 return this . state . currentType === ORG_NAME ? 'org' : 'space' ;
104107 }
@@ -109,6 +112,10 @@ export default class Users extends React.Component {
109112 return entityGuid ;
110113 }
111114
115+ _onChange ( ) {
116+ this . setState ( stateSetter ( ) ) ;
117+ }
118+
112119 render ( ) {
113120 let removeHandler ;
114121 let errorMessage ;
@@ -137,6 +144,20 @@ export default class Users extends React.Component {
137144 ) ;
138145 }
139146
147+ let notification ;
148+
149+ if ( this . state . inviteNotices . description ) {
150+ const notice = this . state . inviteNotices ;
151+ notification = (
152+ < Notification
153+ message = { notice . description }
154+ actions = { [ ] }
155+ onDismiss = { this . onNotificationDismiss }
156+ status = "finish"
157+ />
158+ ) ;
159+ }
160+
140161 return (
141162 < div className = "test-users" >
142163 { errorMessage }
@@ -145,6 +166,7 @@ export default class Users extends React.Component {
145166 currentUserAccess = { this . state . currentUserAccess }
146167 error = { this . state . userInviteError }
147168 />
169+ { notification }
148170 < div >
149171 < div >
150172 { content }
@@ -153,9 +175,8 @@ export default class Users extends React.Component {
153175 </ div >
154176 ) ;
155177 }
156-
157178}
158179
159- Users . propTypes = { } ;
180+ Users . propTypes = { } ;
160181
161- Users . defaultProps = { } ;
182+ Users . defaultProps = { } ;
0 commit comments