Skip to content

Conversation

@dheepak-aot
Copy link
Collaborator

Separate Institution Details and Institution User Profile Information #540

@abschwenker
Copy link
Contributor

Please have a look at the other tests failing as well

}
}

@Get("/institutionUser")
Copy link
Collaborator

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.

Copy link
Contributor

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 ?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes @guru-aot

toast.add({
severity: "success",
summary: "Updated!",
detail: "Institution and User successfully updated!",
Copy link
Collaborator

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.

Copy link
Collaborator Author

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();
Copy link
Collaborator

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?

Copy link
Collaborator Author

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,
Copy link
Collaborator

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?

Copy link
Collaborator Author

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",
Copy link
Collaborator

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.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Message modified.

Copy link
Collaborator

@andrewsignori-aot andrewsignori-aot left a 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.
image

data: InstitutionUserDetailsDto,
authHeader?: any,
): Promise<void> {
return ApiClient.User.updateInstitutionUser(data, authHeader);
Copy link
Contributor

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

Copy link
Collaborator Author

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(
Copy link
Contributor

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

Copy link
Collaborator Author

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) {
Copy link
Contributor

@ann-aot ann-aot Aug 12, 2021

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

Copy link
Collaborator Author

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({
Copy link
Contributor

@ann-aot ann-aot Aug 12, 2021

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

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Toast utils updated

Copy link
Contributor

@ann-aot ann-aot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added some comments

Copy link
Contributor

@guru-aot guru-aot left a 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);
Copy link
Collaborator

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.

Copy link
Collaborator Author

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!");
Copy link
Collaborator

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?

Copy link
Collaborator Author

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.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed

Copy link
Collaborator

@andrewsignori-aot andrewsignori-aot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice start 😉 👍

@sonarqubecloud
Copy link

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
0.0% 0.0% Duplication

Copy link
Contributor

@abschwenker abschwenker left a 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

Copy link
Contributor

@ann-aot ann-aot left a 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 👍

@dheepak-aot dheepak-aot changed the title feature-540 initial commit [web][api][SIMS #540] Separate Institution Details and Institution User Profile Aug 13, 2021
@dheepak-aot dheepak-aot merged commit c00485f into main Aug 13, 2021
@ann-aot ann-aot deleted the feature/sims-540 branch August 13, 2021 23:35
@ann-aot ann-aot restored the feature/sims-540 branch August 13, 2021 23:35
@andrewsignori-aot andrewsignori-aot deleted the feature/sims-540 branch August 20, 2021 19:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants