mirror of
https://github.com/TheAnachronism/docspell.git
synced 2025-06-23 10:58:26 +00:00
@ -10,9 +10,12 @@ module Util.CustomField exposing
|
||||
, nameOrLabel
|
||||
, renderValue
|
||||
, renderValue2
|
||||
, statsToFields
|
||||
)
|
||||
|
||||
import Api.Model.CustomField exposing (CustomField)
|
||||
import Api.Model.ItemFieldValue exposing (ItemFieldValue)
|
||||
import Api.Model.SearchStats exposing (SearchStats)
|
||||
import Data.CustomFieldType
|
||||
import Data.Icons as Icons
|
||||
import Html exposing (..)
|
||||
@ -20,6 +23,15 @@ import Html.Attributes exposing (..)
|
||||
import Html.Events exposing (onClick)
|
||||
|
||||
|
||||
statsToFields : SearchStats -> List CustomField
|
||||
statsToFields stats =
|
||||
let
|
||||
mkField fs =
|
||||
CustomField fs.id fs.name fs.label fs.ftype fs.count 0
|
||||
in
|
||||
List.map mkField stats.fieldStats
|
||||
|
||||
|
||||
{-| This is how the server wants the value to a bool custom field
|
||||
-}
|
||||
boolValue : Bool -> String
|
||||
|
Reference in New Issue
Block a user