disable backup of sharepoint lists (#4960)

disable backup of sharepoint lists

#### Does this PR need a docs update or release note?
- [x]  No

#### Test Plan

<!-- How will this be tested prior to merging.-->
- [x] 💪 Manual
- [x]  Unit test
- [x] 💚 E2E
This commit is contained in:
Hitesh Pattanayak 2024-01-03 01:11:35 +05:30 committed by GitHub
parent e43fec2de6
commit 4224a98927
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 25 additions and 21 deletions

View File

@ -75,15 +75,18 @@ func SharePointAllowedCategories() map[string]struct{} {
func AddCategories(sel *selectors.SharePointBackup, cats []string) *selectors.SharePointBackup {
if len(cats) == 0 {
sel.Include(sel.LibraryFolders(selectors.Any()), sel.Lists(selectors.Any()))
// backup of sharepoint lists not enabled yet
// sel.Include(sel.LibraryFolders(selectors.Any()), sel.Lists(selectors.Any()))
sel.Include(sel.LibraryFolders(selectors.Any()))
}
for _, d := range cats {
switch d {
// backup of sharepoint lists not enabled yet
// case flags.DataLists:
// sel.Include(sel.Lists(selectors.Any()))
case flags.DataLibraries:
sel.Include(sel.LibraryFolders(selectors.Any()))
case flags.DataLists:
sel.Include(sel.Lists(selectors.Any()))
}
}

View File

@ -378,35 +378,36 @@ func (suite *SharePointUtilsSuite) TestValidateSharePointRestoreFlags() {
}
}
// [TODO] uncomment the test cases once sharepoint list backup is enabled
func (suite *SharePointUtilsSuite) TestAddSharepointCategories() {
table := []struct {
name string
cats []string
expectScopeLen int
}{
{
name: "none",
cats: []string{},
expectScopeLen: 2,
},
// {
// name: "none",
// cats: []string{},
// expectScopeLen: 2,
// },
{
name: "libraries",
cats: []string{flags.DataLibraries},
expectScopeLen: 1,
},
{
name: "lists",
cats: []string{flags.DataLists},
expectScopeLen: 1,
},
{
name: "all allowed",
cats: []string{
flags.DataLibraries,
flags.DataLists,
},
expectScopeLen: 2,
},
// {
// name: "lists",
// cats: []string{flags.DataLists},
// expectScopeLen: 1,
// },
// {
// name: "all allowed",
// cats: []string{
// flags.DataLibraries,
// flags.DataLists,
// },
// expectScopeLen: 2,
// },
{
name: "bad inputs",
cats: []string{"foo"},