Corso: Exchange: Details: add parentpath (#2690)

<!-- Insert PR description-->
Parent Path field added to  `Exchange` Backup Details 
---
- Only Exchange mail will display the path for  backup details. 
#### Does this PR need a docs update or release note?

- [x]  No

#### Type of change

<!--- Please check the type of change your PR introduces: --->
- [x] 🌻 Feature
- [x] 🧹 Tech Debt/Cleanup

#### Issue(s)

<!-- Can reference multiple issues. Use one of the following "magic words" - "closes, fixes" to auto-close the Github issue. -->
* closes #2352<issue>

#### Test Plan


- [x]  Unit test
This commit is contained in:
Danny 2023-03-06 10:01:26 -08:00 committed by GitHub
parent fc26ff3207
commit 36d7d44bb4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 12 additions and 8 deletions

View File

@ -7,6 +7,7 @@ import (
"bytes"
"context"
"io"
"strings"
"sync"
"sync/atomic"
"time"
@ -266,6 +267,7 @@ func (col *Collection) streamItems(ctx context.Context, errs *fault.Bus) {
}
info.Size = int64(len(data))
info.ParentPath = strings.Join(col.fullPath.Folders(), "/")
col.data <- &Stream{
id: id,

View File

@ -516,6 +516,7 @@ type ExchangeInfo struct {
ItemType ItemType `json:"itemType,omitempty"`
Sender string `json:"sender,omitempty"`
Subject string `json:"subject,omitempty"`
ParentPath string `json:"parentPath,omitempty"`
Received time.Time `json:"received,omitempty"`
EventStart time.Time `json:"eventStart,omitempty"`
EventEnd time.Time `json:"eventEnd,omitempty"`
@ -538,7 +539,7 @@ func (i ExchangeInfo) Headers() []string {
return []string{"Contact Name"}
case ExchangeMail:
return []string{"Sender", "Subject", "Received"}
return []string{"Sender", "Folder", "Subject", "Received"}
}
return []string{}
@ -562,7 +563,7 @@ func (i ExchangeInfo) Values() []string {
case ExchangeMail:
return []string{
i.Sender, i.Subject,
i.Sender, i.ParentPath, i.Subject,
common.FormatTabularDisplayTime(i.Received),
}
}

View File

@ -91,15 +91,16 @@ func (suite *DetailsUnitSuite) TestDetailsEntry_HeadersValues() {
LocationRef: "locationref",
ItemInfo: ItemInfo{
Exchange: &ExchangeInfo{
ItemType: ExchangeMail,
Sender: "sender",
Subject: "subject",
Received: now,
ItemType: ExchangeMail,
Sender: "sender",
ParentPath: "Parent",
Subject: "subject",
Received: now,
},
},
},
expectHs: []string{"ID", "Sender", "Subject", "Received"},
expectVs: []string{"deadbeef", "sender", "subject", nowStr},
expectHs: []string{"ID", "Sender", "Folder", "Subject", "Received"},
expectVs: []string{"deadbeef", "sender", "Parent", "subject", nowStr},
},
{
name: "sharepoint info",