diff --git a/src/App.elm b/src/App.elm index a8097e5..d5f0e8d 100644 --- a/src/App.elm +++ b/src/App.elm @@ -1,18 +1,10 @@ -module App exposing (..) +module App exposing (main) import Config -import Gitlab import Html import Html.Events as Events -import Paginated import Pass import Ports -import RemoteData -import Task - - -type alias ObjectsResponse = - RemoteData.WebData (List Gitlab.Object) type Model @@ -27,7 +19,6 @@ type Msg | UpdatePass Pass.Msg | SaveConfig | Configure - | GotObjects ObjectsResponse main : Program Never Model Msg @@ -75,9 +66,9 @@ update msg model = , Cmd.none ) - ( UpdateConfig update, Configuring cfg ) -> + ( UpdateConfig msg_, Configuring cfg ) -> ( Configuring <| - Config.update update cfg + Config.update msg_ cfg , Cmd.none ) diff --git a/src/Config.elm b/src/Config.elm index b7e2382..3dd9530 100644 --- a/src/Config.elm +++ b/src/Config.elm @@ -1,4 +1,13 @@ -module Config exposing (..) +module Config + exposing + ( Msg + , init + , fromGitlab + , toClient + , toRepo + , update + , view + ) import Gitlab import Html diff --git a/src/Gitlab.elm b/src/Gitlab.elm index 92ff062..ddc30bd 100644 --- a/src/Gitlab.elm +++ b/src/Gitlab.elm @@ -1,4 +1,4 @@ -module Gitlab exposing (..) +module Gitlab exposing (Client, Repo, getFiles) import Http import Json.Decode exposing (Decoder) @@ -9,11 +9,6 @@ import RemoteData exposing (WebData) import Task exposing (Task) -type Msg - = FetchFiles - | AddFiles (Result Http.Error (List Object)) - - type alias Client = { url : String , token : Maybe String diff --git a/src/Pass.elm b/src/Pass.elm index e8f3e1f..00eb302 100644 --- a/src/Pass.elm +++ b/src/Pass.elm @@ -1,4 +1,11 @@ -module Pass exposing (..) +module Pass + exposing + ( Msg + , Model + , init + , update + , view + ) import Dict exposing (Dict) import Gitlab @@ -6,7 +13,6 @@ import Html exposing (Html) import Html.Attributes as Attr import Html.Events as Events import Maybe.Extra -import Paginated import Regex import RemoteData exposing (WebData) import Task @@ -66,7 +72,7 @@ fromFilename filename = toFilename : Pass -> String toFilename pass = - (String.join "/" pass) ++ ".gpg" + String.join "/" pass ++ ".gpg" update : Msg -> Model -> ( Model, Cmd Msg ) @@ -115,11 +121,11 @@ filter search entries = regex = Regex.caseInsensitive (Regex.regex search) - matches : String -> Pass -> Bool - matches search entry = + matches : Pass -> Bool + matches entry = List.any (Regex.contains regex) entry in - List.filter (matches search) entries + List.filter matches entries viewPass : Pass -> Html Msg diff --git a/src/Ports.elm b/src/Ports.elm index 5f6fc80..8eba8af 100644 --- a/src/Ports.elm +++ b/src/Ports.elm @@ -1,4 +1,10 @@ -port module Ports exposing (..) +port module Ports + exposing + ( Config + , loadConfig + , saveConfig + , config + ) type alias Config =