mirror of
https://github.com/TheAnachronism/docspell.git
synced 2025-06-06 15:15:58 +00:00
Close task form after submitting and return to list view
This commit is contained in:
parent
2c13f9307c
commit
bdfc151272
@ -34,7 +34,7 @@ type Msg
|
|||||||
| DetailMsg Comp.NotificationForm.Msg
|
| DetailMsg Comp.NotificationForm.Msg
|
||||||
| GetDataResp (Result Http.Error NotificationSettingsList)
|
| GetDataResp (Result Http.Error NotificationSettingsList)
|
||||||
| NewTask
|
| NewTask
|
||||||
| SubmitResp (Result Http.Error BasicResult)
|
| SubmitResp Bool (Result Http.Error BasicResult)
|
||||||
| DeleteResp (Result Http.Error BasicResult)
|
| DeleteResp (Result Http.Error BasicResult)
|
||||||
|
|
||||||
|
|
||||||
@ -121,10 +121,10 @@ update flags msg model =
|
|||||||
, result = Nothing
|
, result = Nothing
|
||||||
}
|
}
|
||||||
, if settings.id == "" then
|
, if settings.id == "" then
|
||||||
Api.createNotifyDueItems flags settings SubmitResp
|
Api.createNotifyDueItems flags settings (SubmitResp True)
|
||||||
|
|
||||||
else
|
else
|
||||||
Api.updateNotifyDueItems flags settings SubmitResp
|
Api.updateNotifyDueItems flags settings (SubmitResp True)
|
||||||
)
|
)
|
||||||
|
|
||||||
Comp.NotificationForm.CancelAction ->
|
Comp.NotificationForm.CancelAction ->
|
||||||
@ -140,7 +140,7 @@ update flags msg model =
|
|||||||
| detailModel = Just mm
|
| detailModel = Just mm
|
||||||
, result = Nothing
|
, result = Nothing
|
||||||
}
|
}
|
||||||
, Api.startOnceNotifyDueItems flags settings SubmitResp
|
, Api.startOnceNotifyDueItems flags settings (SubmitResp False)
|
||||||
)
|
)
|
||||||
|
|
||||||
Comp.NotificationForm.DeleteAction id ->
|
Comp.NotificationForm.DeleteAction id ->
|
||||||
@ -168,12 +168,24 @@ update flags msg model =
|
|||||||
in
|
in
|
||||||
( { model | detailModel = Just mm }, Cmd.map DetailMsg mc )
|
( { model | detailModel = Just mm }, Cmd.map DetailMsg mc )
|
||||||
|
|
||||||
SubmitResp (Ok res) ->
|
SubmitResp close (Ok res) ->
|
||||||
( { model | result = Just res }
|
( { model
|
||||||
, Cmd.none
|
| result = Just res
|
||||||
|
, detailModel =
|
||||||
|
if close then
|
||||||
|
Nothing
|
||||||
|
|
||||||
|
else
|
||||||
|
model.detailModel
|
||||||
|
}
|
||||||
|
, if close then
|
||||||
|
initCmd flags
|
||||||
|
|
||||||
|
else
|
||||||
|
Cmd.none
|
||||||
)
|
)
|
||||||
|
|
||||||
SubmitResp (Err err) ->
|
SubmitResp _ (Err err) ->
|
||||||
( { model | result = Just (BasicResult False (Util.Http.errorToString err)) }
|
( { model | result = Just (BasicResult False (Util.Http.errorToString err)) }
|
||||||
, Cmd.none
|
, Cmd.none
|
||||||
)
|
)
|
||||||
|
@ -34,7 +34,7 @@ type Msg
|
|||||||
| DetailMsg Comp.ScanMailboxForm.Msg
|
| DetailMsg Comp.ScanMailboxForm.Msg
|
||||||
| GetDataResp (Result Http.Error ScanMailboxSettingsList)
|
| GetDataResp (Result Http.Error ScanMailboxSettingsList)
|
||||||
| NewTask
|
| NewTask
|
||||||
| SubmitResp (Result Http.Error BasicResult)
|
| SubmitResp Bool (Result Http.Error BasicResult)
|
||||||
| DeleteResp (Result Http.Error BasicResult)
|
| DeleteResp (Result Http.Error BasicResult)
|
||||||
|
|
||||||
|
|
||||||
@ -121,10 +121,10 @@ update flags msg model =
|
|||||||
, result = Nothing
|
, result = Nothing
|
||||||
}
|
}
|
||||||
, if settings.id == "" then
|
, if settings.id == "" then
|
||||||
Api.createScanMailbox flags settings SubmitResp
|
Api.createScanMailbox flags settings (SubmitResp True)
|
||||||
|
|
||||||
else
|
else
|
||||||
Api.updateScanMailbox flags settings SubmitResp
|
Api.updateScanMailbox flags settings (SubmitResp True)
|
||||||
)
|
)
|
||||||
|
|
||||||
Comp.ScanMailboxForm.CancelAction ->
|
Comp.ScanMailboxForm.CancelAction ->
|
||||||
@ -140,7 +140,7 @@ update flags msg model =
|
|||||||
| detailModel = Just mm
|
| detailModel = Just mm
|
||||||
, result = Nothing
|
, result = Nothing
|
||||||
}
|
}
|
||||||
, Api.startOnceScanMailbox flags settings SubmitResp
|
, Api.startOnceScanMailbox flags settings (SubmitResp False)
|
||||||
)
|
)
|
||||||
|
|
||||||
Comp.ScanMailboxForm.DeleteAction id ->
|
Comp.ScanMailboxForm.DeleteAction id ->
|
||||||
@ -168,12 +168,24 @@ update flags msg model =
|
|||||||
in
|
in
|
||||||
( { model | detailModel = Just mm }, Cmd.map DetailMsg mc )
|
( { model | detailModel = Just mm }, Cmd.map DetailMsg mc )
|
||||||
|
|
||||||
SubmitResp (Ok res) ->
|
SubmitResp close (Ok res) ->
|
||||||
( { model | result = Just res }
|
( { model
|
||||||
, Cmd.none
|
| result = Just res
|
||||||
|
, detailModel =
|
||||||
|
if close then
|
||||||
|
Nothing
|
||||||
|
|
||||||
|
else
|
||||||
|
model.detailModel
|
||||||
|
}
|
||||||
|
, if close then
|
||||||
|
initCmd flags
|
||||||
|
|
||||||
|
else
|
||||||
|
Cmd.none
|
||||||
)
|
)
|
||||||
|
|
||||||
SubmitResp (Err err) ->
|
SubmitResp _ (Err err) ->
|
||||||
( { model | result = Just (BasicResult False (Util.Http.errorToString err)) }
|
( { model | result = Just (BasicResult False (Util.Http.errorToString err)) }
|
||||||
, Cmd.none
|
, Cmd.none
|
||||||
)
|
)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user