This repository has been archived by the owner on Aug 11, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #5319 from GCTC-NTGC/release/v1.3.0
Release/v1.3.0 - Deployed to Prod on 2021-03-02
- Loading branch information
Showing
381 changed files
with
18,534 additions
and
7,580 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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,21 @@ | ||
<link href="https://talent.test/css/app.css" rel="stylesheet" type="text/css" /> | ||
<link href="https://talent.test/css/h2.css" rel="stylesheet" type="text/css" /> | ||
<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Euphoria+Script&subset=latin-ext" /> | ||
<link rel="stylesheet" href="https://use.fontawesome.com/releases/v5.8.2/css/all.css" | ||
integrity="sha384-oS3vJWv+0UjzBfQzYUhtDYW+Pj2yciDJxpsK1OYPAYjqT085Qq/1cq5FLXAZQ7Ay" crossorigin="anonymous" /> | ||
<script src="https://talent.test/js/modernizr.js"></script> | ||
<script src="https://code.jquery.com/jquery-3.3.1.min.js"></script> | ||
<script src="https://code.jquery.com/ui/1.12.1/jquery-ui.min.js"></script> | ||
<script | ||
src="https://cdn.jsdelivr.net/npm/@hydrogen-design-system/system@latest/dist/compiled/latest/system.min.js"> | ||
</script> | ||
<script> | ||
const addClone = setInterval(function () { | ||
const addDesignSystems = setInterval(function () { | ||
if (document.getElementById('root')) { | ||
document.querySelector('#root').setAttribute('data-clone', ''); | ||
clearInterval(addClone); | ||
document.querySelector('#root').setAttribute('data-h2-system', ''); | ||
document.querySelector('#root').setAttribute('data-h2-props', ''); | ||
clearInterval(addDesignSystems); | ||
} | ||
}, 200); | ||
</script> |
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 |
---|---|---|
@@ -1,11 +1,18 @@ | ||
var path = require("path"); | ||
module.exports = ({ config }) => { | ||
config.module.rules.push({ | ||
test: /\.(ts|tsx)$/, | ||
include: path.resolve(__dirname, "..", "resources/assets/js"), | ||
use: [ | ||
require.resolve("ts-loader"), | ||
require.resolve("react-docgen-typescript-loader"), | ||
] | ||
{ | ||
loader: require.resolve("ts-loader"), | ||
options: { | ||
transpileOnly: true, | ||
} | ||
} | ||
], | ||
}); | ||
|
||
config.resolve.extensions.push(".ts", ".tsx"); | ||
return config; | ||
}; |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,86 @@ | ||
<?php | ||
|
||
namespace App\Http\Controllers\Api; | ||
|
||
use App\Http\Controllers\Controller; | ||
use App\Http\Requests\UpdateApplicantProfile; | ||
use App\Http\Resources\ApplicantProfile as ApplicantProfileResource; | ||
use App\Models\Applicant; | ||
use App\Models\ApplicantClassification; | ||
|
||
class ApplicantController extends Controller | ||
{ | ||
|
||
/** | ||
* Retrieve Applicant profile. | ||
* | ||
* @param Applicant $applicant Incoming Applicant object. | ||
* | ||
* @return mixed | ||
*/ | ||
public function getProfile(Applicant $applicant) | ||
{ | ||
$applicant->loadMissing('applicant_classifications'); | ||
return new ApplicantProfileResource($applicant); | ||
} | ||
|
||
/** | ||
* Update Applicant profile. | ||
* | ||
* @param UpdateApplicantProfile $request Form Validation casted request object. | ||
* @param Applicant $applicant Incoming Applicant object. | ||
*/ | ||
public function updateProfile(UpdateApplicantProfile $request, Applicant $applicant) | ||
{ | ||
$validatedRequest = $request->validated(); | ||
// If there are no applicant classifications in the request, | ||
// then delete all applicant classifications attached to applicant. | ||
if (!array_key_exists('applicant_classifications', $validatedRequest)) { | ||
$applicant->applicant_classifications()->delete(); | ||
} else { | ||
$newApplicantClassifications = collect($validatedRequest['applicant_classifications'])->unique( | ||
// Remove all duplicate classification-level combinations from the collection. | ||
function ($newApplicantClassification) { | ||
return $newApplicantClassification['classification_id'].$newApplicantClassification['level']; | ||
} | ||
); | ||
$oldApplicantClassifications = $applicant->applicant_classifications; | ||
|
||
// Delete old applicant classifications that were not resubmitted. | ||
foreach ($oldApplicantClassifications as $oldApplicantClassification) { | ||
$newApplicantClassification = $newApplicantClassifications->firstWhere( | ||
'id', | ||
$oldApplicantClassification['id'] | ||
); | ||
if ($newApplicantClassification === null) { | ||
$oldApplicantClassification->delete(); | ||
} | ||
} | ||
|
||
|
||
// Update old applicant classifications and/or create them if it doesn't exist. | ||
$newApplicantClassifications->map(function ($newApplicantClassification) use ($oldApplicantClassifications) { | ||
$applicantClassification = $oldApplicantClassifications->firstWhere( | ||
'id', | ||
$newApplicantClassification['id'] | ||
); | ||
if (!$applicantClassification) { | ||
$applicantClassification = new ApplicantClassification(); | ||
} | ||
$applicantClassification->applicant_id = $newApplicantClassification['applicant_id']; | ||
$applicantClassification->classification_id = $newApplicantClassification['classification_id']; | ||
$applicantClassification->fill($newApplicantClassification); | ||
$applicantClassification->save(); | ||
}); | ||
} | ||
|
||
$applicant->citizenship_declaration_id = $validatedRequest['citizenship_declaration_id']; | ||
$applicant->veteran_status_id = $validatedRequest['veteran_status_id']; | ||
$applicant->save(); | ||
|
||
$applicant->refresh(); | ||
$applicant->loadMissing('applicant_classifications'); | ||
|
||
return new ApplicantProfileResource($applicant); | ||
} | ||
} |
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 | ||
namespace App\Http\Controllers\Api; | ||
|
||
use App\Http\Controllers\Controller; | ||
use App\Http\Requests\UpdateApplicantSkills; | ||
use App\Models\Applicant; | ||
use App\Models\ExperienceSkill; | ||
use Illuminate\Http\Resources\Json\JsonResource; | ||
use Illuminate\Support\Facades\DB; | ||
|
||
class ApplicantSkillsController extends Controller | ||
{ | ||
public function index(Applicant $applicant) | ||
{ | ||
return [ | ||
'skill_ids' => $applicant->skills->pluck('id')->all() | ||
]; | ||
} | ||
|
||
public function update(UpdateApplicantSkills $request, Applicant $applicant) | ||
{ | ||
$skillIds = $request->validated()['skill_ids']; | ||
$applicant->skills()->sync($skillIds); | ||
|
||
// $deletedExperienceSkills = $applicant->experienceSkillsQuery()->whereNotIn('skill_id', $skillIds)->get(); | ||
// I'm leaving the above line commented out for now, but if we want to do something with the | ||
// deleted ExperienceSkill objects, we can retrieve them before deleting and include | ||
// them in the api response. | ||
$applicant->experienceSkillsQuery()->whereNotIn('skill_id', $skillIds)->delete(); | ||
return [ | ||
'skill_ids' => $skillIds, | ||
// 'deleted_experience_skills' => JsonResource::collection($deletedExperienceSkills), | ||
]; | ||
} | ||
} |
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.