From 9311d31df12fc3d8e791e063135ce25a686d59de Mon Sep 17 00:00:00 2001 From: dave vader <48764154+plyr4@users.noreply.github.com> Date: Thu, 19 Sep 2024 09:47:24 -0500 Subject: [PATCH] fix(secrets): clear form on update (#820) --- src/elm/Pages/Dash/Secrets/Engine_/Org/Org_/Name_.elm | 5 ++++- src/elm/Pages/Dash/Secrets/Engine_/Repo/Org_/Repo_/Name_.elm | 5 ++++- .../Pages/Dash/Secrets/Engine_/Shared/Org_/Team_/Name_.elm | 5 ++++- 3 files changed, 12 insertions(+), 3 deletions(-) diff --git a/src/elm/Pages/Dash/Secrets/Engine_/Org/Org_/Name_.elm b/src/elm/Pages/Dash/Secrets/Engine_/Org/Org_/Name_.elm index c4c9ae28a..ac8ee310f 100644 --- a/src/elm/Pages/Dash/Secrets/Engine_/Org/Org_/Name_.elm +++ b/src/elm/Pages/Dash/Secrets/Engine_/Org/Org_/Name_.elm @@ -173,7 +173,10 @@ update shared route msg model = UpdateSecretResponse response -> case response of Ok ( _, secret ) -> - ( model + ( { model + | secret = RemoteData.succeed secret + , form = Components.SecretForm.toForm secret + } , Effect.addAlertSuccess { content = "Updated org secret '" ++ secret.name ++ "'." , addToastIfUnique = True diff --git a/src/elm/Pages/Dash/Secrets/Engine_/Repo/Org_/Repo_/Name_.elm b/src/elm/Pages/Dash/Secrets/Engine_/Repo/Org_/Repo_/Name_.elm index f2569686f..494d15b6e 100644 --- a/src/elm/Pages/Dash/Secrets/Engine_/Repo/Org_/Repo_/Name_.elm +++ b/src/elm/Pages/Dash/Secrets/Engine_/Repo/Org_/Repo_/Name_.elm @@ -171,7 +171,10 @@ update shared route msg model = UpdateSecretResponse response -> case response of Ok ( _, secret ) -> - ( model + ( { model + | secret = RemoteData.succeed secret + , form = Components.SecretForm.toForm secret + } , Effect.addAlertSuccess { content = "Updated repo secret '" ++ route.params.name ++ "'." , addToastIfUnique = True diff --git a/src/elm/Pages/Dash/Secrets/Engine_/Shared/Org_/Team_/Name_.elm b/src/elm/Pages/Dash/Secrets/Engine_/Shared/Org_/Team_/Name_.elm index 99b4982ab..143636f9c 100644 --- a/src/elm/Pages/Dash/Secrets/Engine_/Shared/Org_/Team_/Name_.elm +++ b/src/elm/Pages/Dash/Secrets/Engine_/Shared/Org_/Team_/Name_.elm @@ -166,7 +166,10 @@ update shared route msg model = UpdateSecretResponse response -> case response of Ok ( _, secret ) -> - ( model + ( { model + | secret = RemoteData.succeed secret + , form = Components.SecretForm.toForm secret + } , Effect.addAlertSuccess { content = "Updated shared secret '" ++ route.params.name ++ "'." , addToastIfUnique = True