Skip to content

Commit

Permalink
Merge pull request #6 from TappNetwork/formatted_json_in_infolist
Browse files Browse the repository at this point in the history
Replace KeyValueEntry with formatted JSON
  • Loading branch information
andreia authored Sep 30, 2024
2 parents 447eef7 + ea422e2 commit 1987e67
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 4 deletions.
8 changes: 8 additions & 0 deletions resources/views/infolists/entries/formatted-json.blade.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<x-dynamic-component :component="$getEntryWrapperView()" :entry="$entry">
<pre class="text-sm leading-6 text-gray-950 dark:text-white">
{{ json_encode(
$getState(),
JSON_PRETTY_PRINT | JSON_UNESCAPED_SLASHES
) }}
</pre>
</x-dynamic-component>
1 change: 1 addition & 0 deletions src/FilamentWebhookClientServiceProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ public function configurePackage(Package $package): void
$package
->name('filament-webhook-client')
->hasConfigFile()
->hasViews()
->hasTranslations();
}

Expand Down
13 changes: 9 additions & 4 deletions src/Resources/WebhookCallResource.php
Original file line number Diff line number Diff line change
Expand Up @@ -49,11 +49,14 @@ public static function infolist(Infolist $infolist): Infolist
->label('ID'),
Infolists\Components\TextEntry::make('name'),
Infolists\Components\TextEntry::make('url'),
Infolists\Components\KeyValueEntry::make('headers')
Infolists\Components\ViewEntry::make('headers')
->view('filament-webhook-client::infolists.entries.formatted-json')
->columnSpanFull(),
Infolists\Components\KeyValueEntry::make('payload')
Infolists\Components\ViewEntry::make('payload')
->view('filament-webhook-client::infolists.entries.formatted-json')
->columnSpanFull(),
Infolists\Components\KeyValueEntry::make('exception')
Infolists\Components\ViewEntry::make('exception')
->view('filament-webhook-client::infolists.entries.formatted-json')
->columnSpanFull(),
]);
}
Expand Down Expand Up @@ -100,7 +103,9 @@ public static function table(Table $table): Table
//
])
->actions([
Tables\Actions\ViewAction::make(),
Tables\Actions\ViewAction::make()
->stickyModalFooter()
->stickyModalHeader(),
])
->bulkActions([
Tables\Actions\BulkActionGroup::make([
Expand Down

0 comments on commit 1987e67

Please sign in to comment.