Skip to content

Commit 8af8f13

Browse files
committed
UP
1 parent 22fe415 commit 8af8f13

File tree

11 files changed

+52
-50
lines changed

11 files changed

+52
-50
lines changed

resources/dist/flowforge.js

Lines changed: 4 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

resources/js/flowforge.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,6 @@ export default function flowforge({state}) {
33
state,
44
columns: state.columns,
55
currentColumn: null,
6-
currentCard: null,
7-
formData: {},
86
isLoading: {},
97

108
init: function () {
@@ -77,6 +75,10 @@ export default function flowforge({state}) {
7775
this.isLoading[columnId] = false;
7876
}
7977
});
78+
79+
this.$wire.$on('close-modal', (data) => {
80+
this.$wire.resetEditForm()
81+
})
8082
},
8183

8284
/**

resources/views/livewire/card.blade.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,15 +14,15 @@ class="kanban-card mb-3 bg-white dark:bg-gray-800 rounded-lg shadow-sm border bo
1414
<p class="mt-1 text-xs text-gray-500 dark:text-gray-400 line-clamp-2">{{ $card['description'] }}</p>
1515
@endif
1616

17-
@if(!empty($config['cardAttributes']))
17+
@if(!empty($config->cardAttributes))
1818
<div class="mt-2 flex flex-wrap gap-2">
19-
@foreach($config['cardAttributes'] as $attribute => $label)
19+
@foreach($config->cardAttributes as $attribute => $label)
2020
@if(isset($card['attributes'][$attribute]) && !empty($card['attributes'][$attribute]['value']))
2121
<x-flowforge::card-badge
2222
:label="$card['attributes'][$attribute]['label']"
2323
:value="$card['attributes'][$attribute]['value']"
24-
:color="$config['cardAttributeColors'][$attribute] ?? 'gray'"
25-
:icon="$config['cardAttributeIcons'][$attribute] ?? null"
24+
:color="$config->cardAttributeColors[$attribute] ?? 'gray'"
25+
:icon="$config->cardAttributeIcons[$attribute] ?? null"
2626
/>
2727
@endif
2828
@endforeach

resources/views/livewire/column.blade.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ class="kanban-column-header flex items-center justify-between py-3 px-4 border-b
1010
{{ $column['label'] }}
1111
</h3>
1212
<div
13-
class="ml-2 px-2.5 py-0.5 rounded-full text-xs font-medium kanban-color-{{ $config['columnColors'][$columnId] }}">
13+
class="ml-2 px-2.5 py-0.5 rounded-full text-xs font-medium kanban-color-{{ $column['color'] }}">
1414
{{ $column['total'] ?? (isset($column['items']) ? count($column['items']) : 0) }}
1515
</div>
1616
</div>
@@ -52,7 +52,7 @@ class="p-3 flex-1 overflow-y-auto overflow-x-hidden"
5252
x-intersect.full="
5353
if (!isLoadingColumn('{{ $columnId }}')) {
5454
beginLoading('{{ $columnId }}');
55-
$wire.loadMoreItems('{{ $columnId }}', {{ $config['cardsIncrement'] ?? 'null' }});
55+
$wire.loadMoreItems('{{ $columnId }}', {{ $config->cardsIncrement ?? 'null' }});
5656
}
5757
"
5858
class="py-3 text-center"
@@ -67,7 +67,7 @@ class="py-3 text-center"
6767
</div>
6868
</div>
6969
<div wire:loading.remove wire:target="loadMoreItems('{{ $columnId }}')" class="text-xs text-gray-400">
70-
{{ count($column['items']) }} / {{ $column['total'] }} {{ $config['pluralCardLabel'] ?? 'Cards' }}
70+
{{ count($column['items']) }} / {{ $column['total'] }} {{ $config->pluralCardLabel ?? 'Records' }}
7171
</div>
7272
</div>
7373
@endif

resources/views/livewire/empty-column.blade.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,6 @@
55
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="1.5" d="M19 11H5m14 0a2 2 0 012 2v6a2 2 0 01-2 2H5a2 2 0 01-2-2v-6a2 2 0 012-2m14 0V9a2 2 0 00-2-2M5 11V9a2 2 0 012-2m0 0V5a2 2 0 012-2h6a2 2 0 012 2v2M7 7h10"></path>
66
</svg>
77
<p class="text-sm text-gray-500 dark:text-gray-400">
8-
{{ __('No cards in this column') }}
8+
{{ __('No records in this column') }}
99
</p>
1010
</div>

resources/views/livewire/kanban-board.blade.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,9 @@ class="w-full h-full flex flex-col relative"
88
x-data="flowforge({
99
state: {
1010
columns: @js($columns),
11-
columnField: '{{ $config['columnField'] }}',
12-
cardLabel: '{{ $config['cardLabel'] ?? 'Card' }}',
13-
pluralCardLabel: '{{ $config['pluralCardLabel'] ?? 'Cards' }}'
11+
columnField: '{{ $config->getColumnField() }}',
12+
cardLabel: '{{ $config->cardLabel ?? 'record' }}',
13+
pluralCardLabel: '{{ $config->pluralCardLabel ?? 'Records' }}'
1414
}
1515
})"
1616
>

resources/views/livewire/modals/create-card.blade.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
@props(['config'])
22

3-
<x-filament::modal id="create-card-modal" :heading="__('Create New :cardLabel', ['cardLabel' => $config['cardLabel'] ?? 'Card'])"
4-
:description="__('Add a new :cardLabel to the board', ['cardLabel' => strtolower($config['cardLabel'] ?? 'card')])"
3+
<x-filament::modal id="create-card-modal" :heading="__('Create New :cardLabel', ['cardLabel' => $config->cardLabel ?? 'Record'])"
4+
:description="__('Add a new :cardLabel to the board', ['cardLabel' => strtolower($config->cardLabel ?? 'record')])"
55
>
66

77
{{ $this->createRecordForm }}
@@ -18,7 +18,7 @@
1818
<x-filament::button
1919
wire:click="createRecord"
2020
>
21-
{{ __('Create :cardLabel', ['cardLabel' => $config['cardLabel'] ?? 'Card']) }}
21+
{{ __('Create :cardLabel', ['cardLabel' => $config->cardLabel ?? 'Record']) }}
2222
</x-filament::button>
2323
</div>
2424
</x-slot>

resources/views/livewire/modals/edit-card.blade.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
@props(['config'])
22

3-
<x-filament::modal id="edit-card-modal" :heading="__('Edit :cardLabel', ['cardLabel' => $config['cardLabel'] ?? 'Card'])">
3+
<x-filament::modal id="edit-card-modal" :heading="__('Edit :cardLabel', ['cardLabel' => $config->cardLabel ?? 'Card'])">
44
{{ $this->editRecordForm }}
55

66
<x-slot name="footer">

src/Adapters/DefaultKanbanAdapter.php

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -47,15 +47,14 @@ public function toLivewire(): array
4747
{
4848
return [
4949
'query' => \EloquentSerialize::serialize($this->baseQuery),
50-
'config' => $this->config->toArray(),
50+
'config' => $this->config
5151
];
5252
}
5353

5454
public static function fromLivewire($value): static
5555
{
5656
$query = \EloquentSerialize::unserialize($value['query']);
57-
$config = new KanbanConfig(...$value['config']);
5857

59-
return new static($query, $config);
58+
return new static($query, $value['config']);
6059
}
6160
}

0 commit comments

Comments
 (0)