From ea5185df090aef01ff10927160ff30fe2e32cb22 Mon Sep 17 00:00:00 2001 From: davidvader Date: Mon, 5 Feb 2024 13:19:13 -0600 Subject: [PATCH] refactor: rearrange type order and add allow events header --- src/elm/Vela.elm | 24 +++++++++++++----------- 1 file changed, 13 insertions(+), 11 deletions(-) diff --git a/src/elm/Vela.elm b/src/elm/Vela.elm index 909f03ee1..b04213027 100644 --- a/src/elm/Vela.elm +++ b/src/elm/Vela.elm @@ -458,6 +458,19 @@ defaultRepoPayload = } + +-- ALLOW EVENTS + + +type alias AllowEvents = + { push : PushActions + , pull : PullActions + , deploy : DeployActions + , comment : CommentActions + , schedule : ScheduleActions + } + + type alias PushActions = { branch : Bool , tag : Bool @@ -488,15 +501,6 @@ type alias ScheduleActions = } -type alias AllowEvents = - { push : PushActions - , pull : PullActions - , deploy : DeployActions - , comment : CommentActions - , schedule : ScheduleActions - } - - defaultAllowEvents : AllowEvents defaultAllowEvents = { push = @@ -1302,7 +1306,6 @@ type alias Secret = , name : String , type_ : SecretType , images : List String - , events : List String , allowCommand : Bool , allowEvents : AllowEvents } @@ -1388,7 +1391,6 @@ decodeSecret = |> optional "name" string "" |> optional "type" secretTypeDecoder RepoSecret |> optional "images" (Json.Decode.list string) [] - |> optional "events" (Json.Decode.list string) [] |> optional "allow_command" bool False |> optional "allow_events" decodeAllowEvents defaultAllowEvents