From b7ed39e1467df7ba70065f96989d7b711a599d08 Mon Sep 17 00:00:00 2001 From: Bogdan Bocioaca Date: Thu, 2 Nov 2023 07:55:18 +0200 Subject: [PATCH] changes --- .../MapPointsResource/Pages/ViewMapPoint.php | 124 +++++++++--------- 1 file changed, 62 insertions(+), 62 deletions(-) diff --git a/app/Filament/Resources/MapPointsResource/Pages/ViewMapPoint.php b/app/Filament/Resources/MapPointsResource/Pages/ViewMapPoint.php index 1d381601..a9ecc140 100644 --- a/app/Filament/Resources/MapPointsResource/Pages/ViewMapPoint.php +++ b/app/Filament/Resources/MapPointsResource/Pages/ViewMapPoint.php @@ -63,19 +63,19 @@ public function editLocationAction(): Action ->description('Update map point location') ->schema([ TextInput::make('county') - ->required() - ->default($this->getRecord()->county)->disabled(), + ->required() + ->default($this->getRecord()->county)->disabled(), TextInput::make('city') - ->required() - ->default($this->getRecord()->city)->disabled(), + ->required() + ->default($this->getRecord()->city)->disabled(), TextInput::make('address') - ->required() - ->default($this->getRecord()->address), + ->required() + ->default($this->getRecord()->address), // TextInput::make('lat')->required()->default($this->getRecord()->lat), // TextInput::make('lon')->required()->default($this->getRecord()->lon), TextInput::make('location_notes') - ->required() - ->default($this->getRecord()->location_notes), + ->required() + ->default($this->getRecord()->location_notes), ]) ->columns(2), @@ -98,53 +98,53 @@ public function editDetailsAction(): Action ->iconButton() ->form([ Select::make('type') - ->label(__('map_points.point_type_alt')) + ->label(__('map_points.point_type_alt')) ->options(MapPointTypeModel::query()->pluck('display_name', 'id')) ->default($this->getRecord()->type->id) ->required(), Select::make('materials') - ->label(__('map_points.materials')) + ->label(__('map_points.materials')) ->options(RecycleMaterialModel::query()->pluck('name', 'id')) ->default($this->getRecord()->materials->pluck('id')->toArray()) ->multiple() ->required(), TextInput::make('managed_by') - ->required() - ->default($this->getRecord()->managed_by), + ->required() + ->default($this->getRecord()->managed_by), TextInput::make('website') - ->required() - ->default($this->getRecord()->website), + ->required() + ->default($this->getRecord()->website), TextInput::make('email') - ->required() - ->default($this->getRecord()->email)->email(), + ->required() + ->default($this->getRecord()->email)->email(), TextInput::make('phone_no') - ->required() - ->default($this->getRecord()->phone_no), + ->required() + ->default($this->getRecord()->phone_no), Repeater::make('opening_hours') ->schema([ Select::make('start_day') ->label('Start day') - ->options(__('common.week_days')) + ->options(__('common.week_days')) ->required(), Select::make('end_day') ->label('End day') - ->options(__('common.week_days')) + ->options(__('common.week_days')) // ->default($this->getRecord()->materials->pluck('id')->toArray()) ->required(), TimePicker::make('start_hour') - ->seconds('false') - ->hoursStep(1) + ->seconds('false') + ->hoursStep(1) ->minutesStep(10), TimePicker::make('end_hour') - ->seconds('false') - ->hoursStep(1) + ->seconds('false') + ->hoursStep(1) ->minutesStep(10), ]) - ->default($this->getRecord()->opening_hours) + ->default($this->getRecord()->opening_hours) ->columns(4), TextInput::make('notes') - ->required() - ->default($this->getRecord()->notes), + ->required() + ->default($this->getRecord()->notes), Checkbox::make('offers_transport')->default($this->getRecord()->offers_transport), Checkbox::make('offers_money')->default($this->getRecord()->offers_money), ]) @@ -161,8 +161,8 @@ protected function getHeaderActions(): array { $actions = array_merge($actions, [ Action::make('validate-point') - ->label(__('map_points.buttons.change_status')) - ->icon('heroicon-m-check') + ->label(__('map_points.buttons.change_status')) + ->icon('heroicon-m-check') ->action(function (array $data, Collection $records): void { $this->record->changeStatus(); @@ -177,7 +177,7 @@ protected function getHeaderActions(): array ->label(__('map_points.buttons.set_group')) ->form([ Select::make('group_id') - ->label(__('map_points.buttons.group')) + ->label(__('map_points.buttons.group')) ->options(MapPointGroupModel::query()->pluck('name', 'id')) ->required(), ]) @@ -239,41 +239,41 @@ public function table(Table $table): Table ->query(ActionLogModel::whereModel(\get_class($this->getRecord()))->whereModelId($this->getRecord()->id)->orderBy('created_at', 'desc')) ->columns([ TextColumn::make('user_id') - ->formatStateUsing(function (string $state, $record) - { - if ($record->user_id > 0) - { - $user = UserModel::find($record->user_id); - } - else - { - $user = new UserModel(); - $user->name = 'System'; - } - - return "[{$record->user_id}] {$user->name}"; - }) - ->html(), + ->formatStateUsing(function (string $state, $record) + { + if ($record->user_id > 0) + { + $user = UserModel::find($record->user_id); + } + else + { + $user = new UserModel(); + $user->name = 'System'; + } + + return "[{$record->user_id}] {$user->name}"; + }) + ->html(), TextColumn::make('action') - ->formatStateUsing(function (string $state, $record) - { - return trans('actions.' . $record->action); - }) - ->html(), + ->formatStateUsing(function (string $state, $record) + { + return trans('actions.' . $record->action); + }) + ->html(), TextColumn::make('old_values') - ->formatStateUsing(function (string $state, $record) - { - return ActionLogModel::formatValuesText($record, 'old_values'); - }) - ->wrap() - ->html(), + ->formatStateUsing(function (string $state, $record) + { + return ActionLogModel::formatValuesText($record, 'old_values'); + }) + ->wrap() + ->html(), TextColumn::make('new_values') - ->formatStateUsing(function (string $state, $record) - { - return ActionLogModel::formatValuesText($record, 'new_values'); - }) - ->wrap() - ->html(), + ->formatStateUsing(function (string $state, $record) + { + return ActionLogModel::formatValuesText($record, 'new_values'); + }) + ->wrap() + ->html(), TextColumn::make('created_at'), ]);