Skip to content

Commit

Permalink
using new payload for edit description
Browse files Browse the repository at this point in the history
  • Loading branch information
jeffibm committed Nov 9, 2023
1 parent 83c6dd6 commit e7470e1
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 4 deletions.
2 changes: 1 addition & 1 deletion app/controllers/vm_common.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
3 changes: 2 additions & 1 deletion app/helpers/application_helper/toolbar/x_vm_center.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down
5 changes: 3 additions & 2 deletions app/javascript/components/vm-edit-form/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit e7470e1

Please sign in to comment.