-
Notifications
You must be signed in to change notification settings - Fork 17
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
enhance: more consistent patterns generated by elm-land (#781)
- Loading branch information
Showing
14 changed files
with
1,661 additions
and
1,070 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,80 @@ | ||
{-- | ||
SPDX-License-Identifier: Apache-2.0 | ||
--} | ||
|
||
|
||
module Pages.Account.Authenticate exposing (Model, Msg, page) | ||
|
||
import Dict | ||
import Effect exposing (Effect) | ||
import Page exposing (Page) | ||
import Route exposing (Route) | ||
import Shared | ||
import View exposing (View) | ||
|
||
|
||
page : Shared.Model -> Route () -> Page Model Msg | ||
page shared route = | ||
Page.new | ||
{ init = init route | ||
, update = update | ||
, subscriptions = subscriptions | ||
, view = view | ||
} | ||
|
||
|
||
|
||
-- INIT | ||
|
||
|
||
type alias Model = | ||
{} | ||
|
||
|
||
init : Route () -> () -> ( Model, Effect Msg ) | ||
init route () = | ||
let | ||
code = | ||
Dict.get "code" route.query | ||
|
||
state = | ||
Dict.get "state" route.query | ||
in | ||
( {} | ||
, Effect.finishAuthentication { code = code, state = state } | ||
) | ||
|
||
|
||
|
||
-- UPDATE | ||
|
||
|
||
type Msg | ||
= NoOp | ||
|
||
|
||
update : Msg -> Model -> ( Model, Effect Msg ) | ||
update msg model = | ||
case msg of | ||
NoOp -> | ||
( model | ||
, Effect.none | ||
) | ||
|
||
|
||
|
||
-- SUBSCRIPTIONS | ||
|
||
|
||
subscriptions : Model -> Sub Msg | ||
subscriptions model = | ||
Sub.none | ||
|
||
|
||
|
||
-- VIEW | ||
|
||
|
||
view : Model -> View Msg | ||
view model = | ||
View.none |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,73 @@ | ||
{-- | ||
SPDX-License-Identifier: Apache-2.0 | ||
--} | ||
|
||
|
||
module Pages.Account.Logout exposing (Model, Msg, page) | ||
|
||
import Dict | ||
import Effect exposing (Effect) | ||
import Page exposing (Page) | ||
import Route exposing (Route) | ||
import Shared | ||
import View exposing (View) | ||
|
||
|
||
page : Shared.Model -> Route () -> Page Model Msg | ||
page shared route = | ||
Page.new | ||
{ init = init route | ||
, update = update | ||
, subscriptions = subscriptions | ||
, view = view | ||
} | ||
|
||
|
||
|
||
-- INIT | ||
|
||
|
||
type alias Model = | ||
{} | ||
|
||
|
||
init : Route () -> () -> ( Model, Effect Msg ) | ||
init route () = | ||
( {} | ||
, Effect.logout { from = Dict.get "from" route.query } | ||
) | ||
|
||
|
||
|
||
-- UPDATE | ||
|
||
|
||
type Msg | ||
= NoOp | ||
|
||
|
||
update : Msg -> Model -> ( Model, Effect Msg ) | ||
update msg model = | ||
case msg of | ||
NoOp -> | ||
( model | ||
, Effect.none | ||
) | ||
|
||
|
||
|
||
-- SUBSCRIPTIONS | ||
|
||
|
||
subscriptions : Model -> Sub Msg | ||
subscriptions model = | ||
Sub.none | ||
|
||
|
||
|
||
-- VIEW | ||
|
||
|
||
view : Model -> View Msg | ||
view model = | ||
View.none |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,78 @@ | ||
{-- | ||
SPDX-License-Identifier: Apache-2.0 | ||
--} | ||
|
||
|
||
module Pages.Org_.Repo_.Pulls exposing (Model, Msg, page) | ||
|
||
import Dict | ||
import Effect exposing (Effect) | ||
import Page exposing (Page) | ||
import Route exposing (Route) | ||
import Route.Path | ||
import Shared | ||
import View exposing (View) | ||
|
||
|
||
page : Shared.Model -> Route { org : String, repo : String } -> Page Model Msg | ||
page shared route = | ||
Page.new | ||
{ init = init route | ||
, update = update | ||
, subscriptions = subscriptions | ||
, view = view | ||
} | ||
|
||
|
||
|
||
-- INIT | ||
|
||
|
||
type alias Model = | ||
{} | ||
|
||
|
||
init : Route { org : String, repo : String } -> () -> ( Model, Effect Msg ) | ||
init route () = | ||
( {} | ||
, Effect.replaceRoute <| | ||
{ path = Route.Path.Org__Repo_ route.params | ||
, query = Dict.fromList [ ( "event", "pull_request" ) ] | ||
, hash = Nothing | ||
} | ||
) | ||
|
||
|
||
|
||
-- UPDATE | ||
|
||
|
||
type Msg | ||
= NoOp | ||
|
||
|
||
update : Msg -> Model -> ( Model, Effect Msg ) | ||
update msg model = | ||
case msg of | ||
NoOp -> | ||
( model | ||
, Effect.none | ||
) | ||
|
||
|
||
|
||
-- SUBSCRIPTIONS | ||
|
||
|
||
subscriptions : Model -> Sub Msg | ||
subscriptions model = | ||
Sub.none | ||
|
||
|
||
|
||
-- VIEW | ||
|
||
|
||
view : Model -> View Msg | ||
view model = | ||
View.none |
Oops, something went wrong.