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

137 filtering hs #146

Merged
merged 6 commits into from
Jun 9, 2020
Merged

137 filtering hs #146

merged 6 commits into from
Jun 9, 2020

Conversation

benlk
Copy link
Collaborator

@benlk benlk commented Jun 5, 2020

Changes

This pull request implements the following portion of #137 (comment):

  • submit the form when the <select> changes
  • track whether the inputs in the details element are changed, and how many are checked
  • when the
    element is closed or otherwise onBlur, if the inputs there are changed, submit the search
  • limit the number of checked inputs to no more than 3: if it's 3, disable all inputs until one is unchecked

It also:

  • makes the summary in the details full width when the details is open

Screen Shot 2020-06-05 at 18 23 41

Why

For #137

Testing/Questions

Features that this PR affects:

  • search form

Questions that need to be answered before merging:

  • Is this PR targeting the correct branch in this repository?
  • [ ]

Steps to test this PR:

  1. check that the form submits when the select's value changes
  2. Check that the form submits when the <details> closes, only if the checkboxes checked have changed.
    • uncheck and check the same box: should not submit
    • check a new box: should submit
    • uncheck a checked box: should submit
  3. check that if three checkboxes are checked, other checkboxes in that dropdown are disabled:
    • on page load, with three checked
    • after checking three

@benlk benlk added this to the INOV-001 milestone Jun 5, 2020
@benlk
Copy link
Collaborator Author

benlk commented Jun 5, 2020

This is now :deployed: to staging and ready for review.

@benlk
Copy link
Collaborator Author

benlk commented Jun 8, 2020

  • remove automatic submit from search JS
  • add second search button to a box containing the org type and categories
  • move that org type/categories/search cluster to the right on desktop. On mobile, two search buttons, with the rows stacked.
  • figure out what's causing timeouts

@joshdarby
Copy link

joshdarby commented Jun 8, 2020

figure out what's causing timeouts

I think the problem here happens when there are no posts found for the specific query.

For example:
http://staging.current.flywheelsites.com/local-projects/?projects-search=&tax_input%5Bproject-org-type%5D%5B%5D=&tax_input%5Bproject-category%5D%5B%5D=6996&tax_input%5Bproject-category%5D%5B%5D=6997 works and there are 36 results found.

The issue is happening when 0 results are found and the projects-single-held.php file is trying to be loaded because it assumes that $query->the_post is not empty.

Putting the include() function for the holder file here inside of a if ( $query->have_posts() ) conditional fixes the issue.

include( locate_template( 'partials/projects-single-holder.php', false, false ) );

@joshdarby
Copy link

Solution for the above committed in 0ce254f

@benlk
Copy link
Collaborator Author

benlk commented Jun 8, 2020

Desktop:
Screen Shot 2020-06-08 at 13 57 38
Screen Shot 2020-06-08 at 13 57 44

Narrow desktop:

Screen Shot 2020-06-08 at 13 58 00

Phone:
Screen Shot 2020-06-08 at 13 58 05
Screen Shot 2020-06-08 at 13 58 14
Screen Shot 2020-06-08 at 13 58 20

@joshdarby
Copy link

@benlk can we merge/close this since it's already on staging?

@benlk benlk merged commit e105e0b into staging Jun 9, 2020
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.

2 participants