diff --git a/src/elm/Pages/Org_/Repo_/Build_/Graph.elm b/src/elm/Pages/Org_/Repo_/Build_/Graph.elm index 4a671b4ac..200b73a92 100644 --- a/src/elm/Pages/Org_/Repo_/Build_/Graph.elm +++ b/src/elm/Pages/Org_/Repo_/Build_/Graph.elm @@ -288,11 +288,11 @@ subscriptions model = Sub.batch [ Interop.onGraphInteraction (Vela.decodeOnGraphInteraction OnBuildGraphInteraction NoOp) - , Interval.tickEveryOneSecond Tick -- on visiblity changed, same as shared , Browser.Events.onVisibilityChange (\visibility -> VisibilityChanged { visibility = visibility }) + , Interval.tickEveryOneSecond Tick ] diff --git a/src/elm/Pages/Org_/Repo_/Schedules.elm b/src/elm/Pages/Org_/Repo_/Schedules.elm index 96b93c917..291d7c28c 100644 --- a/src/elm/Pages/Org_/Repo_/Schedules.elm +++ b/src/elm/Pages/Org_/Repo_/Schedules.elm @@ -12,8 +12,8 @@ import Components.Table import Dict import Effect exposing (Effect) import FeatherIcons -import Html exposing (..) -import Html.Attributes exposing (..) +import Html exposing (Html, a, div, span, text, tr) +import Html.Attributes exposing (class) import Http import Http.Detailed import Layouts @@ -26,7 +26,6 @@ import Shared import Svg.Attributes import Time import Utils.Errors -import Utils.Favorites as Favorites import Utils.Helpers as Util import Utils.Interval as Interval import Vela diff --git a/src/elm/Pages/Secrets/Engine_/Org/Org_.elm b/src/elm/Pages/Secrets/Engine_/Org/Org_.elm index 05bc0ea2b..cd3f83eeb 100644 --- a/src/elm/Pages/Secrets/Engine_/Org/Org_.elm +++ b/src/elm/Pages/Secrets/Engine_/Org/Org_.elm @@ -147,7 +147,7 @@ update shared route msg model = Err error -> ( { model | sharedSecrets = Utils.Errors.toFailure error } - , Effect.handleHttpError { httpError = error } + , Effect.none ) GotoPage pageNumber -> diff --git a/src/elm/Pages/Secrets/Engine_/Repo/Org_/Repo_.elm b/src/elm/Pages/Secrets/Engine_/Repo/Org_/Repo_.elm index ed68cc139..49b2982d8 100644 --- a/src/elm/Pages/Secrets/Engine_/Repo/Org_/Repo_.elm +++ b/src/elm/Pages/Secrets/Engine_/Repo/Org_/Repo_.elm @@ -68,37 +68,37 @@ toLayout user route model = type alias Model = - { orgSecrets : WebData (List Vela.Secret) - , repoSecrets : WebData (List Vela.Secret) + { repoSecrets : WebData (List Vela.Secret) + , orgSecrets : WebData (List Vela.Secret) , pager : List WebLink } init : Shared.Model -> Route { engine : String, org : String, repo : String } -> () -> ( Model, Effect Msg ) init shared route () = - ( { orgSecrets = RemoteData.Loading - , repoSecrets = RemoteData.Loading + ( { repoSecrets = RemoteData.Loading + , orgSecrets = RemoteData.Loading , pager = [] } , Effect.batch - [ Effect.getOrgSecrets + [ Effect.getRepoSecrets { baseUrl = shared.velaAPIBaseURL , session = shared.session - , onResponse = GetOrgSecretsResponse - , pageNumber = Nothing - , perPage = Nothing + , onResponse = GetRepoSecretsResponse + , pageNumber = Dict.get "page" route.query |> Maybe.andThen String.toInt + , perPage = Dict.get "perPage" route.query |> Maybe.andThen String.toInt , engine = route.params.engine , org = route.params.org + , repo = route.params.repo } - , Effect.getRepoSecrets + , Effect.getOrgSecrets { baseUrl = shared.velaAPIBaseURL , session = shared.session - , onResponse = GetRepoSecretsResponse - , pageNumber = Dict.get "page" route.query |> Maybe.andThen String.toInt - , perPage = Dict.get "perPage" route.query |> Maybe.andThen String.toInt + , onResponse = GetOrgSecretsResponse + , pageNumber = Nothing + , perPage = Nothing , engine = route.params.engine , org = route.params.org - , repo = route.params.repo } ] ) @@ -110,8 +110,8 @@ init shared route () = type Msg = -- SECRETS - GetOrgSecretsResponse (Result (Http.Detailed.Error String) ( Http.Metadata, List Vela.Secret )) - | GetRepoSecretsResponse (Result (Http.Detailed.Error String) ( Http.Metadata, List Vela.Secret )) + GetRepoSecretsResponse (Result (Http.Detailed.Error String) ( Http.Metadata, List Vela.Secret )) + | GetOrgSecretsResponse (Result (Http.Detailed.Error String) ( Http.Metadata, List Vela.Secret )) | GotoPage Int -- ALERTS | AddAlertCopiedToClipboard String @@ -123,33 +123,33 @@ update : Shared.Model -> Route { engine : String, org : String, repo : String } update shared route msg model = case msg of -- SECRETS - GetOrgSecretsResponse response -> + GetRepoSecretsResponse response -> case response of - Ok ( _, secrets ) -> + Ok ( meta, secrets ) -> ( { model - | orgSecrets = RemoteData.Success secrets + | repoSecrets = RemoteData.Success secrets + , pager = Api.Pagination.get meta.headers } , Effect.none ) Err error -> - ( { model | orgSecrets = Utils.Errors.toFailure error } - , Effect.none + ( { model | repoSecrets = Utils.Errors.toFailure error } + , Effect.handleHttpError { httpError = error } ) - GetRepoSecretsResponse response -> + GetOrgSecretsResponse response -> case response of - Ok ( meta, secrets ) -> + Ok ( _, secrets ) -> ( { model - | repoSecrets = RemoteData.Success secrets - , pager = Api.Pagination.get meta.headers + | orgSecrets = RemoteData.Success secrets } , Effect.none ) Err error -> - ( { model | repoSecrets = Utils.Errors.toFailure error } - , Effect.handleHttpError { httpError = error } + ( { model | orgSecrets = Utils.Errors.toFailure error } + , Effect.none ) GotoPage pageNumber -> @@ -184,24 +184,24 @@ update shared route msg model = Tick options -> ( model , Effect.batch - [ Effect.getOrgSecrets + [ Effect.getRepoSecrets { baseUrl = shared.velaAPIBaseURL , session = shared.session - , onResponse = GetOrgSecretsResponse - , pageNumber = Nothing - , perPage = Nothing + , onResponse = GetRepoSecretsResponse + , pageNumber = Dict.get "page" route.query |> Maybe.andThen String.toInt + , perPage = Dict.get "perPage" route.query |> Maybe.andThen String.toInt , engine = route.params.engine , org = route.params.org + , repo = route.params.repo } - , Effect.getRepoSecrets + , Effect.getOrgSecrets { baseUrl = shared.velaAPIBaseURL , session = shared.session - , onResponse = GetRepoSecretsResponse - , pageNumber = Dict.get "page" route.query |> Maybe.andThen String.toInt - , perPage = Dict.get "perPage" route.query |> Maybe.andThen String.toInt + , onResponse = GetOrgSecretsResponse + , pageNumber = Nothing + , perPage = Nothing , engine = route.params.engine , org = route.params.org - , repo = route.params.repo } ] )