Skip to content
This repository was archived by the owner on Jul 19, 2022. It is now read-only.

Commit cb4ce4e

Browse files
committed
Enable the Catalog as the front page of Share
1 parent b0c2fe6 commit cb4ce4e

File tree

3 files changed

+21
-17
lines changed

3 files changed

+21
-17
lines changed

src/UnisonLocal/App.elm

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -785,5 +785,11 @@ view model =
785785
}
786786
in
787787
{ title = "Unison Local"
788-
, body = [ div [ id "app" ] [ AppHeader.view appHeader, PageLayout.view page, viewModal model ] ]
788+
, body =
789+
[ div [ id "app" ]
790+
[ AppHeader.view appHeader
791+
, PageLayout.view page
792+
, viewModal model
793+
]
794+
]
789795
}

src/UnisonShare/Route.elm

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -36,11 +36,9 @@ import Url.Builder exposing (relative)
3636

3737
{-
3838
39-
Routing
40-
=======
39+
URL Scheme for Projects
40+
=======================
4141
42-
URL Scheme
43-
----------
4442
4543
Directly on the codebase
4644
/[latest|:codebase-hash]/[namespaces|types|terms]/[:namespace-name|:definition-name|:definition-hash]
@@ -49,11 +47,14 @@ import Url.Builder exposing (relative)
4947
Within a namespace
5048
/[latest|:codebase-hash]/[namespaces]/[:namespace-name]/-/[types|terms]/[:definition-name|:definition-hash]
5149
50+
TODO:
51+
/projects/[:project-name]/-/[namespaces|types|terms]/[:definition-name|:definition-hash]
52+
/projects/[:project-name]/-/[namespaces]/[:namespace-name]/-/[types|terms]/[:definition-name|:definition-hash]
5253
5354
Relative examples
5455
-----------------
5556
56-
Top level of a Codebase: /
57+
Top level of a Codebase: /
5758
Top level of a Codebase: /latest
5859
With namespace context: /latest/namespaces/base/List
5960
Definitions: /latest/[types|terms]/base/List/map
@@ -183,7 +184,7 @@ fromUrl basePath url =
183184
"/" ++ path
184185

185186
parse url_ =
186-
Result.withDefault (Project (ByCodebase Relative) ProjectRoot) (Parser.run toRoute url_)
187+
Result.withDefault Catalog (Parser.run toRoute url_)
187188
in
188189
url
189190
|> .path

tests/UnisonShare/RouteTests.elm

Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -21,16 +21,13 @@ catalogRoute =
2121
mkUrl "/catalog"
2222
in
2323
Expect.equal Catalog (Route.fromUrl "" url)
24-
25-
{- TODO enable when cutting over to catalog
26-
, test "Matches root to Catalog" <|
27-
\_ ->
28-
let
29-
url =
30-
mkUrl "/"
31-
in
32-
Expect.equal Catalog (Route.fromUrl "" url)
33-
-}
24+
, test "Matches root to Catalog" <|
25+
\_ ->
26+
let
27+
url =
28+
mkUrl "/"
29+
in
30+
Expect.equal Catalog (Route.fromUrl "" url)
3431
]
3532

3633

0 commit comments

Comments
 (0)