mirror of
https://github.com/TheAnachronism/docspell.git
synced 2025-06-22 18:38:26 +00:00
Show concerning/correspond person exclusively in dropdowns
Now a person that is not marked as "concerning only" is treated as "correspondent only". The options of all dropdown fields are now restricted to those subsets. Issue: #332
This commit is contained in:
@ -606,14 +606,30 @@ update key flags inav settings msg model =
|
||||
|
||||
GetPersonResp (Ok ps) ->
|
||||
let
|
||||
opts =
|
||||
Comp.Dropdown.SetOptions ps.items
|
||||
( conc, corr ) =
|
||||
List.partition .concerning ps.items
|
||||
|
||||
concRefs =
|
||||
List.map (\e -> IdName e.id e.name) conc
|
||||
|
||||
corrRefs =
|
||||
List.map (\e -> IdName e.id e.name) corr
|
||||
|
||||
res1 =
|
||||
update key flags inav settings (CorrPersonMsg opts) model
|
||||
update key
|
||||
flags
|
||||
inav
|
||||
settings
|
||||
(CorrPersonMsg (Comp.Dropdown.SetOptions corrRefs))
|
||||
model
|
||||
|
||||
res2 =
|
||||
update key flags inav settings (ConcPersonMsg opts) res1.model
|
||||
update key
|
||||
flags
|
||||
inav
|
||||
settings
|
||||
(ConcPersonMsg (Comp.Dropdown.SetOptions concRefs))
|
||||
res1.model
|
||||
in
|
||||
{ model = res2.model
|
||||
, cmd = Cmd.batch [ res1.cmd, res2.cmd ]
|
||||
@ -1410,7 +1426,7 @@ getOptions flags =
|
||||
Cmd.batch
|
||||
[ Api.getTags flags "" GetTagsResp
|
||||
, Api.getOrgLight flags GetOrgResp
|
||||
, Api.getPersonsLight flags GetPersonResp
|
||||
, Api.getPersons flags "" GetPersonResp
|
||||
, Api.getEquipments flags "" GetEquipResp
|
||||
, Api.getFolders flags "" False GetFolderResp
|
||||
]
|
||||
|
Reference in New Issue
Block a user