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

case insensetive filters on the Map page #161

Merged
merged 1 commit into from
Sep 20, 2023
Merged
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 @@ -2,6 +2,7 @@

## [Unreleased]

- Update: ignore case for filters on the `Map` page
- Fix: The filter on the `Map` page wasn't working correctly if there was a space in the fields
- Update: Show the total number of rows for most of the tables (Logbook, Licensing, Airports)
- New: Date Range Picker first day of the week settings - Sunday or Monday.
Expand Down
4 changes: 2 additions & 2 deletions cmd/web/helpers.go
Original file line number Diff line number Diff line change
Expand Up @@ -98,13 +98,13 @@ func (app *application) isFlightRecordHelpEnabled() bool {
return !settings.DisableFlightRecordHelp
}

// parameterFilter is some custom string compare function
// parameterFilter is a custom string case insensetive compare function
func parameterFilter(s string, substr string) bool {
if strings.TrimSpace(s) == "" {
return true
}

return strings.Contains(s, substr)
return strings.Contains(strings.ToLower(s), strings.ToLower(substr))
}

func parameterClassFilter(classes map[string]string, model string, filter string) bool {
Expand Down
Loading