mirror of
https://github.com/TheAnachronism/docspell.git
synced 2025-04-05 10:59:33 +00:00
parent
dc061b10a6
commit
e701040212
@ -105,7 +105,7 @@ type alias Action =
|
|||||||
|
|
||||||
type Outcome
|
type Outcome
|
||||||
= OutcomeCancel
|
= OutcomeCancel
|
||||||
| OutcomeActionDone
|
| OutcomeActionDone (Maybe ItemLight)
|
||||||
| OutcomeNotYet
|
| OutcomeNotYet
|
||||||
|
|
||||||
|
|
||||||
@ -148,7 +148,7 @@ update _ action msg model =
|
|||||||
if result.success then
|
if result.success then
|
||||||
{ model = { model | formState = FormStateActionSuccessful }
|
{ model = { model | formState = FormStateActionSuccessful }
|
||||||
, cmd = Cmd.none
|
, cmd = Cmd.none
|
||||||
, outcome = OutcomeActionDone
|
, outcome = OutcomeActionDone (List.head model.items)
|
||||||
}
|
}
|
||||||
|
|
||||||
else
|
else
|
||||||
|
@ -17,8 +17,10 @@ module Data.ItemIds exposing
|
|||||||
, fromSet
|
, fromSet
|
||||||
, isEmpty
|
, isEmpty
|
||||||
, isMember
|
, isMember
|
||||||
|
, maybeOne
|
||||||
, noChange
|
, noChange
|
||||||
, nonEmpty
|
, nonEmpty
|
||||||
|
, one
|
||||||
, select
|
, select
|
||||||
, selectAll
|
, selectAll
|
||||||
, size
|
, size
|
||||||
@ -66,6 +68,16 @@ fromSet ids =
|
|||||||
ItemIds ids
|
ItemIds ids
|
||||||
|
|
||||||
|
|
||||||
|
one : String -> ItemIds
|
||||||
|
one id =
|
||||||
|
ItemIds (Set.singleton id)
|
||||||
|
|
||||||
|
|
||||||
|
maybeOne : Maybe String -> ItemIds
|
||||||
|
maybeOne id =
|
||||||
|
Maybe.map one id |> Maybe.withDefault empty
|
||||||
|
|
||||||
|
|
||||||
union : ItemIds -> ItemIds -> ItemIds
|
union : ItemIds -> ItemIds -> ItemIds
|
||||||
union (ItemIds ids1) (ItemIds ids2) =
|
union (ItemIds ids1) (ItemIds ids2) =
|
||||||
ItemIds (Set.union ids1 ids2)
|
ItemIds (Set.union ids1 ids2)
|
||||||
|
@ -620,21 +620,22 @@ update texts bookmarkId lastViewedItemId env msg model =
|
|||||||
Comp.ItemMerge.OutcomeNotYet ->
|
Comp.ItemMerge.OutcomeNotYet ->
|
||||||
SelectView { svm | mergeModel = createModel result.model }
|
SelectView { svm | mergeModel = createModel result.model }
|
||||||
|
|
||||||
Comp.ItemMerge.OutcomeActionDone ->
|
Comp.ItemMerge.OutcomeActionDone _ ->
|
||||||
SearchView
|
SearchView
|
||||||
|
|
||||||
model_ =
|
model_ =
|
||||||
{ model | viewMode = nextView }
|
{ model | viewMode = nextView }
|
||||||
in
|
in
|
||||||
if result.outcome == Comp.ItemMerge.OutcomeActionDone then
|
case result.outcome of
|
||||||
|
Comp.ItemMerge.OutcomeActionDone target ->
|
||||||
update texts
|
update texts
|
||||||
bookmarkId
|
bookmarkId
|
||||||
lastViewedItemId
|
lastViewedItemId
|
||||||
env
|
{ env | selectedItems = Data.ItemIds.maybeOne <| Maybe.map .id target }
|
||||||
(DoSearch model.searchTypeDropdownValue)
|
(DoSearch model.searchTypeDropdownValue)
|
||||||
model_
|
model_
|
||||||
|
|
||||||
else
|
_ ->
|
||||||
resultModelCmd env.selectedItems
|
resultModelCmd env.selectedItems
|
||||||
( model_
|
( model_
|
||||||
, Cmd.map MergeItemsMsg result.cmd
|
, Cmd.map MergeItemsMsg result.cmd
|
||||||
|
Loading…
x
Reference in New Issue
Block a user