mirror of
https://github.com/zulip/zulip.git
synced 2025-11-07 07:23:22 +00:00
user_groups: Add subgroups field to user group objects.
This commit is contained in:
@@ -291,6 +291,7 @@ const hamletcharacters = {
|
|||||||
description: "Characters of Hamlet",
|
description: "Characters of Hamlet",
|
||||||
members: new Set([100, 104]),
|
members: new Set([100, 104]),
|
||||||
is_system_group: false,
|
is_system_group: false,
|
||||||
|
subgroups: new Set([10, 11]),
|
||||||
};
|
};
|
||||||
|
|
||||||
const backend = {
|
const backend = {
|
||||||
@@ -299,6 +300,7 @@ const backend = {
|
|||||||
description: "Backend team",
|
description: "Backend team",
|
||||||
members: new Set([]),
|
members: new Set([]),
|
||||||
is_system_group: false,
|
is_system_group: false,
|
||||||
|
subgroups: new Set([]),
|
||||||
};
|
};
|
||||||
|
|
||||||
const call_center = {
|
const call_center = {
|
||||||
@@ -307,6 +309,7 @@ const call_center = {
|
|||||||
description: "folks working in support",
|
description: "folks working in support",
|
||||||
members: new Set([]),
|
members: new Set([]),
|
||||||
is_system_group: false,
|
is_system_group: false,
|
||||||
|
subgroups: new Set([]),
|
||||||
};
|
};
|
||||||
|
|
||||||
const make_emoji = (emoji_dict) => ({
|
const make_emoji = (emoji_dict) => ({
|
||||||
|
|||||||
@@ -15,6 +15,7 @@ run_test("user_groups", () => {
|
|||||||
id: 0,
|
id: 0,
|
||||||
members: new Set([1, 2]),
|
members: new Set([1, 2]),
|
||||||
is_system_group: false,
|
is_system_group: false,
|
||||||
|
subgroups: new Set([4, 5]),
|
||||||
};
|
};
|
||||||
|
|
||||||
const params = {};
|
const params = {};
|
||||||
@@ -31,12 +32,14 @@ run_test("user_groups", () => {
|
|||||||
id: 1,
|
id: 1,
|
||||||
members: new Set([3]),
|
members: new Set([3]),
|
||||||
is_system_group: false,
|
is_system_group: false,
|
||||||
|
subgroups: new Set([]),
|
||||||
};
|
};
|
||||||
const all = {
|
const all = {
|
||||||
name: "Everyone",
|
name: "Everyone",
|
||||||
id: 2,
|
id: 2,
|
||||||
members: new Set([1, 2, 3]),
|
members: new Set([1, 2, 3]),
|
||||||
is_system_group: false,
|
is_system_group: false,
|
||||||
|
subgroups: new Set([4, 5, 6]),
|
||||||
};
|
};
|
||||||
|
|
||||||
user_groups.add(admins);
|
user_groups.add(admins);
|
||||||
|
|||||||
@@ -8,6 +8,7 @@ type UserGroup = {
|
|||||||
name: string;
|
name: string;
|
||||||
members: Set<number>;
|
members: Set<number>;
|
||||||
is_system_group: boolean;
|
is_system_group: boolean;
|
||||||
|
subgroups: Set<number>;
|
||||||
};
|
};
|
||||||
|
|
||||||
// The members field is a number array which we convert
|
// The members field is a number array which we convert
|
||||||
@@ -35,6 +36,7 @@ export function add(user_group_raw: UserGroupRaw): void {
|
|||||||
name: user_group_raw.name,
|
name: user_group_raw.name,
|
||||||
members: new Set(user_group_raw.members),
|
members: new Set(user_group_raw.members),
|
||||||
is_system_group: user_group_raw.is_system_group,
|
is_system_group: user_group_raw.is_system_group,
|
||||||
|
subgroups: new Set(user_group_raw.subgroups),
|
||||||
};
|
};
|
||||||
|
|
||||||
user_group_name_dict.set(user_group.name, user_group);
|
user_group_name_dict.set(user_group.name, user_group);
|
||||||
|
|||||||
Reference in New Issue
Block a user