Skip to content

Commit 28433c7

Browse files
committed
feat: list view for data
1 parent b78b4e5 commit 28433c7

File tree

2 files changed

+22
-27
lines changed

2 files changed

+22
-27
lines changed

resources/views/forms/page-builder-preview.blade.php

Lines changed: 21 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -16,32 +16,27 @@
1616
@endif
1717
@else
1818
{{-- TODO: give it better height calculations. --}}
19-
@if ($singleItemPreview)
20-
<iframe
21-
src="{{ $getIframeUrl() }}"
22-
x-data="{
23-
data: @js($pageBuilderData['data']),
24-
ready: $wire.entangle('{{ $getStatePath() }}.ready'),
25-
init() {
26-
if (this.ready) {
27-
$root.contentWindow.postMessage(JSON.stringify(this.data), '*');
28-
}
29-
}
30-
}"
31-
@message.window="() => {
32-
if (!$data.ready) {
33-
$data.ready = $event.data === 'readyForData';
34-
$root.contentWindow.postMessage(JSON.stringify($data.data), '*');
19+
<iframe
20+
src="{{ $getIframeUrl() }}"
21+
x-data="{
22+
data: @js($singleItemPreview ? $pageBuilderData['data'] : $pageBuilderData),
23+
ready: $wire.entangle('{{ $getStatePath() }}.ready'),
24+
init() {
25+
if (this.ready) {
26+
$root.contentWindow.postMessage(JSON.stringify(this.data), '*');
3527
}
36-
}"
37-
class="w-full h-screen"
38-
frameborder="0"
39-
allowfullscreen
40-
>
41-
</iframe>
42-
@else
43-
{{-- TODO: do this. --}}
44-
@dd($pageBuilderData)
45-
@endif
28+
}
29+
}"
30+
@message.window="() => {
31+
if (!$data.ready) {
32+
$data.ready = $event.data === 'readyForData';
33+
$root.contentWindow.postMessage(JSON.stringify($data.data), '*');
34+
}
35+
}"
36+
class="w-full h-screen"
37+
frameborder="0"
38+
allowfullscreen
39+
>
40+
</iframe>
4641
@endif
4742
</x-dynamic-component>

src/Components/Forms/PageBuilder.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -268,7 +268,7 @@ public function relationship(
268268
$component->state($blocks->toArray());
269269
});
270270

271-
$this->saveRelationshipsUsing(function (PageBuilder $component, Model $record, $state, Page $livewire) {
271+
$this->saveRelationshipsUsing(function (Model $record, $state) {
272272
$query = $this->getConstrainAppliedQuery($record);
273273
$existingIds = $query->clone()->pluck('id');
274274

0 commit comments

Comments
 (0)