mirror of https://github.com/zulip/zulip.git
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:
parent
69c0a772cc
commit
caf919fca2
|
@ -318,6 +318,10 @@ export function check_group_can_be_subgroup(
|
|||
// This logic could be optimized if we maintained a reverse map
|
||||
// from each group to the groups containing it, which might be a
|
||||
// useful data structure for other code paths as well.
|
||||
if (subgroup.deactivated) {
|
||||
return false;
|
||||
}
|
||||
|
||||
const already_subgroup_ids = target_user_group.direct_subgroup_ids;
|
||||
if (subgroup.id === target_user_group.id) {
|
||||
return false;
|
||||
|
|
Loading…
Reference in New Issue