Skip to content

Commit 888e32c

Browse files
committed
UP
1 parent e7b13a3 commit 888e32c

File tree

4 files changed

+11
-11
lines changed

4 files changed

+11
-11
lines changed

resources/views/livewire/card.blade.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ class="kanban-card mb-3 bg-white dark:bg-gray-800 rounded-lg shadow-sm border bo
1010
<div class="p-3">
1111
<h4 class="text-sm font-medium text-gray-900 dark:text-white">{{ $card['title'] }}</h4>
1212

13-
@if(isset($card['description']) && !empty($card['description']))
13+
@if(!empty($card['description']))
1414
<p class="mt-1 text-xs text-gray-500 dark:text-gray-400 line-clamp-2">{{ $card['description'] }}</p>
1515
@endif
1616

src/Concerns/CardFormattingTrait.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ protected function formatCardForDisplay(Model $model): array
2222
{
2323
$titleField = $this->config->getTitleField();
2424
$descriptionField = $this->config->getDescriptionField();
25-
$recordAttributes = $this->config->getRecordAttributes();
25+
$cardAttributes = $this->config->getcardAttributes();
2626
$columnField = $this->config->getColumnField();
2727

2828
$card = [
@@ -35,7 +35,7 @@ protected function formatCardForDisplay(Model $model): array
3535
$card['description'] = $model->{$descriptionField};
3636
}
3737

38-
foreach ($recordAttributes as $key => $label) {
38+
foreach ($cardAttributes as $key => $label) {
3939
$field = is_string($key) ? $key : $label;
4040
$card['attributes'][$field] = [
4141
'label' => is_string($key) ? $label : $field,

src/Config/KanbanConfig.php

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
* @method self withColumnColors(array $columnColors) Set the color mappings for columns
2222
* @method self withTitleField(string $titleField) Set the field name used for card titles
2323
* @method self withDescriptionField(string|null $descriptionField) Set the field name for card descriptions
24-
* @method self withRecordAttributes(array $recordAttributes) Set the additional fields to display on cards
24+
* @method self withCardAttributes(array $cardAttributes) Set the additional fields to display on cards
2525
* @method self withOrderField(string|null $orderField) Set the field name for maintaining card order
2626
* @method self withCardLabel(string|null $cardLabel) Set the label for individual cards
2727
* @method self withPluralCardLabel(string|null $pluralCardLabel) Set the plural label for collection of cards
@@ -34,7 +34,7 @@ public function __construct(
3434
private array|bool|null $columnColors = null,
3535
private string $titleField = 'title',
3636
private ?string $descriptionField = null,
37-
private array $recordAttributes = [],
37+
private array $cardAttributes = [],
3838
private ?string $orderField = null,
3939
private ?string $cardLabel = null,
4040
private ?string $pluralCardLabel = null,
@@ -97,9 +97,9 @@ public function getDescriptionField(): ?string
9797
*
9898
* @return array<string, string> Map of attribute names to their display labels
9999
*/
100-
public function getRecordAttributes(): array
100+
public function getCardAttributes(): array
101101
{
102-
return $this->recordAttributes;
102+
return $this->cardAttributes;
103103
}
104104

105105
/**
@@ -241,7 +241,7 @@ public function toLivewire(): array
241241
'columnColors' => $this->columnColors,
242242
'titleField' => $this->titleField,
243243
'descriptionField' => $this->descriptionField,
244-
'recordAttributes' => $this->recordAttributes,
244+
'cardAttributes' => $this->cardAttributes,
245245
'orderField' => $this->orderField,
246246
'cardLabel' => $this->cardLabel,
247247
'pluralCardLabel' => $this->pluralCardLabel,
@@ -256,7 +256,7 @@ public static function fromLivewire($value): KanbanConfig
256256
$value['columnColors'],
257257
$value['titleField'],
258258
$value['descriptionField'],
259-
$value['recordAttributes'],
259+
$value['cardAttributes'],
260260
$value['orderField'],
261261
$value['cardLabel'],
262262
$value['pluralCardLabel']

src/Filament/Pages/KanbanBoardPage.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -84,9 +84,9 @@ public function descriptionField(string $field): static
8484
*
8585
* @param array<string, string> $attributes
8686
*/
87-
public function recordAttributes(array $attributes): static
87+
public function cardAttributes(array $attributes): static
8888
{
89-
$this->config = $this->config->withRecordAttributes($attributes);
89+
$this->config = $this->config->withCardAttributes($attributes);
9090

9191
return $this;
9292
}

0 commit comments

Comments
 (0)