Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor: remove unused #481

Merged
merged 2 commits into from
Nov 30, 2021
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
4 changes: 0 additions & 4 deletions src/elm/Alerts.elm
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@ type alias Destination =

type Alert
= Success String String (Maybe Link)
| Warning String String
| Error String String


Expand All @@ -50,9 +49,6 @@ view copy toast =
Success title message link ->
wrapAlert "-success" title message link Nothing

Warning title message ->
wrapAlert "-warning" title message Nothing Nothing

Error title message ->
wrapAlert "-error" title message Nothing <| Just copy

Expand Down
15 changes: 1 addition & 14 deletions src/elm/Api.elm
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ module Api exposing
, deleteSecret
, enableRepository
, expandPipelineConfig
, getAllRepositories
, getAllSecrets
, getAllServices
, getAllSteps
Expand Down Expand Up @@ -47,7 +46,7 @@ module Api exposing
, updateSecret
)

import Api.Endpoint as Endpoint exposing (Endpoint(..))
import Api.Endpoint as Endpoint exposing (Endpoint)
import Api.Pagination as Pagination
import Auth.Jwt exposing (JwtAccessToken, decodeJwtAccessToken)
import Auth.Session exposing (Session(..))
Expand Down Expand Up @@ -443,18 +442,6 @@ updateCurrentUser model body =
|> withAuth model.session


{-| getAllRepositories : used in conjuction with 'tryAll', it retrieves all pages of the resource

Note: the singular version of the type/decoder is needed in this case as it turns it into a list

-}
getAllRepositories : PartialModel a -> Request Repository
getAllRepositories model =
-- we using the max perPage setting of 100 to reduce the number of calls
get model.velaAPI (Endpoint.Repositories (Just 1) (Just 100)) decodeRepository
|> withAuth model.session


{-| getRepo : fetches single repo by org and repo name
-}
getRepo : PartialModel a -> Org -> Repo -> Request Repository
Expand Down
10 changes: 2 additions & 8 deletions src/elm/Crumbs.elm
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ module Crumbs exposing (view)

import Html exposing (Html, a, li, ol, text)
import Html.Attributes exposing (attribute)
import Pages exposing (Page(..), toRoute)
import Routes exposing (Route(..))
import Pages exposing (Page, toRoute)
import Routes
import Tuple exposing (first, second)
import Url exposing (percentDecode)
import Util exposing (pageToString)
Expand Down Expand Up @@ -330,16 +330,10 @@ toPath page =
Pages.Login ->
[]

Pages.Logout ->
[]

Pages.Settings ->
[ ( "Overview", Just Pages.Overview ), ( "My Settings", Nothing ) ]

Pages.NotFound ->
[ overviewPage, notFoundPage ]

Pages.Authenticate ->
[]
in
pages
2 changes: 1 addition & 1 deletion src/elm/Errors.elm
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ Use of this source code is governed by the LICENSE file in this repository.
module Errors exposing (Error, addError, addErrorString, detailedErrorToString, toFailure, viewResourceError)

import Html exposing (Html, div, p, text)
import Http exposing (Error(..))
import Http
import Http.Detailed
import Json.Decode as Decode
import RemoteData exposing (RemoteData(..), WebData)
Expand Down
22 changes: 2 additions & 20 deletions src/elm/Help/Commands.elm
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ module Help.Commands exposing
, usageDocsUrl
)

import Pages exposing (Page(..))
import Pages exposing (Page)
import String.Extra
import Util exposing (anyBlank, noBlanks)
import Vela
Expand All @@ -29,7 +29,7 @@ import Vela
, Name
, Org
, Repo
, SecretType(..)
, SecretType
, StepNumber
, secretTypeToString
)
Expand Down Expand Up @@ -153,15 +153,9 @@ commands page =
Pages.Settings ->
[]

Pages.Authenticate ->
[]

Pages.Login ->
[ authenticate ]

Pages.Logout ->
[]

Pages.NotFound ->
[]

Expand Down Expand Up @@ -849,12 +843,6 @@ resourceLoaded args =
Pages.Login ->
True

Pages.Logout ->
True

Pages.Authenticate ->
True

Pages.NotFound ->
False

Expand Down Expand Up @@ -939,11 +927,5 @@ resourceLoading args =
Pages.Login ->
False

Pages.Logout ->
True

Pages.Authenticate ->
True

Pages.NotFound ->
False
1 change: 0 additions & 1 deletion src/elm/Help/View.elm
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ import Help.Commands
import Html exposing (Html, a, button, details, div, label, li, span, strong, summary, text)
import Html.Attributes exposing (attribute, class, for, href, id, size, value)
import Html.Events
import Pages exposing (Page(..))
import SvgBuilder
import Util
import Vela exposing (Copy)
Expand Down
Loading