Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(collaborator-modal/client/controller): bugfix for spinner ui #1858

Merged
merged 4 commits into from
May 11, 2021
Merged
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -237,29 +237,33 @@ function CollaboratorModalController(
)

$scope.btnStatus = 2 // pressed; loading
$scope.updatePermissionList(permissionList).catch((err) => {
if (err) {
// Make the alert message correspond to the error code
if (err.response.status === StatusCodes.BAD_REQUEST) {
Toastr.error(
'Please ensure that the email entered is a valid government email. If the error still persists, refresh and try again later.',
)
} else if (err.response.status === StatusCodes.UNPROCESSABLE_ENTITY) {
Toastr.error(`${email} is not part of a whitelisted agency.`)
} else {
Toastr.error('Error adding collaborator.')
}
resetCollabForm()
return
}
// If no error, clear email input
$scope.btnStatus = 3 // pressed; saved
$scope.closeEditCollaboratorDropdowns()
$scope
.updatePermissionList(permissionList)
.then(() => {
// If no error, clear email input
$scope.btnStatus = 3 // pressed; saved
$scope.closeEditCollaboratorDropdowns()

$timeout(() => {
resetCollabForm()
}, 1000)
})
$timeout(() => {
resetCollabForm()
}, 1000)
})
.catch((err) => {
if (err) {
seaerchin marked this conversation as resolved.
Show resolved Hide resolved
// Make the alert message correspond to the error code
if (err.response.status === StatusCodes.BAD_REQUEST) {
Toastr.error(
'Please ensure that the email entered is a valid government email. If the error still persists, refresh and try again later.',
)
} else if (err.response.status === StatusCodes.UNPROCESSABLE_ENTITY) {
Toastr.error(`${email} is not part of a whitelisted agency.`)
} else {
Toastr.error('Error adding collaborator.')
}
resetCollabForm()
return
seaerchin marked this conversation as resolved.
Show resolved Hide resolved
}
})
}

/**
Expand Down