Prompt Team Admin before joining private channel (#29955)

* Prompt Team Admin before joining private channel

* fix and implement prompt when team admin joins via channel link

* update premission check and unit tests

* remove comment

* clean up some code

* update check to fix E2E tests
Этот коммит содержится в:
Scott Bishel
2025-01-30 08:21:09 -07:00
коммит произвёл GitHub
родитель f2af360401
Коммит 369b9fa96b
6 изменённых файлов: 260 добавлений и 17 удалений

Просмотреть файл

@@ -2487,6 +2487,13 @@ func TestGetChannelByName(t *testing.T) {
_, _, err = client.GetChannelByName(context.Background(), th.BasicChannel.Name, th.BasicTeam.Id, "")
require.NoError(t, err)
})
th.SystemAdminClient.RemoveUserFromChannel(context.Background(), th.BasicPrivateChannel.Id, th.TeamAdminUser.Id)
TeamAdminClient := th.CreateClient()
th.LoginTeamAdminWithClient(TeamAdminClient)
channel, _, err = TeamAdminClient.GetChannelByName(context.Background(), th.BasicPrivateChannel.Name, th.BasicTeam.Id, "")
require.NoError(t, err)
require.Equal(t, th.BasicPrivateChannel.Name, channel.Name, "names did not match")
}
func TestGetChannelByNameForTeamName(t *testing.T) {
@@ -2498,7 +2505,14 @@ func TestGetChannelByNameForTeamName(t *testing.T) {
require.NoError(t, err)
require.Equal(t, th.BasicChannel.Name, channel.Name, "names did not match")
_, _, err = client.GetChannelByNameForTeamName(context.Background(), th.BasicChannel.Name, th.BasicTeam.Name, "")
th.SystemAdminClient.RemoveUserFromChannel(context.Background(), th.BasicPrivateChannel.Id, th.TeamAdminUser.Id)
TeamAdminClient := th.CreateClient()
th.LoginTeamAdminWithClient(TeamAdminClient)
channel, _, err = TeamAdminClient.GetChannelByNameForTeamName(context.Background(), th.BasicPrivateChannel.Name, th.BasicTeam.Name, "")
require.NoError(t, err)
require.Equal(t, th.BasicPrivateChannel.Name, channel.Name, "names did not match")
channel, _, err = client.GetChannelByNameForTeamName(context.Background(), th.BasicChannel.Name, th.BasicTeam.Name, "")
require.NoError(t, err)
require.Equal(t, th.BasicChannel.Name, channel.Name, "names did not match")