Skip to content

Commit e4e703b

Browse files
feat: update form layouts and add global configuration for FormsSelect
- Adjusted column settings across various flow presentation forms to use single-column layouts and improve readability. - Added global `FormsSelect` configuration for consistent field wrapper styling. - Enhanced section components in `EditCaseFlowPresentation` with full column span for better alignment.
1 parent f184059 commit e4e703b

File tree

3 files changed

+18
-6
lines changed

3 files changed

+18
-6
lines changed

app/Filament/Organizations/Resources/Cases/Pages/EditCaseFlowPresentation.php

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -71,12 +71,13 @@ public static function getPersonalInformationFormSchema(): array
7171
public static function flowSection(): array
7272
{
7373
return [
74-
Grid::make()
74+
Grid::make(1)
7575
->maxWidth('3xl')
7676
->relationship('flowPresentation')
7777
->schema([
7878
Section::make(__('beneficiary.section.flow.presentation_and_referral'))
7979
->compact()
80+
->columnSpanFull()
8081
->columns(2)
8182
->schema([
8283
Select::make('presentation_mode')
@@ -110,6 +111,7 @@ public static function flowSection(): array
110111

111112
Section::make(__('beneficiary.section.flow.notification'))
112113
->compact()
114+
->columnSpanFull()
113115
->columns(2)
114116
->schema([
115117
Select::make('notifier')
@@ -137,7 +139,8 @@ public static function flowSection(): array
137139

138140
Section::make(__('beneficiary.section.flow.act_location'))
139141
->compact()
140-
->columns(2)
142+
->columnSpanFull()
143+
->columns(1)
141144
->schema([
142145
Select::make('act_location')
143146
->label(__('field.act_location'))
@@ -159,7 +162,8 @@ public static function flowSection(): array
159162

160163
Section::make(__('beneficiary.section.flow.institutions_called'))
161164
->compact()
162-
->columns(2)
165+
->columnSpanFull()
166+
->columns(1)
163167
->schema([
164168
Select::make('first_called_institution_id')
165169
->label(__('field.first_called_institution'))

app/Filament/Organizations/Resources/Cases/Schemas/FlowPresentationFormSchema.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ public static function getSchemaForCreateWizard(): array
107107
Section::make(__('beneficiary.section.flow.act_location'))
108108
->compact()
109109
->columnSpanFull()
110-
->columns(2)
110+
->columns(1)
111111
->schema([
112112
Select::make('act_location')
113113
->label(__('field.act_location'))
@@ -130,7 +130,7 @@ public static function getSchemaForCreateWizard(): array
130130
Section::make(__('beneficiary.section.flow.institutions_called'))
131131
->compact()
132132
->columnSpanFull()
133-
->columns(2)
133+
->columns(1)
134134
->schema([
135135
Select::make('first_called_institution_id')
136136
->label(__('field.first_called_institution'))

app/Providers/AppServiceProvider.php

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44

55
namespace App\Providers;
66

7+
use App\Filament\Organizations\Resources\Cases\Pages\InterventionPlan\ViewCaseInterventionPlan;
78
use App\Http\Responses\LoginResponse;
89
use App\Models\Activity;
910
use App\Models\Address;
@@ -58,8 +59,8 @@
5859
use App\Models\UserRole;
5960
use App\Models\UserStatus;
6061
use App\Models\Violence;
61-
use App\Filament\Organizations\Resources\Cases\Pages\InterventionPlan\ViewCaseInterventionPlan;
6262
use App\Models\ViolenceHistory;
63+
use Filament\Forms\Components\Select as FormsSelect;
6364
use Filament\Forms\Components\TextInput;
6465
use Filament\Infolists\Components\TextEntry;
6566
use Filament\Schemas\Components\Grid;
@@ -101,6 +102,13 @@ public function register(): void
101102
$input->minValue(0);
102103
}
103104
});
105+
106+
FormsSelect::configureUsing(function (FormsSelect $select): void {
107+
$select->extraFieldWrapperAttributes([
108+
'class' => 'min-w-0 w-full',
109+
]);
110+
});
111+
104112
Grid::configureUsing(function (Grid $grid) {
105113
$grid->extraAttributes([
106114
'class' => 'bg-white dark:bg-gray-800/50 rounded-xl p-6 shadow',

0 commit comments

Comments
 (0)