Revert "Mm 30807 granular data retention scaffold (#16891)" (#17437)

This reverts commit 3ea75332e7.
Этот коммит содержится в:
Agniva De Sarker
2021-04-18 22:41:50 +05:30
коммит произвёл GitHub
родитель 3a13987ee1
Коммит e0efdd708b
49 изменённых файлов: 984 добавлений и 5079 удалений

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

@@ -1025,62 +1025,6 @@ func TestGetAllChannels(t *testing.T) {
_, resp := Client.GetAllChannels(0, 20, "")
CheckForbiddenStatus(t, resp)
sysManagerChannels, resp := th.SystemManagerClient.GetAllChannels(0, 10000, "")
CheckOKStatus(t, resp)
policyChannel := (*sysManagerChannels)[0]
policy, savePolicyErr := th.App.Srv().Store.RetentionPolicy().Save(&model.RetentionPolicyWithTeamAndChannelIDs{
RetentionPolicy: model.RetentionPolicy{
DisplayName: "Policy 1",
PostDuration: model.NewInt64(30),
},
ChannelIDs: []string{policyChannel.Id},
})
require.NoError(t, savePolicyErr)
t.Run("exclude policy constrained", func(t *testing.T) {
_, resp := th.SystemManagerClient.GetAllChannelsExcludePolicyConstrained(0, 10000, "")
CheckForbiddenStatus(t, resp)
channels, resp := th.SystemAdminClient.GetAllChannelsExcludePolicyConstrained(0, 10000, "")
CheckOKStatus(t, resp)
found := false
for _, channel := range *channels {
if channel.Id == policyChannel.Id {
found = true
break
}
}
require.False(t, found)
})
t.Run("does not return policy ID", func(t *testing.T) {
channels, resp := th.SystemManagerClient.GetAllChannels(0, 10000, "")
CheckOKStatus(t, resp)
found := false
for _, channel := range *channels {
if channel.Id == policyChannel.Id {
found = true
require.Nil(t, channel.PolicyID)
break
}
}
require.True(t, found)
})
t.Run("returns policy ID", func(t *testing.T) {
channels, resp := th.SystemAdminClient.GetAllChannels(0, 10000, "")
CheckOKStatus(t, resp)
found := false
for _, channel := range *channels {
if channel.Id == policyChannel.Id {
found = true
require.Equal(t, *channel.PolicyID, policy.ID)
break
}
}
require.True(t, found)
})
}
func TestGetAllChannelsWithCount(t *testing.T) {
@@ -1446,46 +1390,6 @@ func TestSearchAllChannels(t *testing.T) {
_, resp = Client.SearchAllChannels(&model.ChannelSearch{Term: ""})
CheckForbiddenStatus(t, resp)
// Choose a policy which the system manager can read
sysManagerChannels, resp := th.SystemManagerClient.GetAllChannels(0, 10000, "")
CheckOKStatus(t, resp)
policyChannel := (*sysManagerChannels)[0]
policy, savePolicyErr := th.App.Srv().Store.RetentionPolicy().Save(&model.RetentionPolicyWithTeamAndChannelIDs{
RetentionPolicy: model.RetentionPolicy{
DisplayName: "Policy 1",
PostDuration: model.NewInt64(30),
},
ChannelIDs: []string{policyChannel.Id},
})
require.NoError(t, savePolicyErr)
t.Run("does not return policy ID", func(t *testing.T) {
channels, resp := th.SystemManagerClient.SearchAllChannels(&model.ChannelSearch{Term: policyChannel.Name})
CheckOKStatus(t, resp)
found := false
for _, channel := range *channels {
if channel.Id == policyChannel.Id {
found = true
require.Nil(t, channel.PolicyID)
break
}
}
require.True(t, found)
})
t.Run("returns policy ID", func(t *testing.T) {
channels, resp := th.SystemAdminClient.SearchAllChannels(&model.ChannelSearch{Term: policyChannel.Name})
CheckOKStatus(t, resp)
found := false
for _, channel := range *channels {
if channel.Id == policyChannel.Id {
found = true
require.Equal(t, *channel.PolicyID, policy.ID)
break
}
}
require.True(t, found)
})
}
func TestSearchAllChannelsPaged(t *testing.T) {