Skip to content
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

feat: workspaces #1156

Merged
merged 95 commits into from
Dec 14, 2024
Merged

feat: workspaces #1156

merged 95 commits into from
Dec 14, 2024

Conversation

nikkothari22
Copy link
Member

@nikkothari22 nikkothari22 commented Nov 17, 2024

Workspaces allows users to create multiple "spaces" each having it's own channels.

Example use case: a company like Frappe wants to run internal comms, customer support/community engagement etc all with just one Raven account and site. They would create private workspaces for internal comms or 1-on-1 customer engagement, and public workspaces for community engagement. This could apply to any organisation trying to separate departments/teams or using Raven to communicate with external vendors/staff.

DMs are not included in workspaces and hence are "shared".

CleanShot 2024-11-17 at 18 32 48@2x

Things to do:

Permissions

A new role of "Raven Admin" has been created - users with this role can create workspaces.

  • Updated permission controller logic for Raven Channel, Raven Channel Member and Raven Message
  • Permission controller logic for Raven Workspace and Raven Workspace Member
  • Unit tests for all permission checks - in progress

Backend - APIs, Caching, Performance

  • Fetching workspaces - in progress
  • Unread count logic for workspaces
  • Get Channel list API with workspace membership check for open channels
  • Search API needs to only check for channel membership
  • Validation - channels cannot be created without a workspace + channel ID needs to be name-spaced according to workspace (e.g. Workspace-my-channel instead of just my-channel
  • Thread creation - copy over main channel workspace. If it's a DM channel, set is_dm_thread to 1.

Patches

  • Added a new field is_dm_thread in Raven Channel for all threads created inside DMs. Since DMs do not have any workspace, threads created in a DM do not need a workspace.
  • Patch to check is_dm_thread in all existing threads created in a DM
  • Patch to migrate all existing users and channels to a default public workspace called "Raven". All existing Raven Users are members of this new workspace, and all of them are admins of this workspace.

UI

  • Workspaces Sidebar layout
  • Show unread count for workspaces
  • Filter channel list in sidebar based on selected workspace
  • Join workspace flow
  • Create workspace flow
  • Workspace List
  • Workspace Member management
  • Forwarding a message - show channel with workspace name
  • Command Palette - show channels with workspace name
  • Threads tab - only show threads from channels in the selected workspace
  • Users can only mention channel in their own workspace

Other unrelated fixes in this PR:

  1. Reactions now store the link to the channel. Deleting a channel will now delete all reactions in it. Closes Deleting a channel does not delete message reactions of messages in that channel #1151
  2. List of channel members are now read from cache instead of database for better performance. Closes Cache channel membership data #762
  3. Link previews are styled better. Closes Limit characters on link previews #1139

Closes #679

@nikkothari22 nikkothari22 self-assigned this Nov 17, 2024
@nikkothari22 nikkothari22 marked this pull request as ready for review December 14, 2024 18:27
@nikkothari22 nikkothari22 merged commit 4255001 into develop Dec 14, 2024
3 checks passed
@nikkothari22 nikkothari22 deleted the raven-orgs branch December 14, 2024 19:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
1 participant