Skip to content

Commit 9467c90

Browse files
wiewiurdpMateuszKolankowski
andauthored
IBX-9855: Added isHidden property to ContentTree Node (#1675)
Co-authored-by: MateuszKolankowski <wiewiurdp@tlen. pl>
1 parent 7b81232 commit 9467c90

File tree

11 files changed

+41
-3
lines changed

11 files changed

+41
-3
lines changed

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,8 @@ public function visit(Visitor $visitor, Generator $generator, $data)
5353
$generator->startValueElement('isInvisible', $generator->serializeBool($data->isInvisible));
5454
$generator->endValueElement('isInvisible');
5555

56+
$generator->valueElement('isHidden', $generator->serializeBool($data->isHidden));
57+
5658
$generator->startValueElement('displayLimit', $data->displayLimit);
5759
$generator->endValueElement('displayLimit');
5860

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

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,8 @@ class Node extends RestValue
3535
/** @var bool */
3636
public $isInvisible;
3737

38+
public bool $isHidden;
39+
3840
/** @var int */
3941
public $displayLimit;
4042

@@ -64,6 +66,7 @@ public function __construct(
6466
string $contentTypeIdentifier,
6567
bool $isContainer,
6668
bool $isInvisible,
69+
bool $isHidden,
6770
int $displayLimit,
6871
int $totalChildrenCount,
6972
int $reverseRelationsCount,
@@ -78,6 +81,7 @@ public function __construct(
7881
$this->versionNo = $versionNo;
7982
$this->name = $name;
8083
$this->isInvisible = $isInvisible;
84+
$this->isHidden = $isHidden;
8185
$this->contentTypeIdentifier = $contentTypeIdentifier;
8286
$this->isContainer = $isContainer;
8387
$this->totalChildrenCount = $totalChildrenCount;

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@
1515
use Ibexa\Contracts\Core\Repository\Exceptions\NotImplementedException;
1616
use Ibexa\Contracts\Core\Repository\PermissionResolver;
1717
use Ibexa\Contracts\Core\Repository\SearchService;
18-
use Ibexa\Contracts\Core\Repository\Values\Content\Content;
1918
use Ibexa\Contracts\Core\Repository\Values\Content\ContentInfo;
2019
use Ibexa\Contracts\Core\Repository\Values\Content\Location;
2120
use Ibexa\Contracts\Core\Repository\Values\Content\LocationQuery;
@@ -396,7 +395,8 @@ private function buildNode(
396395
'', // node name will be provided later by `supplyTranslatedContentName` method
397396
null !== $contentType ? $contentType->getIdentifier() : '',
398397
null === $contentType || $contentType->isContainer(),
399-
$location->isInvisible() || $location->isHidden(),
398+
$location->isInvisible(),
399+
$location->isHidden(),
400400
$limit,
401401
$totalChildrenCount,
402402
$this->getReverseRelationsCount($contentInfo),

tests/integration/Resources/REST/Schemas/ContentTreeNode.xsd

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
<xs:element type="xs:string" name="contentTypeIdentifier"/>
1313
<xs:element type="xs:boolean" name="isContainer"/>
1414
<xs:element type="xs:string" name="isInvisible"/>
15+
<xs:element type="xs:string" name="isHidden"/>
1516
<xs:element type="xs:integer" name="displayLimit"/>
1617
<xs:element type="xs:integer" name="totalChildrenCount"/>
1718
<xs:element type="xs:integer" name="reverseRelationsCount"/>
@@ -28,6 +29,7 @@
2829
<xs:element type="xs:string" name="contentTypeIdentifier"/>
2930
<xs:element type="xs:boolean" name="isContainer"/>
3031
<xs:element type="xs:string" name="isInvisible"/>
32+
<xs:element type="xs:string" name="isHidden"/>
3133
<xs:element type="xs:integer" name="displayLimit"/>
3234
<xs:element type="xs:integer" name="totalChildrenCount"/>
3335
<xs:element type="xs:integer" name="reverseRelationsCount"/>

tests/integration/Resources/REST/Snapshots/ContentTreeNode/filter/json/filter-by-content-type-identifier-folder-and-landing-page.json

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
"displayLimit": 30,
1111
"isBookmarked": false,
1212
"isContainer": true,
13+
"isHidden": false,
1314
"isInvisible": false,
1415
"locationId": 2,
1516
"mainLanguageCode": "eng-GB",
@@ -27,6 +28,7 @@
2728
"displayLimit": 30,
2829
"isBookmarked": false,
2930
"isContainer": true,
31+
"isHidden": false,
3032
"isInvisible": false,
3133
"locationId": 43,
3234
"mainLanguageCode": "eng-US",
@@ -44,6 +46,7 @@
4446
"displayLimit": 30,
4547
"isBookmarked": false,
4648
"isContainer": true,
49+
"isHidden": false,
4750
"isInvisible": false,
4851
"locationId": 48,
4952
"mainLanguageCode": "eng-US",
@@ -61,6 +64,7 @@
6164
"displayLimit": 30,
6265
"isBookmarked": false,
6366
"isContainer": true,
67+
"isHidden": false,
6468
"isInvisible": false,
6569
"locationId": 58,
6670
"mainLanguageCode": "eng-US",
@@ -76,6 +80,7 @@
7680
"displayLimit": 10,
7781
"isBookmarked": false,
7882
"isContainer": true,
83+
"isHidden": false,
7984
"isInvisible": false,
8085
"locationId": 1,
8186
"mainLanguageCode": "eng-GB",

tests/integration/Resources/REST/Snapshots/ContentTreeNode/filter/json/filter-by-content-type-identifier-folder-and-media-location-id.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
"displayLimit": 30,
1111
"isBookmarked": false,
1212
"isContainer": true,
13+
"isHidden": false,
1314
"isInvisible": false,
1415
"locationId": 43,
1516
"mainLanguageCode": "eng-US",
@@ -25,6 +26,7 @@
2526
"displayLimit": 10,
2627
"isBookmarked": false,
2728
"isContainer": true,
29+
"isHidden": false,
2830
"isInvisible": false,
2931
"locationId": 1,
3032
"mainLanguageCode": "eng-GB",

tests/integration/Resources/REST/Snapshots/ContentTreeNode/filter/json/filter-by-content-type-identifier-folder-or-subtree.json

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
"displayLimit": 30,
1111
"isBookmarked": false,
1212
"isContainer": true,
13+
"isHidden": false,
1314
"isInvisible": false,
1415
"locationId": 43,
1516
"mainLanguageCode": "eng-US",
@@ -27,6 +28,7 @@
2728
"displayLimit": 30,
2829
"isBookmarked": false,
2930
"isContainer": true,
31+
"isHidden": false,
3032
"isInvisible": false,
3133
"locationId": 48,
3234
"mainLanguageCode": "eng-US",
@@ -44,6 +46,7 @@
4446
"displayLimit": 30,
4547
"isBookmarked": true,
4648
"isContainer": true,
49+
"isHidden": false,
4750
"isInvisible": false,
4851
"locationId": 5,
4952
"mainLanguageCode": "eng-US",
@@ -61,6 +64,7 @@
6164
"displayLimit": 30,
6265
"isBookmarked": false,
6366
"isContainer": true,
67+
"isHidden": false,
6468
"isInvisible": false,
6569
"locationId": 58,
6670
"mainLanguageCode": "eng-US",
@@ -76,6 +80,7 @@
7680
"displayLimit": 10,
7781
"isBookmarked": false,
7882
"isContainer": true,
83+
"isHidden": false,
7984
"isInvisible": false,
8085
"locationId": 1,
8186
"mainLanguageCode": "eng-GB",

tests/integration/Resources/REST/Snapshots/ContentTreeNode/filter/json/filter-by-content-type-identifier-folder.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
"displayLimit": 30,
1111
"isBookmarked": false,
1212
"isContainer": true,
13+
"isHidden": false,
1314
"isInvisible": false,
1415
"locationId": 43,
1516
"mainLanguageCode": "eng-US",
@@ -27,6 +28,7 @@
2728
"displayLimit": 30,
2829
"isBookmarked": false,
2930
"isContainer": true,
31+
"isHidden": false,
3032
"isInvisible": false,
3133
"locationId": 48,
3234
"mainLanguageCode": "eng-US",
@@ -44,6 +46,7 @@
4446
"displayLimit": 30,
4547
"isBookmarked": false,
4648
"isContainer": true,
49+
"isHidden": false,
4750
"isInvisible": false,
4851
"locationId": 58,
4952
"mainLanguageCode": "eng-US",
@@ -59,6 +62,7 @@
5962
"displayLimit": 10,
6063
"isBookmarked": false,
6164
"isContainer": true,
65+
"isHidden": false,
6266
"isInvisible": false,
6367
"locationId": 1,
6468
"mainLanguageCode": "eng-GB",

tests/integration/Resources/REST/Snapshots/ContentTreeNode/filter/json/no-filter.json

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
"displayLimit": 30,
1111
"isBookmarked": false,
1212
"isContainer": true,
13+
"isHidden": false,
1314
"isInvisible": false,
1415
"locationId": 2,
1516
"mainLanguageCode": "eng-GB",
@@ -27,6 +28,7 @@
2728
"displayLimit": 30,
2829
"isBookmarked": false,
2930
"isContainer": true,
31+
"isHidden": false,
3032
"isInvisible": false,
3133
"locationId": 43,
3234
"mainLanguageCode": "eng-US",
@@ -44,6 +46,7 @@
4446
"displayLimit": 30,
4547
"isBookmarked": false,
4648
"isContainer": true,
49+
"isHidden": false,
4750
"isInvisible": false,
4851
"locationId": 48,
4952
"mainLanguageCode": "eng-US",
@@ -61,6 +64,7 @@
6164
"displayLimit": 30,
6265
"isBookmarked": true,
6366
"isContainer": true,
67+
"isHidden": false,
6468
"isInvisible": false,
6569
"locationId": 5,
6670
"mainLanguageCode": "eng-US",
@@ -78,6 +82,7 @@
7882
"displayLimit": 30,
7983
"isBookmarked": false,
8084
"isContainer": true,
85+
"isHidden": false,
8186
"isInvisible": false,
8287
"locationId": 58,
8388
"mainLanguageCode": "eng-US",
@@ -93,7 +98,8 @@
9398
"displayLimit": 10,
9499
"isBookmarked": false,
95100
"isContainer": true,
96-
"isInvisible": false,
101+
"isHidden": false,
102+
"isInvisible": false,
97103
"locationId": 1,
98104
"mainLanguageCode": "eng-GB",
99105
"name": "",

tests/integration/Resources/REST/Snapshots/ContentTreeNode/filter/xml/no-filter.xml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
<contentTypeIdentifier/>
1010
<isContainer>true</isContainer>
1111
<isInvisible>false</isInvisible>
12+
<isHidden>false</isHidden>
1213
<displayLimit>10</displayLimit>
1314
<totalChildrenCount>5</totalChildrenCount>
1415
<reverseRelationsCount>0</reverseRelationsCount>
@@ -23,6 +24,7 @@
2324
<contentTypeIdentifier>landing_page</contentTypeIdentifier>
2425
<isContainer>true</isContainer>
2526
<isInvisible>false</isInvisible>
27+
<isHidden>false</isHidden>
2628
<displayLimit>30</displayLimit>
2729
<totalChildrenCount>1</totalChildrenCount>
2830
<reverseRelationsCount>0</reverseRelationsCount>
@@ -38,6 +40,7 @@
3840
<contentTypeIdentifier>folder</contentTypeIdentifier>
3941
<isContainer>true</isContainer>
4042
<isInvisible>false</isInvisible>
43+
<isHidden>false</isHidden>
4144
<displayLimit>30</displayLimit>
4245
<totalChildrenCount>3</totalChildrenCount>
4346
<reverseRelationsCount>0</reverseRelationsCount>
@@ -53,6 +56,7 @@
5356
<contentTypeIdentifier>folder</contentTypeIdentifier>
5457
<isContainer>true</isContainer>
5558
<isInvisible>false</isInvisible>
59+
<isHidden>false</isHidden>
5660
<displayLimit>30</displayLimit>
5761
<totalChildrenCount>0</totalChildrenCount>
5862
<reverseRelationsCount>0</reverseRelationsCount>
@@ -68,6 +72,7 @@
6872
<contentTypeIdentifier>user_group</contentTypeIdentifier>
6973
<isContainer>true</isContainer>
7074
<isInvisible>false</isInvisible>
75+
<isHidden>false</isHidden>
7176
<displayLimit>30</displayLimit>
7277
<totalChildrenCount>5</totalChildrenCount>
7378
<reverseRelationsCount>0</reverseRelationsCount>
@@ -83,6 +88,7 @@
8388
<contentTypeIdentifier>folder</contentTypeIdentifier>
8489
<isContainer>true</isContainer>
8590
<isInvisible>false</isInvisible>
91+
<isHidden>false</isHidden>
8692
<displayLimit>30</displayLimit>
8793
<totalChildrenCount>0</totalChildrenCount>
8894
<reverseRelationsCount>0</reverseRelationsCount>

0 commit comments

Comments
 (0)