From b3353f8b6fc35b51b212124266b3176d3b6b8e91 Mon Sep 17 00:00:00 2001 From: davidvader Date: Fri, 9 Jun 2023 09:32:36 -0500 Subject: [PATCH 1/5] fix: remove tabs from add-deployment --- src/elm/Main.elm | 2 +- src/elm/Nav.elm | 54 ++++++++++++++++++++++++++++-- src/elm/Pages/Deployments/View.elm | 17 +--------- 3 files changed, 53 insertions(+), 20 deletions(-) diff --git a/src/elm/Main.elm b/src/elm/Main.elm index d81f51d6c..224c82177 100644 --- a/src/elm/Main.elm +++ b/src/elm/Main.elm @@ -2586,7 +2586,7 @@ viewContent model = Pages.PromoteDeployment org repo buildNumber -> ( String.join "/" [ org, repo, buildNumber ] ++ " promote deployment" - , Html.map AddDeploymentUpdate <| lazy Pages.Deployments.View.promoteDeployment model + , Html.map AddDeploymentUpdate <| lazy Pages.Deployments.View.addDeployment model ) Pages.RepositoryDeployments org repo maybePage _ -> diff --git a/src/elm/Nav.elm b/src/elm/Nav.elm index 230e960ae..b72a17e73 100644 --- a/src/elm/Nav.elm +++ b/src/elm/Nav.elm @@ -225,10 +225,58 @@ viewUtil model = Pages.BuildPipeline _ _ _ _ _ -> Pages.Build.History.view model.time model.zone model.page 10 model.repo - Pages.AddDeployment org repo -> - viewRepoTabs rm org repo model.page + Pages.AddDeployment _ _ -> + text "" + + Pages.PromoteDeployment _ _ _ -> + text "" + + Pages.Overview -> + text "" + + Pages.SourceRepositories -> + text "" + + Pages.SharedSecrets _ _ _ _ _ -> + text "" + + Pages.AddOrgSecret _ _ -> + text "" + + Pages.AddRepoSecret _ _ _ -> + text "" + + Pages.AddSharedSecret _ _ _ -> + text "" + + Pages.OrgSecret _ _ _ -> + text "" + + Pages.RepoSecret _ _ _ _ -> + text "" + + Pages.SharedSecret _ _ _ _ -> + text "" + + Pages.RepositoryBuildsPulls _ _ _ _ -> + text "" + + Pages.RepositoryBuildsTags _ _ _ _ -> + text "" + + Pages.AddSchedule _ _ -> + text "" + + Pages.Schedule _ _ _ -> + text "" + + Pages.Settings -> + text "" + + Pages.Login -> + text "" - _ -> + Pages.NotFound -> text "" ] diff --git a/src/elm/Pages/Deployments/View.elm b/src/elm/Pages/Deployments/View.elm index 86e8c235f..1079f8f96 100644 --- a/src/elm/Pages/Deployments/View.elm +++ b/src/elm/Pages/Deployments/View.elm @@ -4,7 +4,7 @@ Use of this source code is governed by the LICENSE file in this repository. --} -module Pages.Deployments.View exposing (addDeployment, promoteDeployment, viewDeployments) +module Pages.Deployments.View exposing (addDeployment, viewDeployments) import Errors exposing (viewResourceError) import FeatherIcons @@ -167,18 +167,3 @@ viewDeployments deploymentsModel org repo = RemoteData.Failure _ -> viewResourceError { resourceLabel = "deployments for this repository", testLabel = "deployments" } - - - --- Promote Deployment - - -{-| promoteDeployment : takes partial model and renders deployment form for promoting a deployment --} -promoteDeployment : PartialModel a msg -> Html Msg -promoteDeployment model = - div [ class "manage-deployment", Util.testAttribute "add-deployment" ] - [ div [] - [ addForm model.deploymentModel - ] - ] From 3e64e54f587b23b87af41f5f23b9c53f4afa18e2 Mon Sep 17 00:00:00 2001 From: davidvader Date: Fri, 9 Jun 2023 09:35:09 -0500 Subject: [PATCH 2/5] chore: separate refactor --- src/elm/Main.elm | 2 +- src/elm/Pages/Deployments/View.elm | 17 ++++++++++++++++- 2 files changed, 17 insertions(+), 2 deletions(-) diff --git a/src/elm/Main.elm b/src/elm/Main.elm index 224c82177..d81f51d6c 100644 --- a/src/elm/Main.elm +++ b/src/elm/Main.elm @@ -2586,7 +2586,7 @@ viewContent model = Pages.PromoteDeployment org repo buildNumber -> ( String.join "/" [ org, repo, buildNumber ] ++ " promote deployment" - , Html.map AddDeploymentUpdate <| lazy Pages.Deployments.View.addDeployment model + , Html.map AddDeploymentUpdate <| lazy Pages.Deployments.View.promoteDeployment model ) Pages.RepositoryDeployments org repo maybePage _ -> diff --git a/src/elm/Pages/Deployments/View.elm b/src/elm/Pages/Deployments/View.elm index 1079f8f96..86e8c235f 100644 --- a/src/elm/Pages/Deployments/View.elm +++ b/src/elm/Pages/Deployments/View.elm @@ -4,7 +4,7 @@ Use of this source code is governed by the LICENSE file in this repository. --} -module Pages.Deployments.View exposing (addDeployment, viewDeployments) +module Pages.Deployments.View exposing (addDeployment, promoteDeployment, viewDeployments) import Errors exposing (viewResourceError) import FeatherIcons @@ -167,3 +167,18 @@ viewDeployments deploymentsModel org repo = RemoteData.Failure _ -> viewResourceError { resourceLabel = "deployments for this repository", testLabel = "deployments" } + + + +-- Promote Deployment + + +{-| promoteDeployment : takes partial model and renders deployment form for promoting a deployment +-} +promoteDeployment : PartialModel a msg -> Html Msg +promoteDeployment model = + div [ class "manage-deployment", Util.testAttribute "add-deployment" ] + [ div [] + [ addForm model.deploymentModel + ] + ] From bb0d1a3d46c90dae69229663ce97b2fb3fb57c73 Mon Sep 17 00:00:00 2001 From: davidvader Date: Thu, 15 Jun 2023 10:27:32 -0500 Subject: [PATCH 3/5] enhance: use consistent form styling for schedules --- src/elm/Pages/Schedules/Model.elm | 2 +- src/elm/Pages/Schedules/View.elm | 6 ++++-- src/scss/_main.scss | 24 ++++++++++++++++-------- 3 files changed, 21 insertions(+), 11 deletions(-) diff --git a/src/elm/Pages/Schedules/Model.elm b/src/elm/Pages/Schedules/Model.elm index 5b4602d2d..74fed989c 100644 --- a/src/elm/Pages/Schedules/Model.elm +++ b/src/elm/Pages/Schedules/Model.elm @@ -74,7 +74,7 @@ type alias ScheduleForm = defaultScheduleUpdate : ScheduleForm defaultScheduleUpdate = - ScheduleForm "Daily" "0 0 * * *" True + ScheduleForm "" "0 0 * * *" True diff --git a/src/elm/Pages/Schedules/View.elm b/src/elm/Pages/Schedules/View.elm index edc344883..66f1b6db5 100644 --- a/src/elm/Pages/Schedules/View.elm +++ b/src/elm/Pages/Schedules/View.elm @@ -18,6 +18,7 @@ import Html , a , button , div + , h2 , span , td , text @@ -171,9 +172,10 @@ updateScheduleHref org repo s = -} addSchedule : PartialModel a msg -> Html Msg addSchedule model = - div [ class "add-schedule", Util.testAttribute "add-schedule" ] + div [ class "manage-schedule", Util.testAttribute "manage-schedule" ] [ div [] - [ addForm model.schedulesModel + [ h2 [] [ text "Add Schedule" ] + , addForm model.schedulesModel ] ] diff --git a/src/scss/_main.scss b/src/scss/_main.scss index 561a93a9f..7f94f561a 100644 --- a/src/scss/_main.scss +++ b/src/scss/_main.scss @@ -1440,7 +1440,8 @@ details.build-toggle { } .manage-secret .header, -.manage-deployment .header { +.manage-deployment .header, +.manage-schedule .header { display: flex; flex-direction: row; align-items: center; @@ -1451,20 +1452,23 @@ details.build-toggle { } .manage-secret h2, -.manage-deployment h2 { +.manage-deployment h2, +.manage-schedule h2 { margin: 0; border-bottom: 2px solid var(--color-secondary); } .secret-form, -.deployment-form { +.deployment-form, +.schedule-form { margin-bottom: 0.5rem; padding-top: 1rem; } .secret-form section, -.deployment-form section { +.deployment-form section, +.schedule-form section { justify-content: flex-start; margin-bottom: 1rem; } @@ -1547,7 +1551,8 @@ details.build-toggle { .manage-secret textarea, .update-secret textarea, -.manage-deployment textarea { +.manage-deployment textarea, +.manage-schedule textarea { width: 70%; margin-bottom: 0.5rem; padding: 0.5rem; @@ -1567,17 +1572,20 @@ details.build-toggle { } .manage-secret textarea, -.manage-deployment textarea { +.manage-deployment textarea, +.manage-schedule textarea { max-width: 70%; } .secret-form .help, -.deployment-form .help { +.deployment-form .help, +.schedule-form .help { padding-bottom: 1rem; } .secret-form .form-action, -.deployment-form .form-action { +.deployment-form .form-action, +.schedule-form .form-action { padding-left: 1rem; } From 00e39a656e0f893f3752a2026a46b20b01c8a6ff Mon Sep 17 00:00:00 2001 From: davidvader Date: Thu, 15 Jun 2023 10:36:41 -0500 Subject: [PATCH 4/5] fix: add header to edit schedule --- src/elm/Pages/Schedules/View.elm | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/elm/Pages/Schedules/View.elm b/src/elm/Pages/Schedules/View.elm index 66f1b6db5..3399dff7a 100644 --- a/src/elm/Pages/Schedules/View.elm +++ b/src/elm/Pages/Schedules/View.elm @@ -214,7 +214,8 @@ editSchedule model = Success _ -> div [ class "manage-schedule", Util.testAttribute "manage-schedule" ] [ div [] - [ editForm model.schedulesModel + [ h2 [] [ text "View/Edit Schedule" ] + , editForm model.schedulesModel ] ] From e8c068ca91e4885637582dedaa24cf63356636c8 Mon Sep 17 00:00:00 2001 From: davidvader Date: Thu, 15 Jun 2023 10:41:20 -0500 Subject: [PATCH 5/5] revert: Nav.elm changes for deployments --- src/elm/Nav.elm | 54 +++---------------------------------------------- 1 file changed, 3 insertions(+), 51 deletions(-) diff --git a/src/elm/Nav.elm b/src/elm/Nav.elm index 48f5d9402..d1c504121 100644 --- a/src/elm/Nav.elm +++ b/src/elm/Nav.elm @@ -214,58 +214,10 @@ viewUtil model = Pages.BuildPipeline _ _ _ _ _ -> Pages.Build.History.view model.time model.zone model.page 10 model.repo - Pages.AddDeployment _ _ -> - text "" - - Pages.PromoteDeployment _ _ _ -> - text "" - - Pages.Overview -> - text "" - - Pages.SourceRepositories -> - text "" - - Pages.SharedSecrets _ _ _ _ _ -> - text "" - - Pages.AddOrgSecret _ _ -> - text "" - - Pages.AddRepoSecret _ _ _ -> - text "" - - Pages.AddSharedSecret _ _ _ -> - text "" - - Pages.OrgSecret _ _ _ -> - text "" - - Pages.RepoSecret _ _ _ _ -> - text "" - - Pages.SharedSecret _ _ _ _ -> - text "" - - Pages.RepositoryBuildsPulls _ _ _ _ -> - text "" - - Pages.RepositoryBuildsTags _ _ _ _ -> - text "" - - Pages.AddSchedule _ _ -> - text "" - - Pages.Schedule _ _ _ -> - text "" - - Pages.Settings -> - text "" - - Pages.Login -> - text "" + Pages.AddDeployment org repo -> + viewRepoTabs rm org repo model.page - Pages.NotFound -> + _ -> text "" ]