Skip to content

Commit

Permalink
Merge pull request #9116 from GilbertCherrie/fix_tag_bug
Browse files Browse the repository at this point in the history
Fixed bug with deleting group tags
  • Loading branch information
jeffibm authored Mar 14, 2024
2 parents 5b640df + 70b917d commit 8758bd0
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
3 changes: 2 additions & 1 deletion app/controllers/ops_controller/ops_rbac.rb
Original file line number Diff line number Diff line change
Expand Up @@ -1078,7 +1078,8 @@ def rbac_group_get_form_vars
if params[:check] # User checked/unchecked a tree node
if params[:tree_typ] == "tags" # MyCompany tag checked
cat_name = Classification.find_by(:id => params[:cat]).name
tag_name = Classification.find_by(:id => params[:val]).name
classification = Classification.find_by(:id => params[:val])
tag_name = classification ? classification.name : ''
if params[:check] == "0" # unchecked
@edit[:new][:filters].except!("#{cat_name}-#{tag_name}") # Remove the tag from the filters array
else
Expand Down
4 changes: 2 additions & 2 deletions app/javascript/components/taggingWrapper.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ const selectedTags = (state, tag) => {
return [state.tagging.appState.assignedTags.map((t) => t.values.map((val) => val.id)).flat(), selectedVal].flat();
};

const params = (type = 'default', state, tag = {}) => ({
const params = (type = 'default', state, tag = { tagCategory: undefined, tagValue: { id: undefined } }) => ({
provision: {
id: 'new',
ids_checked: selectedTags(state, tag),
Expand All @@ -18,7 +18,7 @@ const params = (type = 'default', state, tag = {}) => ({
default: {
id: state.tagging.appState.affectedItems[0] || 'new',
cat: tag.tagCategory.id,
val: tag.tagValue.id || tag.tagValue[0].id,
val: tag.tagValue.id || tag.tagValue[0],
check: 1,
tree_typ: 'tags',
},
Expand Down

0 comments on commit 8758bd0

Please sign in to comment.