mirror of
https://github.com/jhillyerd/inbucket.git
synced 2025-12-17 09:37:02 +00:00
ui: Reformat with elm-format 0.8.1
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
module Data.Date exposing (..)
|
||||
module Data.Date exposing (date)
|
||||
|
||||
import Date exposing (Date)
|
||||
import Json.Decode as Decode exposing (..)
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
module Data.Message exposing (..)
|
||||
module Data.Message exposing (Attachment, Message, attachmentDecoder, decoder)
|
||||
|
||||
import Data.Date exposing (date)
|
||||
import Date exposing (Date)
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
module Data.MessageHeader exposing (..)
|
||||
module Data.MessageHeader exposing (MessageHeader, decoder)
|
||||
|
||||
import Data.Date exposing (date)
|
||||
import Date exposing (Date)
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
module Data.Metrics exposing (..)
|
||||
module Data.Metrics exposing (Metrics, decodeIntList, decoder)
|
||||
|
||||
import Json.Decode as Decode exposing (..)
|
||||
import Json.Decode.Pipeline exposing (..)
|
||||
|
||||
@@ -1,14 +1,13 @@
|
||||
module Data.Session
|
||||
exposing
|
||||
( Msg(..)
|
||||
, Persistent
|
||||
, Session
|
||||
, decodeValueWithDefault
|
||||
, decoder
|
||||
, init
|
||||
, none
|
||||
, update
|
||||
)
|
||||
module Data.Session exposing
|
||||
( Msg(..)
|
||||
, Persistent
|
||||
, Session
|
||||
, decodeValueWithDefault
|
||||
, decoder
|
||||
, init
|
||||
, none
|
||||
, update
|
||||
)
|
||||
|
||||
import Json.Decode as Decode exposing (..)
|
||||
import Json.Decode.Pipeline exposing (..)
|
||||
@@ -63,6 +62,7 @@ update msg session =
|
||||
AddRecent mailbox ->
|
||||
if List.head session.persistent.recentMailboxes == Just mailbox then
|
||||
session
|
||||
|
||||
else
|
||||
let
|
||||
recent =
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
module HttpUtil exposing (..)
|
||||
module HttpUtil exposing (delete, errorString, patch)
|
||||
|
||||
import Http
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
module Main exposing (..)
|
||||
module Main exposing (Model, Msg(..), Page(..), applySession, init, main, pageSubscriptions, sessionChange, setRoute, subscriptions, update, updatePage, view)
|
||||
|
||||
import Data.Session as Session exposing (Session, decoder)
|
||||
import Html exposing (..)
|
||||
@@ -13,6 +13,7 @@ import Route exposing (Route)
|
||||
import Views.Page as Page exposing (ActivePage(..), frame)
|
||||
|
||||
|
||||
|
||||
-- MODEL
|
||||
|
||||
|
||||
@@ -112,6 +113,7 @@ update msg model =
|
||||
-- Responds to new browser URL.
|
||||
if model.session.routing then
|
||||
setRoute route model
|
||||
|
||||
else
|
||||
-- Skip once, but re-enable routing.
|
||||
( model, Cmd.none, Session.EnableRouting )
|
||||
@@ -256,6 +258,7 @@ applySession ( model, cmd, sessionMsg ) =
|
||||
if session.persistent == model.session.persistent then
|
||||
-- No change
|
||||
( newModel, cmd )
|
||||
|
||||
else
|
||||
( newModel
|
||||
, Cmd.batch [ cmd, Ports.storeSession session.persistent ]
|
||||
|
||||
@@ -9,6 +9,7 @@ import Json.Encode as Encode
|
||||
import Ports
|
||||
|
||||
|
||||
|
||||
-- MODEL --
|
||||
|
||||
|
||||
|
||||
@@ -31,6 +31,7 @@ import Task
|
||||
import Time exposing (Time)
|
||||
|
||||
|
||||
|
||||
-- MODEL
|
||||
|
||||
|
||||
@@ -105,6 +106,7 @@ subscriptions model =
|
||||
ShowingList _ (ShowingMessage { message }) ->
|
||||
if message.seen then
|
||||
Sub.none
|
||||
|
||||
else
|
||||
Time.every (250 * Time.millisecond) SeenTick
|
||||
|
||||
@@ -212,6 +214,7 @@ update session msg model =
|
||||
ShowingList list (ShowingMessage visible) ->
|
||||
if visible.message.seen then
|
||||
( model, Cmd.none, Session.none )
|
||||
|
||||
else
|
||||
-- Set delay before reporting message as seen to backend.
|
||||
( { model
|
||||
@@ -246,6 +249,7 @@ update session msg model =
|
||||
Just deadline ->
|
||||
if now >= deadline then
|
||||
updateMarkMessageSeen model message
|
||||
|
||||
else
|
||||
( model, Cmd.none, Session.none )
|
||||
|
||||
@@ -267,6 +271,7 @@ updateMessageResult model message =
|
||||
bodyMode =
|
||||
if message.html == "" then
|
||||
TextBody
|
||||
|
||||
else
|
||||
model.bodyMode
|
||||
in
|
||||
@@ -313,6 +318,7 @@ updateSearchInput model searchInput =
|
||||
searchFilter =
|
||||
if String.length searchInput > 1 then
|
||||
String.toLower searchInput
|
||||
|
||||
else
|
||||
""
|
||||
in
|
||||
@@ -393,6 +399,7 @@ updateMarkMessageSeen model message =
|
||||
updateSeen header =
|
||||
if header.id == message.id then
|
||||
{ header | seen = True }
|
||||
|
||||
else
|
||||
header
|
||||
|
||||
@@ -568,6 +575,7 @@ messageBody message bodyMode =
|
||||
tabs =
|
||||
if message.html == "" then
|
||||
[ plainText ]
|
||||
|
||||
else
|
||||
[ safeHtml, plainText ]
|
||||
in
|
||||
@@ -592,6 +600,7 @@ attachments message =
|
||||
in
|
||||
if List.isEmpty message.attachments then
|
||||
div [] []
|
||||
|
||||
else
|
||||
table [ class "attachments well" ] (List.map (attachmentRow baseUrl) message.attachments)
|
||||
|
||||
@@ -645,6 +654,7 @@ filterMessageList : MessageList -> List MessageHeader
|
||||
filterMessageList list =
|
||||
if list.searchFilter == "" then
|
||||
list.headers
|
||||
|
||||
else
|
||||
let
|
||||
matches header =
|
||||
|
||||
@@ -20,6 +20,7 @@ import Ports
|
||||
import Route
|
||||
|
||||
|
||||
|
||||
-- MODEL
|
||||
|
||||
|
||||
@@ -104,6 +105,7 @@ view session model =
|
||||
[ text
|
||||
(if model.connected then
|
||||
"Connected."
|
||||
|
||||
else
|
||||
"Disconnected!"
|
||||
)
|
||||
|
||||
@@ -12,6 +12,7 @@ import Svg.Attributes as SvgAttrib
|
||||
import Time exposing (Time)
|
||||
|
||||
|
||||
|
||||
-- MODEL --
|
||||
|
||||
|
||||
@@ -381,6 +382,7 @@ zeroPadList numbers =
|
||||
in
|
||||
if needed > 0 then
|
||||
List.repeat needed 0 ++ numbers
|
||||
|
||||
else
|
||||
numbers
|
||||
|
||||
@@ -394,6 +396,7 @@ fmtInt n =
|
||||
thousands str =
|
||||
if String.length str <= 3 then
|
||||
str
|
||||
|
||||
else
|
||||
thousands (String.slice 0 -3 str) ++ "," ++ String.right 3 str
|
||||
in
|
||||
|
||||
@@ -1,11 +1,10 @@
|
||||
port module Ports
|
||||
exposing
|
||||
( monitorCommand
|
||||
, monitorMessage
|
||||
, onSessionChange
|
||||
, storeSession
|
||||
, windowTitle
|
||||
)
|
||||
port module Ports exposing
|
||||
( monitorCommand
|
||||
, monitorMessage
|
||||
, onSessionChange
|
||||
, storeSession
|
||||
, windowTitle
|
||||
)
|
||||
|
||||
import Data.Session exposing (Persistent)
|
||||
import Json.Encode exposing (Value)
|
||||
|
||||
@@ -75,6 +75,7 @@ fromLocation : Location -> Route
|
||||
fromLocation location =
|
||||
if String.isEmpty location.hash then
|
||||
Home
|
||||
|
||||
else
|
||||
case parseHash matcher location of
|
||||
Nothing ->
|
||||
|
||||
@@ -91,6 +91,7 @@ navbarRecent page controls =
|
||||
title =
|
||||
if active then
|
||||
controls.recentActive
|
||||
|
||||
else
|
||||
"Recent Mailboxes"
|
||||
|
||||
@@ -98,6 +99,7 @@ navbarRecent page controls =
|
||||
items =
|
||||
if active then
|
||||
List.tail controls.recentOptions |> Maybe.withDefault []
|
||||
|
||||
else
|
||||
controls.recentOptions
|
||||
in
|
||||
|
||||
@@ -1,9 +1,10 @@
|
||||
module Tests exposing (..)
|
||||
module Tests exposing (all)
|
||||
|
||||
import Expect
|
||||
import Test exposing (..)
|
||||
|
||||
|
||||
|
||||
-- Check out http://package.elm-lang.org/packages/elm-community/elm-test/latest to learn more about testing in Elm!
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user