on master help sign in
Get src/Main.elm compiling again
commit7ddee3332487dc61bcf080789ac9e49dd285ef61 authorEvan Czaplicki <evancz@users.noreply.github.com> dateMon 2 Apr 2018, 19:06 (9 years ago) parenta750191
1 file changed+40−23
ui/browser/src/Main.elm+40−23
ui/browser/src/Main.elm+40−23
@@ -1,29 +1,43 @@
1−module Index.Dashboard exposing
2− ( view
3− )
1+module Main exposing (main)
42
53
4+import Browser
5+import Dict
66import Html exposing (..)
7−import Html.Attributes exposing (class, href, style, title)
7+import Html.Attributes exposing (class, href, src, style, title)
8+import Json.Decode as D
89
9−import Elm.Config as Config exposing (Config)
1010import Elm.License as License
11−import Elm.Repo as Repo exposing (Repo)
12−import Elm.Version as Version exposing (Version)
11+import Elm.Package as Package
12+import Elm.Project as Project
13+import Elm.Version as Version
1314import Index.Icon as Icon
14−import Index.Navigator as Navigator exposing ((</>))
15−import Index.Project as Project exposing (Project, File(..))
1615import Index.Skeleton as Skeleton
1716
1817
1918
19+-- MAIN
20+
21+
22+main : Program () () ()
23+main =
24+ Browser.fullscreen
25+ { init = Debug.crash "init"
26+ , update = Debug.crash "update"
27+ , subscriptions = Debug.crash "subscriptions"
28+ , view = Debug.crash "view"
29+ , onNavigation = Nothing
30+ }
31+
32+
33+
2034-- MODEL
2135
2236
2337type alias Model =
2438 { path : String
2539 , status : ProjectStatus
26− , directory : Status Directory
40+ , directory : DirectoryStatus
2741 }
2842
2943
@@ -33,7 +47,7 @@ type ProjectStatus
3347 | ProjectIsValid
3448 { root : String
3549 , project : Project.Project
36− , exactDeps : List (Package.Name, Version.Version)
50+ , exactDeps : Dict.Dict String Version.Version
3751 }
3852
3953
@@ -66,8 +80,7 @@ type alias File =
6680
6781decoder : D.Decoder Directory
6882decoder =
69− D.map4 Directory
70− (D.field "path" (D.list D.string))
83+ D.map3 Directory
7184 (D.field "dirs" (D.list D.string))
7285 (D.field "files" (D.list fileDecoder))
7386 (D.field "readme" (D.nullable D.string))
@@ -107,18 +120,18 @@ waiting =
107120-- VIEW DIRECTORY
108121
109122
110−viewDirectory : Project -> Directory -> Html msg
111−viewDirectory project directory =
123+viewDirectory : ExactDeps -> Project.Project -> Directory -> Html msg
124+viewDirectory exactDeps project directory =
112125 Skeleton.view
113− [ Navigator.view pwd
114− , section [ class "left-column" ]
126+ -- Navigator.view pwd TODO
127+ [ section [ class "left-column" ]
115128 [ viewFiles directory.dirs directory.files
116129 , viewReadme directory.readme
117130 ]
118131 , section [ class "right-column" ]
119132 [ viewProjectSummary project
120− , viewDeps project
121− , viewTestDeps project
133+ , viewDeps exactDeps project
134+ , viewTestDeps exactDeps project
122135 ]
123136 , div [ style "clear" "both" ] []
124137 ]
@@ -170,7 +183,7 @@ viewFile {name} =
170183viewProjectSummary : Project.Project -> Html msg
171184viewProjectSummary project =
172185 case project of
173− Project.Browser info ->
186+ Project.Application info ->
174187 Skeleton.box
175188 { title = "Source Directories"
176189 , items = List.map (\dir -> [text dir]) info.dirs
@@ -182,7 +195,7 @@ viewProjectSummary project =
182195 Skeleton.box
183196 { title = "Package Info"
184197 , items =
185− [ [ text ("Name: " ++ info.name) ]
198+ [ [ text ("Name: " ++ Package.toString info.name) ]
186199 , [ text ("Version: " ++ Version.toString info.version) ]
187200 , [ text ("License: " ++ License.toString info.license) ]
188201 ]
@@ -194,12 +207,16 @@ viewProjectSummary project =
194207-- VIEW DEPENDENCIES
195208
196209
210+type alias ExactDeps =
211+ Dict.Dict String Version.Version
212+
213+
197214viewDeps : ExactDeps -> Project.Project -> Html msg
198215viewDeps exactDeps project =
199216 let
200217 dependencies =
201218 case project of
202− Project.Browser info ->
219+ Project.Application info ->
203220 List.map (viewDependency exactDeps) info.deps
204221
205222 Project.Package info ->
@@ -217,7 +234,7 @@ viewTestDeps exactDeps project =
217234 let
218235 dependencies =
219236 case project of
220− Project.Browser info ->
237+ Project.Application info ->
221238 List.map (viewDependency exactDeps) info.testDeps
222239
223240 Project.Package info ->