-
Notifications
You must be signed in to change notification settings - Fork 13
[web][api][SIMS #540] Separate Institution Details and Institution User Profile #627
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
Conversation
|
Please have a look at the other tests failing as well |
sources/packages/api/src/route-controllers/user/models/institution-user.dto.ts
Outdated
Show resolved
Hide resolved
| } | ||
| } | ||
|
|
||
| @Get("/institutionUser") |
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.
IMO, the information being returned here is not institution-specific. I would recommend that this endpoint would be generic GET users.
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 guess we decided to have it as /institution. Right @dheepak-aot, @andrewsignori-aot @ann-aot ?
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.
Yes @guru-aot
sources/packages/api/src/route-controllers/user/user.controller.ts
Outdated
Show resolved
Hide resolved
sources/packages/web/src/views/institution/InstitutionUserProfile.vue
Outdated
Show resolved
Hide resolved
| toast.add({ | ||
| severity: "success", | ||
| summary: "Updated!", | ||
| detail: "Institution and User successfully updated!", |
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.
We are no longer saving institution data on this screen. Please adjust the messages accordingly.
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.
Messages have been updated accordingly.
| // Hooks | ||
| onMounted(async () => { | ||
| const bceidAccount = await UserService.shared.getInstitutionUser(); |
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.
This should be treated as our user data since it is in our DB. The use of the BCeID account could lead to misinterpretations. Could you please rename it to something like "userAccount", please?
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.
const has been renamed.
| const bceidAccount = await UserService.shared.getInstitutionUser(); | ||
| if (bceidAccount) { | ||
| initialData.value = { | ||
| userFirstName: bceidAccount?.userFirstName, |
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.
There is already a check in place on line 68 to ensure that the variable is defined. Could you please remove the null check while accessing the properties?
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.
Null check removed.
| } else { | ||
| toast.add({ | ||
| severity: "error", | ||
| summary: "BCeID Account error", |
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.
IMO, this is not related to BCeID account, can you please adjust the message.
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.
Message modified.
andrewsignori-aot
left a comment
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.
Please review the comments.
Is this commit a partial delivery of the ticket or is it supposed to deliver it entirely?
If it is a complete delivery, there are some missing acceptance criteria, IMO.
Once the institutionuserprofile form definition is completed it must be added to code repo, the same for any other form definition that was updated as part of this ticket.
There are some readonly components in the screen that do not need to be sent to the API and they could be configured as below.

| data: InstitutionUserDetailsDto, | ||
| authHeader?: any, | ||
| ): Promise<void> { | ||
| return ApiClient.User.updateInstitutionUser(data, authHeader); |
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.
promising void and you are returning a value
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.
return statement has been removed.
| headers?: any, | ||
| ): Promise<void> { | ||
| try { | ||
| const response = await this.apiClient.patch( |
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 const response is not used inside the scope, you can remove it
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.
Yes. The const has been removed
| }); | ||
| } | ||
| if (redirectHome) { |
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.
IMO, I think you can avoid this check and flags and add the redirect logic inside the try
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.
As discussed the redirect logic is removed from condition.
| userEmail: bceidAccount?.userEmail, | ||
| }; | ||
| } else { | ||
| toast.add({ |
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 @andrewsignori-aot, has added utils for toast, we can use that from now on. correct me if I am wrong @andrewsignori-aot
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.
Toast utils updated
ann-aot
left a comment
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.
Added some comments
guru-aot
left a comment
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.
Please check on @ann-aot @andrewsignori-aot comments, I do second them on the comments. Nice overall work @dheepak-aot :)
| label: "Notifications Settings", | ||
| icon: "pi pi-bell", | ||
| command: () => { | ||
| AppConfigService.shared.logout(ClientIdType.INSTITUTION); |
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.
The notifications settings should not point to the logout. I would recommend adding a placeholder page in the same way that we did for Students.
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.
Agreed. Forgot to remove that action for notifications icon.
| await UserService.shared.updateInstitutionUser( | ||
| institutionUserPersistDto, | ||
| ); | ||
| toast.success("Updated!", "Institution and User successfully updated!"); |
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.
The message is mentioning the institution, but I believe that only the user is being updated here, right?
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.
Again a copy paste issue. will fix it.
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.
Fixed
andrewsignori-aot
left a comment
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.
Nice start 😉 👍
|
Kudos, SonarCloud Quality Gate passed!
|
abschwenker
left a comment
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.
LGTM, thank you for reviewing the comments. Once everyone is approved please merge
ann-aot
left a comment
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.
Nice work @dheepak-aot 👍








Separate Institution Details and Institution User Profile Information #540