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

Revert "Enable the Catalog as the front page of Share" #314

Merged
merged 1 commit into from
Jan 31, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 1 addition & 7 deletions src/UnisonLocal/App.elm
Original file line number Diff line number Diff line change
Expand Up @@ -785,11 +785,5 @@ view model =
}
in
{ title = "Unison Local"
, body =
[ div [ id "app" ]
[ AppHeader.view appHeader
, PageLayout.view page
, viewModal model
]
]
, body = [ div [ id "app" ] [ AppHeader.view appHeader, PageLayout.view page, viewModal model ] ]
}
13 changes: 6 additions & 7 deletions src/UnisonShare/Route.elm
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,11 @@ import Url.Builder exposing (relative)

{-

URL Scheme for Projects
=======================
Routing
=======

URL Scheme
----------

Directly on the codebase
/[latest|:codebase-hash]/[namespaces|types|terms]/[:namespace-name|:definition-name|:definition-hash]
Expand All @@ -49,14 +51,11 @@ import Url.Builder exposing (relative)
Within a namespace
/[latest|:codebase-hash]/[namespaces]/[:namespace-name]/-/[types|terms]/[:definition-name|:definition-hash]

TODO:
/projects/[:project-name]/-/[namespaces|types|terms]/[:definition-name|:definition-hash]
/projects/[:project-name]/-/[namespaces]/[:namespace-name]/-/[types|terms]/[:definition-name|:definition-hash]

Relative examples
-----------------

Top level of a Codebase: /
Top level of a Codebase: /
Top level of a Codebase: /latest
With namespace context: /latest/namespaces/base/List
Definitions: /latest/[types|terms]/base/List/map
Expand Down Expand Up @@ -186,7 +185,7 @@ fromUrl basePath url =
"/" ++ path

parse url_ =
Result.withDefault Catalog (Parser.run toRoute url_)
Result.withDefault (Project (ByCodebase Relative) ProjectRoot) (Parser.run toRoute url_)
in
url
|> .path
Expand Down
17 changes: 10 additions & 7 deletions tests/UnisonShare/RouteTests.elm
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,16 @@ catalogRoute =
mkUrl "/catalog"
in
Expect.equal Catalog (Route.fromUrl "" url)
, test "Matches root to Catalog" <|
\_ ->
let
url =
mkUrl "/"
in
Expect.equal Catalog (Route.fromUrl "" url)

{- TODO enable when cutting over to catalog
, test "Matches root to Catalog" <|
\_ ->
let
url =
mkUrl "/"
in
Expect.equal Catalog (Route.fromUrl "" url)
-}
]


Expand Down