Add a use colum to metadata entities

This commit is contained in:
Eike Kettner
2021-03-10 22:16:04 +01:00
parent 1a188afbd7
commit 0229a867af
13 changed files with 223 additions and 22 deletions

View File

@ -229,6 +229,9 @@ view2 mobile settings model =
Data.PersonUse.Both ->
text "Use as both concerning or correspondent person"
Data.PersonUse.Disabled ->
text "Do not use for suggestions."
]
]
, div [ class "mb-4" ]

View File

@ -14,6 +14,7 @@ type PersonUse
= Correspondent
| Concerning
| Both
| Disabled
fromString : String -> Maybe PersonUse
@ -28,6 +29,9 @@ fromString str =
"both" ->
Just Both
"disabled" ->
Just Disabled
_ ->
Nothing
@ -44,6 +48,9 @@ asString pu =
Both ->
"both"
Disabled ->
"disabled"
label : PersonUse -> String
label pu =
@ -57,10 +64,13 @@ label pu =
Both ->
"Both"
Disabled ->
"Disabled"
all : List PersonUse
all =
[ Correspondent, Concerning, Both ]
[ Correspondent, Concerning, Both, Disabled ]
spanPersonList : List Person -> { concerning : List Person, correspondent : List Person }
@ -86,5 +96,8 @@ spanPersonList input =
| correspondent = p :: res.correspondent
, concerning = p :: res.concerning
}
Disabled ->
res
in
List.foldl merge init input