mirror of
https://github.com/TheAnachronism/docspell.git
synced 2025-06-22 02:18:26 +00:00
Change webapp to support multiple scan-mailbox tasks
This commit is contained in:
@ -9,7 +9,7 @@ import Comp.ChangePasswordForm
|
||||
import Comp.EmailSettingsManage
|
||||
import Comp.ImapSettingsManage
|
||||
import Comp.NotificationForm
|
||||
import Comp.ScanMailboxForm
|
||||
import Comp.ScanMailboxManage
|
||||
import Data.Flags exposing (Flags)
|
||||
|
||||
|
||||
@ -19,7 +19,7 @@ type alias Model =
|
||||
, emailSettingsModel : Comp.EmailSettingsManage.Model
|
||||
, imapSettingsModel : Comp.ImapSettingsManage.Model
|
||||
, notificationModel : Comp.NotificationForm.Model
|
||||
, scanMailboxModel : Comp.ScanMailboxForm.Model
|
||||
, scanMailboxModel : Comp.ScanMailboxManage.Model
|
||||
}
|
||||
|
||||
|
||||
@ -30,7 +30,7 @@ emptyModel flags =
|
||||
, emailSettingsModel = Comp.EmailSettingsManage.emptyModel
|
||||
, imapSettingsModel = Comp.ImapSettingsManage.emptyModel
|
||||
, notificationModel = Tuple.first (Comp.NotificationForm.init flags)
|
||||
, scanMailboxModel = Tuple.first (Comp.ScanMailboxForm.init flags)
|
||||
, scanMailboxModel = Tuple.first (Comp.ScanMailboxManage.init flags)
|
||||
}
|
||||
|
||||
|
||||
@ -48,4 +48,4 @@ type Msg
|
||||
| EmailSettingsMsg Comp.EmailSettingsManage.Msg
|
||||
| NotificationMsg Comp.NotificationForm.Msg
|
||||
| ImapSettingsMsg Comp.ImapSettingsManage.Msg
|
||||
| ScanMailboxMsg Comp.ScanMailboxForm.Msg
|
||||
| ScanMailboxMsg Comp.ScanMailboxManage.Msg
|
||||
|
@ -4,7 +4,7 @@ import Comp.ChangePasswordForm
|
||||
import Comp.EmailSettingsManage
|
||||
import Comp.ImapSettingsManage
|
||||
import Comp.NotificationForm
|
||||
import Comp.ScanMailboxForm
|
||||
import Comp.ScanMailboxManage
|
||||
import Data.Flags exposing (Flags)
|
||||
import Page.UserSettings.Data exposing (..)
|
||||
|
||||
@ -48,7 +48,7 @@ update flags msg model =
|
||||
let
|
||||
initCmd =
|
||||
Cmd.map ScanMailboxMsg
|
||||
(Tuple.second (Comp.ScanMailboxForm.init flags))
|
||||
(Tuple.second (Comp.ScanMailboxManage.init flags))
|
||||
in
|
||||
( m, initCmd )
|
||||
in
|
||||
@ -87,7 +87,7 @@ update flags msg model =
|
||||
ScanMailboxMsg lm ->
|
||||
let
|
||||
( m2, c2 ) =
|
||||
Comp.ScanMailboxForm.update flags lm model.scanMailboxModel
|
||||
Comp.ScanMailboxManage.update flags lm model.scanMailboxModel
|
||||
in
|
||||
( { model | scanMailboxModel = m2 }
|
||||
, Cmd.map ScanMailboxMsg c2
|
||||
|
@ -4,7 +4,7 @@ import Comp.ChangePasswordForm
|
||||
import Comp.EmailSettingsManage
|
||||
import Comp.ImapSettingsManage
|
||||
import Comp.NotificationForm
|
||||
import Comp.ScanMailboxForm
|
||||
import Comp.ScanMailboxManage
|
||||
import Html exposing (..)
|
||||
import Html.Attributes exposing (..)
|
||||
import Html.Events exposing (onClick)
|
||||
@ -45,7 +45,7 @@ view model =
|
||||
viewImapSettings model
|
||||
|
||||
Just ScanMailboxTab ->
|
||||
viewScanMailboxForm model
|
||||
viewScanMailboxManage model
|
||||
|
||||
Nothing ->
|
||||
[]
|
||||
@ -126,8 +126,8 @@ viewNotificationForm model =
|
||||
]
|
||||
|
||||
|
||||
viewScanMailboxForm : Model -> List (Html Msg)
|
||||
viewScanMailboxForm model =
|
||||
viewScanMailboxManage : Model -> List (Html Msg)
|
||||
viewScanMailboxManage model =
|
||||
[ h2 [ class "ui header" ]
|
||||
[ i [ class "ui envelope open outline icon" ] []
|
||||
, div [ class "content" ]
|
||||
@ -151,5 +151,7 @@ viewScanMailboxForm model =
|
||||
again."""
|
||||
]
|
||||
, Html.map ScanMailboxMsg
|
||||
(Comp.ScanMailboxForm.view "segment" model.scanMailboxModel)
|
||||
(Comp.ScanMailboxManage.view
|
||||
model.scanMailboxModel
|
||||
)
|
||||
]
|
||||
|
Reference in New Issue
Block a user