Skip to content

Commit

Permalink
Prevent possible clashing key names
Browse files Browse the repository at this point in the history
  • Loading branch information
ncounter committed May 30, 2024
1 parent 59b1753 commit 518cc49
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@
%b Projects
- @projects_for_filter.each do |project_name|
.px-4.py-1
= render partial: 'webui/shared/check_box', locals: { label: project_name, amount: @count[project_name],
= render partial: 'webui/shared/check_box', locals: { label: project_name, amount: @count["project_#{project_name}"],
key: "project[#{project_name}]", name: 'project[]', value: project_name,
checked: @selected_filter[:project]&.include?(project_name) }
- unless @groups_for_filter.empty?
Expand All @@ -81,7 +81,7 @@
%b Groups
- @groups_for_filter.each do |group_title|
.px-4.py-1
= render partial: 'webui/shared/check_box', locals: { label: group_title, amount: @count[group_title],
= render partial: 'webui/shared/check_box', locals: { label: group_title, amount: @count["group_#{group_title}"],
key: "group[#{group_title}]", name: 'group[]', value: group_title,
checked: @selected_filter[:group]&.include?(group_title) }

Expand Down
4 changes: 2 additions & 2 deletions src/api/app/components/notification_filter_component.rb
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,10 @@ def notifications_count
counted_notifications['workflow_runs'] = @notifications.for_workflow_runs.count
counted_notifications['appealed_decisions'] = @notifications.for_appealed_decisions.count
@projects_for_filter.each do |project_name|
counted_notifications[project_name] = @notifications.for_project_name(project_name).count
counted_notifications["project_#{project_name}"] = @notifications.for_project_name(project_name).count
end
@groups_for_filter.each do |group_title|
counted_notifications[group_title] = @notifications.for_group_title(group_title).count
counted_notifications["group_#{group_title}"] = @notifications.for_group_title(group_title).count
end
counted_notifications
end
Expand Down

0 comments on commit 518cc49

Please sign in to comment.