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

agegroup search filter fix #92

Open
wants to merge 1 commit into
base: PO-372-base
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ Perustuu projektiin [Keep a Changelog](http://keepachangelog.com/en/1.0.0/)
- PO-323: Filtereiden checkboxien mobiilityylit
- PO-324: Hakutuloksien määrä
- PO-350: Tehdään tyhjentämisen jälkeen haku vain jos jotain muuttui
- PO-372: Bugi missä haku välillä menetti agegroup valinnat

## [1.2.0] - 2018-09-05

Expand Down
2 changes: 1 addition & 1 deletion content/themes/custom/assets/dist/admin.js.map

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion content/themes/custom/assets/dist/main.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion content/themes/custom/assets/dist/main.js.map

Large diffs are not rendered by default.

4 changes: 3 additions & 1 deletion content/themes/custom/assets/scripts/search.js
Original file line number Diff line number Diff line change
Expand Up @@ -255,6 +255,8 @@ class Search {
this.collectGuids( $( el ).parent().find( '>.collapsed>.field-list' ), collected );
});

collected = _.uniq( collected );

return collected;
}

Expand All @@ -267,7 +269,7 @@ class Search {
getArgs( $searchForm = null ) {
const $filterForm = $().add( this.$filterForm ).add( $searchForm ).filter( ':visible' );
const formdata = new FormData( $filterForm.get( 0 ) );
const postGuids = this.collectGuids( $filterForm.find( '.agegroups:visible' ) ).join( ',' );
const postGuids = this.collectGuids( $filterForm.find( '.agegroups' ) ).join( ',' );
const postRelation = formdata.get( 'post_relation' );
const s = formdata.get( 's' );
const args = { s }; // Create the return object
Expand Down