From 3b831ebd7d822cb71731f917eaca81854b5c78aa Mon Sep 17 00:00:00 2001 From: Sagar Date: Wed, 28 Aug 2024 21:58:41 +0200 Subject: [PATCH] fix: column altered to handle empty name --- .../RelationManagers/MoleculesRelationManager.php | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/app/Filament/Dashboard/Resources/OrganismResource/RelationManagers/MoleculesRelationManager.php b/app/Filament/Dashboard/Resources/OrganismResource/RelationManagers/MoleculesRelationManager.php index 15a24e85..fc5845e8 100644 --- a/app/Filament/Dashboard/Resources/OrganismResource/RelationManagers/MoleculesRelationManager.php +++ b/app/Filament/Dashboard/Resources/OrganismResource/RelationManagers/MoleculesRelationManager.php @@ -48,12 +48,18 @@ public function table(Table $table): Table ->defaultImageUrl(url('/images/placeholder.png')), Tables\Columns\TextColumn::make('id')->searchable()->toggleable(isToggledHiddenByDefault: true), Tables\Columns\TextColumn::make('identifier')->searchable()->toggleable(isToggledHiddenByDefault: true), - Tables\Columns\TextColumn::make('name')->searchable() + Tables\Columns\TextColumn::make('identifier') + ->label('Details') ->formatStateUsing( fn (Molecule $molecule): HtmlString => new HtmlString("ID: {$molecule->id}
Identifier: {$molecule->identifier}
Name: {$molecule->name}") ) ->description(fn (Molecule $molecule): string => $molecule->standard_inchi) ->wrap(), + Tables\Columns\TextColumn::make('name') + ->searchable() + ->wrap() + ->lineClamp(6) + ->toggleable(isToggledHiddenByDefault: true), Tables\Columns\TextColumn::make('synonyms') ->searchable() ->wrap()