zFigma link: https://www.figma.com/design/C5KmGaL6A0teemBsLc3IVy/Shared-Teams-across-Server?node-id=1971-43986&t=YVuhbFCjnSHwpuJI-11

Creating a connection

We can create and accept a connection from the Connected Organizations page under the environment section.

image-20240112-121513.png

On the add a connection button, you have two options:

  1. Create a connection

  2. Accept an invitation

Creating a connection

Only instances with an Enterprise license can create a connection with another server. Once the user clicks on Create a connection, they’re taken to the Connection Inner page.

Here they can enter/decide:

  1. Organisation name

    1. This would also be the connection name

  2. Decide if channel invites should automatically be accepted.

  3. If automatically accepted, choose default destination team for those channels.

    1. This would be the default team where any channels shared would land.

  4. Channels they want to share

    1. Initially, the user can only share their own channels, and not see other channels that are shared, but later on, they will see two tabs:

      1. For channels shared by the external server

      2. Their own channels shared.

image-20240112-121734.pngimage-20240708-130240.png

If the automatically select channel invites option is turned on, we will show the destination team dropdown.

image-20240708-130610.png

Channel Sharing

image-20240708-130806.png

Once the channels are selected and added, they appear in the list.

image-20240708-130940.png

Share code

Once done, the user can click on Save to create a connection. They get a share popup to share the code needed to accept the connection.

This code will only be shared once, and the user has to copy both of these and send them to the other org in order for a connection to be established.

image-20240711-141708.png

If the user closes the modal, they can regenerate another code, which renders the old code invalid.

The list should show all of the connections you’ve created or accepted, with their state and the channels being shared in total (from us, and from the other party):

It would also include the options to:

  1. Generate a new invitation code

  2. Edit the connection

  3. Delete it

image-20240708-131304.png

Creating a new connection opens up a new modal with a new invitation code and password.

image-20240711-141640.png

Accepting a connection

Only instances with an Enterprise license can accept a connection with another server. On the other end, once the user receives the invitation code, they can go to the same page and click on Accept a connection in the Add connection dropdown.

Here the user can enter the organisation name, encrypted invitation code, and password shared by the other organisation.

image-20240711-141629.png

Connection Inner Page

This inner page is similar to the one above. Except, it has two tabs which shows channels shared by the external org, and then your own channels shared.

The user would see the channels the other party has shared, and since by default you do not accept channel invites. The admin would have an option to accept each individual channel and choose a destination team.

image-20240708-131630.png

The user can click on Reject to reject the channel invite, or Accept to get this modal to choose a destination team:

image-20240708-131714.png

After which, the team would show up like this.

image-20240711-133744.png

The save and cancel buttons only are for the top section, not for the Shared channels section where the user is sharing, accepting or removing channels.

Once accepted, the user can also change the destination team of a channel.

The Your channel list flow is going to be similar to the one mentioned previously.

Adding a channel

If the user adds a channel by staying on the external channels tab, once he has selected the channels, we will take him to his own channels tab automatically and show the added channel there.

image-20240711-133821.png

Changing the destination team

New channel requests

If a channel request is sent and the automatically accept channel invites option is turned off. We will send a bot message to all admins as well. They can then accept or reject the channel and choose a destination team.

image-20240711-135315.pngimage-20240711-135324.png

Removing an accepted channel

Once a channel is accepted, each server has the option to unsync the channel from the other remote.

They can do that by clicking the remove button on the channel.

CleanShot 2024-07-11 at 20.49.14.mp4

If a channel has been removed previously in a shared connection, then any party that tries to share that channel will get an error like this when sharing that channel.

image-20240711-193236.png

This only exists per connection. The admins can still share this channel with another remote (if it hasn’t been removed from there either).

Connection list page

image-20240708-131830.png

DMs with External Connection

If you are sharing a channel with a user, you can also communicate with them via DM.

Shared channels in sidebar

image-20240112-122646.png

Browse shared channels

Shared channels would also be visible in the browse channels modal with an icon.

image-20240112-122740.png

Channel Members

Members from other orgs can also be seen in the channel member list (with an icon on the right), but you won’t be able to manage them.

image-20240112-122829.pngimage-20240112-122842.png

Removing a connection

When a connection/channel is removed, we will remove all shared users from the channel list, and also remove the link icon from the LHS, header, and anywhere it appears.

System console updates

Users page

On the users page, if we show the shared users, we should remove all options on the right, such as changing their membership or reset their password, etc.

image-20240606-140446.png

Channels list

On the channels list, we would show a list of channels that are shared with external orgs as well.

image-20240606-140554.png

And on hover, we get a tooltip on it identifying which connections are sharing those channels.

And on click, we take the user to the first organisation that this is being shared to.

I say first because a single channel could potentially be shared to multiple organisations.

image-20240606-140645.png