mirror of
https://github.com/TheAnachronism/docspell.git
synced 2025-06-23 10:58:26 +00:00
Allow to confirm/unconfirm multiple items
This commit is contained in:
@ -81,6 +81,7 @@ type Msg
|
||||
| UpdateThrottle
|
||||
| RemoveDueDate
|
||||
| RemoveDate
|
||||
| ConfirmMsg Bool
|
||||
| FolderDropdownMsg (Comp.Dropdown.Msg IdName)
|
||||
| TagDropdownMsg (Comp.Dropdown.Msg Tag)
|
||||
| DirDropdownMsg (Comp.Dropdown.Msg Direction)
|
||||
@ -201,6 +202,9 @@ resultNone model =
|
||||
update : Flags -> Msg -> Model -> UpdateResult
|
||||
update flags msg model =
|
||||
case msg of
|
||||
ConfirmMsg flag ->
|
||||
resultNoCmd (ConfirmChange flag) model
|
||||
|
||||
TagDropdownMsg m ->
|
||||
let
|
||||
( m2, _ ) =
|
||||
@ -553,7 +557,26 @@ renderEditForm cfg settings model =
|
||||
in
|
||||
div [ class cfg.menuClass ]
|
||||
[ div [ class "ui form warning" ]
|
||||
[ optional [ Data.Fields.Tag ] <|
|
||||
[ div [ class "field" ]
|
||||
[ div
|
||||
[ class "ui fluid buttons"
|
||||
]
|
||||
[ button
|
||||
[ class "ui primary button"
|
||||
, onClick (ConfirmMsg True)
|
||||
]
|
||||
[ text "Confirm"
|
||||
]
|
||||
, div [ class "or" ] []
|
||||
, button
|
||||
[ class "ui secondary button"
|
||||
, onClick (ConfirmMsg False)
|
||||
]
|
||||
[ text "Unconfirm"
|
||||
]
|
||||
]
|
||||
]
|
||||
, optional [ Data.Fields.Tag ] <|
|
||||
div [ class "field" ]
|
||||
[ label []
|
||||
[ Icons.tagsIcon "grey"
|
||||
|
@ -30,6 +30,7 @@ type FormChange
|
||||
| ItemDateChange (Maybe Int)
|
||||
| DueDateChange (Maybe Int)
|
||||
| NameChange String
|
||||
| ConfirmChange Bool
|
||||
|
||||
|
||||
multiUpdate :
|
||||
@ -114,5 +115,12 @@ multiUpdate flags ids change receive =
|
||||
in
|
||||
Api.setConcEquipmentMultiple flags data receive
|
||||
|
||||
ConfirmChange flag ->
|
||||
if flag then
|
||||
Api.confirmMultiple flags ids receive
|
||||
|
||||
else
|
||||
Api.unconfirmMultiple flags ids receive
|
||||
|
||||
NoFormChange ->
|
||||
Cmd.none
|
||||
|
Reference in New Issue
Block a user