Skip to content

feat: 512/unit type filtering - #571

Open
cade-exygy wants to merge 21 commits into
mainfrom
512/unit-type-filtering
Open

feat: 512/unit type filtering#571
cade-exygy wants to merge 21 commits into
mainfrom
512/unit-type-filtering

Conversation

@cade-exygy

@cade-exygy cade-exygy commented Apr 5, 2024

Copy link
Copy Markdown
Collaborator

feat: 512/unit type filtering

Issue Overview

https://app.zenhub.com/workspaces/bloom-5dc32d7144bd400001315dac/issues/gh/metrotranscom/doorway/512

This PR addresses #512

  • 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

How Can This Be Tested/Reviewed?

  • Go to listings -> filter, and try out bedroom/bathroom filters
    **- Currently the seed data on localhost has incorrect database values for bedrooms, which are different from the unit type. This causes the filtering to appear not to align properly. **

Describe the tests that you ran to verify your changes. Please also list any relevant details for your test configuration.

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
  • 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.

Comment thread api/src/services/listing.service.ts Outdated
Comment thread api/src/services/listing.service.ts Outdated
Comment thread sites/public/src/components/listings/search/ButtonSelect.tsx Outdated
@emilyjablonski

Copy link
Copy Markdown
Collaborator

@cade-exygy Heads up about the failing tests

}

.checkbox-group > div > label {
color: var(--seeds-color-primary-dark) !important;

@emilyjablonski emilyjablonski May 8, 2024

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

We try to do everything we can to not use important, it can make things brittle / the order of CSS application becomes confusing. If this is the root class of the new component in seeds, if we're needing to override a style over here, we should make it a CSS variable over there :)

Comment thread api/src/services/listing.service.ts
})
@IsNumberString({}, { groups: [ValidationsGroupsEnum.default] })
[ListingFilterKeys.bedrooms]?: number;
@IsArray({ groups: [ValidationsGroupsEnum.default] })

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

@YazeedLoonat Do you have preferences on stronger typing here?

@emilyjablonski

emilyjablonski commented May 8, 2024

Copy link
Copy Markdown
Collaborator

I see the label so I did take a look, but not sure it's ready for review? It doesn't look like filtering is working for me locally, and if I try and open the filter modal on the listings page I get a react error. Pls let me know if I am missing something!

@cade-exygy

Copy link
Copy Markdown
Collaborator Author

I see the label so I did take a look, but not sure it's ready for review? It doesn't look like filtering is working for me locally, and if I try and open the filter modal on the listings page I get a react error. Pls let me know if I am missing something!

Hmm, could you share the react error you are getting? I just merged latest main and ran locally and am not seeing an error

@emilyjablonski

Copy link
Copy Markdown
Collaborator

Ty for the merge! Post merge I no longer get it opening the filter modal, but I get it trying to visit the partners site. The failing partners Cypress tests are caused by the same issue.

@emilyjablonski

Copy link
Copy Markdown
Collaborator

A few more notes for ya, I am still curious if filtering is working for you locally though?

  • I'm not seeing the new multiselect on the homepage
  • The Figma indicates we need to remove the Any option on the homepage and does still have all caps on the filter modal
  • If I select Studio and hit View listings the listings are not filtered
  • It appears like one filter might be set from the filter button but when I open it, nothing is set
  • If I select a unit filter, not all of the listings that match that filter seem to be coming back (video below)
filtering.mov

@cade-exygy

Copy link
Copy Markdown
Collaborator Author

@sarahlazarich @emilyjablonski I addressed what I could on this PR with my limited capacity.

  • Filters should work on Landing Search and Listings view
  • Refactored to reduce repetitive code

Remaining:

  • I believe the seed data has mismatches between the # of bedrooms and the associated unit type. Meaning that the filters come back with odd looking results.
  • Style changes: I changed the checkbox inputs to match more closely to the other form inputs.
  • Having some issues with tests. May be something to do with the ui-seeds version I am specifying?

If possible, I think pairing to knock out these last few remaining issues would be best path forward due to my limited time.

Thank you for your patience!

@emilyjablonski

Copy link
Copy Markdown
Collaborator

Ty for the update! Would be interested in green tests before the next review round, happy to pair

@cade-exygy

Copy link
Copy Markdown
Collaborator Author

Ty for the update! Would be interested in green tests before the next review round, happy to pair

I am uncertain why Partners tests are failing, at first glance it doesn't seem related to my changes, but curious if it has to do with the specified version of ui-seeds?

@emilyjablonski

Copy link
Copy Markdown
Collaborator

@cade-exygy Not sure w/out digging into it, but v happy to pair if it is sticky!

@cade-exygy

Copy link
Copy Markdown
Collaborator Author

Tests passing. Needs 2 reviews. If there any follow-ups (that are not small tweaks), I will need to hand off to another engineer, as I have no capacity for Doorway work currently. Let me know if there any questions. Thank you! cc. @sarahlazarich

@mcgarrye mcgarrye left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Testing locally, finding that the filtering results are not always accurate

--inner-button-gap: var(--seeds-s3);
padding-top: var(--seeds-s4);
padding-bottom: var(--seeds-s4);
} No newline at end of file

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

nit: missing EOF newline

@cade-exygy

Copy link
Copy Markdown
Collaborator Author

Testing locally, finding that the filtering results are not always accurate

Curious what your local database data looks like? On my end I saw that the seed data has lots of misalignments between # of bedrooms and Unit type label. For example a listing with 0 bedrooms is actually labeled as "1 bedroom" etc.

@mcgarrye

Copy link
Copy Markdown
Collaborator

Testing locally, finding that the filtering results are not always accurate

Curious what your local database data looks like? On my end I saw that the seed data has lots of misalignments between # of bedrooms and Unit type label. For example a listing with 0 bedrooms is actually labeled as "1 bedroom" etc.

Great call out cause that's exactly what it was!

@mcgarrye mcgarrye left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

We should definitely have a follow-up ticket to fix the seed data

@jaredcwhite jaredcwhite left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

The new functionality seems to be working well for me, but I'm noticing a visual regression where it looks like a stock Seeds component's been dropped into the Doorway design system.

I suspect some overridden tokens are needed?

image image

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.

4 participants