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

Caregiver CaseOverview component #218

Merged
merged 1 commit into from
Dec 4, 2023
Merged

Caregiver CaseOverview component #218

merged 1 commit into from
Dec 4, 2023

Conversation

JennyVong
Copy link
Contributor

@JennyVong JennyVong commented Oct 31, 2023

Notion ticket link

Case Overview Visiting Family component

Implementation description

frontend:

  • New CasePromptBox component to display each caseoverview components details
  • New CaregiverAPIClient for frontend/backend integration for Caregiver APIs (PUT and POST)
  • Existing NewCaregiverModal component is edited to handle both POST and PUT calls
  • Existing NewCaregiverModal displays existing caregiver data if a caregiver is passed in
  • CaseOverview page pulls Caregiver data from backend through get_caregivers_by_intake_id
  • New CaregiverDetails and CaregiverRelationship types

backend:

  • work in caregiver_service functions for editing existing caregiver, update_caregiver
  • need to add to caregiver_routes for routes to PUT (edit)
  • functional tests for get_caregiver_by_intake_id and update_caregiver
  • caregiver.py model edited to add enum values for caregiver_relationship_to_child
  • new migration made for changes ^
  • regression changes for change in enum values in db_seed

Steps to test

  1. postman to check API routes
  2. pytest to run functional tests
  3. click on different cases in homepage to view different lists of caregivers for each intake_id
  4. make dummy caregivers in the frontend through caseoverview
  5. edit dummy caregivers in frontend

What should reviewers focus on?

  • added new button style in the buttonstyles.tsx file
  • lmk if things need to be refactored (ik state is looking to be refactored, I can do that in a later ticket)

Checklist

  • My PR name is descriptive and in imperative tense
  • My commit messages are descriptive and in imperative tense. My commits are atomic and trivial commits are squashed or fixup'd into non-trivial commits
  • I have run the appropriate linter(s)
  • I have requested a review from the PL, as well as other devs who have background knowledge on this PR or who will be building on top of this PR

Copy link

github-actions bot commented Oct 31, 2023

Visit the preview URL for this PR (updated for commit 2985845):

https://childrens-aid-society--pr218-jenny-caregiver-lsh8dhfd.web.app

(expires Mon, 11 Dec 2023 20:08:32 GMT)

🔥 via Firebase Hosting GitHub Action 🌎

Sign: 93f6cb7bff946a1edd29d684408e6d31442cf0b1

caregivers = caregiver_service.get_all_caregivers()
return jsonify(list(map(lambda user: user.__dict__, caregivers))), 200
except Exception as error:
return jsonify(error), 400

Check warning

Code scanning / CodeQL

Information exposure through an exception Medium

Stack trace information
flows to this location and may be exposed to an external user.
backend/python/app/rest/caregiver_routes.py Fixed Show fixed Hide fixed
Copy link
Collaborator

@Ezzhingy Ezzhingy left a comment

Choose a reason for hiding this comment

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

Great work!! The PUT, POST, and GET work amazingly :))

Ik this wasn't in the figma, but could we also have a delete button next to each caregiver? i saw that u implemented the delete caregiver logic in the caregiverAPIClient; could u hook it up w the delete btn?

backend/python/app/rest/caregiver_routes.py Outdated Show resolved Hide resolved
frontend/src/components/pages/CaseOverview.tsx Outdated Show resolved Hide resolved
frontend/src/components/pages/CaseOverview.tsx Outdated Show resolved Hide resolved
return jsonify(updated_caregiver.__dict__), 200

except Exception as error:
return jsonify(str(error)), 400

Check warning

Code scanning / CodeQL

Information exposure through an exception Medium

Stack trace information
flows to this location and may be exposed to an external user.
except Exception as e:
error_message = getattr(e, "message", None)
return (
jsonify({"error": (error_message if error_message else str(e))}),

Check warning

Code scanning / CodeQL

Information exposure through an exception Medium

Stack trace information
flows to this location and may be exposed to an external user.
Copy link
Collaborator

@Ezzhingy Ezzhingy left a comment

Choose a reason for hiding this comment

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

Nice! Delete works swellingly :))
Just some small typos to fix & formatting for PUT

frontend/src/APIClients/CaregiverAPIClient.ts Show resolved Hide resolved
frontend/src/components/intake/NewCaregiverModal.tsx Outdated Show resolved Hide resolved
frontend/src/components/intake/NewCaregiverModal.tsx Outdated Show resolved Hide resolved
Copy link
Collaborator

@Ezzhingy Ezzhingy left a comment

Choose a reason for hiding this comment

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

oh sry, adding the formattedDate to the PUT method was redundant, feel free to remove 😅
could u instead go into NewCaregiverModal.tsx and add it to line 127:

defaultValue={caregiver ? formattedDate(caregiver.dateOfBirth) : ""}

other than that, lgtm!! tysm for working on this :))

@JennyVong JennyVong merged commit d12b876 into main Dec 4, 2023
7 checks passed
@JennyVong JennyVong deleted the jenny/caregiver branch December 4, 2023 20:09
jacque1ine pushed a commit that referenced this pull request Dec 11, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants