Skip to content

Commit

Permalink
tests: added livewire tests for filament resources & bump dependencies (
Browse files Browse the repository at this point in the history
  • Loading branch information
Kyrch authored Nov 17, 2024
1 parent e374b7d commit ed6662c
Show file tree
Hide file tree
Showing 40 changed files with 4,524 additions and 451 deletions.
2 changes: 2 additions & 0 deletions app/Filament/Resources/List/External/ExternalEntry.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
use App\Filament\Components\Fields\Select;
use App\Filament\Components\Infolist\TextEntry;
use App\Filament\Resources\BaseResource;
use App\Filament\Resources\List\External\ExternalEntry\Pages\EditExternalEntry;
use App\Filament\Resources\List\External\ExternalEntry\Pages\ListExternalEntries;
use App\Filament\Resources\List\External\ExternalEntry\Pages\ViewExternalEntry;
use App\Filament\Resources\List\External\RelationManagers\ExternalEntryExternalProfileRelationManager;
Expand Down Expand Up @@ -325,6 +326,7 @@ public static function getPages(): array
{
return [
'index' => ListExternalEntries::route('/'),
'edit' => EditExternalEntry::route('/{record:entry_id}/edit'),
'view' => ViewExternalEntry::route('/{record:entry_id}'),
];
}
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
<?php

declare(strict_types=1);

namespace App\Filament\Resources\List\External\ExternalEntry\Pages;

use App\Filament\Resources\List\External\ExternalEntry;
use App\Filament\Resources\Base\BaseEditResource;

/**
* Class EditExternalEntry.
*/
class EditExternalEntry extends BaseEditResource
{
protected static string $resource = ExternalEntry::class;

/**
* Get the header actions available.
*
* @return array
*
* @noinspection PhpMissingParentCallCommonInspection
*/
protected function getHeaderActions(): array
{
return array_merge(
parent::getHeaderActions(),
[],
);
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
<?php

declare(strict_types=1);

namespace App\Filament\Resources\List\External\Pages;

use App\Filament\Resources\Base\BaseCreateResource;
use App\Filament\Resources\List\ExternalProfile;

/**
* Class CreateExternalProfile.
*/
class CreateExternalProfile extends BaseCreateResource
{
protected static string $resource = ExternalProfile::class;
}
17 changes: 3 additions & 14 deletions app/Filament/Resources/List/ExternalProfile.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,11 @@
use App\Filament\Components\Infolist\TextEntry;
use App\Filament\Resources\Auth\User;
use App\Filament\Resources\BaseResource;
use App\Filament\Resources\List\External\Pages\CreateExternalProfile;
use App\Filament\Resources\List\External\Pages\EditExternalProfile;
use App\Filament\Resources\List\External\Pages\ListExternalProfiles;
use App\Filament\Resources\List\External\Pages\ViewExternalProfile;
use App\Filament\Resources\List\External\RelationManagers\ExternalEntryExternalProfileRelationManager;
use App\Filament\TableActions\Models\List\ExternalProfile\CreateExternalProfileTableAction;
use App\Models\Auth\User as UserModel;
use App\Models\List\ExternalProfile as ExternalProfileModel;
use Filament\Forms\Components\TextInput;
Expand Down Expand Up @@ -313,22 +313,10 @@ public static function getTableActions(): array
{
return array_merge(
parent::getTableActions(),
[
CreateExternalProfileTableAction::make('create-profile'),
],
[],
);
}

/**
* Determine whether the related model can be created.
*
* @return bool
*/
public static function canCreate(): bool
{
return false;
}

/**
* Get the pages available for the resource.
*
Expand All @@ -340,6 +328,7 @@ public static function getPages(): array
{
return [
'index' => ListExternalProfiles::route('/'),
'create' => CreateExternalProfile::route('/create'),
'view' => ViewExternalProfile::route('/{record:profile_id}'),
'edit' => EditExternalProfile::route('/{record:profile_id}/edit'),
];
Expand Down
2 changes: 1 addition & 1 deletion app/Filament/Resources/Wiki/Anime/Theme.php
Original file line number Diff line number Diff line change
Expand Up @@ -373,7 +373,7 @@ public static function infolist(Infolist $infolist): Infolist

TextEntry::make(ThemeModel::ATTRIBUTE_ID)
->label(__('filament.fields.anime_theme.slug.name'))
->formatStateUsing(fn ($state) => ThemeModel::find(intval($state))->getName()),
->formatStateUsing(fn ($state) => ThemeModel::withTrashed()->find(intval($state))->getName()),

TextEntry::make(ThemeModel::RELATION_GROUP . '.' . Group::ATTRIBUTE_NAME)
->label(__('filament.resources.singularLabel.group'))
Expand Down
31 changes: 4 additions & 27 deletions app/Filament/Resources/Wiki/Audio.php
Original file line number Diff line number Diff line change
Expand Up @@ -121,30 +121,7 @@ public static function getRecordTitleAttribute(): string
*/
public static function form(Form $form): Form
{
return $form
->schema([
TextInput::make(AudioModel::ATTRIBUTE_BASENAME)
->label(__('filament.fields.audio.basename.name'))
->hiddenOn(['create', 'edit']),

TextInput::make(AudioModel::ATTRIBUTE_FILENAME)
->label(__('filament.fields.audio.filename.name'))
->hiddenOn(['create', 'edit']),

TextInput::make(AudioModel::ATTRIBUTE_PATH)
->label(__('filament.fields.audio.path.name'))
->hiddenOn(['create', 'edit']),

TextInput::make(AudioModel::ATTRIBUTE_SIZE)
->label(__('filament.fields.audio.size.name'))
->numeric()
->hiddenOn(['create', 'edit']),

TextInput::make(AudioModel::ATTRIBUTE_MIMETYPE)
->label(__('filament.fields.audio.mimetype.name'))
->hiddenOn(['create', 'edit']),
])
->columns(1);
return $form;
}

/**
Expand All @@ -162,7 +139,7 @@ public static function table(Table $table): Table
TextColumn::make(AudioModel::ATTRIBUTE_ID)
->label(__('filament.fields.base.id'))
->sortable(),

TextColumn::make(AudioModel::ATTRIBUTE_FILENAME)
->label(__('filament.fields.audio.filename.name'))
->sortable()
Expand Down Expand Up @@ -261,7 +238,7 @@ public static function getActions(): array
[
ActionGroup::make([
MoveAudioAction::make('move-audio'),

DeleteAudioAction::make('delete-audio'),

AttachAudioToRelatedVideosAction::make('attach-audio-related-video'),
Expand Down Expand Up @@ -300,7 +277,7 @@ public static function getTableActions(): array
return [
ActionGroup::make([
UploadAudioTableAction::make('upload-audio'),

ReconcileAudioTableAction::make('reconcile-audio'),
]),
];
Expand Down

This file was deleted.

78 changes: 39 additions & 39 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,49 +24,49 @@
"ext-gd": "*",
"ext-intl": "*",
"ext-pdo": "*",
"awcodes/recently": "^1.0",
"babenkoivan/elastic-migrations": "^3.3",
"babenkoivan/elastic-scout-driver-plus": "^4.3",
"bepsvpt/secure-headers": "^7.4",
"bezhansalleh/filament-exceptions": "^2.1",
"cyrildewit/eloquent-viewable": "^7.0",
"fakerphp/faker": "^1.21",
"filament/filament": "^3.2.115",
"filament/forms": "^3.2.115",
"flowframe/laravel-trend": "*",
"guzzlehttp/guzzle": "^7.5",
"laravel-notification-channels/discord": "^1.4",
"laravel/fortify": "^1.16",
"laravel/framework": "^11.21",
"laravel/horizon": "^5.12",
"laravel/pennant": "^1.2",
"laravel/pulse": "^1.2",
"laravel/sanctum": "^4.0",
"laravel/scout": "^10.0",
"laravel/tinker": "^2.8",
"league/flysystem-aws-s3-v3": "^3.0",
"leandrocfe/filament-apex-charts": "^3.1",
"awcodes/recently": "^1.0.6",
"babenkoivan/elastic-migrations": "^3.4.1",
"babenkoivan/elastic-scout-driver-plus": "^4.8",
"bepsvpt/secure-headers": "^7.5",
"bezhansalleh/filament-exceptions": "^2.1.2",
"cyrildewit/eloquent-viewable": "^7.0.3",
"fakerphp/faker": "^1.24",
"filament/filament": "^3.2.124",
"filament/forms": "^3.2.124",
"flowframe/laravel-trend": ">=0.3",
"guzzlehttp/guzzle": "^7.9.2",
"laravel-notification-channels/discord": "^1.6",
"laravel/fortify": "^1.24.5",
"laravel/framework": "^11.32",
"laravel/horizon": "^5.29.3",
"laravel/pennant": "^1.13",
"laravel/pulse": "^1.2.6",
"laravel/sanctum": "^4.0.3",
"laravel/scout": "^10.11.7",
"laravel/tinker": "^2.10",
"league/flysystem-aws-s3-v3": "^3.29",
"leandrocfe/filament-apex-charts": "^3.1.4",
"malzariey/filament-daterangepicker-filter": "2.7",
"propaganistas/laravel-disposable-email": "^2.2",
"spatie/db-dumper": "^3.1.1",
"spatie/laravel-permission": "^6.0",
"staudenmeir/belongs-to-through": "^2.13",
"staudenmeir/laravel-adjacency-list": "^1.13",
"symfony/http-client": "^6.0",
"symfony/mailgun-mailer": "^6.0",
"propaganistas/laravel-disposable-email": "^2.4.7",
"spatie/db-dumper": "^3.7.0",
"spatie/laravel-permission": "^6.10.1",
"staudenmeir/belongs-to-through": "^2.16.2",
"staudenmeir/laravel-adjacency-list": "^1.23.1",
"symfony/http-client": "^6.4.15",
"symfony/mailgun-mailer": "^6.4.13",
"vinkla/hashids": "^12.0"
},
"require-dev": {
"barryvdh/laravel-debugbar": "^3.14",
"brianium/paratest": "^7.0",
"larastan/larastan": "^2.9",
"laravel/pint": "^1.6",
"laravel/sail": "^1.28",
"mockery/mockery": "^1.5.1",
"nunomaduro/collision": "^8.1",
"phpunit/phpunit": "^10.1",
"predis/predis": "^2.0",
"spatie/laravel-ignition": "^2.0"
"barryvdh/laravel-debugbar": "^3.14.7",
"brianium/paratest": "^7.4.8",
"larastan/larastan": "^2.9.11",
"laravel/pint": "^1.18.1",
"laravel/sail": "^1.38",
"mockery/mockery": "^1.6.12",
"nunomaduro/collision": "^8.5",
"phpunit/phpunit": "^10.5.38",
"predis/predis": "^2.2.2",
"spatie/laravel-ignition": "^2.8"
},
"config": {
"optimize-autoloader": true,
Expand Down
Loading

0 comments on commit ed6662c

Please sign in to comment.