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

Get Buildings Route #196

Merged
merged 7 commits into from
Nov 26, 2023
Merged

Get Buildings Route #196

merged 7 commits into from
Nov 26, 2023

Conversation

phamkelly17
Copy link
Contributor

Notion task link

Get Buildings Route

Implementation description

  • added GET endpoint to get all buildings from DB
  • replaced hardcoded BUILDINGS variable with the buildings fetched from the database

Steps to test

  1. Check if you're able to see the building options on log filter, add log, edit log, add resident, edit resident
  2. Check if the functionality works for the places mentioned above

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
  • If I have made API changes, I have updated the REST API Docs
  • IF I have made changes to the db/models, I have updated the Data Models Page
  • I have documented this PR in the Production Release Page
  • I have updated other Docs as needed

@phamkelly17 phamkelly17 changed the title Kelly/get buildings route Get Buildings Route Nov 6, 2023
Copy link

github-actions bot commented Nov 6, 2023

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

https://blueprintsupportivehousing--pr196-kelly-get-buildings-iz7aduro.web.app

(expires Sun, 03 Dec 2023 19:16:03 GMT)

🔥 via Firebase Hosting GitHub Action 🌎

Sign: f6bcdba7452bf82a6ec1a299c37d1bdff7870d09

Copy link
Contributor

@owen-sellner owen-sellner left a comment

Choose a reason for hiding this comment

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

Very cool 😎 I found a couple nits but the main functionality works great!

Also, I noticed the notion ticket for this talks about being able to get a specific building using the id, is that no longer part of this ticket?

frontend/src/APIClients/BuildingAPIClient.ts Outdated Show resolved Hide resolved
frontend/src/APIClients/BuildingAPIClient.ts Outdated Show resolved Hide resolved
frontend/src/components/forms/CreateLog.tsx Show resolved Hide resolved
Copy link
Collaborator

@connor-bechthold connor-bechthold left a comment

Choose a reason for hiding this comment

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

Everything works as expected besides the edit - if you make a new resident/log record and then try and edit it, the building doesn't appear until you close the modal and open it a second time. I think I ran into this issue last term and it had to do with how I was initially setting the state when the component rendered. Should be good to after this is fixed though 👨‍🍳
Screenshot 2023-11-12 at 12 08 59 AM

Copy link
Collaborator

@connor-bechthold connor-bechthold left a comment

Choose a reason for hiding this comment

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

so with the log record edit, the previous bug I mentioned is still there. i left a comment on how to resolve it and then this should be good to merge

@@ -202,6 +209,7 @@ const EditLog = ({

const initializeValues = () => {
// set state variables
getBuildingsOptions();
Copy link
Collaborator

Choose a reason for hiding this comment

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

so instead of calling this here, you should call this in LogRecordsTable.tsx. the issue is that the state doesn't update in time, so when the building ID from the log record is being matched with these options, they don't exist yet (when you close and re-open the options have loaded ands appear)

there's a function there called getLogEntryOptions that you can pop this in and then pass it as a prop to this component which should resolve things

Copy link
Collaborator

@connor-bechthold connor-bechthold left a comment

Choose a reason for hiding this comment

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

muy bien

Copy link
Contributor

@owen-sellner owen-sellner left a comment

Choose a reason for hiding this comment

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

très bien

@phamkelly17 phamkelly17 merged commit ab34584 into main Nov 26, 2023
3 checks passed
@phamkelly17 phamkelly17 deleted the kelly/get_buildings_route branch November 26, 2023 19:17
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.

3 participants