mirror of
https://github.com/TheAnachronism/docspell.git
synced 2025-06-06 15:15:58 +00:00
Add boolean custom field immediately with value false
The time the user selects this field it should be pushed to the server, because the initial value of "false" is a correct value. All other fields require the user to type something first.
This commit is contained in:
parent
9da47cd76c
commit
29cfa035f4
@ -22,6 +22,7 @@ import Api.Model.ItemFieldValue exposing (ItemFieldValue)
|
|||||||
import Comp.CustomFieldInput
|
import Comp.CustomFieldInput
|
||||||
import Comp.FixedDropdown
|
import Comp.FixedDropdown
|
||||||
import Data.CustomFieldChange exposing (CustomFieldChange(..))
|
import Data.CustomFieldChange exposing (CustomFieldChange(..))
|
||||||
|
import Data.CustomFieldType
|
||||||
import Data.DropdownStyle as DS
|
import Data.DropdownStyle as DS
|
||||||
import Data.Flags exposing (Flags)
|
import Data.Flags exposing (Flags)
|
||||||
import Dict exposing (Dict)
|
import Dict exposing (Dict)
|
||||||
@ -217,8 +218,16 @@ update1 forSearch flags msg model =
|
|||||||
|
|
||||||
cmd_ =
|
cmd_ =
|
||||||
Cmd.map (CustomFieldInputMsg f) fc
|
Cmd.map (CustomFieldInputMsg f) fc
|
||||||
|
|
||||||
|
change =
|
||||||
|
case Data.CustomFieldType.fromString f.ftype of
|
||||||
|
Just Data.CustomFieldType.Boolean ->
|
||||||
|
FieldValueChange f "false"
|
||||||
|
|
||||||
|
_ ->
|
||||||
|
NoFieldChange
|
||||||
in
|
in
|
||||||
UpdateResult model_ cmd_ NoFieldChange
|
UpdateResult model_ cmd_ change
|
||||||
|
|
||||||
RemoveField f ->
|
RemoveField f ->
|
||||||
let
|
let
|
||||||
|
Loading…
x
Reference in New Issue
Block a user