diff --git a/src/lib/REST/Output/ValueObjectVisitor/ContentTree/Node.php b/src/lib/REST/Output/ValueObjectVisitor/ContentTree/Node.php index fcee9b66da..45c5e51fae 100644 --- a/src/lib/REST/Output/ValueObjectVisitor/ContentTree/Node.php +++ b/src/lib/REST/Output/ValueObjectVisitor/ContentTree/Node.php @@ -53,6 +53,8 @@ public function visit(Visitor $visitor, Generator $generator, $data) $generator->startValueElement('isInvisible', $generator->serializeBool($data->isInvisible)); $generator->endValueElement('isInvisible'); + $generator->valueElement('isHidden', $generator->serializeBool($data->isHidden)); + $generator->startValueElement('displayLimit', $data->displayLimit); $generator->endValueElement('displayLimit'); diff --git a/src/lib/REST/Value/ContentTree/Node.php b/src/lib/REST/Value/ContentTree/Node.php index 8e172614f9..a00c4c9987 100644 --- a/src/lib/REST/Value/ContentTree/Node.php +++ b/src/lib/REST/Value/ContentTree/Node.php @@ -35,6 +35,8 @@ class Node extends RestValue /** @var bool */ public $isInvisible; + public bool $isHidden; + /** @var int */ public $displayLimit; @@ -64,6 +66,7 @@ public function __construct( string $contentTypeIdentifier, bool $isContainer, bool $isInvisible, + bool $isHidden, int $displayLimit, int $totalChildrenCount, int $reverseRelationsCount, @@ -78,6 +81,7 @@ public function __construct( $this->versionNo = $versionNo; $this->name = $name; $this->isInvisible = $isInvisible; + $this->isHidden = $isHidden; $this->contentTypeIdentifier = $contentTypeIdentifier; $this->isContainer = $isContainer; $this->totalChildrenCount = $totalChildrenCount; diff --git a/src/lib/UI/Module/ContentTree/NodeFactory.php b/src/lib/UI/Module/ContentTree/NodeFactory.php index 1c00d55c29..0efb0ff38a 100644 --- a/src/lib/UI/Module/ContentTree/NodeFactory.php +++ b/src/lib/UI/Module/ContentTree/NodeFactory.php @@ -15,7 +15,6 @@ use Ibexa\Contracts\Core\Repository\Exceptions\NotImplementedException; use Ibexa\Contracts\Core\Repository\PermissionResolver; use Ibexa\Contracts\Core\Repository\SearchService; -use Ibexa\Contracts\Core\Repository\Values\Content\Content; use Ibexa\Contracts\Core\Repository\Values\Content\ContentInfo; use Ibexa\Contracts\Core\Repository\Values\Content\Location; use Ibexa\Contracts\Core\Repository\Values\Content\LocationQuery; @@ -396,7 +395,8 @@ private function buildNode( '', // node name will be provided later by `supplyTranslatedContentName` method null !== $contentType ? $contentType->getIdentifier() : '', null === $contentType || $contentType->isContainer(), - $location->isInvisible() || $location->isHidden(), + $location->isInvisible(), + $location->isHidden(), $limit, $totalChildrenCount, $this->getReverseRelationsCount($contentInfo), diff --git a/tests/integration/Resources/REST/Schemas/ContentTreeNode.xsd b/tests/integration/Resources/REST/Schemas/ContentTreeNode.xsd index 9da3d622eb..507cb86390 100644 --- a/tests/integration/Resources/REST/Schemas/ContentTreeNode.xsd +++ b/tests/integration/Resources/REST/Schemas/ContentTreeNode.xsd @@ -12,6 +12,7 @@ + @@ -28,6 +29,7 @@ + diff --git a/tests/integration/Resources/REST/Snapshots/ContentTreeNode/filter/json/filter-by-content-type-identifier-folder-and-landing-page.json b/tests/integration/Resources/REST/Snapshots/ContentTreeNode/filter/json/filter-by-content-type-identifier-folder-and-landing-page.json index 2125da70f2..ae2f2c8694 100644 --- a/tests/integration/Resources/REST/Snapshots/ContentTreeNode/filter/json/filter-by-content-type-identifier-folder-and-landing-page.json +++ b/tests/integration/Resources/REST/Snapshots/ContentTreeNode/filter/json/filter-by-content-type-identifier-folder-and-landing-page.json @@ -10,6 +10,7 @@ "displayLimit": 30, "isBookmarked": false, "isContainer": true, + "isHidden": false, "isInvisible": false, "locationId": 2, "mainLanguageCode": "eng-GB", @@ -27,6 +28,7 @@ "displayLimit": 30, "isBookmarked": false, "isContainer": true, + "isHidden": false, "isInvisible": false, "locationId": 43, "mainLanguageCode": "eng-US", @@ -44,6 +46,7 @@ "displayLimit": 30, "isBookmarked": false, "isContainer": true, + "isHidden": false, "isInvisible": false, "locationId": 48, "mainLanguageCode": "eng-US", @@ -61,6 +64,7 @@ "displayLimit": 30, "isBookmarked": false, "isContainer": true, + "isHidden": false, "isInvisible": false, "locationId": 58, "mainLanguageCode": "eng-US", @@ -76,6 +80,7 @@ "displayLimit": 10, "isBookmarked": false, "isContainer": true, + "isHidden": false, "isInvisible": false, "locationId": 1, "mainLanguageCode": "eng-GB", diff --git a/tests/integration/Resources/REST/Snapshots/ContentTreeNode/filter/json/filter-by-content-type-identifier-folder-and-media-location-id.json b/tests/integration/Resources/REST/Snapshots/ContentTreeNode/filter/json/filter-by-content-type-identifier-folder-and-media-location-id.json index a5c583fdd9..b9fe6c4abf 100644 --- a/tests/integration/Resources/REST/Snapshots/ContentTreeNode/filter/json/filter-by-content-type-identifier-folder-and-media-location-id.json +++ b/tests/integration/Resources/REST/Snapshots/ContentTreeNode/filter/json/filter-by-content-type-identifier-folder-and-media-location-id.json @@ -10,6 +10,7 @@ "displayLimit": 30, "isBookmarked": false, "isContainer": true, + "isHidden": false, "isInvisible": false, "locationId": 43, "mainLanguageCode": "eng-US", @@ -25,6 +26,7 @@ "displayLimit": 10, "isBookmarked": false, "isContainer": true, + "isHidden": false, "isInvisible": false, "locationId": 1, "mainLanguageCode": "eng-GB", diff --git a/tests/integration/Resources/REST/Snapshots/ContentTreeNode/filter/json/filter-by-content-type-identifier-folder-or-subtree.json b/tests/integration/Resources/REST/Snapshots/ContentTreeNode/filter/json/filter-by-content-type-identifier-folder-or-subtree.json index c93a0a1d7c..21087d25d6 100644 --- a/tests/integration/Resources/REST/Snapshots/ContentTreeNode/filter/json/filter-by-content-type-identifier-folder-or-subtree.json +++ b/tests/integration/Resources/REST/Snapshots/ContentTreeNode/filter/json/filter-by-content-type-identifier-folder-or-subtree.json @@ -10,6 +10,7 @@ "displayLimit": 30, "isBookmarked": false, "isContainer": true, + "isHidden": false, "isInvisible": false, "locationId": 43, "mainLanguageCode": "eng-US", @@ -27,6 +28,7 @@ "displayLimit": 30, "isBookmarked": false, "isContainer": true, + "isHidden": false, "isInvisible": false, "locationId": 48, "mainLanguageCode": "eng-US", @@ -44,6 +46,7 @@ "displayLimit": 30, "isBookmarked": true, "isContainer": true, + "isHidden": false, "isInvisible": false, "locationId": 5, "mainLanguageCode": "eng-US", @@ -61,6 +64,7 @@ "displayLimit": 30, "isBookmarked": false, "isContainer": true, + "isHidden": false, "isInvisible": false, "locationId": 58, "mainLanguageCode": "eng-US", @@ -76,6 +80,7 @@ "displayLimit": 10, "isBookmarked": false, "isContainer": true, + "isHidden": false, "isInvisible": false, "locationId": 1, "mainLanguageCode": "eng-GB", diff --git a/tests/integration/Resources/REST/Snapshots/ContentTreeNode/filter/json/filter-by-content-type-identifier-folder.json b/tests/integration/Resources/REST/Snapshots/ContentTreeNode/filter/json/filter-by-content-type-identifier-folder.json index 362e61fad0..ecef32b803 100644 --- a/tests/integration/Resources/REST/Snapshots/ContentTreeNode/filter/json/filter-by-content-type-identifier-folder.json +++ b/tests/integration/Resources/REST/Snapshots/ContentTreeNode/filter/json/filter-by-content-type-identifier-folder.json @@ -10,6 +10,7 @@ "displayLimit": 30, "isBookmarked": false, "isContainer": true, + "isHidden": false, "isInvisible": false, "locationId": 43, "mainLanguageCode": "eng-US", @@ -27,6 +28,7 @@ "displayLimit": 30, "isBookmarked": false, "isContainer": true, + "isHidden": false, "isInvisible": false, "locationId": 48, "mainLanguageCode": "eng-US", @@ -44,6 +46,7 @@ "displayLimit": 30, "isBookmarked": false, "isContainer": true, + "isHidden": false, "isInvisible": false, "locationId": 58, "mainLanguageCode": "eng-US", @@ -59,6 +62,7 @@ "displayLimit": 10, "isBookmarked": false, "isContainer": true, + "isHidden": false, "isInvisible": false, "locationId": 1, "mainLanguageCode": "eng-GB", diff --git a/tests/integration/Resources/REST/Snapshots/ContentTreeNode/filter/json/no-filter.json b/tests/integration/Resources/REST/Snapshots/ContentTreeNode/filter/json/no-filter.json index 0892041a5a..8a78295e12 100644 --- a/tests/integration/Resources/REST/Snapshots/ContentTreeNode/filter/json/no-filter.json +++ b/tests/integration/Resources/REST/Snapshots/ContentTreeNode/filter/json/no-filter.json @@ -10,6 +10,7 @@ "displayLimit": 30, "isBookmarked": false, "isContainer": true, + "isHidden": false, "isInvisible": false, "locationId": 2, "mainLanguageCode": "eng-GB", @@ -27,6 +28,7 @@ "displayLimit": 30, "isBookmarked": false, "isContainer": true, + "isHidden": false, "isInvisible": false, "locationId": 43, "mainLanguageCode": "eng-US", @@ -44,6 +46,7 @@ "displayLimit": 30, "isBookmarked": false, "isContainer": true, + "isHidden": false, "isInvisible": false, "locationId": 48, "mainLanguageCode": "eng-US", @@ -61,6 +64,7 @@ "displayLimit": 30, "isBookmarked": true, "isContainer": true, + "isHidden": false, "isInvisible": false, "locationId": 5, "mainLanguageCode": "eng-US", @@ -78,6 +82,7 @@ "displayLimit": 30, "isBookmarked": false, "isContainer": true, + "isHidden": false, "isInvisible": false, "locationId": 58, "mainLanguageCode": "eng-US", @@ -93,7 +98,8 @@ "displayLimit": 10, "isBookmarked": false, "isContainer": true, - "isInvisible": false, + "isHidden": false, + "isInvisible": false, "locationId": 1, "mainLanguageCode": "eng-GB", "name": "", diff --git a/tests/integration/Resources/REST/Snapshots/ContentTreeNode/filter/xml/no-filter.xml b/tests/integration/Resources/REST/Snapshots/ContentTreeNode/filter/xml/no-filter.xml index a28ef0d08a..6ad608b6eb 100644 --- a/tests/integration/Resources/REST/Snapshots/ContentTreeNode/filter/xml/no-filter.xml +++ b/tests/integration/Resources/REST/Snapshots/ContentTreeNode/filter/xml/no-filter.xml @@ -9,6 +9,7 @@ true false + false 10 5 0 @@ -23,6 +24,7 @@ landing_page true false + false 30 1 0 @@ -38,6 +40,7 @@ folder true false + false 30 3 0 @@ -53,6 +56,7 @@ folder true false + false 30 0 0 @@ -68,6 +72,7 @@ user_group true false + false 30 5 0 @@ -83,6 +88,7 @@ folder true false + false 30 0 0 diff --git a/tests/integration/Resources/REST/Snapshots/ContentTreeRoot.json b/tests/integration/Resources/REST/Snapshots/ContentTreeRoot.json index aacf1ed1bd..ca751c8383 100644 --- a/tests/integration/Resources/REST/Snapshots/ContentTreeRoot.json +++ b/tests/integration/Resources/REST/Snapshots/ContentTreeRoot.json @@ -12,6 +12,7 @@ "pathString": "/1/2/", "contentTypeIdentifier": "landing_page", "isContainer": true, + "isHidden": false, "isInvisible": false, "displayLimit": 30, "totalChildrenCount": 1, @@ -28,6 +29,7 @@ "pathString": "/1/2/60/", "contentTypeIdentifier": "feedback_form", "isContainer": true, + "isHidden": false, "isInvisible": false, "displayLimit": 30, "totalChildrenCount": 0,