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

feat: add neighborhood amenities to listing #1462

Merged
merged 1 commit into from
Oct 17, 2022

Conversation

ludtkemorgan
Copy link
Collaborator

Pull Request Template

Issue Overview

This PR addresses #1457

  • This change addresses the issue in full
  • This change addresses only certain aspects of the issue
  • This change is a dependency for another issue
  • This change has a dependency from another issue

Description

Adds the new backend fields for neighborhood amenities to listings. These include "grocery", "medicalCenter", "park", "pharmacy", and "senior center"

How Can This Be Tested/Reviewed?

A new listing has been created in the seeded data called "Test: Neighborhood Amenities". This property has the neighborhood amenities field filled out. All but "senior center" has at least some text in it. Also, the "park" field has a large amount of text.

Checklist:

  • My code follows the style guidelines of this project
  • I have added QA notes to the issue with applicable URLs
  • I have performed a self-review of my own code
  • I have reviewed the changes in a desktop view
  • I have reviewed the changes in a mobile view
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes
  • Any dependent changes have been merged and published in downstream modules
  • I have assigned reviewers
  • I have run yarn generate:client and/or created a migration if I made backend changes that require them
  • I have exported any new pieces added to ui-components
  • My commit message(s) is/are polished, and any breaking changes are indicated in the message and are well-described
  • Commits made across packages purposefully have the same commit message/version change, else are separated into different commits

Reviewer Notes:

Steps to review a PR:

  • Read and understand the issue, and ensure the author has added QA notes
  • Review the code itself from a style point of view
  • Pull the changes down locally and test that the acceptance criteria is met
  • Also review the acceptance criteria on the Netlify deploy preview (noting that these do not yet include any backend changes made in the PR)
  • Either explicitly ask a clarifying question, request changes, or approve the PR if there are small remaining changes but the PR is otherwise good to go

On Merge:

If you have one commit and message, squash. If you need each message to be applied, rebase and merge.

@netlify
Copy link

netlify bot commented Oct 4, 2022

Deploy Preview for detroit-partners-dev ready!

Name Link
🔨 Latest commit 66b7900
🔍 Latest deploy log https://app.netlify.com/sites/detroit-partners-dev/deploys/63473ad9830ba3000878eb9f
😎 Deploy Preview https://deploy-preview-1462--detroit-partners-dev.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site settings.

@netlify
Copy link

netlify bot commented Oct 4, 2022

Deploy Preview for detroit-public-dev ready!

Name Link
🔨 Latest commit 66b7900
🔍 Latest deploy log https://app.netlify.com/sites/detroit-public-dev/deploys/63473ad9a259590008aabf29
😎 Deploy Preview https://deploy-preview-1462--detroit-public-dev.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site settings.

@netlify
Copy link

netlify bot commented Oct 4, 2022

Deploy Preview for detroit-storybook-dev ready!

Name Link
🔨 Latest commit 66b7900
🔍 Latest deploy log https://app.netlify.com/sites/detroit-storybook-dev/deploys/63473ad9d6600900083f083c
😎 Deploy Preview https://deploy-preview-1462--detroit-storybook-dev.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site settings.

Copy link
Collaborator

@ColinBuyck ColinBuyck left a comment

Choose a reason for hiding this comment

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

I would have thought that this change would require additions to the backend-swagger.ts files as well. Am I missing something?

Copy link
Collaborator

@emilyjablonski emilyjablonski left a comment

Choose a reason for hiding this comment

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

LGTM post swagger 🐯

@ludtkemorgan ludtkemorgan force-pushed the 1457/neighborhood-amenities branch 2 times, most recently from 3a4d1ca to 0c00dce Compare October 5, 2022 18:54
Comment on lines 8 to 9
"listing",
"grocery",
Copy link
Collaborator

@KrissDrawing KrissDrawing Oct 6, 2022

Choose a reason for hiding this comment

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

Few things that i got while connecting with frontend that doesn't seem right to me😅

  • Should that ☝️ force me to pass id, createdAt, updatedAt on frontend ?
  • on listing create/edit i got error "neighborhoodAmenities should not be null or undefined"

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I've updated the listing dto to make neighborhoodAmenities be optional. That way you won't get the error when creating/editing.
You shouldn't have to pass the id, createdAt, or updatedAt. I'll add a test though to make sure

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Update: good catch, I did need to add the id and timestamps to this list in order for it to work. I added a test as well

Copy link
Collaborator

Choose a reason for hiding this comment

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

nice, It's working now 💪

@ludtkemorgan ludtkemorgan force-pushed the 1457/neighborhood-amenities branch 3 times, most recently from 3103773 to b878590 Compare October 6, 2022 16:14
@ludtkemorgan
Copy link
Collaborator Author

I would have thought that this change would require additions to the backend-swagger.ts files as well. Am I missing something?

@ColinBuyck The swagger changes have been added

Copy link
Collaborator

@YazeedLoonat YazeedLoonat left a comment

Choose a reason for hiding this comment

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

Looks good, I think some extra info made its way into the migration though

await queryRunner.query(`ALTER TABLE "listings" ADD CONSTRAINT "UQ_59b4618dfbe6dca2edda375b8d3" UNIQUE ("neighborhood_amenities_id")`);
await queryRunner.query(`ALTER TABLE "listings" DROP COLUMN "marketing_season"`);
await queryRunner.query(`DROP TYPE "public"."listings_marketing_season_enum"`);
await queryRunner.query(`ALTER TABLE "listings" ADD "marketing_season" character varying`);
Copy link
Collaborator

Choose a reason for hiding this comment

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

I think marketing season is already on the listing table

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

This has been updated. I don't know how that got added. That enum hasn't changed recently or anything

Copy link
Collaborator

@ColinBuyck ColinBuyck left a comment

Choose a reason for hiding this comment

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

🥇

Copy link
Collaborator

@YazeedLoonat YazeedLoonat left a comment

Choose a reason for hiding this comment

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

LGTM

@ludtkemorgan ludtkemorgan merged commit 16d5b28 into dev Oct 17, 2022
@ludtkemorgan ludtkemorgan deleted the 1457/neighborhood-amenities branch October 17, 2022 14:06
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.

None yet

5 participants