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

Commit 9a5b783

Browse files
authored
Merge pull request #315 from unisonweb/revert-314-revert-301-front-page-catalog
Revert "Revert "Enable the Catalog as the front page of Share""
2 parents 244cc58 + e7a5c1e commit 9a5b783

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
@@ -38,11 +38,9 @@ import Url.Builder exposing (relative)
3838

3939
{-
4040
41-
Routing
42-
=======
41+
URL Scheme for Projects
42+
=======================
4343
44-
URL Scheme
45-
----------
4644
4745
Directly on the codebase
4846
/[latest|:codebase-hash]/[namespaces|types|terms]/[:namespace-name|:definition-name|:definition-hash]
@@ -51,11 +49,14 @@ import Url.Builder exposing (relative)
5149
Within a namespace
5250
/[latest|:codebase-hash]/[namespaces]/[:namespace-name]/-/[types|terms]/[:definition-name|:definition-hash]
5351
52+
TODO:
53+
/projects/[:project-name]/-/[namespaces|types|terms]/[:definition-name|:definition-hash]
54+
/projects/[:project-name]/-/[namespaces]/[:namespace-name]/-/[types|terms]/[:definition-name|:definition-hash]
5455
5556
Relative examples
5657
-----------------
5758
58-
Top level of a Codebase: /
59+
Top level of a Codebase: /
5960
Top level of a Codebase: /latest
6061
With namespace context: /latest/namespaces/base/List
6162
Definitions: /latest/[types|terms]/base/List/map
@@ -185,7 +186,7 @@ fromUrl basePath url =
185186
"/" ++ path
186187

187188
parse url_ =
188-
Result.withDefault (Project (ByCodebase Relative) ProjectRoot) (Parser.run toRoute url_)
189+
Result.withDefault Catalog (Parser.run toRoute url_)
189190
in
190191
url
191192
|> .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)