MM-8839: Adds ChannelType to compliance-related model. (#8424)

Этот коммит содержится в:
Martin Kraft
2018-03-09 10:30:05 -05:00
коммит произвёл Joram Wilander
родитель 8ad99b4b1f
Коммит 426796829a
4 изменённых файлов: 9 добавлений и 0 удалений

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

@@ -17,6 +17,7 @@ type CompliancePost struct {
// From Channel
ChannelName string
ChannelDisplayName string
ChannelType string
// From User
UserUsername string
@@ -45,6 +46,7 @@ func CompliancePostHeader() []string {
"ChannelName",
"ChannelDisplayName",
"ChannelType",
"UserUsername",
"UserEmail",
@@ -92,6 +94,7 @@ func (me *CompliancePost) Row() []string {
cleanComplianceStrings(me.ChannelName),
cleanComplianceStrings(me.ChannelDisplayName),
cleanComplianceStrings(me.ChannelType),
cleanComplianceStrings(me.UserUsername),
cleanComplianceStrings(me.UserEmail),

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

@@ -6,6 +6,7 @@ package model
type MessageExport struct {
ChannelId *string
ChannelDisplayName *string
ChannelType *string
UserId *string
UserEmail *string

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

@@ -138,6 +138,7 @@ func (s SqlComplianceStore) ComplianceExport(job *model.Compliance) store.StoreC
Teams.DisplayName AS TeamDisplayName,
Channels.Name AS ChannelName,
Channels.DisplayName AS ChannelDisplayName,
Channels.Type AS ChannelType,
Users.Username AS UserUsername,
Users.Email AS UserEmail,
Users.Nickname AS UserNickname,
@@ -172,6 +173,7 @@ func (s SqlComplianceStore) ComplianceExport(job *model.Compliance) store.StoreC
'Direct Messages' AS TeamDisplayName,
Channels.Name AS ChannelName,
Channels.DisplayName AS ChannelDisplayName,
Channels.Type AS ChannelType,
Users.Username AS UserUsername,
Users.Email AS UserEmail,
Users.Nickname AS UserNickname,
@@ -228,6 +230,7 @@ func (s SqlComplianceStore) MessageExport(after int64, limit int) store.StoreCha
WHEN Channels.Type = 'G' THEN 'Group Message'
ELSE Channels.DisplayName
END AS ChannelDisplayName,
Channels.Type AS ChannelType,
Users.Id AS UserId,
Users.Email AS UserEmail,
Users.Username

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

@@ -509,6 +509,7 @@ func testMessageExportPrivateChannel(t *testing.T, ss store.Store) {
assert.Equal(t, post1.Message, *messageExportMap[post1.Id].PostMessage)
assert.Equal(t, channel.Id, *messageExportMap[post1.Id].ChannelId)
assert.Equal(t, channel.DisplayName, *messageExportMap[post1.Id].ChannelDisplayName)
assert.Equal(t, channel.Type, *messageExportMap[post1.Id].ChannelType)
assert.Equal(t, user1.Id, *messageExportMap[post1.Id].UserId)
assert.Equal(t, user1.Email, *messageExportMap[post1.Id].UserEmail)
assert.Equal(t, user1.Username, *messageExportMap[post1.Id].Username)
@@ -519,6 +520,7 @@ func testMessageExportPrivateChannel(t *testing.T, ss store.Store) {
assert.Equal(t, post2.Message, *messageExportMap[post2.Id].PostMessage)
assert.Equal(t, channel.Id, *messageExportMap[post2.Id].ChannelId)
assert.Equal(t, channel.DisplayName, *messageExportMap[post2.Id].ChannelDisplayName)
assert.Equal(t, channel.Type, *messageExportMap[post2.Id].ChannelType)
assert.Equal(t, user1.Id, *messageExportMap[post2.Id].UserId)
assert.Equal(t, user1.Email, *messageExportMap[post2.Id].UserEmail)
assert.Equal(t, user1.Username, *messageExportMap[post2.Id].Username)