design wip
This commit is contained in:
1 parent
70a443db6b
commit
eb11298d24
22 files changed
+418
-81
No files matched your search
@@ -29,7 +29,7 @@ class AlarmBookmaker extends Component implements HasActions, HasSchemas, HasTab
|
||||
use InteractsWithTable;
|
||||
|
||||
protected $listeners = [
|
||||
'reload_alarm_bookmaker' => '$refresh',
|
||||
'refreshlarmBookmaker' => '$refresh',
|
||||
];
|
||||
|
||||
public static $default_filter;
|
||||
|
||||
@@ -34,7 +34,7 @@ class ComparingBookmakerMenu extends Component implements HasActions, HasSchemas
|
||||
public $user;
|
||||
|
||||
protected $listeners = [
|
||||
'refresh_comparing_bookmaker' => '$refresh',
|
||||
'refreshComparingBookmakerMenu' => '$refresh',
|
||||
];
|
||||
|
||||
public function table(Table $table): Table
|
||||
|
||||
@@ -45,7 +45,7 @@ class MapperLeft extends Component implements HasActions, HasSchemas, HasTable
|
||||
public $user;
|
||||
|
||||
protected $listeners = [
|
||||
'reload_data_left' => '$refresh',
|
||||
'refreshMapperLeft' => '$refresh',
|
||||
];
|
||||
|
||||
public function removeTableFilter(string $filterName, ?string $field = null, bool $shouldTriggerUpdatedFiltersHook = true): void
|
||||
@@ -62,7 +62,7 @@ class MapperLeft extends Component implements HasActions, HasSchemas, HasTable
|
||||
$this->search_left = '';
|
||||
}
|
||||
|
||||
$this->dispatch('reload_data_left');
|
||||
$this->dispatch('refreshMapperLeft');
|
||||
}
|
||||
|
||||
public function table(Table $table): Table
|
||||
@@ -152,7 +152,7 @@ class MapperLeft extends Component implements HasActions, HasSchemas, HasTable
|
||||
->persistFiltersInSession()
|
||||
->deferFilters(false)
|
||||
->toolbarActions([
|
||||
Action::make('reload_data_left')
|
||||
Action::make('refreshMapperLeft')
|
||||
->hiddenLabel()
|
||||
->icon('phosphor-x')
|
||||
->color('danger')
|
||||
@@ -162,7 +162,7 @@ class MapperLeft extends Component implements HasActions, HasSchemas, HasTable
|
||||
$this->tableSearch = ''; // Clears the main search bar
|
||||
$livewire->fill(['tableSearch' => '']);
|
||||
$livewire->resetTableFiltersForm(); // Clears all filters
|
||||
$this->dispatch('reload_data_left');
|
||||
$this->dispatch('refreshMapperLeft');
|
||||
}),
|
||||
]);
|
||||
}
|
||||
@@ -177,7 +177,7 @@ class MapperLeft extends Component implements HasActions, HasSchemas, HasTable
|
||||
{
|
||||
$this->search_left = $str;
|
||||
|
||||
$this->dispatch('reload_data_left');
|
||||
$this->dispatch('refreshMapperLeft');
|
||||
}
|
||||
|
||||
public function leftAction(): Action
|
||||
@@ -196,8 +196,8 @@ class MapperLeft extends Component implements HasActions, HasSchemas, HasTable
|
||||
StoreMapped::store($arguments, $this->elements_swopped);
|
||||
$this->search_right = '';
|
||||
$this->search_left = '';
|
||||
$this->dispatch('reload_data_left');
|
||||
$this->dispatch('reload_data_right');
|
||||
$this->dispatch('refreshMapperLeft');
|
||||
$this->dispatch('refreshMapperRight');
|
||||
|
||||
})
|
||||
->closeModalByEscaping(false)
|
||||
|
||||
@@ -42,7 +42,7 @@ class MapperRight extends Component implements HasActions, HasSchemas, HasTable
|
||||
public $search_right = false;
|
||||
|
||||
protected $listeners = [
|
||||
'reload_data_right' => '$refresh',
|
||||
'refreshMapperRight' => '$refresh',
|
||||
];
|
||||
|
||||
public $user;
|
||||
@@ -61,7 +61,7 @@ class MapperRight extends Component implements HasActions, HasSchemas, HasTable
|
||||
$this->search_right = '';
|
||||
}
|
||||
|
||||
$this->dispatch('reload_data_right');
|
||||
$this->dispatch('refreshMapperRight');
|
||||
}
|
||||
|
||||
public function table(Table $table): Table
|
||||
@@ -165,7 +165,7 @@ class MapperRight extends Component implements HasActions, HasSchemas, HasTable
|
||||
->filtersFormColumns(3)
|
||||
->deferFilters(false)
|
||||
->toolbarActions([
|
||||
Action::make('reload_data_right')
|
||||
Action::make('refreshMapperRight')
|
||||
->hiddenLabel()
|
||||
->icon('phosphor-x')
|
||||
->color('danger')
|
||||
@@ -175,8 +175,8 @@ class MapperRight extends Component implements HasActions, HasSchemas, HasTable
|
||||
$this->tableSearch = ''; // Clears the main search bar
|
||||
$livewire->fill(['tableSearch' => '']);
|
||||
$livewire->resetTableFiltersForm(); // Clears all filters
|
||||
$this->dispatch('reload_data_right');
|
||||
$this->dispatch('reload_data_left');
|
||||
$this->dispatch('refreshMapperRight');
|
||||
$this->dispatch('refreshMapperLeft');
|
||||
}),
|
||||
]);
|
||||
}
|
||||
@@ -191,7 +191,7 @@ class MapperRight extends Component implements HasActions, HasSchemas, HasTable
|
||||
{
|
||||
$this->search_right = $str;
|
||||
|
||||
$this->dispatch('reload_data_right');
|
||||
$this->dispatch('refreshMapperRight');
|
||||
}
|
||||
|
||||
public function rightAction(): Action
|
||||
@@ -209,8 +209,8 @@ class MapperRight extends Component implements HasActions, HasSchemas, HasTable
|
||||
StoreMapped::store($arguments, $this->elements_swopped);
|
||||
$this->search_right = '';
|
||||
$this->search_left = '';
|
||||
$this->dispatch('reload_data_left');
|
||||
$this->dispatch('reload_data_right');
|
||||
$this->dispatch('refreshMapperLeft');
|
||||
$this->dispatch('refreshMapperRight');
|
||||
})
|
||||
->closeModalByEscaping(false)
|
||||
->modalCloseButton(false)
|
||||
|
||||
@@ -6,7 +6,6 @@ use App\Filament\Tables\Columns\BookmakerIcon;
|
||||
use App\Models\Bookmaker;
|
||||
use App\Models\MultilineClient;
|
||||
use App\Models\MultilineSetting;
|
||||
use App\Models\User;
|
||||
use Filament\Actions\Concerns\InteractsWithActions;
|
||||
use Filament\Actions\Contracts\HasActions;
|
||||
use Filament\Forms\Components\Radio;
|
||||
@@ -32,18 +31,13 @@ class MultilineBookmaker extends Component implements HasActions, HasSchemas, Ha
|
||||
use InteractsWithTable;
|
||||
|
||||
protected $listeners = [
|
||||
'reload_bookmaker_multiline' => '$refresh',
|
||||
'refreshMultilineBookmaker' => '$refresh',
|
||||
];
|
||||
|
||||
public $user;
|
||||
|
||||
public function table(Table $table): Table
|
||||
{
|
||||
|
||||
$this->user = User::getUser();
|
||||
|
||||
return $table
|
||||
->query(MultilineClient::query()->where('client_bookmaker_id', $this->user->bookmaker_id)->where('sport_id', $this->user->sport_id))
|
||||
->query(MultilineClient::query()->where('client_bookmaker_id', auth()->user()->bookmaker_id)->where('sport_id', auth()->user()->sport_id))
|
||||
->paginated(false)
|
||||
->columns([
|
||||
IconColumn::make('sport.icon')
|
||||
@@ -62,7 +56,7 @@ class MultilineBookmaker extends Component implements HasActions, HasSchemas, Ha
|
||||
$table = MultilineSetting::where('id', $livewire->tableFilters['multiline_setting_id'])->value('table');
|
||||
|
||||
$bookies = DB::table($table)
|
||||
->where('sport_id', $this->user->sport_id)
|
||||
->where('sport_id', auth()->user()->sport_id)
|
||||
->groupBy('bookmaker_id')->pluck('bookmaker_id');
|
||||
|
||||
$res = Bookmaker::whereIn('id', $bookies)->pluck('name', 'id');
|
||||
@@ -81,12 +75,13 @@ class MultilineBookmaker extends Component implements HasActions, HasSchemas, Ha
|
||||
Filter::make('multiline_setting_id')
|
||||
->schema([
|
||||
Radio::make('multiline_setting_id')
|
||||
->extraAttributes(['id' => 'multiline_setting'])
|
||||
->inline()
|
||||
->default(1)
|
||||
->default(fn ($record) => MultilineSetting::where('sport_id', auth()->user()->sport_id)->pluck('id')->first())
|
||||
->columnSpan(6)
|
||||
->columnSpanFull()
|
||||
->hiddenLabel()
|
||||
->options(fn () => MultilineSetting::where('sport_id', $this->user->sport_id)->orderBy('name')->pluck('name', 'id')),
|
||||
->options(fn () => MultilineSetting::where('sport_id', auth()->user()->sport_id)->orderBy('name')->pluck('name', 'id')),
|
||||
])
|
||||
->query(function (Builder $query, array $data): Builder {
|
||||
return $query
|
||||
|
||||
@@ -48,6 +48,17 @@ class SportSwitcher extends Component
|
||||
$this->dispatch('filterClearFilter');
|
||||
|
||||
$this->dispatch('refreshSportSwitcher');
|
||||
|
||||
$this->dispatch('refreshMultilineBookmaker');
|
||||
|
||||
$this->dispatch('refreshComparingBookmakerMenu');
|
||||
|
||||
$this->dispatch('refreshMapperLeft');
|
||||
|
||||
$this->dispatch('refreshMapperRight');
|
||||
|
||||
$this->dispatch('refreshlarmBookmaker');
|
||||
|
||||
}
|
||||
|
||||
public function render()
|
||||
|
||||
@@ -13,8 +13,8 @@ class TopMenuItems extends Component
|
||||
public $current = '';
|
||||
|
||||
protected $listeners = [
|
||||
'reload_data_left' => '$refresh',
|
||||
'reload_data_right' => '$refresh',
|
||||
'refreshMapperLeft' => '$refresh',
|
||||
'refreshMapperRight' => '$refresh',
|
||||
];
|
||||
|
||||
protected string $sport = '';
|
||||
@@ -50,6 +50,6 @@ class TopMenuItems extends Component
|
||||
{
|
||||
User::where('id', auth()->user()->id)->update(['provider_id' => $provider_id]);
|
||||
|
||||
$this->dispatch('reload_data_right');
|
||||
$this->dispatch('refreshMapperRight');
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user