Skip to content

Commit

Permalink
Merge branch 'release/0.5.1'
Browse files Browse the repository at this point in the history
  • Loading branch information
eliashaeussler committed May 31, 2023
2 parents ba90ad7 + fed5226 commit 9ab038e
Show file tree
Hide file tree
Showing 8 changed files with 196 additions and 177 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/cgl.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ jobs:
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: 8.1
php-version: 8.2
tools: composer:v2, composer-require-checker, composer-unused
coverage: none

Expand Down
2 changes: 1 addition & 1 deletion Classes/Domain/Model/Dto/ImportResult.php
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,6 @@ public function isDryRun(): bool
*/
private function filterByOperation(ImportOperation $operation): array
{
return $this->importResult[$operation->value] ?? [];
return $this->operations[$operation->value] ?? [];
}
}
1 change: 1 addition & 0 deletions Classes/Enums/Job/EmploymentType.php
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ enum EmploymentType: string
case Freelance = 'freelance';
case Intern = 'intern';
case Permanent = 'permanent';
case Temporary = 'temporary';
case Trainee = 'trainee';
case WorkingStudent = 'working_student';
}
30 changes: 25 additions & 5 deletions Configuration/TCA/tx_personiojobs_domain_model_job.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@

use CPSIT\Typo3PersonioJobs\Domain\Model\JobDescription;

return [
$tca = [
'ctrl' => [
'label' => 'name',
'tstamp' => 'tstamp',
Expand Down Expand Up @@ -87,7 +87,7 @@
'config' => [
'type' => 'input',
'size' => 30,
'eval' => 'int,unique,required',
'eval' => 'int,unique',
'readOnly' => true,
],
],
Expand All @@ -97,7 +97,7 @@
'config' => [
'type' => 'input',
'size' => 30,
'eval' => 'trim,required',
'eval' => 'trim',
],
],
'slug' => [
Expand Down Expand Up @@ -127,7 +127,7 @@
'config' => [
'type' => 'input',
'size' => 30,
'eval' => 'trim,required',
'eval' => 'trim',
'max' => 255,
'readOnly' => true,
],
Expand Down Expand Up @@ -258,7 +258,7 @@
'config' => [
'type' => 'input',
'renderType' => 'inputDateTime',
'eval' => 'datetime,required',
'eval' => 'datetime',
],
],
'job_descriptions' => [
Expand Down Expand Up @@ -302,3 +302,23 @@
],
],
];

$typo3Version = (new \TYPO3\CMS\Core\Information\Typo3Version())->getMajorVersion();
$requiredFields = [
'personio_id',
'name',
'content_hash',
'create_date',
];

// @todo Remove different handling of required columns once support for TYPO3 v11 is dropped
foreach ($requiredFields as $fieldName) {
if ($typo3Version >= 12) {
$tca['columns'][$fieldName]['config']['required'] = true;
} else {
$eval = $tca['columns'][$fieldName]['config']['eval'] ?? '';
$tca['columns'][$fieldName]['config']['eval'] = ltrim($eval . ',required', ',');
}
}

return $tca;
3 changes: 3 additions & 0 deletions Resources/Private/Language/locallang.xlf
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,9 @@
<trans-unit id="meta.employmentType.permanent">
<source>Permanent</source>
</trans-unit>
<trans-unit id="meta.employmentType.temporary">
<source>Temporary</source>
</trans-unit>
<trans-unit id="meta.employmentType.trainee">
<source>Trainee</source>
</trans-unit>
Expand Down
3 changes: 3 additions & 0 deletions Resources/Private/Language/locallang_db.xlf
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,9 @@
<trans-unit id="tx_personiojobs_domain_model_job.employment_type.permanent">
<source>Permanent</source>
</trans-unit>
<trans-unit id="tx_personiojobs_domain_model_job.employment_type.temporary">
<source>Temporary</source>
</trans-unit>
<trans-unit id="tx_personiojobs_domain_model_job.employment_type.trainee">
<source>Trainee</source>
</trans-unit>
Expand Down
Loading

0 comments on commit 9ab038e

Please sign in to comment.