-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Feature] Bookmark pool candidates (#8767)
* Add is_bookmarked field and custom mutation to backend * Add candidate bookmark funationality to frontend * Make results keep their original order number * Run pint * Update apps/web/src/components/AssessmentStepTracker/AssessmentResults.tsx Add apostrophe to translation Co-authored-by: Matt <[email protected]> * Change some copy to use 'pin' instead of 'bookmark' * Revert "Change some copy to use 'pin' instead of 'bookmark'" This reverts commit bd5d865. * Lint fix * Change permissions for field and add comment to mutation in schema * Button updates from feedback * Add jest tests for AssessmentStepTracker * Add comments to sortResultsAndAddOrdinal * Refactor sortResultsAndAddOrdinal to hopefully improve clarity * New test and sorting update * Update test to use more descriptive ids * Add translations --------- Co-authored-by: Matt <[email protected]>
- Loading branch information
Showing
13 changed files
with
577 additions
and
39 deletions.
There are no files selected for viewing
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,22 @@ | ||
<?php | ||
|
||
namespace App\GraphQL\Mutations; | ||
|
||
use App\Models\PoolCandidate; | ||
|
||
final class TogglePoolCandidateBookmark | ||
{ | ||
/** | ||
* Toggles the pool candidates is_bookmarked. | ||
* | ||
* @param array{} $args | ||
*/ | ||
public function __invoke($_, array $args) | ||
{ | ||
$candidate = PoolCandidate::find($args['id']); | ||
$candidate->is_bookmarked = ! $candidate->is_bookmarked; | ||
$candidate->save(); | ||
|
||
return $candidate->is_bookmarked; | ||
} | ||
} |
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
28 changes: 28 additions & 0 deletions
28
api/database/migrations/2023_12_05_210313_add_bookmarked_column_to_pool_candidates.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,28 @@ | ||
<?php | ||
|
||
use Illuminate\Database\Migrations\Migration; | ||
use Illuminate\Database\Schema\Blueprint; | ||
use Illuminate\Support\Facades\Schema; | ||
|
||
return new class extends Migration | ||
{ | ||
/** | ||
* Run the migrations. | ||
*/ | ||
public function up(): void | ||
{ | ||
Schema::table('pool_candidates', function (Blueprint $table) { | ||
$table->boolean('is_bookmarked'); | ||
}); | ||
} | ||
|
||
/** | ||
* Reverse the migrations. | ||
*/ | ||
public function down(): void | ||
{ | ||
Schema::table('pool_candidates', function (Blueprint $table) { | ||
$table->dropColumn('is_bookmarked'); | ||
}); | ||
} | ||
}; |
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
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.