mirror of
https://github.com/zulip/zulip.git
synced 2025-11-06 15:03:34 +00:00
user_groups: Don't allow adding deactivated groups as subgroups in UI.
We already have the code to ignore the deactivated groups before sending the request and show appropriate message. This commit just adds code to not show them in the typeahead and also not create its pill if user types the full group name.
This commit is contained in:
@@ -318,6 +318,10 @@ export function check_group_can_be_subgroup(
|
|||||||
// This logic could be optimized if we maintained a reverse map
|
// This logic could be optimized if we maintained a reverse map
|
||||||
// from each group to the groups containing it, which might be a
|
// from each group to the groups containing it, which might be a
|
||||||
// useful data structure for other code paths as well.
|
// useful data structure for other code paths as well.
|
||||||
|
if (subgroup.deactivated) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
const already_subgroup_ids = target_user_group.direct_subgroup_ids;
|
const already_subgroup_ids = target_user_group.direct_subgroup_ids;
|
||||||
if (subgroup.id === target_user_group.id) {
|
if (subgroup.id === target_user_group.id) {
|
||||||
return false;
|
return false;
|
||||||
|
|||||||
Reference in New Issue
Block a user