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

#356 Database should be connected to Profile Page #367

Closed
wants to merge 39 commits into from

Conversation

seidior
Copy link
Member

@seidior seidior commented Jun 7, 2022

Proposed changes

This pull request allows the API to deliver well-formed profile data to the profile component in the web app as well as allowing the API to receive and correctly parse edited profile data being sent back to it from the web app. This fully resolves issue #356.

This also resolves issue #366 by back-filling all the missing Jest tests for the API which causes all automated tests for the repository to pass.

Checklist

  • Are the issues being addressed linked to this PR?
  • Do all commit messages start with the issue number?
  • Are all code changes sufficiently tested?
  • Are there screenshots for UI changes? (No UI changes expected.)

SiriusLL and others added 24 commits June 1, 2022 17:33
…ounts interface"

This reverts commit feeabb5.

# Conflicts:
#	webapp/src/components/Profile.tsx
#356 needed some specialized work to bring it up to date with main because of some cherry picked reverts that happened in #355.
This WIP was done on #355 but we needed to close that ticket and merge it with main so it's going here instead.
This WIP was done on #355 but we needed to close that ticket and merge it with main so it's going here instead.
Add some function stubs into the appropriate files so it's easier to break down the task ahead to be able to process changes to an IUserData object.
…thub.com:OpenTree-Education/rhizone-lms into 356-Database-should-be-connected-to-Profile-Page
… '356-Database-should-be-connected-to-Profile-Page' of github.com:OpenTree-Education/rhizone-lms into 356-Database-should-be-connected-to-Profile-Page
…thub.com:OpenTree-Education/rhizone-lms into 356-Database-should-be-connected-to-Profile-Page
WIP commit so I can switch machines.
With the addition of the logic for comparing social profiles, we can now fully compare two IUserData objects. This should finalize the work on the issue for now. However, the logic has not been tested.
In the case of a modified object, we were returning the modified object back to the user, re-generated. In the case of the unmodified object, we were returning an empty response. I'm modifying that second behavior to instead return the object, for consistency's sake.
This is to conform to the Entity interface in the web app, but also, it makes more sense when working with the principals table.
Let's clean things up by capitalizing the social networks.
I finally got a chance to test the HTTP PUT for the full_name at least and our implementation was surprisingly close to working for having worked late into yesterday night. Some minor fixes were needed to get it to behave (almost) as expected.
Before addressing the failing tests, let's make sure `yarn delint` is run.
There's more work to be done here in coverage, but all tests are now passing.
@seidior seidior added the bug Something isn't working label Jun 7, 2022
@seidior seidior self-assigned this Jun 7, 2022
We're mocking and catching console.log but we also should be mocking console.error.
Suppresses warning message from Jest letting us know that our caniuse-lite database is out of date.
Files committed are to support the completion of the `getUserProfileDataService.ts` test.
Since we're parsing input that could be any type, we need the any type here. Better to be explicit about it.
We had a 401 error defined but not a 403 error defined. This commit adds the 403 and changes the 401 message to differentiate it more clearly.
Changes in this commit were to add full coverage for all tests in the middleware directory as well as changes to any other files to be able to support or pass these tests.
Only show non-public social networks if we're authenticated as the user being queried.
if user chooses to hide email address, make sure we blank out the email address field in the IUserData object unless it's our own profile.
I really wanted to comment out the errors from having Jest test them, but that would cause us not to hit 100%. So, let's simulate an error being encountered during a transaction, as unlikely as that would be.
We're not done, of course. But this marks the first time in a while that all Jest tests have passed.
There is now a test for all API code.
Pre-populate the principals table with full_name, avatar_url, and bio from GitHub.
@seidior seidior changed the title [Testing] Making sure the server can run tests again. #356 Database should be connected to Profile Page Jun 10, 2022
The last commit caused an error with testing. This is now fixed.
@seidior seidior linked an issue Jun 10, 2022 that may be closed by this pull request
2 tasks
@seidior seidior marked this pull request as ready for review June 10, 2022 06:32
@seidior seidior requested a review from a team as a code owner June 10, 2022 06:32
This reverts commit 59f2f44 to ensure this branch only contains changes to the api/ subdirectory and not any changes to the webapp/ subdirectory. The changes from that commit will be migrated over to the appropriate branch.
@seidior seidior linked an issue Jun 10, 2022 that may be closed by this pull request
2 tasks
This reverts commit 69e4559, which was done to suppress the warnings from Jest about the caniuse-lite database being out of date. With the lock file unchanged, the PR for this branch will not require the review by production engineers.
@seidior seidior marked this pull request as draft June 12, 2022 03:39
@seidior seidior marked this pull request as ready for review June 12, 2022 03:39
@daveytech daveytech closed this Jun 12, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Database should be connected to Profile Page Automated code checks are failing on main
6 participants