Skip to content
18 changes: 2 additions & 16 deletions apps/meteor/client/hooks/useRoomIcon.spec.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,59 +6,45 @@ const mockRooms = {
t: 'c',
name: 'public',
teamMain: false,
// @ts-expect-error TODO: Implement ABAC attributes in rooms
abacAttributes: false,
}),
private: createFakeRoom({
t: 'p',
name: 'private',
teamMain: false,
// @ts-expect-error TODO: Implement ABAC attributes in rooms
abacAttributes: false,
}),
team: createFakeRoom({
t: 'c',
name: 'team',
teamMain: true,
// @ts-expect-error TODO: Implement ABAC attributes in rooms
abacAttributes: false,
}),
direct: createFakeRoom({
t: 'd',
name: 'direct',
teamMain: false,
// @ts-expect-error TODO: Implement ABAC attributes in rooms
abacAttributes: false,
}),
directMultiple: createFakeRoom({
t: 'd',
name: 'direct-multiple',
teamMain: false,
// @ts-expect-error TODO: Implement ABAC attributes in rooms
abacAttributes: false,
uids: ['user1', 'user2', 'user3'],
}),
federated: createFakeRoom({
t: 'c',
name: 'federated',
teamMain: false,
// @ts-expect-error TODO: Implement ABAC attributes in rooms
abacAttributes: false,
federated: true,
}),
abacRoom: createFakeRoom({
t: 'c',
name: 'abac-room',
teamMain: false,
// @ts-expect-error TODO: Implement ABAC attributes in rooms
abacAttributes: true,
abacAttributes: [{ key: 'department', values: ['engineering'] }],
}),
abacTeamRoom: createFakeRoom({
t: 'c',
name: 'abac-team-room',
teamMain: true,
// @ts-expect-error TODO: Implement ABAC attributes in rooms
abacAttributes: true,
abacAttributes: [{ key: 'team', values: ['core'] }],
}),
};

Expand Down
3 changes: 1 addition & 2 deletions apps/meteor/client/hooks/useRoomIcon.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,8 @@ import type { ComponentProps, ReactElement } from 'react';
import { ReactiveUserStatus } from '../components/UserStatus';

export const useRoomIcon = (
room: Pick<IRoom, 't' | 'prid' | 'teamMain' | 'uids' | 'u'>,
room: Pick<IRoom, 't' | 'prid' | 'teamMain' | 'uids' | 'u' | 'abacAttributes'>,
): ComponentProps<typeof Icon> | ReactElement | null => {
// @ts-expect-error TODO: Implement ABAC attributes in rooms
if (room.abacAttributes) {
if (room.teamMain) {
return { name: 'team-shield' };
Expand Down
Loading