mirror of
https://github.com/TheAnachronism/docspell.git
synced 2025-06-23 10:58:26 +00:00
Use search stats to populate search menu
This commit is contained in:
@ -15,6 +15,7 @@ module Comp.SearchMenu exposing
|
||||
, isFulltextSearch
|
||||
, isNamesSearch
|
||||
, linkTargetMsg
|
||||
, setFromStats
|
||||
, textSearchString
|
||||
, update
|
||||
, updateDrop
|
||||
@ -379,6 +380,11 @@ type Msg
|
||||
| ToggleOpenAllAkkordionTabs
|
||||
|
||||
|
||||
setFromStats : SearchStats -> Msg
|
||||
setFromStats stats =
|
||||
GetStatsResp (Ok stats)
|
||||
|
||||
|
||||
linkTargetMsg : LinkTarget -> Maybe Msg
|
||||
linkTargetMsg linkTarget =
|
||||
case linkTarget of
|
||||
|
@ -245,6 +245,12 @@ makeWorkModel sel model =
|
||||
}
|
||||
|
||||
|
||||
noEmptyTags : Model -> Bool
|
||||
noEmptyTags model =
|
||||
Dict.filter (\k -> \v -> v.count == 0) model.availableTags
|
||||
|> Dict.isEmpty
|
||||
|
||||
|
||||
type Msg
|
||||
= ToggleTag String
|
||||
| ToggleCat String
|
||||
@ -422,6 +428,7 @@ viewTagsDrop2 texts ddm wm settings model =
|
||||
[ a
|
||||
[ class S.secondaryBasicButtonPlain
|
||||
, class "border rounded flex-none px-1 py-1"
|
||||
, classList [ ( "hidden", noEmptyTags model ) ]
|
||||
, href "#"
|
||||
, onClick ToggleShowEmpty
|
||||
]
|
||||
|
Reference in New Issue
Block a user