minor touchups from manual testing (#4265)

#### Does this PR need a docs update or release note?

- [x]  Yes, it's included

#### Type of change

- [x] 🐛 Bugfix

#### Issue(s)

* #3988

#### Test Plan

- [x]  Unit test
- [x] 💚 E2E
This commit is contained in:
Keepers 2023-09-18 10:55:15 -06:00 committed by GitHub
parent dbbf9246fe
commit 77c48ebf95
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 18 additions and 9 deletions

View File

@ -12,7 +12,6 @@ import (
"github.com/alcionai/corso/src/internal/data"
"github.com/alcionai/corso/src/internal/m365/graph"
"github.com/alcionai/corso/src/internal/m365/support"
"github.com/alcionai/corso/src/internal/observe"
"github.com/alcionai/corso/src/internal/operations/inject"
"github.com/alcionai/corso/src/pkg/backup/metadata"
"github.com/alcionai/corso/src/pkg/control"
@ -58,11 +57,6 @@ func CreateCollections(
ctx = clues.Add(ctx, "can_use_previous_backup", canUsePreviousBackup)
catProgress := observe.MessageWithCompletion(
ctx,
observe.Bulletf("%s", qp.Category))
defer close(catProgress)
channels, err := bh.getChannels(ctx)
if err != nil {
return nil, false, clues.Stack(err)

View File

@ -67,9 +67,14 @@ func ProduceBackupCollections(
break
}
catStr := scope.Category().PathType().String()
if scope.Category().PathType() == path.ChannelMessagesCategory {
catStr = "messages"
}
progressBar := observe.MessageWithCompletion(
ctx,
observe.Bulletf("%s", scope.Category().PathType()))
observe.Bulletf("%s", catStr))
defer close(progressBar)
var dbcs []data.BackupCollection

View File

@ -65,7 +65,7 @@ func (i GroupsInfo) Headers() []string {
case SharePointLibrary:
return []string{"ItemName", "Library", "ParentPath", "Size", "Owner", "Created", "Modified"}
case GroupsChannelMessage:
return []string{"Message", "Channel", "Replies", "Creator", "Created", "Last Response"}
return []string{"Message", "Channel", "Replies", "Creator", "Created", "Last Reply"}
}
return []string{}
@ -86,13 +86,18 @@ func (i GroupsInfo) Values() []string {
dttm.FormatToTabularDisplay(i.Modified),
}
case GroupsChannelMessage:
lastReply := dttm.FormatToTabularDisplay(i.LastReplyAt)
if i.LastReplyAt.Equal(time.Time{}) {
lastReply = ""
}
return []string{
i.MessagePreview,
i.ParentPath,
strconv.Itoa(i.ReplyCount),
i.MessageCreator,
dttm.FormatToTabularDisplay(i.Created),
dttm.FormatToTabularDisplay(i.Modified),
lastReply,
}
}

View File

@ -3,6 +3,7 @@ package selectors
import (
"context"
"fmt"
"time"
"github.com/alcionai/clues"
@ -801,6 +802,10 @@ func (s GroupsScope) matchesInfo(dii details.ItemInfo) bool {
case GroupsInfoChannelMessageCreatedAfter, GroupsInfoChannelMessageCreatedBefore:
i = dttm.Format(info.Created)
case GroupsInfoChannelMessageLastReplyAfter, GroupsInfoChannelMessageLastReplyBefore:
if info.LastReplyAt.Equal(time.Time{}) {
return false
}
i = dttm.Format(info.LastReplyAt)
}