mirror of
https://github.com/TheAnachronism/docspell.git
synced 2025-06-23 10:58:26 +00:00
Allow to choose from existing tag categories
Also fixes a ui problem with a too long dropdown menu in the small modal popup when adding tags or custom fields in item detail view. Issue: #331
This commit is contained in:
@ -98,6 +98,7 @@ type alias Model =
|
||||
, customFieldsModel : Comp.CustomFieldMultiInput.Model
|
||||
, customFieldSavingIcon : Dict String String
|
||||
, customFieldThrottle : Throttle Msg
|
||||
, allTags : List Tag
|
||||
}
|
||||
|
||||
|
||||
@ -202,6 +203,7 @@ emptyModel =
|
||||
, customFieldsModel = Comp.CustomFieldMultiInput.initWith []
|
||||
, customFieldSavingIcon = Dict.empty
|
||||
, customFieldThrottle = Throttle.create 1
|
||||
, allTags = []
|
||||
}
|
||||
|
||||
|
||||
|
@ -65,6 +65,7 @@ import Util.Http
|
||||
import Util.List
|
||||
import Util.Maybe
|
||||
import Util.String
|
||||
import Util.Tag
|
||||
|
||||
|
||||
update : Nav.Key -> Flags -> ItemNav -> UiSettings -> Msg -> Model -> UpdateResult
|
||||
@ -588,7 +589,7 @@ update key flags inav settings msg model =
|
||||
tagList =
|
||||
Comp.Dropdown.SetOptions tags.items
|
||||
in
|
||||
update key flags inav settings (TagDropdownMsg tagList) model
|
||||
update key flags inav settings (TagDropdownMsg tagList) { model | allTags = tags.items }
|
||||
|
||||
GetTagsResp (Err _) ->
|
||||
resultModel model
|
||||
@ -1039,9 +1040,13 @@ update key flags inav settings msg model =
|
||||
resultModel model
|
||||
|
||||
StartTagModal ->
|
||||
let
|
||||
cats =
|
||||
Util.Tag.getCategories model.allTags
|
||||
in
|
||||
resultModel
|
||||
{ model
|
||||
| modalEdit = Just (Comp.DetailEdit.initTagByName model.item.id "")
|
||||
| modalEdit = Just (Comp.DetailEdit.initTagByName model.item.id "" cats)
|
||||
}
|
||||
|
||||
StartCorrOrgModal ->
|
||||
|
Reference in New Issue
Block a user