Skip to content

Commit

Permalink
Merge pull request #192 from lara-zeus/fix-collection
Browse files Browse the repository at this point in the history
Fix collection
  • Loading branch information
atmonshi authored Oct 15, 2023
2 parents 378552b + 17690a5 commit dd528cb
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 3 deletions.
14 changes: 12 additions & 2 deletions src/Filament/Resources/ResponseResource/Pages/ReportResponses.php
Original file line number Diff line number Diff line change
Expand Up @@ -48,16 +48,23 @@ public function table(Table $table): Table
->toggleable(),*/
TextColumn::make('user.name')
->label(__('User Name'))
->toggleable()
->sortable()
->searchable(),
TextColumn::make('status')
->toggleable()
->sortable()
->badge()
->label(__('status'))
->colors(BoltPlugin::getModel('FormsStatus')::pluck('key', 'color')->toArray())
->icons(BoltPlugin::getModel('FormsStatus')::pluck('key', 'icon')->toArray())
->grow(false)
->searchable('status'),

TextColumn::make('notes')->toggleable(),
TextColumn::make('notes')
->label(__('notes'))
->sortable()
->toggleable(),
];

/**
Expand All @@ -77,7 +84,10 @@ public function table(Table $table): Table
->toggleable();
}

$mainColumns[] = TextColumn::make('created_at')->toggleable();
$mainColumns[] = TextColumn::make('created_at')
->sortable()
->label(__('created at'))
->toggleable();

return $table
->query(
Expand Down
2 changes: 1 addition & 1 deletion src/Models/Collection.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ public function getValuesListAttribute(): ?string
return $allValues
->take(5)
->map(function ($item) {
return $item['itemValue'];
return $item['itemValue'] ?? null;
})
->join(',');
}
Expand Down

0 comments on commit dd528cb

Please sign in to comment.