mirror of
https://github.com/TheAnachronism/docspell.git
synced 2025-04-04 10:29:34 +00:00
Fix searching on share page if fulltext search is disabled
This commit is contained in:
parent
0651db9901
commit
d2b7c37dfc
@ -24,6 +24,7 @@ type alias Texts =
|
||||
, authFailed : String
|
||||
, fulltextPlaceholder : String
|
||||
, powerSearchPlaceholder : String
|
||||
, normalSearchPlaceholder : String
|
||||
, extendedSearch : String
|
||||
}
|
||||
|
||||
@ -39,6 +40,7 @@ gb =
|
||||
, fulltextPlaceholder = "Fulltext search…"
|
||||
, powerSearchPlaceholder = "Extended search…"
|
||||
, extendedSearch = "Extended search query"
|
||||
, normalSearchPlaceholder = "Search…"
|
||||
}
|
||||
|
||||
|
||||
@ -53,4 +55,5 @@ de =
|
||||
, fulltextPlaceholder = "Volltextsuche…"
|
||||
, powerSearchPlaceholder = "Erweiterte Suche…"
|
||||
, extendedSearch = "Erweiterte Suchanfrage"
|
||||
, normalSearchPlaceholder = "Suche…"
|
||||
}
|
||||
|
@ -10,7 +10,7 @@ module Page.Share.Menubar exposing (view)
|
||||
import Comp.Basic as B
|
||||
import Comp.MenuBar as MB
|
||||
import Comp.PowerSearchInput
|
||||
import Comp.SearchMenu
|
||||
import Data.Flags exposing (Flags)
|
||||
import Html exposing (..)
|
||||
import Html.Attributes exposing (..)
|
||||
import Html.Events exposing (onClick, onInput)
|
||||
@ -20,16 +20,9 @@ import Styles as S
|
||||
import Util.Html
|
||||
|
||||
|
||||
view : Texts -> Model -> Html Msg
|
||||
view texts model =
|
||||
view : Texts -> Flags -> Model -> Html Msg
|
||||
view texts flags model =
|
||||
let
|
||||
btnStyle =
|
||||
S.secondaryBasicButton ++ " text-sm"
|
||||
|
||||
searchInput =
|
||||
Comp.SearchMenu.textSearchString
|
||||
model.searchMenuModel.textSearchModel
|
||||
|
||||
powerSearchBar =
|
||||
div [ class "flex-grow flex flex-col relative" ]
|
||||
[ div
|
||||
@ -67,7 +60,11 @@ view texts model =
|
||||
[ type_ "text"
|
||||
, class S.textInput
|
||||
, class "text-sm"
|
||||
, placeholder texts.fulltextPlaceholder
|
||||
, if flags.config.fullTextSearchEnabled then
|
||||
placeholder texts.fulltextPlaceholder
|
||||
|
||||
else
|
||||
placeholder texts.normalSearchPlaceholder
|
||||
, onInput SetContentSearch
|
||||
, value (Maybe.withDefault "" model.contentSearch)
|
||||
, Util.Html.onKeyUpCode ContentSearchKey
|
||||
|
@ -214,7 +214,11 @@ makeSearchCmd flags model =
|
||||
model.powerSearchInput.input
|
||||
|
||||
SearchBarContent ->
|
||||
Maybe.map (Q.Contents >> Q.render) model.contentSearch
|
||||
if flags.config.fullTextSearchEnabled then
|
||||
Maybe.map (Q.Contents >> Q.render) model.contentSearch
|
||||
|
||||
else
|
||||
Maybe.map (Q.AllNames >> Q.render) model.contentSearch
|
||||
]
|
||||
|
||||
request mq =
|
||||
|
@ -80,7 +80,7 @@ mainContent texts flags settings shareId model =
|
||||
]
|
||||
[ text <| Maybe.withDefault "" model.verifyResult.name
|
||||
]
|
||||
, Menubar.view texts model
|
||||
, Menubar.view texts flags model
|
||||
, errorMessage texts model
|
||||
, Results.view texts settings flags shareId model
|
||||
]
|
||||
|
Loading…
x
Reference in New Issue
Block a user