bump version 1.22 (#3429)

* adjusted release note template
* stabilize test
* deactivate audit listener, more pre-validation for kimai 1 importer
This commit is contained in:
Kevin Papst
2022-07-22 12:41:49 +02:00
committed by GitHub
parent c0f3f31095
commit ad880b5b97
5 changed files with 58 additions and 15 deletions

View File

@@ -18,8 +18,7 @@ exclude-labels:
- 'wontfix'
exclude-contributors:
- 'dependabot'
- 'weblate'
change-template: '- $TITLE (#$NUMBER) @$AUTHOR'
change-template: '- $TITLE (#$NUMBER)'
change-title-escapes: '\<*_&`#@'
version-resolver:
major:
@@ -35,12 +34,14 @@ version-resolver:
- 'translation'
default: patch
template: |
[Upgrade Kimai](https://www.kimai.org/documentation/updates.html) - [Install Kimai](https://www.kimai.org/documentation/installation.html) - [Docker](https://tobybatch.github.io/kimai2/) & [Hub](https://hub.docker.com/r/kimai/kimai2)
[Upgrade Kimai](https://www.kimai.org/documentation/updates.html) - [Install Kimai](https://www.kimai.org/documentation/installation.html) - [Docker](https://tobybatch.github.io/kimai2/)
**PHP Version compatibility:**
- PHP 7.3 is [end-of-life](https://www.php.net/supported-versions.php): you need to update now
- PHP 7.4, PHP 8 and PHP 8.1 are supported
$CHANGES
Thanks to $CONTRIBUTORS
Thanks to all contributors ❤️
Involved in this release: $CONTRIBUTORS

View File

@@ -101,4 +101,9 @@ class ActivityService
return $activity;
}
public function findActivityByName(string $name, ?Project $project = null): ?Activity
{
return $this->repository->findOneBy(['project' => $project, 'name' => $name]);
}
}

View File

@@ -386,7 +386,7 @@ final class KimaiImporterCommand extends Command
}
$io->success('Fetched Kimai v1 data, validating now');
$validationMessages = $this->validateKimai1Data($options, $users, $customer, $projects, $rates);
$validationMessages = $this->validateKimai1Data($options, $users, $customer, $projects, $activities, $rates);
if (!empty($validationMessages)) {
foreach ($validationMessages as $errorMessage) {
$io->error($errorMessage);
@@ -484,7 +484,7 @@ final class KimaiImporterCommand extends Command
return 0;
}
private function validateKimai1Data(array $options, array $users, array $customer, array $projects, array $rates): array
private function validateKimai1Data(array $options, array $users, array $customer, array $projects, array $activities, array $rates): array
{
$validationMessages = [];
@@ -523,6 +523,14 @@ final class KimaiImporterCommand extends Command
$customerIds = [];
foreach ($customer as $oldCustomer) {
$customerIds[] = $oldCustomer['customerID'];
if (($customerNameLength = mb_strlen($oldCustomer['name'])) > 150) {
$validationMessages[] = sprintf(
'Customer name "%s" (ID %s) is too long. Max. 150 character are allowed, found %s.',
$oldCustomer['name'],
$oldCustomer['customerID'],
$customerNameLength
);
}
}
foreach ($projects as $oldProject) {
@@ -534,6 +542,25 @@ final class KimaiImporterCommand extends Command
$oldProject['customerID']
);
}
if (($projectNameLength = mb_strlen($oldProject['name'])) > 150) {
$validationMessages[] = sprintf(
'Project name "%s" (ID %s) is too long. Max. 150 character are allowed, found %s.',
$oldProject['name'],
$oldProject['projectID'],
$projectNameLength
);
}
}
foreach ($activities as $oldActivity) {
if (($activityNameLength = mb_strlen($oldActivity['name'])) > 150) {
$validationMessages[] = sprintf(
'Activity name "%s" (ID %s) is too long. Max. 150 character are allowed, found %s.',
$oldActivity['name'],
$oldActivity['activityID'],
$activityNameLength
);
}
}
if (!$options['skip-error-rates']) {
@@ -664,6 +691,10 @@ final class KimaiImporterCommand extends Command
foreach ($listeners as $hash => $object) {
if ($object instanceof TimesheetSubscriber) {
$connection->getEventManager()->removeEventListener([$event], $object);
/* @phpstan-ignore-next-line */
} elseif ($object instanceof \KimaiPlugin\AuditTrailBundle\Doctrine\MetadataSubscriber) {
// deactivate audit plugin listener
$connection->getEventManager()->removeEventListener([$event], $object);
}
}
}
@@ -2017,6 +2048,7 @@ final class KimaiImporterCommand extends Command
private function fixEncoding(): void
{
// https://onlineasciitools.com/convert-ascii-to-utf8
$searchReplace = [
'ä' => 'ä',
'Ä' => 'Ä',
@@ -2025,6 +2057,7 @@ final class KimaiImporterCommand extends Command
'ö' => 'ö',
'Ö' => 'Ö',
'ß' => 'ß',
'⦁' => '-',
];
$tablesColumns = [

View File

@@ -17,11 +17,11 @@ class Constants
/**
* The current release version
*/
public const VERSION = '1.21';
public const VERSION = '1.22.0';
/**
* The current release: major * 10000 + minor * 100 + patch
*/
public const VERSION_ID = 12100;
public const VERSION_ID = 12200;
/**
* The current release status, either "stable" or "dev"
*/

View File

@@ -126,11 +126,13 @@ class LocaleFormatExtensionsTest extends TestCase
public function getDateShortData()
{
$timezone = new \DateTimeZone('Europe/Vienna');
return [
['en', new \DateTime('7 January 2010'), '2010-01-07'],
['en', new \DateTime('2016-06-23'), '2016-06-23'],
['de', new \DateTime('1980-12-14'), '14.12.1980'],
['ru', new \DateTime('1980-12-14'), '14.12.1980'],
['en', new \DateTime('7 January 2010', $timezone), '2010-01-07'],
['en', new \DateTime('2016-06-23', $timezone), '2016-06-23'],
['de', new \DateTime('1980-12-14', $timezone), '14.12.1980'],
['ru', new \DateTime('1980-12-14', $timezone), '14.12.1980'],
['ru', '1980-12-14', '14.12.1980'],
['ru', 1.2345, 1.2345],
];
@@ -153,9 +155,11 @@ class LocaleFormatExtensionsTest extends TestCase
public function getDateTimeData()
{
$timezone = new \DateTimeZone('Europe/Vienna');
return [
['en', new \DateTime('7 January 2010'), '2010-01-07 12:01 AM'],
['de', (new \DateTime('1980-12-14'))->setTime(13, 27, 55), '14.12.1980 13:27:55'],
['en', new \DateTime('7 January 2010', $timezone), '2010-01-07 12:01 AM'],
['de', (new \DateTime('1980-12-14', $timezone))->setTime(13, 27, 55), '14.12.1980 13:27:55'],
['de', '1980-12-14 13:27:55', '14.12.1980 13:27:55'],
['de', 1.2345, 1.2345],
];