Skip to content

Commit

Permalink
feat(filament): added tabs to upload video action (#730)
Browse files Browse the repository at this point in the history
  • Loading branch information
Kyrch authored Aug 21, 2024
1 parent d8a673b commit cc2e3e1
Show file tree
Hide file tree
Showing 119 changed files with 626 additions and 782 deletions.
2 changes: 1 addition & 1 deletion app/Actions/Discord/DiscordVideoNotificationAction.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ class DiscordVideoNotificationAction
*/
public function handle(Collection $videos, array $fields): void
{
$type = Arr::get($fields, 'type');
$type = Arr::get($fields, 'notification-type');
$shouldForce = Arr::get($fields, 'should-force-thread');

/** @var \Illuminate\Filesystem\FilesystemAdapter */
Expand Down
3 changes: 2 additions & 1 deletion app/Filament/Actions/Models/Wiki/AttachResourceAction.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
use Filament\Forms\Form;
use Filament\Support\Enums\MaxWidth;
use Illuminate\Contracts\Validation\ValidationRule;
use Illuminate\Support\Str;

/**
* Class AttachResourceAction.
Expand Down Expand Up @@ -57,7 +58,7 @@ public function getForm(Form $form): ?Form
if ($resources->where(ExternalResource::ATTRIBUTE_SITE, $resourceSite->value)->exists()) continue;
}

$resourceSiteLower = strtolower($resourceSite->name);
$resourceSiteLower = Str::lower($resourceSite->name);

$fields[] = TextInput::make($resourceSite->name)
->label($resourceSite->localize())
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ public function getForm(Form $form): ?Form
{
return $form
->schema([
Select::make('type')
Select::make('notification-type')
->label(__('filament.bulk_actions.discord.notification.type.name'))
->helperText(__('filament.bulk_actions.discord.notification.type.help'))
->options([
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@ protected function setUp(): void
parent::setUp();

$this->label(__('filament.actions.video.delete.name'));
$this->icon(__('filament.actions.video.delete.icon'));
$this->color('danger');
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
use Filament\Forms\Form;
use Filament\Support\Enums\MaxWidth;
use Illuminate\Contracts\Validation\ValidationRule;
use Illuminate\Support\Str;

/**
* Class AttachResourceHeaderAction.
Expand Down Expand Up @@ -57,7 +58,7 @@ public function getForm(Form $form): ?Form
if ($resources->where(ExternalResource::ATTRIBUTE_SITE, $resourceSite->value)->exists()) continue;
}

$resourceSiteLower = strtolower($resourceSite->name);
$resourceSiteLower = Str::lower($resourceSite->name);

$fields[] = TextInput::make($resourceSite->name)
->label($resourceSite->localize())
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,11 +78,12 @@ public static function getActions(): array
/**
* Get the bulk actions available for the relation.
*
* @param array|null $actionsIncludedInGroup
* @return array
*
* @noinspection PhpMissingParentCallCommonInspection
*/
public static function getBulkActions(): array
public static function getBulkActions(?array $actionsIncludedInGroup = []): array
{
return array_merge(
parent::getBulkActions(),
Expand All @@ -91,14 +92,14 @@ public static function getBulkActions(): array
}

/**
* Get the header actions available for the relation.
* Get the header actions available for the relation. These are merged with the table actions of the resources.
*
* @return array
*
* @noinspection PhpMissingParentCallCommonInspection
*/
public static function getHeaderActions(): array
{
return PermissionResource::getHeaderActions();
return PermissionResource::getTableActions();
}
}
7 changes: 4 additions & 3 deletions app/Filament/RelationManagers/Auth/RoleRelationManager.php
Original file line number Diff line number Diff line change
Expand Up @@ -81,11 +81,12 @@ public static function getActions(): array
/**
* Get the bulk actions available for the relation.
*
* @param array|null $actionsIncludedInGroup
* @return array
*
* @noinspection PhpMissingParentCallCommonInspection
*/
public static function getBulkActions(): array
public static function getBulkActions(?array $actionsIncludedInGroup = []): array
{
return array_merge(
parent::getBulkActions(),
Expand All @@ -94,14 +95,14 @@ public static function getBulkActions(): array
}

/**
* Get the header actions available for the relation.
* Get the header actions available for the relation. These are merged with the table actions of the resources.
*
* @return array
*
* @noinspection PhpMissingParentCallCommonInspection
*/
public static function getHeaderActions(): array
{
return RoleResource::getHeaderActions();
return RoleResource::getTableActions();
}
}
7 changes: 4 additions & 3 deletions app/Filament/RelationManagers/Auth/UserRelationManager.php
Original file line number Diff line number Diff line change
Expand Up @@ -81,11 +81,12 @@ public static function getActions(): array
/**
* Get the bulk actions available for the relation.
*
* @param array|null $actionsIncludedInGroup
* @return array
*
* @noinspection PhpMissingParentCallCommonInspection
*/
public static function getBulkActions(): array
public static function getBulkActions(?array $actionsIncludedInGroup = []): array
{
return array_merge(
parent::getBulkActions(),
Expand All @@ -94,14 +95,14 @@ public static function getBulkActions(): array
}

/**
* Get the header actions available for the relation.
* Get the header actions available for the relation. These are merged with the table actions of the resources.
*
* @return array
*
* @noinspection PhpMissingParentCallCommonInspection
*/
public static function getHeaderActions(): array
{
return UserResource::getHeaderActions();
return UserResource::getTableActions();
}
}
4 changes: 2 additions & 2 deletions app/Filament/RelationManagers/BaseRelationManager.php
Original file line number Diff line number Diff line change
Expand Up @@ -102,15 +102,15 @@ public static function getActions(): array
*
* @noinspection PhpMissingParentCallCommonInspection
*/
public static function getBulkActions(): array
public static function getBulkActions(?array $actionsIncludedInGroup = []): array
{
return [
DetachBulkAction::make(),
];
}

/**
* Get the header actions available for the relation.
* Get the header actions available for the relation. These are merged with the table actions of the resources.
*
* @return array
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -81,11 +81,12 @@ public static function getActions(): array
/**
* Get the bulk actions available for the relation.
*
* @param array|null $actionsIncludedInGroup
* @return array
*
* @noinspection PhpMissingParentCallCommonInspection
*/
public static function getBulkActions(): array
public static function getBulkActions(?array $actionsIncludedInGroup = []): array
{
return array_merge(
parent::getBulkActions(),
Expand All @@ -94,7 +95,7 @@ public static function getBulkActions(): array
}

/**
* Get the header actions available for the relation.
* Get the header actions available for the relation. These are merged with the table actions of the resources.
*
* @return array
*
Expand All @@ -104,7 +105,7 @@ public static function getHeaderActions(): array
{
return array_merge(
parent::getHeaderActions(),
ExternalEntryResource::getHeaderActions(),
ExternalEntryResource::getTableActions(),
);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -81,11 +81,12 @@ public static function getActions(): array
/**
* Get the bulk actions available for the relation.
*
* @param array|null $actionsIncludedInGroup
* @return array
*
* @noinspection PhpMissingParentCallCommonInspection
*/
public static function getBulkActions(): array
public static function getBulkActions(?array $actionsIncludedInGroup = []): array
{
return array_merge(
parent::getBulkActions(),
Expand All @@ -94,7 +95,7 @@ public static function getBulkActions(): array
}

/**
* Get the header actions available for the relation.
* Get the header actions available for the relation. These are merged with the table actions of the resources.
*
* @return array
*
Expand All @@ -104,7 +105,7 @@ public static function getHeaderActions(): array
{
return array_merge(
parent::getHeaderActions(),
ExternalProfileResource::getHeaderActions(),
ExternalProfileResource::getTableActions(),
);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -81,11 +81,12 @@ public static function getActions(): array
/**
* Get the bulk actions available for the relation.
*
* @param array|null $actionsIncludedInGroup
* @return array
*
* @noinspection PhpMissingParentCallCommonInspection
*/
public static function getBulkActions(): array
public static function getBulkActions(?array $actionsIncludedInGroup = []): array
{
return array_merge(
parent::getBulkActions(),
Expand All @@ -94,7 +95,7 @@ public static function getBulkActions(): array
}

/**
* Get the header actions available for the relation.
* Get the header actions available for the relation. These are merged with the table actions of the resources.
*
* @return array
*
Expand All @@ -104,7 +105,7 @@ public static function getHeaderActions(): array
{
return array_merge(
parent::getHeaderActions(),
TrackResource::getHeaderActions(),
TrackResource::getTableActions(),
);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -81,11 +81,12 @@ public static function getActions(): array
/**
* Get the bulk actions available for the relation.
*
* @param array|null $actionsIncludedInGroup
* @return array
*
* @noinspection PhpMissingParentCallCommonInspection
*/
public static function getBulkActions(): array
public static function getBulkActions(?array $actionsIncludedInGroup = []): array
{
return array_merge(
parent::getBulkActions(),
Expand All @@ -94,7 +95,7 @@ public static function getBulkActions(): array
}

/**
* Get the header actions available for the relation.
* Get the header actions available for the relation. These are merged with the table actions of the resources.
*
* @return array
*
Expand All @@ -104,7 +105,7 @@ public static function getHeaderActions(): array
{
return array_merge(
parent::getHeaderActions(),
PlaylistResource::getHeaderActions(),
PlaylistResource::getTableActions(),
);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -81,11 +81,12 @@ public static function getActions(): array
/**
* Get the bulk actions available for the relation.
*
* @param array|null $actionsIncludedInGroup
* @return array
*
* @noinspection PhpMissingParentCallCommonInspection
*/
public static function getBulkActions(): array
public static function getBulkActions(?array $actionsIncludedInGroup = []): array
{
return array_merge(
parent::getBulkActions(),
Expand All @@ -94,7 +95,7 @@ public static function getBulkActions(): array
}

/**
* Get the header actions available for the relation.
* Get the header actions available for the relation. These are merged with the table actions of the resources.
*
* @return array
*
Expand All @@ -104,7 +105,7 @@ public static function getHeaderActions(): array
{
return array_merge(
parent::getHeaderActions(),
SynonymResource::getHeaderActions(),
SynonymResource::getTableActions(),
);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -81,11 +81,12 @@ public static function getActions(): array
/**
* Get the bulk actions available for the relation.
*
* @param array|null $actionsIncludedInGroup
* @return array
*
* @noinspection PhpMissingParentCallCommonInspection
*/
public static function getBulkActions(): array
public static function getBulkActions(?array $actionsIncludedInGroup = []): array
{
return array_merge(
parent::getBulkActions(),
Expand All @@ -94,7 +95,7 @@ public static function getBulkActions(): array
}

/**
* Get the header actions available for the relation.
* Get the header actions available for the relation. These are merged with the table actions of the resources.
*
* @return array
*
Expand All @@ -104,7 +105,7 @@ public static function getHeaderActions(): array
{
return array_merge(
parent::getHeaderActions(),
EntryResource::getHeaderActions(),
EntryResource::getTableActions(),
);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -81,11 +81,12 @@ public static function getActions(): array
/**
* Get the bulk actions available for the relation.
*
* @param array|null $actionsIncludedInGroup
* @return array
*
* @noinspection PhpMissingParentCallCommonInspection
*/
public static function getBulkActions(): array
public static function getBulkActions(?array $actionsIncludedInGroup = []): array
{
return array_merge(
parent::getBulkActions(),
Expand All @@ -94,7 +95,7 @@ public static function getBulkActions(): array
}

/**
* Get the header actions available for the relation.
* Get the header actions available for the relation. These are merged with the table actions of the resources.
*
* @return array
*
Expand All @@ -104,7 +105,7 @@ public static function getHeaderActions(): array
{
return array_merge(
parent::getHeaderActions(),
ThemeResource::getHeaderActions(),
ThemeResource::getTableActions(),
);
}
}
Loading

0 comments on commit cc2e3e1

Please sign in to comment.