Skip to content

Commit

Permalink
Fix delete for provision tagging
Browse files Browse the repository at this point in the history
  • Loading branch information
PanSpagetka committed Jul 31, 2019
1 parent d3c7e1b commit 4f868a0
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -986,6 +986,7 @@ def workflow_instance_from_vars(req)
def build_tags_tree(wf, vm_tags, edit_mode)
# for some reason @tags is set in wf, and it is changed by map bellow which causes bugs
wf.instance_variable_set(:@tags, nil)
vm_tags = vm_tags - [params[:deleted].to_i]
tags = wf.allowed_tags.map do |cat|
{
:values => cat[:children].map do |tag|
Expand Down
2 changes: 1 addition & 1 deletion app/javascript/components/taggingWrapper.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ const params = (type = 'default', state, tag = {}) => ({
})[type]

const onDelete = (type = 'default', params = [], deleted_element) => ({
provision: {...params, check: 0, ids_checked: params.ids_checked.filter(element => element !== deleted_element)},
provision: {...params, check: 0, ids_checked: params.ids_checked.filter(element => element !== deleted_element), deleted: deleted_element },
default: params,
})[type]

Expand Down

0 comments on commit 4f868a0

Please sign in to comment.