Skip to content

Commit 00f67b1

Browse files
committed
activity & category, do not embed rootContentNode
1 parent 982cc24 commit 00f67b1

11 files changed

+78
-1932
lines changed

api/src/Entity/HasRootContentNodeTrait.php

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,8 @@ trait HasRootContentNodeTrait {
1515
* exchanged, but all the contents attached to it can.
1616
*/
1717
#[Assert\DisableAutoMapping]
18-
#[ApiProperty(writable: false, readableLink: true, example: '/content_nodes/1a2b3c4d')]
18+
#[ApiProperty(writable: false, example: '/content_nodes/1a2b3c4d')]
19+
#[Groups(['read'])]
1920
#[ORM\OneToOne(targetEntity: ColumnLayout::class, cascade: ['persist'])]
2021
#[ORM\JoinColumn(nullable: false, unique: true)]
2122
public ?ColumnLayout $rootContentNode = null;
@@ -29,8 +30,6 @@ public function setRootContentNode(?ColumnLayout $rootContentNode) {
2930
$this->rootContentNode = $rootContentNode;
3031
}
3132

32-
#[Assert\DisableAutoMapping]
33-
#[Groups(['read'])]
3433
public function getRootContentNode(): ?ColumnLayout {
3534
// Getter is here to add annotations to parent class property
3635
return $this->rootContentNode;

api/tests/Api/Activities/ReadActivityTest.php

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -90,9 +90,6 @@ public function testGetSingleActivityIsAllowedForMember() {
9090
]);
9191

9292
$data = $result->toArray();
93-
$this->assertEquals($this->getIriFor($activity->getRootContentNode()), $data['_embedded']['rootContentNode']['_links']['self']['href']);
94-
$this->assertEquals($this->getIriFor($activity->getRootContentNode()), $data['_embedded']['rootContentNode']['_links']['root']['href']);
95-
$this->assertContains(['href' => $this->getIriFor('responsiveLayout1')], $data['_embedded']['rootContentNode']['_links']['children']);
9693
$this->assertEquals(12, count($data['_embedded']['contentNodes']));
9794
}
9895

api/tests/Api/SnapshotTests/__snapshots__/ResponseSnapshotTest__testGetCollectionMatchesStructure with data set activities__1.json

Lines changed: 0 additions & 127 deletions
Original file line numberDiff line numberDiff line change
@@ -5,38 +5,6 @@
55
"_embedded": {
66
"activityResponsibles": [],
77
"progressLabel": "escaped_value",
8-
"rootContentNode": {
9-
"_links": {
10-
"children": [
11-
{
12-
"href": "escaped_value"
13-
}
14-
],
15-
"contentType": {
16-
"href": "escaped_value"
17-
},
18-
"parent": "escaped_value",
19-
"root": {
20-
"href": "escaped_value"
21-
},
22-
"self": {
23-
"href": "escaped_value"
24-
}
25-
},
26-
"contentTypeName": "escaped_value",
27-
"data": {
28-
"columns": [
29-
{
30-
"slot": "escaped_value",
31-
"width": "escaped_value"
32-
}
33-
]
34-
},
35-
"id": "escaped_value",
36-
"instanceName": "escaped_value",
37-
"position": "escaped_value",
38-
"slot": "escaped_value"
39-
},
408
"scheduleEntries": [
419
{
4210
"_links": {
@@ -111,34 +79,6 @@
11179
}
11280
],
11381
"progressLabel": "escaped_value",
114-
"rootContentNode": {
115-
"_links": {
116-
"children": [],
117-
"contentType": {
118-
"href": "escaped_value"
119-
},
120-
"parent": "escaped_value",
121-
"root": {
122-
"href": "escaped_value"
123-
},
124-
"self": {
125-
"href": "escaped_value"
126-
}
127-
},
128-
"contentTypeName": "escaped_value",
129-
"data": {
130-
"columns": [
131-
{
132-
"slot": "escaped_value",
133-
"width": "escaped_value"
134-
}
135-
]
136-
},
137-
"id": "escaped_value",
138-
"instanceName": "escaped_value",
139-
"position": "escaped_value",
140-
"slot": "escaped_value"
141-
},
14282
"scheduleEntries": [
14383
{
14484
"_links": {
@@ -237,41 +177,6 @@
237177
}
238178
],
239179
"progressLabel": "escaped_value",
240-
"rootContentNode": {
241-
"_links": {
242-
"children": [
243-
{
244-
"href": "escaped_value"
245-
},
246-
{
247-
"href": "escaped_value"
248-
}
249-
],
250-
"contentType": {
251-
"href": "escaped_value"
252-
},
253-
"parent": "escaped_value",
254-
"root": {
255-
"href": "escaped_value"
256-
},
257-
"self": {
258-
"href": "escaped_value"
259-
}
260-
},
261-
"contentTypeName": "escaped_value",
262-
"data": {
263-
"columns": [
264-
{
265-
"slot": "escaped_value",
266-
"width": "escaped_value"
267-
}
268-
]
269-
},
270-
"id": "escaped_value",
271-
"instanceName": "escaped_value",
272-
"position": "escaped_value",
273-
"slot": "escaped_value"
274-
},
275180
"scheduleEntries": [
276181
{
277182
"_links": {
@@ -382,38 +287,6 @@
382287
"position": "escaped_value",
383288
"title": "escaped_value"
384289
},
385-
"rootContentNode": {
386-
"_links": {
387-
"children": [
388-
{
389-
"href": "escaped_value"
390-
}
391-
],
392-
"contentType": {
393-
"href": "escaped_value"
394-
},
395-
"parent": "escaped_value",
396-
"root": {
397-
"href": "escaped_value"
398-
},
399-
"self": {
400-
"href": "escaped_value"
401-
}
402-
},
403-
"contentTypeName": "escaped_value",
404-
"data": {
405-
"columns": [
406-
{
407-
"slot": "escaped_value",
408-
"width": "escaped_value"
409-
}
410-
]
411-
},
412-
"id": "escaped_value",
413-
"instanceName": "escaped_value",
414-
"position": "escaped_value",
415-
"slot": "escaped_value"
416-
},
417290
"scheduleEntries": [
418291
{
419292
"_links": {

api/tests/Api/SnapshotTests/__snapshots__/ResponseSnapshotTest__testGetCollectionMatchesStructure with data set categories__1.json

Lines changed: 0 additions & 154 deletions
Original file line numberDiff line numberDiff line change
@@ -2,36 +2,6 @@
22
"_embedded": {
33
"items": [
44
{
5-
"_embedded": {
6-
"rootContentNode": {
7-
"_links": {
8-
"children": [],
9-
"contentType": {
10-
"href": "escaped_value"
11-
},
12-
"parent": "escaped_value",
13-
"root": {
14-
"href": "escaped_value"
15-
},
16-
"self": {
17-
"href": "escaped_value"
18-
}
19-
},
20-
"contentTypeName": "escaped_value",
21-
"data": {
22-
"columns": [
23-
{
24-
"slot": "escaped_value",
25-
"width": "escaped_value"
26-
}
27-
]
28-
},
29-
"id": "escaped_value",
30-
"instanceName": "escaped_value",
31-
"position": "escaped_value",
32-
"slot": "escaped_value"
33-
}
34-
},
355
"_links": {
366
"camp": {
377
"href": "escaped_value"
@@ -56,36 +26,6 @@
5626
"short": "escaped_value"
5727
},
5828
{
59-
"_embedded": {
60-
"rootContentNode": {
61-
"_links": {
62-
"children": [],
63-
"contentType": {
64-
"href": "escaped_value"
65-
},
66-
"parent": "escaped_value",
67-
"root": {
68-
"href": "escaped_value"
69-
},
70-
"self": {
71-
"href": "escaped_value"
72-
}
73-
},
74-
"contentTypeName": "escaped_value",
75-
"data": {
76-
"columns": [
77-
{
78-
"slot": "escaped_value",
79-
"width": "escaped_value"
80-
}
81-
]
82-
},
83-
"id": "escaped_value",
84-
"instanceName": "escaped_value",
85-
"position": "escaped_value",
86-
"slot": "escaped_value"
87-
}
88-
},
8929
"_links": {
9030
"camp": {
9131
"href": "escaped_value"
@@ -110,36 +50,6 @@
11050
"short": "escaped_value"
11151
},
11252
{
113-
"_embedded": {
114-
"rootContentNode": {
115-
"_links": {
116-
"children": [],
117-
"contentType": {
118-
"href": "escaped_value"
119-
},
120-
"parent": "escaped_value",
121-
"root": {
122-
"href": "escaped_value"
123-
},
124-
"self": {
125-
"href": "escaped_value"
126-
}
127-
},
128-
"contentTypeName": "escaped_value",
129-
"data": {
130-
"columns": [
131-
{
132-
"slot": "escaped_value",
133-
"width": "escaped_value"
134-
}
135-
]
136-
},
137-
"id": "escaped_value",
138-
"instanceName": "escaped_value",
139-
"position": "escaped_value",
140-
"slot": "escaped_value"
141-
}
142-
},
14353
"_links": {
14454
"camp": {
14555
"href": "escaped_value"
@@ -164,36 +74,6 @@
16474
"short": "escaped_value"
16575
},
16676
{
167-
"_embedded": {
168-
"rootContentNode": {
169-
"_links": {
170-
"children": [],
171-
"contentType": {
172-
"href": "escaped_value"
173-
},
174-
"parent": "escaped_value",
175-
"root": {
176-
"href": "escaped_value"
177-
},
178-
"self": {
179-
"href": "escaped_value"
180-
}
181-
},
182-
"contentTypeName": "escaped_value",
183-
"data": {
184-
"columns": [
185-
{
186-
"slot": "escaped_value",
187-
"width": "escaped_value"
188-
}
189-
]
190-
},
191-
"id": "escaped_value",
192-
"instanceName": "escaped_value",
193-
"position": "escaped_value",
194-
"slot": "escaped_value"
195-
}
196-
},
19777
"_links": {
19878
"camp": {
19979
"href": "escaped_value"
@@ -218,40 +98,6 @@
21898
"short": "escaped_value"
21999
},
220100
{
221-
"_embedded": {
222-
"rootContentNode": {
223-
"_links": {
224-
"children": [
225-
{
226-
"href": "escaped_value"
227-
}
228-
],
229-
"contentType": {
230-
"href": "escaped_value"
231-
},
232-
"parent": "escaped_value",
233-
"root": {
234-
"href": "escaped_value"
235-
},
236-
"self": {
237-
"href": "escaped_value"
238-
}
239-
},
240-
"contentTypeName": "escaped_value",
241-
"data": {
242-
"columns": [
243-
{
244-
"slot": "escaped_value",
245-
"width": "escaped_value"
246-
}
247-
]
248-
},
249-
"id": "escaped_value",
250-
"instanceName": "escaped_value",
251-
"position": "escaped_value",
252-
"slot": "escaped_value"
253-
}
254-
},
255101
"_links": {
256102
"camp": {
257103
"href": "escaped_value"

0 commit comments

Comments
 (0)