diff --git a/ruby_event_store-browser/elm/src/Main.elm b/ruby_event_store-browser/elm/src/Main.elm index 6e9cc5c776..5327d43ac2 100644 --- a/ruby_event_store-browser/elm/src/Main.elm +++ b/ruby_event_store-browser/elm/src/Main.elm @@ -56,6 +56,7 @@ type Page = NotFound | ShowEvent Page.ShowEvent.Model | ShowStream Page.ShowStream.Model + | Debug subscriptions : Model -> Sub Msg @@ -213,6 +214,9 @@ navigate model location = Nothing -> ( { model | page = NotFound }, Cmd.none ) + Just (Route.Debug) -> + ( { model | page = Debug }, Cmd.none ) + Nothing -> ( { model | page = NotFound }, Cmd.none ) @@ -265,5 +269,8 @@ viewPage page selectedTime = in ( Just title, Html.map GotShowEventMsg content ) + Debug -> + ( Just "Debug", text "to be filled with some helpful content" ) + NotFound -> ( Nothing, Layout.viewNotFound ) diff --git a/ruby_event_store-browser/elm/src/Route.elm b/ruby_event_store-browser/elm/src/Route.elm index e50aa6a95d..6aa7599145 100644 --- a/ruby_event_store-browser/elm/src/Route.elm +++ b/ruby_event_store-browser/elm/src/Route.elm @@ -12,6 +12,7 @@ import Url.Parser.Query as Query type Route = BrowseEvents String Pagination.Specification | ShowEvent String + | Debug decodeLocation : Url.Url -> Url.Url -> Maybe Route @@ -25,6 +26,7 @@ routeParser = [ Url.Parser.map (BrowseEvents "all" Pagination.empty) Url.Parser.top , Url.Parser.map browseEvents (Url.Parser.s "streams" Url.Parser.string Query.string "page[position]" Query.string "page[direction]" Query.string "page[count]") , Url.Parser.map ShowEvent (Url.Parser.s "events" Url.Parser.string) + , Url.Parser.map Debug (Url.Parser.s "debug" Url.Parser.top) ] diff --git a/ruby_event_store-browser/lib/ruby_event_store/browser/app.rb b/ruby_event_store-browser/lib/ruby_event_store/browser/app.rb index 311cf15244..f3ec163948 100644 --- a/ruby_event_store-browser/lib/ruby_event_store/browser/app.rb +++ b/ruby_event_store-browser/lib/ruby_event_store/browser/app.rb @@ -101,7 +101,7 @@ def call(env) ) end - %w[/ /events/:event_id /streams/:stream_name].each do |starting_route| + %w[/ /events/:event_id /streams/:stream_name /debug].each do |starting_route| router.add_route("GET", starting_route) do |_, urls| erb bootstrap_html, browser_js_src: urls.browser_js_url,