Skip to content

Commit

Permalink
Merge pull request #161 from vsimakhin/enhancement/ignore-case-send-m…
Browse files Browse the repository at this point in the history
…ap-filters

case insensetive filters on the Map page
  • Loading branch information
vsimakhin authored Sep 20, 2023
2 parents ce62894 + 4a2407d commit fd75cde
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 fd75cde

Please sign in to comment.