Skip to content

Commit

Permalink
progress or not, depends on your outlook
Browse files Browse the repository at this point in the history
  • Loading branch information
ecrupper committed Dec 31, 2024
1 parent 2557666 commit f8b1fa6
Show file tree
Hide file tree
Showing 17 changed files with 361 additions and 36 deletions.
4 changes: 2 additions & 2 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ services:
ui:
build:
context: .
dockerfile: Dockerfile.local
dockerfile: ${VELA_UI_DOCKERFILE:-Dockerfile}
container_name: ui
image: ui:local
networks:
Expand All @@ -34,7 +34,7 @@ services:
# https://go-vela.github.io/docs/administration/server/
server:
container_name: server
image: target/vela-server:latest
image: server:local
networks:
- vela
environment:
Expand Down
9 changes: 9 additions & 0 deletions src/elm/Api/Endpoint.elm
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ type Endpoint
| Dashboard String
| Dashboards
| Deployment Vela.Org Vela.Repo (Maybe String)
| DeploymentConfig Vela.Org Vela.Repo (Maybe Vela.Ref)
| Deployments (Maybe Pagination.Page) (Maybe Pagination.PerPage) Vela.Org Vela.Repo
| Token
| Repositories (Maybe Pagination.Page) (Maybe Pagination.PerPage)
Expand Down Expand Up @@ -162,6 +163,14 @@ toUrl api endpoint =
Nothing ->
url api [ "deployments", org, repo ] []

DeploymentConfig org repo maybeRef ->
case maybeRef of
Nothing ->
url api ["deployments", org, repo, "config"] []

Just ref ->
url api ["deployments", org, repo, "config"] [ UB.string "ref" ref ]

Deployments maybePage maybePerPage org repo ->
url api [ "deployments", org, repo ] <| Pagination.toQueryParams maybePage maybePerPage

Expand Down
23 changes: 23 additions & 0 deletions src/elm/Api/Operations.elm
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ module Api.Operations exposing
, getCurrentUser
, getDashboard
, getDashboards
, getDeploymentConfig
, getOrgBuilds
, getOrgRepos
, getOrgSecret
Expand Down Expand Up @@ -464,6 +465,28 @@ addDeployment baseUrl session options =
|> withAuth session


{-| getDeploymentConfig : retrieves deployment config for a repo and pipeline ref.
-}
getDeploymentConfig :
String
-> Session
->
{ a
| org : String
, repo : String
, ref : Maybe String
}
-> Request Vela.DeploymentConfig
getDeploymentConfig baseUrl session options =
get baseUrl
(Api.Endpoint.DeploymentConfig
options.org
options.repo
options.ref
)
Vela.decodeDeploymentConfig
|> withAuth session

{-| getRepoHooks : retrieves hooks for a repo.
-}
getRepoHooks :
Expand Down
8 changes: 7 additions & 1 deletion src/elm/Components/Form.elm
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,12 @@ viewInputSection :
, wrap_ : Maybe String
, msg : String -> msg
, disabled_ : Bool
, min : Maybe String
, max : Maybe String
, required : Bool
}
-> Html msg
viewInputSection { id_, title, subtitle, val, placeholder_, classList_, rows_, wrap_, msg, disabled_ } =
viewInputSection { id_, title, subtitle, val, placeholder_, classList_, rows_, wrap_, msg, disabled_, min, max, required } =
let
target =
String.join "-" [ "input", id_ ]
Expand All @@ -62,6 +65,9 @@ viewInputSection { id_, title, subtitle, val, placeholder_, classList_, rows_, w
, Maybe.Extra.unwrap Util.attrNone wrap wrap_
, onInput msg
, disabled disabled_
, Maybe.Extra.unwrap Util.attrNone Html.Attributes.min min
, Maybe.Extra.unwrap Util.attrNone Html.Attributes.max max
, Html.Attributes.required required
, Util.testAttribute target
]
[]
Expand Down
3 changes: 3 additions & 0 deletions src/elm/Components/SecretForm.elm
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,9 @@ viewImagesInput { onInput_, addImage, removeImage, images, imageValue, disabled_
, wrap_ = Just "soft"
, msg = onInput_
, disabled_ = disabled_
, min = Nothing
, max = Nothing
, required = False
}
, button
[ class "button"
Expand Down
21 changes: 20 additions & 1 deletion src/elm/Effect.elm
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ module Effect exposing
, sendCmd, sendMsg
, pushRoute, replaceRoute, loadExternalUrl
, map, toCmd
, addAlertError, addAlertSuccess, addDeployment, addFavorites, addOrgSecret, addRepoSchedule, addRepoSecret, addSharedSecret, alertsUpdate, approveBuild, cancelBuild, chownRepo, clearRedirect, deleteOrgSecret, deleteRepoSchedule, deleteRepoSecret, deleteSharedSecret, disableRepo, downloadFile, enableRepo, expandPipelineConfig, finishAuthentication, focusOn, getAllBuildServices, getAllBuildSteps, getBuild, getBuildGraph, getBuildServiceLog, getBuildServices, getBuildStepLog, getBuildSteps, getCurrentUser, getCurrentUserShared, getDashboard, getDashboards, getOrgBuilds, getOrgRepos, getOrgSecret, getOrgSecrets, getPipelineConfig, getPipelineTemplates, getRepo, getRepoBuilds, getRepoBuildsShared, getRepoDeployments, getRepoHooks, getRepoHooksShared, getRepoSchedule, getRepoSchedules, getRepoSecret, getRepoSecrets, getSettings, getSharedSecret, getSharedSecrets, getWorkers, handleHttpError, logout, pushPath, redeliverHook, repairRepo, replacePath, replaceRouteRemoveTabHistorySkipDomFocus, restartBuild, setRedirect, setTheme, updateFavicon, updateFavorite, updateOrgSecret, updateRepo, updateRepoHooksShared, updateRepoSchedule, updateRepoSecret, updateSettings, updateSharedSecret, updateSourceReposShared
, addAlertError, addAlertSuccess, addDeployment, addFavorites, addOrgSecret, addRepoSchedule, addRepoSecret, addSharedSecret, alertsUpdate, approveBuild, cancelBuild, chownRepo, clearRedirect, deleteOrgSecret, deleteRepoSchedule, deleteRepoSecret, deleteSharedSecret, disableRepo, downloadFile, enableRepo, expandPipelineConfig, finishAuthentication, focusOn, getAllBuildServices, getAllBuildSteps, getBuild, getBuildGraph, getBuildServiceLog, getBuildServices, getBuildStepLog, getBuildSteps, getCurrentUser, getCurrentUserShared, getDashboard, getDashboards, getDeploymentConfig, getOrgBuilds, getOrgRepos, getOrgSecret, getOrgSecrets, getPipelineConfig, getPipelineTemplates, getRepo, getRepoBuilds, getRepoBuildsShared, getRepoDeployments, getRepoHooks, getRepoHooksShared, getRepoSchedule, getRepoSchedules, getRepoSecret, getRepoSecrets, getSettings, getSharedSecret, getSharedSecrets, getWorkers, handleHttpError, logout, pushPath, redeliverHook, repairRepo, replacePath, replaceRouteRemoveTabHistorySkipDomFocus, restartBuild, setRedirect, setTheme, updateFavicon, updateFavorite, updateOrgSecret, updateRepo, updateRepoHooksShared, updateRepoSchedule, updateRepoSecret, updateSettings, updateSharedSecret, updateSourceReposShared
)

{-|
Expand Down Expand Up @@ -592,6 +592,25 @@ addDeployment options =
)
|> sendCmd

getDeploymentConfig :
{ baseUrl : String
, session : Auth.Session.Session
, onResponse : Result (Http.Detailed.Error String) ( Http.Metadata, Vela.DeploymentConfig ) -> msg
, ref : Maybe String
, org : String
, repo : String
}
-> Effect msg
getDeploymentConfig options =
Api.try
options.onResponse
(Api.Operations.getDeploymentConfig
options.baseUrl
options.session
options
)
|> sendCmd


getRepoHooks :
{ baseUrl : String
Expand Down
3 changes: 3 additions & 0 deletions src/elm/Pages/Dash/Secrets/Engine_/Org/Org_/Add.elm
Original file line number Diff line number Diff line change
Expand Up @@ -286,6 +286,9 @@ view shared route model =
, wrap_ = Nothing
, msg = NameOnInput
, disabled_ = False
, min = Nothing
, max = Nothing
, required = False
}
, Components.Form.viewTextareaSection
{ title = Just "Value"
Expand Down
3 changes: 3 additions & 0 deletions src/elm/Pages/Dash/Secrets/Engine_/Org/Org_/Name_.elm
Original file line number Diff line number Diff line change
Expand Up @@ -393,6 +393,9 @@ view shared route model =
, wrap_ = Nothing
, msg = NameOnInput
, disabled_ = True
, min = Nothing
, max = Nothing
, required = False
}
, Components.Form.viewTextareaSection
{ title = Just "Value"
Expand Down
3 changes: 3 additions & 0 deletions src/elm/Pages/Dash/Secrets/Engine_/Repo/Org_/Repo_/Add.elm
Original file line number Diff line number Diff line change
Expand Up @@ -274,6 +274,9 @@ view shared route model =
, wrap_ = Nothing
, msg = NameOnInput
, disabled_ = False
, min = Nothing
, max = Nothing
, required = False
}
, Components.Form.viewTextareaSection
{ title = Just "Value"
Expand Down
3 changes: 3 additions & 0 deletions src/elm/Pages/Dash/Secrets/Engine_/Repo/Org_/Repo_/Name_.elm
Original file line number Diff line number Diff line change
Expand Up @@ -386,6 +386,9 @@ view shared route model =
, wrap_ = Nothing
, msg = \_ -> NoOp
, disabled_ = True
, min = Nothing
, max = Nothing
, required = False
}
, Components.Form.viewTextareaSection
{ title = Just "Value"
Expand Down
6 changes: 6 additions & 0 deletions src/elm/Pages/Dash/Secrets/Engine_/Shared/Org_/Team_/Add.elm
Original file line number Diff line number Diff line change
Expand Up @@ -294,6 +294,9 @@ view shared route model =
, wrap_ = Nothing
, msg = TeamOnInput
, disabled_ = False
, min = Nothing
, max = Nothing
, required = False
}
, Components.Form.viewInputSection
{ title = Just "Name"
Expand All @@ -306,6 +309,9 @@ view shared route model =
, wrap_ = Nothing
, msg = NameOnInput
, disabled_ = False
, min = Nothing
, max = Nothing
, required = False
}
, Components.Form.viewTextareaSection
{ title = Just "Value"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -385,6 +385,9 @@ view shared route model =
, wrap_ = Nothing
, msg = \_ -> NoOp
, disabled_ = True
, min = Nothing
, max = Nothing
, required = False
}
, Components.Form.viewTextareaSection
{ title = Just "Value"
Expand Down
Loading

0 comments on commit f8b1fa6

Please sign in to comment.