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

TA#58503 [FIX] web_search_date_range : filter ID issue #93

Open
wants to merge 3 commits into
base: 14.0
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
2 changes: 1 addition & 1 deletion web_search_date_range/__manifest__.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

{
"name": "Web Search Date Range",
"version": "1.0.1",
"version": "1.0.2",
"author": "Numigi",
"maintainer": "Numigi",
"website": "https://bit.ly/numigi-com",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,12 @@
}

toggleFilterWithOptions(filterId, optionId) {
const filter = this.state.filters[filterId];
var filter = this.state.filters[filterId];
if(filter === undefined){

Check notice on line 52 in web_search_date_range/static/src/js/control_panel_model_extension.js

View check run for this annotation

Codacy Production / Codacy Static Code Analysis

web_search_date_range/static/src/js/control_panel_model_extension.js#L52

Unexpected use of undefined.
filterId = filterId - 1
filter = this.state.filters[filterId];
}

if (!filter.isRelativeDateFilter) {
return super.toggleFilterWithOptions(filterId, optionId)
}
Expand All @@ -60,6 +65,9 @@
if (index >= 0) {
this.state.query.splice(index, 1);
} else {
if(filter.id !== filterId){
filter.id = filter.id - 1;
}
this.state.query.push({ groupId: filter.groupId, filterId, optionId });
}
}
Expand Down