Remove unused code for search dropdown

This commit is contained in:
Eike Kettner 2021-04-02 23:16:38 +02:00
parent 9a23ba9afb
commit dac95e81e6
2 changed files with 0 additions and 44 deletions

View File

@ -22,7 +22,6 @@ import Api.Model.ItemLightList exposing (ItemLightList)
import Api.Model.SearchStats exposing (SearchStats)
import Browser.Dom as Dom
import Comp.ConfirmModal
import Comp.FixedDropdown
import Comp.ItemCardList
import Comp.ItemDetail.FormChange exposing (FormChange)
import Comp.ItemDetail.MultiEditMenu exposing (SaveNameState(..))
@ -50,7 +49,6 @@ type alias Model =
, moreAvailable : Bool
, moreInProgress : Bool
, throttle : Throttle Msg
, searchTypeDropdown : Comp.FixedDropdown.Model SearchType
, searchTypeDropdownValue : SearchType
, lastSearchType : SearchType
, dragDropData : DD.DragDropData
@ -92,13 +90,6 @@ init flags viewMode =
let
searchMenuModel =
Comp.SearchMenu.init flags
searchTypeOptions =
if flags.config.fullTextSearchEnabled then
[ BasicSearch, ContentOnlySearch ]
else
[ BasicSearch ]
in
{ searchMenuModel = searchMenuModel
, itemListModel = Comp.ItemCardList.init
@ -107,8 +98,6 @@ init flags viewMode =
, moreAvailable = True
, moreInProgress = False
, throttle = Throttle.create 1
, searchTypeDropdown =
Comp.FixedDropdown.init searchTypeOptions
, searchTypeDropdownValue =
if Comp.SearchMenu.isFulltextSearch searchMenuModel then
ContentOnlySearch
@ -177,7 +166,6 @@ type Msg
| LoadMore
| UpdateThrottle
| SetBasicSearch String
| SearchTypeMsg (Comp.FixedDropdown.Msg SearchType)
| ToggleSearchType
| KeyUpSearchbarMsg (Maybe KeyCode)
| ScrollResult (Result Dom.Error ())

View File

@ -277,38 +277,6 @@ update mId key flags settings msg model =
ContentOnlySearch ->
update mId key flags settings (SearchMenuMsg Comp.SearchMenu.SetNamesSearch) model
SearchTypeMsg lm ->
let
( sm, mv ) =
Comp.FixedDropdown.update lm model.searchTypeDropdown
mvChange =
Util.Maybe.filter (\a -> a /= model.searchTypeDropdownValue) mv
m0 =
{ model
| searchTypeDropdown = sm
, searchTypeDropdownValue = Maybe.withDefault model.searchTypeDropdownValue mv
}
next =
case mvChange of
Just BasicSearch ->
Just Comp.SearchMenu.SetNamesSearch
Just ContentOnlySearch ->
Just Comp.SearchMenu.SetFulltextSearch
_ ->
Nothing
in
case next of
Just lm_ ->
update mId key flags settings (SearchMenuMsg lm_) m0
Nothing ->
withSub ( m0, Cmd.none )
KeyUpSearchbarMsg (Just Enter) ->
update mId key flags settings (DoSearch model.searchTypeDropdownValue) model