Skip to content

Commit

Permalink
[6.x] Fix showCollapseIcon bug (#1697)
Browse files Browse the repository at this point in the history
* Fix default toggle-detail

* Fix default toggle-detail

* build assets
  • Loading branch information
luanfreitasdev authored Sep 23, 2024
1 parent 75ff9ec commit 47191ed
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
6 changes: 5 additions & 1 deletion resources/views/components/row.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,12 @@
'view' => data_get($setUp, 'detail.viewIcon') ?? null,
])

@php
$defaultCollapseIcon = data_get($theme, 'root') . '.toggle-detail';
@endphp

@includeWhen(data_get($setUp, 'detail.showCollapseIcon'),
data_get(collect($row->__powergrid_rules)->last(), 'toggleDetailView'),
data_get(collect($row->__powergrid_rules)->last(), 'toggleDetailView') ?? $defaultCollapseIcon,
[
'view' => data_get($setUp, 'detail.viewIcon') ?? null,
]
Expand Down
5 changes: 4 additions & 1 deletion src/Concerns/HasActions.php
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,10 @@ public function prepareActionRulesForRows(mixed $row, ?object $loop = null): arr
];
}

$showToggleDetail = data_get($rule, 'rule.toggleableVisibility') === 'show' || (bool) data_get($this->setUp, 'detail.showCollapseIcon');
$showToggleDetail = $apply && data_get($rule, 'rule.toggleDetailVisibility')
? data_get($rule, 'rule.toggleDetailVisibility') === 'show'
: (bool) data_get($this->setUp, 'detail.showCollapseIcon');

$toggleableVisibility = $apply ? data_get($rule, 'rule.toggleableVisibility') : [];
$editOnClickVisibility = $apply ? data_get($rule, 'rule.editOnClickVisibility') : [];
$fieldHideEditOnClick = $apply && (bool) data_get($rule, 'rule.fieldHideEditOnClick');
Expand Down

0 comments on commit 47191ed

Please sign in to comment.