discourse/plugins/discourse-assign/spec/requests
Régis HANOL 026eae7352
FIX: show group Assignments tab based on assignable_level (#39085)
The Assignments tab on group pages had two problematic visibility
conditions that caused it to disappear unexpectedly:

1. `can_show_assigned_tab?` checked whether ALL members of the group
belonged to an `assign_allowed_on_groups` group. This meant a single
member outside those groups would hide the tab for everyone — even when
the group was fully assignable and had active assignments.

2. The frontend required `assignment_count > 0`, so the tab silently
vanished when the last assignment was resolved, with no indication of
whether the feature was unconfigured or simply empty.

The root cause is that tab visibility was answering the wrong question:
"can all members use the assign feature?" instead of "is this group set
up to receive assignments?"

This replaces the member-overlap SQL in `can_show_assigned_tab?` with a
simple check on `assignable_level > nobody` — the setting that actually
controls whether a group can receive assignments. The `assignment_count
> 0` gate is removed from the frontend so the tab stays visible with an
empty state, consistent with other group tabs.

Also fixes the `assign_allowed_on_groups` setting description which
incorrectly stated it controls who can be assigned topics (that's
`assignable_level`).

Ref - t/179679
2026-04-08 16:50:27 +02:00
..
assign_controller_spec.rb FIX: Missing guardian check on target visibility in unassign and assign (#37755) 2026-02-12 11:15:03 +01:00
list_controller_spec.rb FIX: show group Assignments tab based on assignable_level (#39085) 2026-04-08 16:50:27 +02:00
search_controller_spec.rb