This repository has been archived by the owner on May 19, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 18
Add error message when Space user exists on Org user removal. #1163
Merged
Merged
Changes from 11 commits
Commits
Show all changes
33 commits
Select commit
Hold shift + click to select a range
88c99a3
Create a new catch to resole issues with existing space association
rememberlenny c48c3eb
Rename the constants associated to user invite notification and make …
rememberlenny 4487850
Update tests and naming of actions associated to user store
rememberlenny 28b56da
Add the new errors in the user store and change the invite naming
rememberlenny b123cd9
Update the naming of invite notification tests
rememberlenny f4b550f
Update the user actions to remove direct invite affiliation during na…
rememberlenny e8c967e
Update naming convention around the user notifications on the user list
rememberlenny 1e30a66
Lint
rememberlenny d0a8766
Fix up errors
rememberlenny faf2819
Updates for syntax and simplicity
rememberlenny f782d65
Remove the USER_INVITE_STATUS_CREATED
rememberlenny 24b0ba7
add test for emitting description of being unable to remove user
01eef76
Create a preliminary check before the users are verified for deletion
rememberlenny ba99e8d
Add an action to check a current user's space associations
rememberlenny 67d0596
Create the additional cf commands for the space/org
rememberlenny 0ed162f
Create a wrapper around the promises
rememberlenny 3c883d5
move error handling logic to deleteUser
792214e
remove pre-emptive calls
9e8ea37
remove extra calls
fd13220
Merge
rememberlenny 46bbd74
Fix the recall of the user delete
rememberlenny 684ab14
Update the linting around promises
rememberlenny 45bc78b
Update comments on the constants for user list notices
rememberlenny b7815d0
Update the changes to the notification
rememberlenny 3c72fe2
Add tests for receivedOrgSpacesToExtractSpaceUsers
rememberlenny d9984cc
Add missing spaces
fureigh 49465de
Add missing cf api request for fetchAllOrgSpaces
rememberlenny 22ecabf
Create a promise resolve on the deleteUserIfNoSpaceAssociation
rememberlenny e00d4a6
Add tests on all functions associated to the deleteUserIfNoSpaceAssoc…
rememberlenny 2afb68e
Merge with space update
rememberlenny 07e0ddb
bring back code
237dc7e
fix tests for post deleteUser action
607daf9
fix test comment
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -258,6 +258,8 @@ const userActionTypes = keymirror({ | |
USER_INVITE_TRIGGER: null, | ||
// Action to trigger when invite status is triggered for front end. | ||
USER_INVITE_STATUS_UPDATED: null, | ||
// Action to trigger when user list notice is created. | ||
USER_LIST_NOTICE_CREATED: null, | ||
// Action to trigger email sent to user with cloud.gov invite url. | ||
USER_ORG_ASSOCIATE: null, | ||
// Action to associate user to organization on the server. | ||
|
@@ -266,10 +268,8 @@ const userActionTypes = keymirror({ | |
USER_ASSOCIATED_ORG_DISPLAYED: null, | ||
// Action when something goes wrong in user invite and email process. | ||
USER_INVITE_ERROR: null, | ||
// Action to display an invite notification | ||
USER_INVITE_STATUS_DISPLAYED: null, | ||
// Action to dismiss an invite notification | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. update comment There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Got it! There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Is this comment still accurate? |
||
USER_INVITE_STATUS_DISMISSED: null, | ||
USER_LIST_NOTICE_DISMISSED: null, | ||
// Action to delete a user from an org. | ||
USER_DELETE: null, | ||
// Action when a user was deleted from an org on the server. | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -403,7 +403,22 @@ export default { | |
deleteOrgUserPermissions(userGuid, orgGuid, apiKey) { | ||
return http.delete(`${APIV}/organizations/${orgGuid}/${apiKey}/${userGuid}`) | ||
.then((res) => res.response | ||
); | ||
).catch(res => { | ||
const err = parseError(res); | ||
const errorConditions = (res && | ||
res.response && | ||
res.response.status === 400 && | ||
res.response.data.error_code === 'CF-AssociationNotEmpty' | ||
); | ||
if (errorConditions) { | ||
const description = 'This user can\'t be removed because they still have a space ' + | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. you don't have a test that calls |
||
'role within the organization. Please remove all space ' + | ||
'associations before removing this user from the organization.'; | ||
userActions.createUserSpaceAssociationNotification(description); | ||
return Promise.reject(err); | ||
} | ||
return Promise.reject(err); | ||
}); | ||
}, | ||
|
||
putOrgUserPermissions(userGuid, orgGuid, permissions) { | ||
|
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we should start writing new actions in this format:
Then every action presents a consistent interface regardless of the information being passed in. What do you think?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think thats a good idea. It currently uses the ES6 syntax for exampling the variable name as the key. Instead of
data
, it does what you are describing withaction
. I think it would be a lot of refactoring to change them all.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i like the idea as well. but let's save that for a broader discussion.