From e7470e16f5f943cc0593e679d8829b973c0f61f7 Mon Sep 17 00:00:00 2001 From: JEFFREY-Bonson Date: Thu, 9 Nov 2023 12:19:35 +0530 Subject: [PATCH] using new payload for edit description --- app/controllers/vm_common.rb | 2 +- app/helpers/application_helper/toolbar/x_vm_center.rb | 3 ++- app/javascript/components/vm-edit-form/index.jsx | 5 +++-- 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/app/controllers/vm_common.rb b/app/controllers/vm_common.rb index fa8484690b65..2b86e33e8f6b 100644 --- a/app/controllers/vm_common.rb +++ b/app/controllers/vm_common.rb @@ -607,7 +607,7 @@ def edit_description alias_method :image_edit, :edit alias_method :instance_edit, :edit alias_method :vm_edit, :edit - alias vm_edit_description edit_description + alias_method :vm_edit_description, :edit_description alias_method :miq_template_edit, :edit def set_checked_items diff --git a/app/helpers/application_helper/toolbar/x_vm_center.rb b/app/helpers/application_helper/toolbar/x_vm_center.rb index ffba4715d13c..1e290809602e 100644 --- a/app/helpers/application_helper/toolbar/x_vm_center.rb +++ b/app/helpers/application_helper/toolbar/x_vm_center.rb @@ -47,7 +47,8 @@ class ApplicationHelper::Toolbar::XVmCenter < ApplicationHelper::Toolbar::Basic :vm_edit_description, 'pficon pficon-edit fa-lg', t = N_('Edit this VM Description'), - t), + t, + :options => {:feature => :set_description}), button( :vm_rename, 'pficon pficon-edit fa-lg', diff --git a/app/javascript/components/vm-edit-form/index.jsx b/app/javascript/components/vm-edit-form/index.jsx index 582ac81a5acf..7d79cc68c40f 100644 --- a/app/javascript/components/vm-edit-form/index.jsx +++ b/app/javascript/components/vm-edit-form/index.jsx @@ -48,8 +48,9 @@ const VmEditForm = ({ /** Function to update just the description of the record on form submit. */ const updateDescription = (values) => { - const data = descriptionData(values); - return API.post(URL, data) + // const data = descriptionData(values); + const payload = { action: 'set_description', resource: { new_description: 'test_description' } }; + return API.post(URL, payload) .then(() => { miqSparkleOn(); const message = sprintf(__('%s "%s" description was saved'), displayName, initialValues.name);