-
-
Notifications
You must be signed in to change notification settings - Fork 100
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: migrate game Dev Interest page to React (#2997)
- Loading branch information
1 parent
293556b
commit 67b9798
Showing
15 changed files
with
502 additions
and
164 deletions.
There are no files selected for viewing
35 changes: 35 additions & 0 deletions
35
app/Platform/Actions/BuildGameInterestedDevelopersDataAction.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace App\Platform\Actions; | ||
|
||
use App\Community\Enums\UserGameListType; | ||
use App\Data\UserData; | ||
use App\Models\Game; | ||
use App\Models\Role; | ||
use App\Models\UserGameListEntry; | ||
use Illuminate\Support\Collection; | ||
|
||
class BuildGameInterestedDevelopersDataAction | ||
{ | ||
/** | ||
* @return Collection<int, UserData> | ||
*/ | ||
public function execute(Game $game): Collection | ||
{ | ||
$users = UserGameListEntry::whereType(UserGameListType::Develop) | ||
->where('GameID', $game->id) | ||
->with(['user' => function ($query) { | ||
$query->orderBy('User'); | ||
}]) | ||
->get() | ||
->filter(fn (UserGameListEntry $entry) => $entry->user | ||
&& ($entry->user->hasRole(Role::DEVELOPER) || $entry->user->hasRole(Role::DEVELOPER_JUNIOR)) | ||
) | ||
->values() | ||
->map(fn (UserGameListEntry $entry) => UserData::fromUser($entry->user)); | ||
|
||
return $users; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace App\Platform\Data; | ||
|
||
use App\Data\UserData; | ||
use Illuminate\Support\Collection; | ||
use Spatie\LaravelData\Data; | ||
use Spatie\TypeScriptTransformer\Attributes\TypeScript; | ||
|
||
#[TypeScript('DeveloperInterestPageProps')] | ||
class DeveloperInterestPagePropsData extends Data | ||
{ | ||
public function __construct( | ||
public GameData $game, | ||
/** @var Collection<int, UserData> */ | ||
public Collection $developers, | ||
) { | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.