From 58ce1d55dbd5a90712094a8fe0f1fd4d9c8c85e8 Mon Sep 17 00:00:00 2001 From: hc-github-team-secure-vault-core <82990506+hc-github-team-secure-vault-core@users.noreply.github.com> Date: Wed, 29 Nov 2023 17:57:58 -0500 Subject: [PATCH] backport of UI: prevent replication disable action from sending payload (#24296) Co-authored-by: Chelsea Shaw <82459713+hashishaw@users.noreply.github.com> --- changelog/24292.txt | 3 +++ ui/lib/core/addon/components/replication-action-disable.js | 7 +++++++ .../templates/components/replication-action-disable.hbs | 4 ++-- 3 files changed, 12 insertions(+), 2 deletions(-) create mode 100644 changelog/24292.txt diff --git a/changelog/24292.txt b/changelog/24292.txt new file mode 100644 index 000000000..784e2e38f --- /dev/null +++ b/changelog/24292.txt @@ -0,0 +1,3 @@ +```release-note:bug +ui: Fix payload sent when disabling replication +``` diff --git a/ui/lib/core/addon/components/replication-action-disable.js b/ui/lib/core/addon/components/replication-action-disable.js index a0bf58363..2fe96af2f 100644 --- a/ui/lib/core/addon/components/replication-action-disable.js +++ b/ui/lib/core/addon/components/replication-action-disable.js @@ -9,4 +9,11 @@ import layout from '../templates/components/replication-action-disable'; export default Actions.extend({ layout, tagName: '', + + actions: { + onSubmit(replicationMode, clusterMode, evt) { + // No data is submitted for disable request + return this.onSubmit(replicationMode, clusterMode, null, evt); + }, + }, }); diff --git a/ui/lib/core/addon/templates/components/replication-action-disable.hbs b/ui/lib/core/addon/templates/components/replication-action-disable.hbs index 733f129b9..55a54cdce 100644 --- a/ui/lib/core/addon/templates/components/replication-action-disable.hbs +++ b/ui/lib/core/addon/templates/components/replication-action-disable.hbs @@ -28,8 +28,8 @@ @isActive={{this.isModalActive}} @confirmText={{this.model.replicationModeForDisplay}} @toConfirmMsg="disabling {{this.model.replicationModeForDisplay}} Replication on this cluster" - @onConfirm={{action - "onSubmit" + @onConfirm={{fn + (action "onSubmit") "disable" (if (eq this.model.replicationAttrs.modeForUrl "bootstrapping") this.mode this.model.replicationAttrs.modeForUrl) }}