Initial commit: Pireon Admin — headless admin panel and public API
Laravel 13 + Filament 5 admin panel and REST API for a non-profit developer collective, backed by the Pireon OAuth identity server. The public site is a separate, server-rendered application consuming /api/public/v1. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
@@ -0,0 +1,21 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace App\Filament\Resources\RepositoryIssuesResource\Pages;
|
||||
|
||||
use App\Filament\Concerns\WarnsOfConcurrentEditing;
|
||||
use App\Filament\Resources\RepositoryIssuesResource;
|
||||
use Filament\Resources\Pages\EditRecord;
|
||||
|
||||
class EditRepositoryIssue extends EditRecord
|
||||
{
|
||||
use WarnsOfConcurrentEditing;
|
||||
|
||||
protected static string $resource = RepositoryIssuesResource::class;
|
||||
|
||||
protected function getHeaderActions(): array
|
||||
{
|
||||
return [];
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace App\Filament\Resources\RepositoryIssuesResource\Pages;
|
||||
|
||||
use App\Filament\Resources\RepositoryIssuesResource;
|
||||
use Filament\Resources\Pages\ListRecords;
|
||||
|
||||
class ListRepositoryIssues extends ListRecords
|
||||
{
|
||||
protected static string $resource = RepositoryIssuesResource::class;
|
||||
|
||||
protected function getHeaderActions(): array
|
||||
{
|
||||
return [];
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,88 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace App\Filament\Resources\RepositoryIssuesResource\Schemas;
|
||||
|
||||
use Filament\Forms\Components\DateTimePicker;
|
||||
use Filament\Forms\Components\Placeholder;
|
||||
use Filament\Forms\Components\Section;
|
||||
use Filament\Forms\Components\Select;
|
||||
use Filament\Forms\Components\Textarea;
|
||||
use Filament\Forms\Components\TextInput;
|
||||
use Filament\Forms\Components\Toggle;
|
||||
use Filament\Schemas\Schema;
|
||||
|
||||
class RepositoryIssueForm
|
||||
{
|
||||
public static function configure(Schema $schema): Schema
|
||||
{
|
||||
return $schema->components([
|
||||
Section::make(__('panel.issues.sections.details'))
|
||||
->schema([
|
||||
Placeholder::make('number')
|
||||
->label(__('panel.issues.fields.number'))
|
||||
->content(fn ($record) => $record?->number ? "#{$record->number}" : '—'),
|
||||
|
||||
TextInput::make('title')
|
||||
->label(__('panel.issues.fields.title'))
|
||||
->disabled()
|
||||
->columnSpanFull(),
|
||||
|
||||
Select::make('repository_id')
|
||||
->label(__('panel.issues.fields.repository'))
|
||||
->relationship('repository', 'full_name')
|
||||
->disabled()
|
||||
->searchable(),
|
||||
|
||||
TextInput::make('author')
|
||||
->label(__('panel.issues.fields.author'))
|
||||
->disabled(),
|
||||
|
||||
TextInput::make('assignee')
|
||||
->label(__('panel.issues.fields.assignee'))
|
||||
->helperText(__('panel.issues.fields.assignee_hint')),
|
||||
|
||||
TextInput::make('html_url')
|
||||
->label(__('panel.issues.fields.url'))
|
||||
->disabled()
|
||||
->url()
|
||||
->columnSpanFull(),
|
||||
]),
|
||||
|
||||
Section::make(__('panel.issues.sections.classification'))
|
||||
->schema([
|
||||
Toggle::make('is_good_first_issue')
|
||||
->label(__('panel.issues.fields.is_good_first_issue'))
|
||||
->helperText(__('panel.issues.fields.is_good_first_issue_hint')),
|
||||
|
||||
Toggle::make('is_help_wanted')
|
||||
->label(__('panel.issues.fields.is_help_wanted'))
|
||||
->helperText(__('panel.issues.fields.is_help_wanted_hint')),
|
||||
]),
|
||||
|
||||
Section::make(__('panel.issues.sections.metadata'))
|
||||
->collapsed()
|
||||
->schema([
|
||||
TextInput::make('comments')
|
||||
->label(__('panel.issues.fields.comments'))
|
||||
->disabled()
|
||||
->numeric(),
|
||||
|
||||
DateTimePicker::make('issue_created_at')
|
||||
->label(__('panel.issues.fields.issue_created_at'))
|
||||
->disabled(),
|
||||
|
||||
DateTimePicker::make('issue_updated_at')
|
||||
->label(__('panel.issues.fields.issue_updated_at'))
|
||||
->disabled(),
|
||||
|
||||
Textarea::make('labels')
|
||||
->label(__('panel.issues.fields.labels'))
|
||||
->disabled()
|
||||
->rows(3)
|
||||
->columnSpanFull(),
|
||||
]),
|
||||
]);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,95 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace App\Filament\Resources\RepositoryIssuesResource\Tables;
|
||||
|
||||
use Filament\Actions\DeleteAction;
|
||||
use Filament\Actions\EditAction;
|
||||
use Filament\Tables\Columns\BadgeColumn;
|
||||
use Filament\Tables\Columns\IconColumn;
|
||||
use Filament\Tables\Columns\TextColumn;
|
||||
use Filament\Tables\Filters\Filter;
|
||||
use Filament\Tables\Filters\SelectFilter;
|
||||
use Filament\Tables\Table;
|
||||
use Illuminate\Database\Eloquent\Builder;
|
||||
|
||||
class RepositoryIssuesTable
|
||||
{
|
||||
public static function configure(Table $table): Table
|
||||
{
|
||||
return $table
|
||||
->columns([
|
||||
TextColumn::make('number')
|
||||
->label(__('panel.issues.fields.number'))
|
||||
->formatStateUsing(fn ($state) => "#{$state}")
|
||||
->sortable()
|
||||
->width('80px'),
|
||||
|
||||
TextColumn::make('title')
|
||||
->label(__('panel.issues.fields.title'))
|
||||
->weight('medium')
|
||||
->searchable()
|
||||
->wrap()
|
||||
->limit(60),
|
||||
|
||||
TextColumn::make('repository.full_name')
|
||||
->label(__('panel.issues.fields.repository'))
|
||||
->searchable()
|
||||
->sortable(),
|
||||
|
||||
IconColumn::make('is_good_first_issue')
|
||||
->label(__('panel.issues.fields.is_good_first_issue'))
|
||||
->boolean()
|
||||
->trueIcon('heroicon-o-check-circle')
|
||||
->falseIcon('heroicon-o-x-circle'),
|
||||
|
||||
IconColumn::make('is_help_wanted')
|
||||
->label(__('panel.issues.fields.is_help_wanted'))
|
||||
->boolean()
|
||||
->trueIcon('heroicon-o-check-circle')
|
||||
->falseIcon('heroicon-o-x-circle'),
|
||||
|
||||
BadgeColumn::make('assignee')
|
||||
->label(__('panel.issues.fields.assignee'))
|
||||
->color(fn ($state) => $state ? 'success' : 'gray')
|
||||
->formatStateUsing(fn ($state) => $state ?? __('panel.issues.fields.unassigned')),
|
||||
|
||||
TextColumn::make('issue_created_at')
|
||||
->label(__('panel.issues.fields.issue_created_at'))
|
||||
->dateTime()
|
||||
->sortable()
|
||||
->toggleable(isToggledHiddenByDefault: true),
|
||||
])
|
||||
->actions([
|
||||
EditAction::make(),
|
||||
DeleteAction::make(),
|
||||
])
|
||||
->filters([
|
||||
SelectFilter::make('repository_id')
|
||||
->label(__('panel.issues.filters.repository'))
|
||||
->relationship('repository', 'full_name'),
|
||||
|
||||
Filter::make('is_good_first_issue')
|
||||
->label(__('panel.issues.filters.good_first_issue'))
|
||||
->toggle()
|
||||
->query(fn (Builder $q) => $q->where('is_good_first_issue', true)),
|
||||
|
||||
Filter::make('is_help_wanted')
|
||||
->label(__('panel.issues.filters.help_wanted'))
|
||||
->toggle()
|
||||
->query(fn (Builder $q) => $q->where('is_help_wanted', true)),
|
||||
|
||||
Filter::make('unclaimed')
|
||||
->label(__('panel.issues.filters.unclaimed'))
|
||||
->toggle()
|
||||
->query(fn (Builder $q) => $q->whereNull('assignee')),
|
||||
|
||||
Filter::make('claimed')
|
||||
->label(__('panel.issues.filters.claimed'))
|
||||
->toggle()
|
||||
->query(fn (Builder $q) => $q->whereNotNull('assignee')),
|
||||
])
|
||||
->defaultSort('issue_created_at', 'desc');
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user