Commit Graph

12 Commits

Author SHA1 Message Date
Sahil Batra f38ab85f02 user_groups: Pass user group object instead of id to get_recursive_subgroups.
We directly pass the user group object to get_recursive_subgroups as we
already have the object in the caller. We can add separate function which
will accept id as parameter in the future if required.
2022-05-17 14:51:55 -07:00
Sahil Batra dfd7902c77 user_groups: Rename subgroups fields to direct_subgroup_ids.
This commit renames subgroups and subgroup_ids field sent in user
group objects to direct_subgroup_ids for better readability.
2022-05-17 14:51:45 -07:00
Sahil Batra eebc776bf5 user_groups: Add is_user_in_group function.
This commit adds function to check whether a user
belongs to the user group or not.

Fixes part of #19525.
2022-05-05 13:51:57 -07:00
Sahil Batra 41880759cf user_groups: Add get_recursive_subgroups function in frontend.
This commit adds get_recursive_subgroups function to get all
subgroups of a user group.
2022-05-05 13:51:53 -07:00
Sahil Batra c52a135eb3 user_groups: Swap parameter order in is_direct_member_of function.
This commit swaps the parameter order in is_direct_member_of
function to have user_id followed by user_group_id since user_id
is a member of user_group_id and not the other way around.
2022-05-05 13:48:01 -07:00
Sahil Batra 6bca2453cf user_groups: Rename is_member_of function to is_direct_member_of. 2022-05-05 13:48:01 -07:00
Sahil Batra a5b3510cb3 user_groups: Add functions to update subgroups data on receiving events. 2022-05-05 13:48:01 -07:00
Sahil Batra e2b9d6ebeb user_groups: Add subgroups field to user group objects. 2022-05-05 13:48:01 -07:00
Anders Kaseorg f7a7cfea62 js: Fix @typescript-eslint/restrict-plus-operands.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2021-09-22 18:06:06 -07:00
Sahil Batra 3242a61894 user_groups: Hide system user groups from UI.
We do not have any system user groups as of
now, but this commit is just a prep commit
to prevent any change in user-facing pages
to avoid confusion till this feature is
completed.

This change was initially made in 6117c38,
but it was reverted in 1543775a due to merge
conflicts with the typescript migration of
user_groups.js.
2021-09-16 13:11:03 -07:00
Tim Abbott 1543775ac6 user_groups: Temporarily remove is_system_group check.
This effectively reverts 6117c3824a,
which merge conflicted with the typescript migration on this file, and
this commit is easier to undo.
2021-09-15 17:19:21 -07:00
Priyank Patel 9de3b2f4fd ts: Convert user_groups module to TypeScript. 2021-09-15 16:53:17 -07:00