Skip to content

Commit

Permalink
Merge branch 'main' into 11864-update-work-experience-ui
Browse files Browse the repository at this point in the history
  • Loading branch information
Yoni K committed Dec 10, 2024
2 parents ec0e17b + 4aae3b4 commit 9c6c9e2
Show file tree
Hide file tree
Showing 98 changed files with 1,167 additions and 1,167 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ jobs:
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: "8.2"
php-version: "8.3"
extensions: bcmath

- name: Install composer dependencies
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/phpunit.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ jobs:
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: "8.2"
php-version: "8.3"
extensions: bcmath
coverage: pcov

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/translations.yml
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ jobs:
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: "8.2"
php-version: "8.3"
extensions: bcmath

- name: Install composer dependencies
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,4 @@ hydrogen-logs
.jekyll-cache
.turbo
.env
hostingstart.html
2 changes: 1 addition & 1 deletion api/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM php:8.2.9-apache-bullseye as base
FROM php:8.3.9-apache-bullseye as base

# Install pdo_pgsql extension.
RUN apt-get update \
Expand Down
37 changes: 37 additions & 0 deletions api/app/Generators/PoolCandidateCsvGenerator.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,12 @@
use App\Enums\CitizenshipStatus;
use App\Enums\EstimatedLanguageAbility;
use App\Enums\EvaluatedLanguageAbility;
use App\Enums\FinalDecision;
use App\Enums\GovEmployeeType;
use App\Enums\IndigenousCommunity;
use App\Enums\Language;
use App\Enums\OperationalRequirement;
use App\Enums\OverallAssessmentStatus;
use App\Enums\PoolCandidateStatus;
use App\Enums\PoolSkillType;
use App\Enums\PriorityWeight;
Expand Down Expand Up @@ -54,6 +56,8 @@ class PoolCandidateCsvGenerator extends CsvGenerator implements FileGeneratorInt

protected array $RODData = [];

protected array $finalDecisions = [];

protected array $generatedHeaders = [
'general_questions' => [],
'screening_questions' => [],
Expand Down Expand Up @@ -274,6 +278,32 @@ public function generate(): self
}
}
}

$decision = null;
if (is_null($candidate->computed_final_decision) || $candidate->computed_final_decision === FinalDecision::TO_ASSESS->name) {
if (! isset($candidate->computed_assessment_status['overallAssessmentStatus'])) {
$decision = Lang::get('final_decision.to_assess', [], $this->lang);
} else {
if ($candidate->computed_assessment_status['overallAssessmentStatus'] === OverallAssessmentStatus::DISQUALIFIED->name) {
$decision = Lang::get('final_decision.disqualified_pending', [], $this->lang);
} elseif ($candidate->computed_assessment_status['currentStep'] === null) {
$decision = Lang::get('final_decision.qualified_pending', [], $this->lang);
} else {
$decision = Lang::get('final_decision.to_assess', [], $this->lang)
.$this->colon()
.Lang::get('common.step', [], $this->lang)
.' '
.$candidate->computed_assessment_status['currentStep'];
}
}
} else {
$decision = $this->localizeEnum($candidate->computed_final_decision, FinalDecision::class);
}

$this->finalDecisions[] = [
'candidate' => $currentCandidate,
'value' => $decision,
];
}

// 1 is added to the key to account for the header row
Expand Down Expand Up @@ -398,6 +428,7 @@ private function generatePoolHeaders()
);
}
}
$this->generatedHeaders['ROD_details'][] = $this->localizeHeading('final_decision');
}
}
});
Expand Down Expand Up @@ -448,6 +479,12 @@ private function generatePoolCells(Worksheet $sheet, int $columnCount)
}
}
}
$currentColumn++;
if (isset($this->finalDecisions)) {
foreach ($this->finalDecisions as $row) {
$sheet->setCellValue([$currentColumn, $row['candidate'] + 1], $row['value']);
}
}
}

}
Expand Down
4 changes: 2 additions & 2 deletions api/app/GraphQL/Validators/UpdateUserAsUserInputValidator.php
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,8 @@ public function rules(): array
*/
Rule::unique('users', 'email')->ignore($this->arg('id'), 'id'),
Rule::unique('users', 'work_email')->ignore($this->arg('id'), 'id'),
// Note: Domains should be kept in sync with the workEmailDomainRegex
'ends_with:gc.ca,canada.ca,elections.ca,ccc.ca,canadapost-postescanada.ca,gg.ca',
// Note: Should be kept in sync with the workEmailDomainRegex
'regex:/@([A-Za-z0-9-]+\.)*(gc\.ca|canada\.ca|elections\.ca|ccc\.ca|canadapost-postescanada\.ca|gg\.ca)$/i',
],
'sub' => [
'sometimes',
Expand Down
6 changes: 6 additions & 0 deletions api/app/Models/PoolCandidate.php
Original file line number Diff line number Diff line change
Expand Up @@ -1149,6 +1149,11 @@ public function computeFinalDecision()
$status = $this->pool_candidate_status;
$decision = null;

// Short circuit for a case which shouldn't really come up. A PoolCandidate should never go from non-draft back to draft, but just in case...
if ($status === PoolCandidateStatus::DRAFT->name || $status === PoolCandidateStatus::DRAFT_EXPIRED->name) {
return ['decision' => null, 'weight' => null];
}

if (in_array($status, PoolCandidateStatus::toAssessGroup())) {
$assessmentStatus = $this->computed_assessment_status;
$overallStatus = null;
Expand Down Expand Up @@ -1199,6 +1204,7 @@ public function computeFinalDecision()
FinalDecision::DISQUALIFIED->name => 210,
FinalDecision::QUALIFIED_REMOVED->name => 220,
FinalDecision::TO_ASSESS_REMOVED->name => 230,
FinalDecision::DISQUALIFIED_REMOVED->name => 235, // I don't think this can be reached right now.
FinalDecision::REMOVED->name => 240,
FinalDecision::QUALIFIED_EXPIRED->name => 250,
default => $this->unMatchedDecision($decision)
Expand Down
4 changes: 2 additions & 2 deletions api/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
],
"license": "AGPL-3.0",
"require": {
"php": "^8.2",
"php": "^8.3",
"doctrine/dbal": "^3.1",
"gctc-ntgc/laravel-scout-postgres-tsvector": "^1.0",
"guzzlehttp/guzzle": "^7.4",
Expand Down Expand Up @@ -62,7 +62,7 @@
"sort-packages": true,
"optimize-autoloader": true,
"platform": {
"php": "8.2.9"
"php": "8.3.9"
},
"allow-plugins": {
"composer/package-versions-deprecated": true
Expand Down
73 changes: 37 additions & 36 deletions api/composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions api/lang/en/common.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,4 +21,5 @@
'not_sure' => 'Not sure',
'expected_end_date' => '(Expected end date)',
'not_found' => 'Not found',
'step' => 'Step',
];
1 change: 1 addition & 0 deletions api/lang/en/headings.php
Original file line number Diff line number Diff line change
Expand Up @@ -80,4 +80,5 @@
'decision' => 'Decision',
'decision_details' => 'Decision details',
'decision_notes' => 'Decision notes',
'final_decision' => 'Final decision',
];
Loading

0 comments on commit 9c6c9e2

Please sign in to comment.