Skip to content

Commit

Permalink
Fix detail row - loading without state (#1333)
Browse files Browse the repository at this point in the history
  • Loading branch information
luanfreitasdev committed Jan 17, 2024
1 parent 98aa90d commit 786132e
Showing 1 changed file with 29 additions and 19 deletions.
48 changes: 29 additions & 19 deletions resources/views/components/table/detail.blade.php
Original file line number Diff line number Diff line change
@@ -1,19 +1,29 @@
<td colspan="999">
@php
$rulesValues = $actionRulesClass->recoverFromAction($row, 'pg:rows');
@endphp

@if (filled($rulesValues['detailView']))
@include($rulesValues['detailView'][0]['detailView'], [
'id' => data_get($row, $primaryKey),
'options' => array_merge(
data_get($setUp, 'detail.options'),
$rulesValues['detailView']['0']['options']),
])
@else
@include(data_get($setUp, 'detail.view'), [
'id' => data_get($row, $primaryKey),
'options' => data_get($setUp, 'detail.options'),
])
@endif
</td>
@php
$rulesValues = $actionRulesClass->recoverFromAction($row, 'pg:rows');
@endphp
<template
x-cloak
x-if="detailState"
>
<td colspan="999">
@if (filled($rulesValues['detailView']))
@includeWhen(data_get($setUp, 'detail.state.' . $row->{$primaryKey}),
$rulesValues['detailView'][0]['detailView'],
[
'id' => data_get($row, $primaryKey),
'options' => array_merge(
data_get($setUp, 'detail.options'),
$rulesValues['detailView']['0']['options']),
]
)
@else
@includeWhen(data_get($setUp, 'detail.state.' . $row->{$primaryKey}),
data_get($setUp, 'detail.view'),
[
'id' => data_get($row, $primaryKey),
'options' => data_get($setUp, 'detail.options'),
]
)
@endif
</td>
</template>

0 comments on commit 786132e

Please sign in to comment.