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

Differentiating landlord reviews #305

Merged
merged 11 commits into from
Nov 7, 2023
Merged

Differentiating landlord reviews #305

merged 11 commits into from
Nov 7, 2023

Conversation

jesshan700
Copy link
Contributor

Added to landlord reviews

This pull request is the first step towards showing the difference between landlord reviews and apartment reviews on the landlord page. Checks the aptId field for each review to see if it is empty or null indicating a landlord review.

  • Text that shows the user which reviews are landlord reviews

Test Plan

Testing Lambrou landlord vs apartment:
Screen Shot 2023-10-09 at 3 15 29 PM

Testing Travis Hyde landlord vs apartment:
Screen Shot 2023-10-09 at 3 18 27 PM

Notes

  • Decided not to make the text a link because it could get confusing for the user if the link just directs them to the page that they are already on.
  • Could maybe implement some sort of icon to show the differentiation vs text!

Breaking Changes

  • Database schema change (anything that changes Firestore collection structure)
  • Other change that could cause problems (Detailed in notes)

@jesshan700 jesshan700 temporarily deployed to staging October 9, 2023 19:20 — with GitHub Actions Inactive
@CLAassistant
Copy link

CLAassistant commented Oct 9, 2023

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you all sign our Contributor License Agreement before we can accept your contribution.
2 out of 4 committers have signed the CLA.

✅ jesshan700
✅ thuypham03
❌ jesshan70
❌ Thuy Pham


Thuy Pham seems not to be a GitHub user. You need a GitHub account to be able to sign the CLA. If you have already a GitHub account, please add the email address used for this commit to your account.
You have signed the CLA already but the status is still pending? Let us recheck it.

@dti-github-bot
Copy link
Member

dti-github-bot commented Oct 9, 2023

[diff-counting] Significant lines: 64.

@github-actions
Copy link

github-actions bot commented Oct 9, 2023

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

https://cu-apts-staging--pr305-link-apartment-landl-tw8ueh6w.web.app

(expires Tue, 14 Nov 2023 18:14:53 GMT)

🔥 via Firebase Hosting GitHub Action 🌎

Sign: 096ac87b789b31770a01964fe0aaa92d563b9353

@jesshan700 jesshan700 temporarily deployed to staging October 9, 2023 19:30 — with GitHub Actions Inactive
Copy link
Contributor

@mluo24 mluo24 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 Jessica! You really made the indicator look nice, and it's clear which one is a landlord review. Maybe you can also add indication for what's an apartment review with the apartment name?

Your logic with your solution is great, but I left some comments for how to micro-optimize it.

{/* Checking to see if aptId of the review is null or empty, indicating that the review is a
landlord apartment - if landlord apartment is true, will add landlord review text */}
<Typography className={landlordIndicator}>
{review.aptId === '' || review.aptId == null
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 you can do !review.aptId instead.

Also, with what I was saying above, if you add landlordName as a prop, you can rewrite the code as such:

{landlordName && (
<Typography className={landlordIndicator}>
  'Landlord Review - ' + landlordName
</Typography>
)}

This also only renders the component if landlordName has an input.

Comment on lines 121 to 127
//Retreieving landlord data
useEffect(() => {
get<Landlord>(`/api/landlord/${review.landlordId}`, {
callback: setLandlord,
});
}, [review]);

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 this API call isn't actually necessary. The parent component already should have made this API call and acquired the data already (since it's the landlord page), and since you only need the name of the landlord, it would make sense to just pass the name of it as a prop to this component, especially since this component is used in other places where you don't need the landlord name.

I would suggest adding an optional prop to this component that passes in the landlord name, and in 188 replace the landlord?.name with this prop, and maybe change the condition so it relies on the landlord name being not null instead.

@jesshan700 jesshan700 temporarily deployed to staging October 16, 2023 20:04 — with GitHub Actions Inactive
@jesshan700
Copy link
Contributor Author

Updated the differentiation between landlord and apartments so that apartment links with the specific apartment shows on the card rather than showing the landlord review. Changed the styling so that it matches with the admin page.

Screen Shot 2023-10-16 at 4 06 49 PM

Redirects user to the specific apartment of that card.

Screen Shot 2023-10-16 at 4 07 38 PM

@jesshan700 jesshan700 temporarily deployed to staging October 23, 2023 02:30 — with GitHub Actions Inactive
@jesshan700
Copy link
Contributor Author

Screen Shot 2023-10-22 at 10 31 33 PM

Changed styling of properties indicator rather than red link as shown above, better indicator that the link represents the property. Underlined portion is a link to the respective apartment page.

ggsawatyanon
ggsawatyanon previously approved these changes Oct 30, 2023
Copy link
Contributor

@ggsawatyanon ggsawatyanon left a comment

Choose a reason for hiding this comment

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

This looks good, Jessica! This is a really helpful feature for users to understand the UI of the landlord reviews page easier. I'm not sure the purpose of the addition of the install_nvm.s file though. Good job on this PR!

Copy link
Collaborator

@thuypham03 thuypham03 left a comment

Choose a reason for hiding this comment

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

Good job on adding a differentiation between landlord and apartment's review on landlord page. Now, it's easier for the user to follow and can easy redirect to the corresponding landlord page.

@thuypham03 thuypham03 merged commit 728f3fd into main Nov 7, 2023
6 of 7 checks passed
@thuypham03 thuypham03 deleted the link-apartment-landlord branch November 7, 2023 18:15
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.

7 participants