Skip to content

Commit

Permalink
case insensetive filters on the Map page
Browse files Browse the repository at this point in the history
  • Loading branch information
vsimakhin committed Sep 20, 2023
1 parent ce62894 commit 4a2407d
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
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

0 comments on commit 4a2407d

Please sign in to comment.