Skip to content

Commit 41c0bd0

Browse files
authored
Tidy ColumnSelectHelpers & displayToolbarFilters Method (rappasoft#2150)
* Tidy displayToolbarFilters Method * Fix styling --------- Co-authored-by: lrljoe <[email protected]>
1 parent 3f71383 commit 41c0bd0

File tree

2 files changed

+12
-18
lines changed

2 files changed

+12
-18
lines changed

src/Traits/Helpers/ColumnSelectHelpers.php

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -61,8 +61,6 @@ public function getSelectableSelectedColumns(): Collection
6161
->values();
6262
}
6363

64-
public function getCurrentlySelectedCols(): void {}
65-
6664
public function getUnSelectableColumns(): Collection
6765
{
6866
return $this->getColumns()
@@ -125,15 +123,6 @@ public function selectedVisibleColumns(): array
125123
->toArray();
126124
}
127125

128-
public function getVisibleColumns(): array
129-
{
130-
return $this->getColumns()
131-
->reject(fn (Column $column) => $column->isHidden())
132-
->reject(fn (Column $column) => ($column->isSelectable() && ! $this->columnSelectIsEnabledForColumn($column)))
133-
->values()
134-
->toArray();
135-
}
136-
137126
public function selectAllColumns(): void
138127
{
139128
$this->selectedColumns = [];
@@ -208,4 +197,15 @@ protected function setupFirstColumnSelectRun(): void
208197
}
209198

210199
}
200+
201+
/** To Be Removed */
202+
/*
203+
public function getVisibleColumns(): array
204+
{
205+
return $this->selectedVisibleColumns();
206+
}
207+
208+
public function getCurrentlySelectedCols(): void {}
209+
*/
210+
211211
}

src/Traits/Helpers/ToolsHelpers.php

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -77,13 +77,7 @@ public function displayToolbarSearch(): bool
7777
#[Computed]
7878
public function displayToolbarFilters(): bool
7979
{
80-
if ($this->filtersAreEnabled() && $this->filtersVisibilityIsEnabled() && $this->hasVisibleFilters()) {
81-
return true;
82-
} elseif ($this->filtersAreEnabled() && $this->showBulkActionsDropdownAlpine() && $this->shouldAlwaysHideBulkActionsDropdownOption() != true) {
83-
return true;
84-
}
85-
86-
return false;
80+
return $this->filtersAreEnabled() && (($this->filtersVisibilityIsEnabled() && $this->hasVisibleFilters()) || ($this->showBulkActionsDropdownAlpine() && $this->shouldAlwaysHideBulkActionsDropdownOption() != true));
8781
}
8882

8983
protected function hasToolbarColumnSelect(): bool

0 commit comments

Comments
 (0)