Skip to content

Commit

Permalink
refactor: moved Pager into Components
Browse files Browse the repository at this point in the history
  • Loading branch information
plyr4 committed Jan 18, 2024
1 parent 646a678 commit c16b802
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 19 deletions.
2 changes: 1 addition & 1 deletion src/elm/Pager.elm → src/elm/Components/Pager.elm
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ SPDX-License-Identifier: Apache-2.0
--}


module Pager exposing (defaultLabels, prevNextLabels, view)
module Components.Pager exposing (defaultLabels, prevNextLabels, view)

import Api.Pagination as Pagination
import FeatherIcons
Expand Down
34 changes: 17 additions & 17 deletions src/elm/Main.elm
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ import Browser.Events exposing (Visibility(..))
import Browser.Navigation
import Components.Alerts as Alerts exposing (Alert)
import Components.Favorites as Favorites exposing (addFavorite, toFavorite, toggleFavorite)
import Components.Pager
import Dict
import Effect exposing (Effect)
import FeatherIcons
Expand Down Expand Up @@ -65,7 +66,6 @@ import Maybe
import Maybe.Extra exposing (unwrap)
import Organization
import Page
import Pager
import Pages exposing (Page)
import Pages.Account.Login_
import Pages.Account.Settings_
Expand Down Expand Up @@ -5855,24 +5855,24 @@ viewPageUNUSED model =
Pages.OrgRepositories org maybePage _ ->
( org ++ Util.pageToString maybePage
, div []
[ Pager.view model.shared.repo.orgRepos.pager Pager.prevNextLabels GotoPage
[ Components.Pager.view model.shared.repo.orgRepos.pager Components.Pager.prevNextLabels GotoPage
, lazy2 Organization.viewOrgRepos org model.shared.repo.orgRepos
, Pager.view model.shared.repo.orgRepos.pager Pager.prevNextLabels GotoPage
, Components.Pager.view model.shared.repo.orgRepos.pager Components.Pager.prevNextLabels GotoPage
]
)

Pages.Hooks org repo maybePage _ ->
( String.join "/" [ org, repo ] ++ " hooks" ++ Util.pageToString maybePage
, div []
[ Pager.view model.shared.repo.hooks.pager Pager.defaultLabels GotoPage
[ Components.Pager.view model.shared.repo.hooks.pager Components.Pager.defaultLabels GotoPage
, lazy2 Pages.Hooks.view
{ hooks = model.shared.repo.hooks
, time = model.shared.time
, org = model.shared.repo.org
, repo = model.shared.repo.name
}
RedeliverHook
, Pager.view model.shared.repo.hooks.pager Pager.defaultLabels GotoPage
, Components.Pager.view model.shared.repo.hooks.pager Components.Pager.defaultLabels GotoPage
]
)

Expand All @@ -5893,7 +5893,7 @@ viewPageUNUSED model =
( String.join "/" [ org ] ++ " " ++ engine ++ " org secrets" ++ Util.pageToString maybePage
, div []
[ Html.map SecretsUpdate <| lazy3 Pages.Secrets.View.viewOrgSecrets model False True
, Pager.view model.secretsModel.orgSecretsPager Pager.prevNextLabels GotoPage
, Components.Pager.view model.secretsModel.orgSecretsPager Components.Pager.prevNextLabels GotoPage
, Html.map SecretsUpdate <| lazy3 Pages.Secrets.View.viewSharedSecrets model True False
]
)
Expand All @@ -5902,7 +5902,7 @@ viewPageUNUSED model =
( String.join "/" [ org, team ] ++ " " ++ engine ++ " shared secrets"
, div []
[ Html.map SecretsUpdate <| lazy3 Pages.Secrets.View.viewSharedSecrets model False True
, Pager.view model.secretsModel.sharedSecretsPager Pager.prevNextLabels GotoPage
, Components.Pager.view model.secretsModel.sharedSecretsPager Components.Pager.prevNextLabels GotoPage
]
)

Expand Down Expand Up @@ -5950,7 +5950,7 @@ viewPageUNUSED model =
( String.join "/" [ org, repo ] ++ " deployments" ++ Util.pageToString maybePage
, div []
[ lazy3 Pages.Deployments.View.viewDeployments model.shared.repo org repo
, Pager.view model.shared.repo.deployments.pager Pager.defaultLabels GotoPage
, Components.Pager.view model.shared.repo.deployments.pager Components.Pager.defaultLabels GotoPage
]
)

Expand All @@ -5968,7 +5968,7 @@ viewPageUNUSED model =
let
viewPager =
if Util.checkScheduleAllowlist org repo model.shared.velaScheduleAllowlist then
Pager.view model.schedulesModel.pager Pager.defaultLabels GotoPage
Components.Pager.view model.schedulesModel.pager Components.Pager.defaultLabels GotoPage

else
text ""
Expand Down Expand Up @@ -6006,9 +6006,9 @@ viewPageUNUSED model =
[ viewBuildsFilter shouldRenderFilter org repo maybeEvent
, viewTimeToggle shouldRenderFilter model.shared.repo.builds.showTimestamp
]
, Pager.view model.shared.repo.builds.pager Pager.defaultLabels GotoPage
, Components.Pager.view model.shared.repo.builds.pager Components.Pager.defaultLabels GotoPage
, lazy7 Organization.viewBuilds model.shared.repo.builds buildMsgs model.shared.buildMenuOpen model.shared.time model.shared.zone org maybeEvent
, Pager.view model.shared.repo.builds.pager Pager.defaultLabels GotoPage
, Components.Pager.view model.shared.repo.builds.pager Components.Pager.defaultLabels GotoPage
]
)

Expand All @@ -6035,9 +6035,9 @@ viewPageUNUSED model =
[ viewBuildsFilter shouldRenderFilter org repo maybeEvent
, viewTimeToggle shouldRenderFilter model.shared.repo.builds.showTimestamp
]
, Pager.view model.shared.repo.builds.pager Pager.defaultLabels GotoPage
, Components.Pager.view model.shared.repo.builds.pager Components.Pager.defaultLabels GotoPage
, lazy8 Pages.Builds.view model.shared.repo.builds buildMsgs model.shared.buildMenuOpen model.shared.time model.shared.zone org repo maybeEvent
, Pager.view model.shared.repo.builds.pager Pager.defaultLabels GotoPage
, Components.Pager.view model.shared.repo.builds.pager Components.Pager.defaultLabels GotoPage
]
)

Expand All @@ -6064,9 +6064,9 @@ viewPageUNUSED model =
[ viewBuildsFilter shouldRenderFilter org repo (Just "pull_request")
, viewTimeToggle shouldRenderFilter model.shared.repo.builds.showTimestamp
]
, Pager.view model.shared.repo.builds.pager Pager.defaultLabels GotoPage
, Components.Pager.view model.shared.repo.builds.pager Components.Pager.defaultLabels GotoPage
, lazy8 Pages.Builds.view model.shared.repo.builds buildMsgs model.shared.buildMenuOpen model.shared.time model.shared.zone org repo (Just "pull_request")
, Pager.view model.shared.repo.builds.pager Pager.defaultLabels GotoPage
, Components.Pager.view model.shared.repo.builds.pager Components.Pager.defaultLabels GotoPage
]
)

Expand All @@ -6093,9 +6093,9 @@ viewPageUNUSED model =
[ viewBuildsFilter shouldRenderFilter org repo (Just "tag")
, viewTimeToggle shouldRenderFilter model.shared.repo.builds.showTimestamp
]
, Pager.view model.shared.repo.builds.pager Pager.defaultLabels GotoPage
, Components.Pager.view model.shared.repo.builds.pager Components.Pager.defaultLabels GotoPage
, lazy8 Pages.Builds.view model.shared.repo.builds buildMsgs model.shared.buildMenuOpen model.shared.time model.shared.zone org repo (Just "tag")
, Pager.view model.shared.repo.builds.pager Pager.defaultLabels GotoPage
, Components.Pager.view model.shared.repo.builds.pager Components.Pager.defaultLabels GotoPage
]
)

Expand Down
2 changes: 1 addition & 1 deletion src/elm/Pages/Org_/Repo_/Deployments_.elm
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ module Pages.Org_.Repo_.Deployments_ exposing (..)

import Api.Pagination
import Auth
import Components.Pager
import Components.Svgs as SvgBuilder
import Components.Table as Table
import Effect exposing (Effect)
Expand Down Expand Up @@ -34,7 +35,6 @@ import Http.Detailed
import Layouts
import List
import Page exposing (Page)
import Pager
import RemoteData exposing (RemoteData(..), WebData)
import Route exposing (Route)
import Routes
Expand Down

0 comments on commit c16b802

Please sign in to comment.