Skip to content

Commit e859d4d

Browse files
authored
IBX-7304: Exposed pathString property in load-subtree REST response (#1129)
For more details see https://issues.ibexa.co/browse/IBX-7304 and #1129 Key changes: * Exposed pathString property in load-subtree REST response * [Tests] Aligned load-subtree integration test with the change
1 parent 1d3f2cc commit e859d4d

File tree

4 files changed

+12
-2
lines changed

4 files changed

+12
-2
lines changed

src/lib/REST/Output/ValueObjectVisitor/ContentTree/Node.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,9 @@ public function visit(Visitor $visitor, Generator $generator, $data)
3131
$generator->startValueElement('locationId', $data->locationId);
3232
$generator->endValueElement('locationId');
3333

34+
$generator->startValueElement('pathString', $data->pathString);
35+
$generator->endValueElement('pathString');
36+
3437
$generator->startValueElement('contentId', $data->contentId);
3538
$generator->endValueElement('contentId');
3639

src/lib/REST/Value/ContentTree/Node.php

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,8 @@ class Node extends RestValue
5454
/** @var \Ibexa\AdminUi\REST\Value\ContentTree\Node[] */
5555
public $children;
5656

57+
public string $pathString;
58+
5759
/**
5860
* @param int $depth
5961
* @param int $locationId
@@ -83,7 +85,8 @@ public function __construct(
8385
int $totalChildrenCount,
8486
int $reverseRelationsCount,
8587
bool $isBookmarked,
86-
array $children = []
88+
array $children = [],
89+
string $pathString = ''
8790
) {
8891
$this->depth = $depth;
8992
$this->locationId = $locationId;
@@ -100,6 +103,7 @@ public function __construct(
100103
$this->reverseRelationsCount = $reverseRelationsCount;
101104
$this->isBookmarked = $isBookmarked;
102105
$this->children = $children;
106+
$this->pathString = $pathString;
103107
}
104108
}
105109

src/lib/UI/Module/ContentTree/NodeFactory.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -397,7 +397,8 @@ private function buildNode(
397397
$totalChildrenCount,
398398
$this->getReverseRelationsCount($contentInfo),
399399
isset($bookmarkLocations[$location->id]),
400-
$children
400+
$children,
401+
$location->getPathString()
401402
);
402403
}
403404

tests/integration/Resources/REST/Snapshots/ContentTreeRoot.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
"translations": "eng-GB",
1111
"previewableTranslations": "eng-GB",
1212
"name": "Home",
13+
"pathString": "/1/2/",
1314
"contentTypeIdentifier": "landing_page",
1415
"isContainer": true,
1516
"isInvisible": false,
@@ -26,6 +27,7 @@
2627
"translations": "eng-GB",
2728
"previewableTranslations": "eng-GB",
2829
"name": "Contact Us",
30+
"pathString": "/1/2/60/",
2931
"contentTypeIdentifier": "feedback_form",
3032
"isContainer": true,
3133
"isInvisible": false,

0 commit comments

Comments
 (0)