init
This commit is contained in:
232 files changed
+25416
No files matched your search
@@ -0,0 +1,57 @@
|
||||
<?php
|
||||
|
||||
namespace App\Filament\Resources\BazaarReleases;
|
||||
|
||||
use App\Filament\Resources\BazaarReleases\Pages\ListBazaarReleases;
|
||||
use App\Filament\Resources\BazaarReleases\Pages\ViewBazaarRelease;
|
||||
use App\Filament\Resources\BazaarReleases\Schemas\BazaarReleaseForm;
|
||||
use App\Filament\Resources\BazaarReleases\Schemas\BazaarReleaseInfolist;
|
||||
use App\Filament\Resources\BazaarReleases\Tables\BazaarReleasesTable;
|
||||
use App\Models\BazaarRelease;
|
||||
use BackedEnum;
|
||||
use Filament\Resources\Resource;
|
||||
use Filament\Schemas\Schema;
|
||||
use Filament\Support\Icons\Heroicon;
|
||||
use Filament\Tables\Table;
|
||||
use UnitEnum;
|
||||
|
||||
class BazaarReleaseResource extends Resource
|
||||
{
|
||||
protected static ?string $model = BazaarRelease::class;
|
||||
|
||||
protected static string|BackedEnum|null $navigationIcon = Heroicon::OutlinedRectangleStack;
|
||||
|
||||
protected static string|UnitEnum|null $navigationGroup = 'Cafe Bazaar';
|
||||
|
||||
protected static ?string $navigationLabel = 'Publishing';
|
||||
|
||||
public static function form(Schema $schema): Schema
|
||||
{
|
||||
return BazaarReleaseForm::configure($schema);
|
||||
}
|
||||
|
||||
public static function infolist(Schema $schema): Schema
|
||||
{
|
||||
return BazaarReleaseInfolist::configure($schema);
|
||||
}
|
||||
|
||||
public static function table(Table $table): Table
|
||||
{
|
||||
return BazaarReleasesTable::configure($table);
|
||||
}
|
||||
|
||||
public static function getRelations(): array
|
||||
{
|
||||
return [
|
||||
//
|
||||
];
|
||||
}
|
||||
|
||||
public static function getPages(): array
|
||||
{
|
||||
return [
|
||||
'index' => ListBazaarReleases::route('/'),
|
||||
'view' => ViewBazaarRelease::route('/{record}'),
|
||||
];
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
<?php
|
||||
|
||||
namespace App\Filament\Resources\BazaarReleases\Pages;
|
||||
|
||||
use App\Filament\Resources\BazaarReleases\BazaarReleaseResource;
|
||||
use Filament\Resources\Pages\CreateRecord;
|
||||
|
||||
class CreateBazaarRelease extends CreateRecord
|
||||
{
|
||||
protected static string $resource = BazaarReleaseResource::class;
|
||||
}
|
||||
@@ -0,0 +1,21 @@
|
||||
<?php
|
||||
|
||||
namespace App\Filament\Resources\BazaarReleases\Pages;
|
||||
|
||||
use App\Filament\Resources\BazaarReleases\BazaarReleaseResource;
|
||||
use Filament\Actions\DeleteAction;
|
||||
use Filament\Actions\ViewAction;
|
||||
use Filament\Resources\Pages\EditRecord;
|
||||
|
||||
class EditBazaarRelease extends EditRecord
|
||||
{
|
||||
protected static string $resource = BazaarReleaseResource::class;
|
||||
|
||||
protected function getHeaderActions(): array
|
||||
{
|
||||
return [
|
||||
ViewAction::make(),
|
||||
DeleteAction::make(),
|
||||
];
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,19 @@
|
||||
<?php
|
||||
|
||||
namespace App\Filament\Resources\BazaarReleases\Pages;
|
||||
|
||||
use App\Filament\Resources\BazaarReleases\BazaarReleaseResource;
|
||||
use Filament\Actions\CreateAction;
|
||||
use Filament\Resources\Pages\ListRecords;
|
||||
|
||||
class ListBazaarReleases extends ListRecords
|
||||
{
|
||||
protected static string $resource = BazaarReleaseResource::class;
|
||||
|
||||
protected function getHeaderActions(): array
|
||||
{
|
||||
return [
|
||||
CreateAction::make(),
|
||||
];
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,19 @@
|
||||
<?php
|
||||
|
||||
namespace App\Filament\Resources\BazaarReleases\Pages;
|
||||
|
||||
use App\Filament\Resources\BazaarReleases\BazaarReleaseResource;
|
||||
use Filament\Actions\EditAction;
|
||||
use Filament\Resources\Pages\ViewRecord;
|
||||
|
||||
class ViewBazaarRelease extends ViewRecord
|
||||
{
|
||||
protected static string $resource = BazaarReleaseResource::class;
|
||||
|
||||
protected function getHeaderActions(): array
|
||||
{
|
||||
return [
|
||||
EditAction::make(),
|
||||
];
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
<?php
|
||||
|
||||
namespace App\Filament\Resources\BazaarReleases\Schemas;
|
||||
|
||||
use Filament\Schemas\Schema;
|
||||
|
||||
class BazaarReleaseForm
|
||||
{
|
||||
public static function configure(Schema $schema): Schema
|
||||
{
|
||||
return $schema
|
||||
->components([
|
||||
//
|
||||
]);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,26 @@
|
||||
<?php
|
||||
|
||||
namespace App\Filament\Resources\BazaarReleases\Schemas;
|
||||
|
||||
use Filament\Infolists\Components\IconEntry;
|
||||
use Filament\Infolists\Components\TextEntry;
|
||||
use Filament\Schemas\Schema;
|
||||
|
||||
class BazaarReleaseInfolist
|
||||
{
|
||||
public static function configure(Schema $schema): Schema
|
||||
{
|
||||
return $schema
|
||||
->components([
|
||||
TextEntry::make('bazaar_release_id')->label('Bazaar release ID'),
|
||||
TextEntry::make('status')->badge(),
|
||||
TextEntry::make('artifact_type')->badge(),
|
||||
TextEntry::make('staged_rollout_percentage')->suffix('%'),
|
||||
IconEntry::make('auto_publish')->boolean(),
|
||||
TextEntry::make('changelog_fa')->columnSpanFull(),
|
||||
TextEntry::make('changelog_en')->columnSpanFull(),
|
||||
TextEntry::make('developer_note')->columnSpanFull(),
|
||||
TextEntry::make('bazaar_response')->formatStateUsing(fn (?array $state): string => json_encode($state, JSON_PRETTY_PRINT | JSON_UNESCAPED_UNICODE))->columnSpanFull(),
|
||||
]);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,41 @@
|
||||
<?php
|
||||
|
||||
namespace App\Filament\Resources\BazaarReleases\Tables;
|
||||
|
||||
use Filament\Actions\ViewAction;
|
||||
use Filament\Tables\Columns\IconColumn;
|
||||
use Filament\Tables\Columns\TextColumn;
|
||||
use Filament\Tables\Filters\SelectFilter;
|
||||
use Filament\Tables\Table;
|
||||
|
||||
class BazaarReleasesTable
|
||||
{
|
||||
public static function configure(Table $table): Table
|
||||
{
|
||||
return $table
|
||||
->columns([
|
||||
TextColumn::make('bazaar_release_id')->label('Bazaar ID')->sortable(),
|
||||
TextColumn::make('status')->badge()->sortable(),
|
||||
TextColumn::make('artifact_type')->badge(),
|
||||
TextColumn::make('staged_rollout_percentage')->suffix('%')->sortable(),
|
||||
IconColumn::make('auto_publish')->boolean(),
|
||||
TextColumn::make('committed_at')->dateTime()->sortable(),
|
||||
TextColumn::make('published_at')->dateTime()->sortable(),
|
||||
])
|
||||
->filters([
|
||||
SelectFilter::make('status')->options([
|
||||
'draft' => 'Draft',
|
||||
'awaiting_bin' => 'Awaiting BIN',
|
||||
'processing_bundle' => 'Processing bundle',
|
||||
'artifact_uploaded' => 'Artifact uploaded',
|
||||
'committed' => 'Committed',
|
||||
'published' => 'Published',
|
||||
'deleted' => 'Deleted',
|
||||
]),
|
||||
])
|
||||
->recordActions([
|
||||
ViewAction::make(),
|
||||
])
|
||||
->defaultSort('created_at', 'desc');
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user