Skip to content

Commit

Permalink
Merge pull request #292 from lara-zeus/fixes
Browse files Browse the repository at this point in the history
fixes and improvements for grading and disable searchable for counts …
  • Loading branch information
atmonshi authored May 30, 2024
2 parents 37c53b5 + 4a94a7e commit 4b63bb5
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/Fields/Classes/TextInput.php
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ public function appendFilamentComponentsOptions($component, $zeusField, bool $ha
parent::appendFilamentComponentsOptions($component, $zeusField, $hasVisibility);

if (! empty($zeusField['options']['dateType'])) {
call_user_func([$component, $zeusField['options']['dateType']]);
call_user_func([$component, optional($zeusField['options'])['dateType'] ?? 'string']);
}

if (isset($zeusField->options['prefix']) && $zeusField->options['prefix'] !== null) {
Expand Down
2 changes: 1 addition & 1 deletion src/Fields/FieldsContract.php
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ public function appendFilamentComponentsOptions($component, $zeusField, bool $ha
return null;
}

return $zeusField->options['grades']['points'] . ' ' . __('marks');
return optional($zeusField->options)['grades']['points'] ?? 0 . ' ' . __('marks');
})
->helperText($zeusField->description);

Expand Down
4 changes: 2 additions & 2 deletions src/Filament/Resources/FormResource.php
Original file line number Diff line number Diff line change
Expand Up @@ -157,8 +157,8 @@ public static function table(Table $table): Table
IconColumn::make('is_active')->boolean()->label(__('Is Active'))->sortable()->toggleable(),
TextColumn::make('start_date')->dateTime()->searchable()->sortable()->label(__('Start Date'))->toggleable(isToggledHiddenByDefault: true),
TextColumn::make('end_date')->dateTime()->searchable()->sortable()->label(__('End Date'))->toggleable(isToggledHiddenByDefault: true),
IconColumn::make('responses_exists')->boolean()->exists('responses')->label(__('Responses Exists'))->sortable()->toggleable(),
TextColumn::make('responses_count')->counts('responses')->label(__('Responses Count'))->sortable()->toggleable(),
IconColumn::make('responses_exists')->boolean()->exists('responses')->label(__('Responses Exists'))->sortable()->toggleable()->searchable(false),
TextColumn::make('responses_count')->counts('responses')->label(__('Responses Count'))->sortable()->toggleable()->searchable(false),
])
->actions(static::getActions())
->filters([
Expand Down

0 comments on commit 4b63bb5

Please sign in to comment.