Skip to content

Commit 95a476c

Browse files
sfkelseyleegithub-actions[bot]
authored andcommitted
Fix styling
1 parent 8e5000a commit 95a476c

File tree

3 files changed

+31
-29
lines changed

3 files changed

+31
-29
lines changed

src/Base/Filament/Concerns/ContentFormTrait.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -170,7 +170,7 @@ public function updatedActiveLocale(string $newActiveLocale): void
170170

171171
// Prepare data for new locale
172172
$newLocaleData = $this->otherLocaleData[$this->activeLocale] ?? [];
173-
173+
174174
// Handle nested title structure for new locale
175175
if (isset($this->data['title']) && is_array($this->data['title'])) {
176176
// If we have a stored value for the new locale, put it back in the array

src/Base/Filament/Resources/Pages/BaseContentEditPage.php

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ public function mountTranslatable(): void
5555
// Call trait implementation (if trait provides it)
5656
if (method_exists($this, 'traitMountTranslatable')) {
5757
$this->traitMountTranslatable();
58-
}
58+
}
5959
// Ensure query string param takes precedence if present
6060
if ($locale = request()->query('activeLocale')) {
6161
$this->activeLocale = $locale;
@@ -75,36 +75,36 @@ protected function getHeaderActions(): array
7575
ViewAction::make(),
7676

7777
DeleteAction::make()
78-
->visible(fn(Model $record) => ! $record->isLocked()),
78+
->visible(fn (Model $record) => ! $record->isLocked()),
7979

8080
RestoreAction::make(),
8181

8282
ForceDeleteAction::make(),
8383

8484
LockContentAction::make()
85-
->successRedirectUrl(fn($record) => $this->getUrl(array_merge(['record' => $record], $this->getRedirectUrlParameters()))),
85+
->successRedirectUrl(fn ($record) => $this->getUrl(array_merge(['record' => $record], $this->getRedirectUrlParameters()))),
8686

8787
UnlockContentAction::make()
88-
->successRedirectUrl(fn($record) => $this->getUrl(array_merge(['record' => $record], $this->getRedirectUrlParameters()))),
88+
->successRedirectUrl(fn ($record) => $this->getUrl(array_merge(['record' => $record], $this->getRedirectUrlParameters()))),
8989
])
9090
->dropdown(false)
91-
->hidden(fn(ActionGroup $action) => FilamentActionHelper::isAnyVisibleActionInActionGroup($action)),
91+
->hidden(fn (ActionGroup $action) => FilamentActionHelper::isAnyVisibleActionInActionGroup($action)),
9292

9393
ActionGroup::make([
9494
UpdateContentRouteAction::make(),
9595
ContentHistoryAction::make(),
9696
AdjustChildOrderAction::make()
97-
->nodeParentId(fn(Content | Model $record) => $record->nestable_tree_id ?? ($record->nestableTree?->getKey() ?? 0))
97+
->nodeParentId(fn (Content | Model $record) => $record->nestable_tree_id ?? ($record->nestableTree?->getKey() ?? 0))
9898
->hidden(
99-
fn(?Model $record) => ! $record instanceof Content ||
99+
fn (?Model $record) => ! $record instanceof Content ||
100100
$record->trashed()
101101
)
102102
->successRedirectUrl(function ($record) {
103103
return $this->getUrl(['record' => $record, ...$this->getRedirectUrlParameters()]);
104104
}),
105105
])
106106
->dropdown(false)
107-
->hidden(fn(ActionGroup $action) => FilamentActionHelper::isAnyVisibleActionInActionGroup($action)),
107+
->hidden(fn (ActionGroup $action) => FilamentActionHelper::isAnyVisibleActionInActionGroup($action)),
108108
]),
109109
];
110110
}
@@ -144,7 +144,7 @@ protected function handleRecordUpdate(Model $record, array $data): Model
144144
$record->fill(Arr::except($data, $translatableAttributes));
145145

146146
$currentFieldsForType = $record instanceof Content
147-
? $record->documentType?->fieldGroups->whereInstanceOf(FieldGroup::class)->mapWithKeys(fn(FieldGroup $fg) => [$fg->name => $fg->fields->pluck('name')->all()])->all()
147+
? $record->documentType?->fieldGroups->whereInstanceOf(FieldGroup::class)->mapWithKeys(fn (FieldGroup $fg) => [$fg->name => $fg->fields->pluck('name')->all()])->all()
148148
: [];
149149
// Limit the propertyData to the current fields for the type
150150
$propertyData = Arr::only($data['propertyData'] ?? [], array_keys($currentFieldsForType));
@@ -172,7 +172,7 @@ protected function handleRecordUpdate(Model $record, array $data): Model
172172

173173
foreach ($this->otherLocaleData as $locale => $localeData) {
174174
$existingLocales ??= collect($translatableAttributes)
175-
->map(fn(string $attribute): array => array_keys($record->getTranslations($attribute)))
175+
->map(fn (string $attribute): array => array_keys($record->getTranslations($attribute)))
176176
->flatten()
177177
->unique()
178178
->all();

src/Filament/Resources/Contents/Schemas/ContentForm.php

Lines changed: 20 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -171,26 +171,26 @@ protected static function getTitleFormComponent()
171171
foreach ($langs as $lang) {
172172

173173
$locale = $lang->code;
174-
174+
175175
$components[] =
176176
TextInput::make($locale)
177-
->label(__('inspirecms::resources/content.title.label'))
178-
->validationAttribute(__('inspirecms::resources/content.title.validation_attribute'))
179-
->placeholder(__('inspirecms::resources/content.title.placeholder'))
180-
->helperText(__('inspirecms::resources/content.title.instructions'))
181-
->live(true, 5000)
182-
->afterStateUpdated(function ($state, $get, $set, $operation, ContractsContentForm $livewire) use ($locale) {
183-
// Fill slug if empty / operation is create
184-
if ($operation === 'create' || empty($get('slug'))) {
185-
$set('slug', ContentSlugFactory::create()->generate($state));
186-
}
187-
$set("webSetting.seo.meta_title.{$locale}", $state);
188-
})
189-
->autofocus()
190-
->required()
191-
->limitLengthWithHint(60)
192-
->visible(fn(ContractsContentForm $livewire) => $livewire->getActiveActionsLocale() == $locale)
193-
->translatable();
177+
->label(__('inspirecms::resources/content.title.label'))
178+
->validationAttribute(__('inspirecms::resources/content.title.validation_attribute'))
179+
->placeholder(__('inspirecms::resources/content.title.placeholder'))
180+
->helperText(__('inspirecms::resources/content.title.instructions'))
181+
->live(true, 5000)
182+
->afterStateUpdated(function ($state, $get, $set, $operation, ContractsContentForm $livewire) use ($locale) {
183+
// Fill slug if empty / operation is create
184+
if ($operation === 'create' || empty($get('slug'))) {
185+
$set('slug', ContentSlugFactory::create()->generate($state));
186+
}
187+
$set("webSetting.seo.meta_title.{$locale}", $state);
188+
})
189+
->autofocus()
190+
->required()
191+
->limitLengthWithHint(60)
192+
->visible(fn (ContractsContentForm $livewire) => $livewire->getActiveActionsLocale() == $locale)
193+
->translatable();
194194
}
195195

196196
return $components;
@@ -209,8 +209,10 @@ protected static function getTitleFormComponent()
209209
// This makes it compatible with the Translatable trait's handling
210210
if (is_array($state)) {
211211
$activeLocale = $livewire->getActiveActionsLocale();
212+
212213
return $state[$activeLocale] ?? '';
213214
}
215+
214216
return $state;
215217
})
216218
->schema($configureTranslatableComponents);

0 commit comments

Comments
 (0)