mirror of
https://github.com/opencloud-eu/opencloud.git
synced 2026-11-26 18:16:47 -05:00
Merge pull request #4006 from pbleser-oc/fix/3997-remote-item-drive-id
fix(graph): return the drive id in remoteItem.parentReference.driveId
This commit is contained in:
5 files changed
+49
-31
No files matched your search
@@ -289,6 +289,24 @@ var _ = Describe("SharedWithMe", func() {
|
||||
Expect(jsonData.Get("driveId").String()).To(Equal(storagespace.FormatStorageID(utils.ShareStorageProviderID, utils.ShareStorageSpaceID)))
|
||||
})
|
||||
|
||||
It("populates the driveItem.remoteItem.parentReference properties with the drive of the shared resource", func() {
|
||||
statResponse.Info.Space = &providerv1beta1.StorageSpace{
|
||||
SpaceType: "project",
|
||||
Root: toResourceID("1$2!2"),
|
||||
}
|
||||
|
||||
svc.ListSharedWithMe(
|
||||
tape,
|
||||
httptest.NewRequest(http.MethodGet, "/graph/v1beta1/me/drive/sharedWithMe", nil),
|
||||
)
|
||||
|
||||
jsonData := gjson.Get(tape.Body.String(), "value.0.remoteItem.parentReference")
|
||||
|
||||
// the id of the drive, not the id of its root item
|
||||
Expect(jsonData.Get("driveId").String()).To(Equal("1$2"))
|
||||
Expect(jsonData.Get("driveType").String()).To(Equal("project"))
|
||||
})
|
||||
|
||||
It("populates the driveItem remoteItem properties", func() {
|
||||
share := listReceivedSharesResponse.Shares[0].Share
|
||||
share.Id = &collaborationv1beta1.ShareId{OpaqueId: "1:2:3"}
|
||||
|
||||
@@ -264,7 +264,7 @@ func cs3ReceivedSharesToDriveItems(ctx context.Context,
|
||||
}
|
||||
|
||||
if root := shareStat.GetInfo().GetSpace().GetRoot(); root != nil {
|
||||
parentReference.SetDriveId(storagespace.FormatResourceID(root))
|
||||
parentReference.SetDriveId(storagespace.FormatStorageID(root.GetStorageId(), root.GetSpaceId()))
|
||||
}
|
||||
if !reflect.ValueOf(*parentReference).IsZero() {
|
||||
remoteItem.ParentReference = parentReference
|
||||
@@ -619,7 +619,7 @@ func cs3ReceivedOCMSharesToDriveItems(ctx context.Context,
|
||||
}
|
||||
|
||||
if root := shareStat.GetInfo().GetSpace().GetRoot(); root != nil {
|
||||
parentReference.SetDriveId(storagespace.FormatResourceID(root))
|
||||
parentReference.SetDriveId(storagespace.FormatStorageID(root.GetStorageId(), root.GetSpaceId()))
|
||||
}
|
||||
if !reflect.ValueOf(*parentReference).IsZero() {
|
||||
remoteItem.ParentReference = parentReference
|
||||
|
||||
@@ -202,7 +202,7 @@ Feature: an user gets the resources shared to them
|
||||
"properties": {
|
||||
"driveId": {
|
||||
"type": "string",
|
||||
"pattern": "^%file_id_pattern%$"
|
||||
"pattern": "^%space_id_pattern%$"
|
||||
},
|
||||
"driveType": {
|
||||
"type": "string",
|
||||
@@ -571,7 +571,7 @@ Feature: an user gets the resources shared to them
|
||||
"properties": {
|
||||
"driveId": {
|
||||
"type": "string",
|
||||
"pattern": "^%file_id_pattern%$"
|
||||
"pattern": "^%space_id_pattern%$"
|
||||
},
|
||||
"driveType": {
|
||||
"type": "string",
|
||||
@@ -870,7 +870,7 @@ Feature: an user gets the resources shared to them
|
||||
"properties": {
|
||||
"driveId": {
|
||||
"type": "string",
|
||||
"pattern": "%space_id_pattern%"
|
||||
"pattern": "^%space_id_pattern%$"
|
||||
},
|
||||
"driveType" : {
|
||||
"type": "string",
|
||||
@@ -1121,7 +1121,7 @@ Feature: an user gets the resources shared to them
|
||||
"properties": {
|
||||
"driveId": {
|
||||
"type": "string",
|
||||
"pattern": "%space_id_pattern%"
|
||||
"pattern": "^%space_id_pattern%$"
|
||||
},
|
||||
"driveType" : {
|
||||
"const": "personal"
|
||||
@@ -1399,7 +1399,7 @@ Feature: an user gets the resources shared to them
|
||||
"properties": {
|
||||
"driveId": {
|
||||
"type": "string",
|
||||
"pattern": "%space_id_pattern%"
|
||||
"pattern": "^%space_id_pattern%$"
|
||||
},
|
||||
"driveType" : {
|
||||
"type": "string",
|
||||
@@ -1748,7 +1748,7 @@ Feature: an user gets the resources shared to them
|
||||
"properties": {
|
||||
"driveId": {
|
||||
"type": "string",
|
||||
"pattern": "%space_id_pattern%"
|
||||
"pattern": "^%space_id_pattern%$"
|
||||
},
|
||||
"driveType" : {
|
||||
"const": "personal"
|
||||
@@ -2708,7 +2708,7 @@ Feature: an user gets the resources shared to them
|
||||
"properties": {
|
||||
"driveId": {
|
||||
"type": "string",
|
||||
"pattern": "^%file_id_pattern%$"
|
||||
"pattern": "^%space_id_pattern%$"
|
||||
},
|
||||
"driveType" : {
|
||||
"const": "project"
|
||||
@@ -2921,7 +2921,7 @@ Feature: an user gets the resources shared to them
|
||||
"properties": {
|
||||
"driveId": {
|
||||
"type": "string",
|
||||
"pattern": "^%file_id_pattern%$"
|
||||
"pattern": "^%space_id_pattern%$"
|
||||
},
|
||||
"driveType" : {
|
||||
"const": "project"
|
||||
@@ -3146,7 +3146,7 @@ Feature: an user gets the resources shared to them
|
||||
"properties": {
|
||||
"driveId": {
|
||||
"type": "string",
|
||||
"pattern": "%space_id_pattern%"
|
||||
"pattern": "^%space_id_pattern%$"
|
||||
},
|
||||
"driveType" : {
|
||||
"const": "project"
|
||||
@@ -3345,7 +3345,7 @@ Feature: an user gets the resources shared to them
|
||||
"properties": {
|
||||
"driveId": {
|
||||
"type": "string",
|
||||
"pattern": "%space_id_pattern%"
|
||||
"pattern": "^%space_id_pattern%$"
|
||||
},
|
||||
"driveType" : {
|
||||
"const": "project"
|
||||
@@ -3564,7 +3564,7 @@ Feature: an user gets the resources shared to them
|
||||
"properties": {
|
||||
"driveId": {
|
||||
"type": "string",
|
||||
"pattern": "%space_id_pattern%"
|
||||
"pattern": "^%space_id_pattern%$"
|
||||
},
|
||||
"driveType" : {
|
||||
"const": "project"
|
||||
@@ -3842,7 +3842,7 @@ Feature: an user gets the resources shared to them
|
||||
"properties": {
|
||||
"driveId": {
|
||||
"type": "string",
|
||||
"pattern": "%space_id_pattern%"
|
||||
"pattern": "^%space_id_pattern%$"
|
||||
},
|
||||
"driveType" : {
|
||||
"const": "project"
|
||||
@@ -4433,7 +4433,7 @@ Feature: an user gets the resources shared to them
|
||||
"properties": {
|
||||
"driveId": {
|
||||
"type": "string",
|
||||
"pattern": "^%file_id_pattern%$"
|
||||
"pattern": "^%space_id_pattern%$"
|
||||
},
|
||||
"driveType" : {
|
||||
"const": "project"
|
||||
@@ -4660,7 +4660,7 @@ Feature: an user gets the resources shared to them
|
||||
"properties": {
|
||||
"driveId": {
|
||||
"type": "string",
|
||||
"pattern": "^%file_id_pattern%$"
|
||||
"pattern": "^%space_id_pattern%$"
|
||||
},
|
||||
"driveType" : {
|
||||
"const": "project"
|
||||
|
||||
@@ -181,7 +181,7 @@ Feature: listing sharedWithMe when auto-sync is disabled
|
||||
"properties": {
|
||||
"driveId": {
|
||||
"type": "string",
|
||||
"pattern": "^%file_id_pattern%$"
|
||||
"pattern": "^%space_id_pattern%$"
|
||||
},
|
||||
"driveType": {
|
||||
"type": "string",
|
||||
@@ -428,7 +428,7 @@ Feature: listing sharedWithMe when auto-sync is disabled
|
||||
"properties": {
|
||||
"driveId": {
|
||||
"type": "string",
|
||||
"pattern": "^%file_id_pattern%$"
|
||||
"pattern": "^%space_id_pattern%$"
|
||||
},
|
||||
"driveType": {
|
||||
"type": "string",
|
||||
@@ -693,7 +693,7 @@ Feature: listing sharedWithMe when auto-sync is disabled
|
||||
"properties": {
|
||||
"driveId": {
|
||||
"type": "string",
|
||||
"pattern": "^%file_id_pattern%$"
|
||||
"pattern": "^%space_id_pattern%$"
|
||||
},
|
||||
"driveType": {
|
||||
"type": "string",
|
||||
@@ -944,7 +944,7 @@ Feature: listing sharedWithMe when auto-sync is disabled
|
||||
"properties": {
|
||||
"driveId": {
|
||||
"type": "string",
|
||||
"pattern": "^%file_id_pattern%$"
|
||||
"pattern": "^%space_id_pattern%$"
|
||||
},
|
||||
"driveType": {
|
||||
"type": "string",
|
||||
@@ -1173,7 +1173,7 @@ Feature: listing sharedWithMe when auto-sync is disabled
|
||||
"properties": {
|
||||
"driveId": {
|
||||
"type": "string",
|
||||
"pattern": "^%file_id_pattern%$"
|
||||
"pattern": "^%space_id_pattern%$"
|
||||
},
|
||||
"driveType": {
|
||||
"type": "string",
|
||||
@@ -1395,7 +1395,7 @@ Feature: listing sharedWithMe when auto-sync is disabled
|
||||
"properties": {
|
||||
"driveId": {
|
||||
"type": "string",
|
||||
"pattern": "^%file_id_pattern%$"
|
||||
"pattern": "^%space_id_pattern%$"
|
||||
},
|
||||
"driveType": {
|
||||
"type": "string",
|
||||
@@ -1631,7 +1631,7 @@ Feature: listing sharedWithMe when auto-sync is disabled
|
||||
"properties": {
|
||||
"driveId": {
|
||||
"type": "string",
|
||||
"pattern": "^%file_id_pattern%$"
|
||||
"pattern": "^%space_id_pattern%$"
|
||||
},
|
||||
"driveType": {
|
||||
"type": "string",
|
||||
@@ -1843,7 +1843,7 @@ Feature: listing sharedWithMe when auto-sync is disabled
|
||||
"properties": {
|
||||
"driveId": {
|
||||
"type": "string",
|
||||
"pattern": "^%file_id_pattern%$"
|
||||
"pattern": "^%space_id_pattern%$"
|
||||
},
|
||||
"driveType": {
|
||||
"type": "string",
|
||||
@@ -3264,7 +3264,7 @@ Feature: listing sharedWithMe when auto-sync is disabled
|
||||
"properties": {
|
||||
"driveId": {
|
||||
"type": "string",
|
||||
"pattern": "^%file_id_pattern%$"
|
||||
"pattern": "^%space_id_pattern%$"
|
||||
},
|
||||
"driveType": {
|
||||
"const": "project"
|
||||
@@ -3401,7 +3401,7 @@ Feature: listing sharedWithMe when auto-sync is disabled
|
||||
"properties": {
|
||||
"driveId": {
|
||||
"type": "string",
|
||||
"pattern": "^%file_id_pattern%$"
|
||||
"pattern": "^%space_id_pattern%$"
|
||||
},
|
||||
"driveType": {
|
||||
"const": "project"
|
||||
@@ -3582,7 +3582,7 @@ Feature: listing sharedWithMe when auto-sync is disabled
|
||||
"properties": {
|
||||
"driveId": {
|
||||
"type": "string",
|
||||
"pattern": "^%file_id_pattern%$"
|
||||
"pattern": "^%space_id_pattern%$"
|
||||
},
|
||||
"driveType": {
|
||||
"const": "project"
|
||||
|
||||
+4
-4
@@ -529,7 +529,7 @@ Feature: an user shares resources
|
||||
"type": "object",
|
||||
"required": ["driveId", "driveType"],
|
||||
"properties": {
|
||||
"driveId": { "pattern": "^%file_id_pattern%$" },
|
||||
"driveId": { "pattern": "^%space_id_pattern%$" },
|
||||
"driveType": { "const": "personal" }
|
||||
}
|
||||
},
|
||||
@@ -636,7 +636,7 @@ Feature: an user shares resources
|
||||
"type": "object",
|
||||
"required": ["driveId", "driveType"],
|
||||
"properties": {
|
||||
"driveId": { "pattern": "^%file_id_pattern%$" },
|
||||
"driveId": { "pattern": "^%space_id_pattern%$" },
|
||||
"driveType": { "const": "personal" }
|
||||
}
|
||||
},
|
||||
@@ -750,7 +750,7 @@ Feature: an user shares resources
|
||||
"type": "object",
|
||||
"required": ["driveId", "driveType"],
|
||||
"properties": {
|
||||
"driveId": { "pattern": "^%file_id_pattern%$" },
|
||||
"driveId": { "pattern": "^%space_id_pattern%$" },
|
||||
"driveType": { "const": "project" }
|
||||
}
|
||||
},
|
||||
@@ -843,7 +843,7 @@ Feature: an user shares resources
|
||||
"type": "object",
|
||||
"required": ["driveId", "driveType"],
|
||||
"properties": {
|
||||
"driveId": { "pattern": "^%file_id_pattern%$" },
|
||||
"driveId": { "pattern": "^%space_id_pattern%$" },
|
||||
"driveType": { "const": "project" }
|
||||
}
|
||||
},
|
||||
|
||||
Reference in new issue
Block a user