-
Notifications
You must be signed in to change notification settings - Fork 0
Add new room member actions and update interfaces #1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: develop
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -39,6 +39,8 @@ export const RoomMemberActions = { | |||||||||||
| ARCHIVE: 'archive', | ||||||||||||
| IGNORE: 'ignore', | ||||||||||||
| BLOCK: 'block', | ||||||||||||
| ANNOUNCEMENT: 'roomAnnouncement', | ||||||||||||
| DESCRIPTION: 'roomDescription', | ||||||||||||
| MUTE: 'mute', | ||||||||||||
| SET_AS_OWNER: 'setAsOwner', | ||||||||||||
| SET_AS_LEADER: 'setAsLeader', | ||||||||||||
|
|
@@ -57,6 +59,7 @@ export const UiTextContext = { | |||||||||||
| export interface IRoomTypeConfig { | ||||||||||||
| identifier: string; | ||||||||||||
| route?: IRoomTypeRouteConfig<RouteName>; | ||||||||||||
| label?: string; | ||||||||||||
| } | ||||||||||||
|
|
||||||||||||
| export interface IRoomTypeClientConfig extends IRoomTypeConfig { | ||||||||||||
|
|
@@ -84,6 +87,12 @@ export interface IRoomTypeClientDirectives { | |||||||||||
| extractOpenRoomParams?: (routeParams: Record<string, string | null | undefined>) => { type: RoomType; reference: string }; | ||||||||||||
| findRoom: (identifier: string) => IRoom | undefined; | ||||||||||||
| showJoinLink: (roomId: string) => boolean; | ||||||||||||
| showJoinLink: (roomId: string) => boolean; | ||||||||||||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Duplicate method declaration: The Confidence: 5/5 Suggested FixRemove the duplicate declaration on line 90. The method is already declared earlier in the interface. |
||||||||||||
| isLivechatRoom: () => boolean; | ||||||||||||
| isGroupChat: (room: IRoom) => boolean; | ||||||||||||
| canBeDeleted: (hasPermission: (permissionId: string, rid?: string) => Promise<boolean> | boolean, room: IRoom) => Promise<boolean>; | ||||||||||||
| preventRenaming: () => boolean; | ||||||||||||
| getDiscussionType: (room?: AtLeast<IRoom, 'teamId'>) => Promise<Ro | ||||||||||||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Suggestion: The new Severity Level: Minor
Suggested change
Why it matters? ⭐The client directive interface now declares Prompt for AI Agent 🤖This is a comment left during a code review.
**Path:** apps/meteor/definition/IRoomTypeConfig.ts
**Line:** 95:95
**Comment:**
*Type Error: The new `getDiscussionType` signature in the client directives is truncated to `Promise<Ro`, making the interface invalid so any implementation or caller cannot compile; it must return `Promise<RoomType>` just like the server interface.
Validate the correctness of the flagged issue. If correct, How can I resolve this? If you propose a fix, implement it and please make it concise.There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Incomplete method signature: The Confidence: 5/5 Suggested FixComplete the method signature with the full return type. Based on the context, it likely should be something like:
Suggested change
Verify the correct return type from the implementation or related type definitions. |
||||||||||||
| isLivechatRoom: () => boolean; | ||||||||||||
|
Comment on lines
87
to
96
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Critical: Remove duplicate method definitions and fix truncated type. This interface contains multiple critical issues that will prevent compilation:
Apply this diff to fix all issues: getIcon?: (room: Partial<IRoom>) => IconName;
extractOpenRoomParams?: (routeParams: Record<string, string | null | undefined>) => { type: RoomType; reference: string };
findRoom: (identifier: string) => IRoom | undefined;
showJoinLink: (roomId: string) => boolean;
- showJoinLink: (roomId: string) => boolean;
- isLivechatRoom: () => boolean;
- isGroupChat: (room: IRoom) => boolean;
canBeDeleted: (hasPermission: (permissionId: string, rid?: string) => Promise<boolean> | boolean, room: IRoom) => Promise<boolean>;
preventRenaming: () => boolean;
- getDiscussionType: (room?: AtLeast<IRoom, 'teamId'>) => Promise<Ro
+ getDiscussionType: (room?: AtLeast<IRoom, 'teamId'>) => Promise<RoomType>;
isLivechatRoom: () => boolean;
canSendMessage: (rid: string) => boolean;Note: Verify whether
🧰 Tools🪛 Biome (2.1.2)[error] 96-96: expected Remove isLivechatRoom (parse) [error] 96-96: expected Remove : (parse) 🤖 Prompt for AI Agents |
||||||||||||
| canSendMessage: (rid: string) => boolean; | ||||||||||||
| readOnly?: (rid: string, user: AtLeast<IUser, 'username'>) => boolean; | ||||||||||||
|
|
@@ -95,6 +104,10 @@ export interface IRoomTypeServerDirectives { | |||||||||||
| allowRoomSettingChange: (room: IRoom, setting: ValueOf<typeof RoomSettingsEnum>) => boolean; | ||||||||||||
| allowMemberAction: (room: IRoom, action: ValueOf<typeof RoomMemberActions>, userId?: IUser['_id']) => Promise<boolean>; | ||||||||||||
| roomName: (room: IRoom, userId?: string) => Promise<string | undefined>; | ||||||||||||
| extractOpenRoomParams?: (routeParams: Record<string, string | null | undefined>) => { type: RoomType; reference: string }; | ||||||||||||
| findRoom: (identifier: string) => IRoom | undefined; | ||||||||||||
| showJoinLink: (roomId: string) => boolean; | ||||||||||||
| isLivechatRoom: () => boolean; | ||||||||||||
|
Comment on lines
+107
to
+110
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Incorrect method placement: The methods Confidence: 5/5 Suggested FixRemove these four method declarations from 📍 This suggestion applies to lines 107-110 |
||||||||||||
| isGroupChat: (room: IRoom) => boolean; | ||||||||||||
| canBeDeleted: (hasPermission: (permissionId: string, rid?: string) => Promise<boolean> | boolean, room: IRoom) => Promise<boolean>; | ||||||||||||
| preventRenaming: () => boolean; | ||||||||||||
|
|
||||||||||||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Consider distinct values for member actions vs. settings.
The values
'roomAnnouncement'and'roomDescription'are already used inRoomSettingsEnum(lines 27-28). Using identical string values for both settings and member actions may cause confusion when these constants are used interchangeably, as settings and actions represent different concepts.Consider using distinct prefixes or suffixes to differentiate between the two contexts:
export const RoomMemberActions = { ARCHIVE: 'archive', IGNORE: 'ignore', BLOCK: 'block', - ANNOUNCEMENT: 'roomAnnouncement', - DESCRIPTION: 'roomDescription', + ANNOUNCEMENT: 'memberActionAnnouncement', + DESCRIPTION: 'memberActionDescription', MUTE: 'mute',📝 Committable suggestion
🤖 Prompt for AI Agents