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

generic error message displayed on update user page for 400 bad requests #1217

Merged
merged 1 commit into from
Jun 10, 2024
Merged
Changes from all 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
generic error message displayed on update user page for 400 bad requests
  • Loading branch information
bobcaprice committed Jun 10, 2024
commit 543b9398acd357d18c85e4cc520347feb90d375b
1 change: 1 addition & 0 deletions ui/src/app/error/error-alert.component.ts
Original file line number Diff line number Diff line change
@@ -19,6 +19,7 @@ export class ErrorAlertComponent implements OnInit {
ngOnInit(): void {
this.sub = this.errorService.on().subscribe((err: AppError) => {
console.log(err)
console.log('error message is ', err.message)

const alert: ErrorAlert = {
type: 'danger',
10 changes: 6 additions & 4 deletions ui/src/app/user/user-update.component.ts
Original file line number Diff line number Diff line change
@@ -106,6 +106,12 @@ export class UserUpdateComponent {
this.showIsAdminCheckbox = false
}
})

this.editForm.get('firstName')?.valueChanges.subscribe((val) => (this.isSaving = false))
this.editForm.get('lastName')?.valueChanges.subscribe((val) => (this.isSaving = false))
this.editForm.get('salesforceId')?.valueChanges.subscribe((val) => (this.isSaving = false))
this.editForm.get('mainContact')?.valueChanges.subscribe((val) => (this.isSaving = false))
this.editForm.get('assertionServiceEnabled')?.valueChanges.subscribe((val) => (this.isSaving = false))
}

updateForm(user: IUser) {
@@ -308,28 +314,24 @@ export class UserUpdateComponent {
protected subscribeToSaveResponse(result: Observable<IUser>) {
result.subscribe({
next: () => this.onSaveSuccess(),
error: () => this.onSaveError(),
})
}

protected subscribeToUpdateResponse(result: Observable<IUser>) {
result.subscribe({
next: () => this.onUpdateSuccess(),
error: () => this.onSaveError(),
})
}

protected subscribeToSaveResponseWithOwnershipChange(result: Observable<IUser>) {
result.subscribe({
next: () => this.onSaveSuccessOwnershipChange(),
error: () => this.onSaveError(),
})
}

protected subscribeToUpdateResponseWithOwnershipChange(result: Observable<IUser>) {
result.subscribe({
next: () => this.onUpdateSuccessOwnershipChange(),
error: () => this.onSaveError(),
})
}

Loading