1.18.1 - fix description pattern in title (#3179)

* bump version
* add comment to customer/project/activity entity and collections api 
* improve title pattern usage
This commit is contained in:
Kevin Papst
2022-02-28 16:32:41 +01:00
committed by GitHub
parent 2ad7629c2a
commit b08c156552
17 changed files with 35 additions and 25 deletions

View File

@@ -1,5 +1,5 @@
unreleased=true
future-release=1.17
future-release=1.18
exclude-labels=duplicate,support,question,invalid,wontfix,release,waiting for feedback,documentation
enhancement_labels=>enhancement,Enhancement,feature request,translation i18n,technical debt,documentation
issues-wo-labels=false

View File

@@ -27,7 +27,7 @@ It is built with modern technologies such as [Symfony](https://github.com/symfon
### Requirements
- PHP 7.3 or higher (PHP 8 supported)
- PHP 7.4 or higher (PHP 8 supported, PHP 8.1 does not support LDAP yet)
- MariaDB or MySQL
- A webserver and subdomain
- PHP extensions: `gd`, `intl`, `json`, `mbstring`, `pdo`, `xsl`, `zip`

View File

@@ -5,10 +5,10 @@
As announced in the [README](README.md) I only support the latest available release and master.
| Version | Supported |
|---------| ------------------ |
|---------|--------------------|
| master | :white_check_mark: |
| 1.17 | :white_check_mark: |
| < 1.17 | :x: |
| 1.18 | :white_check_mark: |
| < 1.18 | :x: |
## Reporting a Vulnerability
@@ -20,5 +20,5 @@ Depending on the size of the required fixes, this might take a couple of hours o
You can expect that your message will be answered ASAP.
If your issue is valid and after I verified and fixed it, you will be mentioned in the release notes.
You will be mentioned in the release notes if your issue is valid and after it was fixed.
I am grateful for any (discrete) disclosure of vulnerabilities!

View File

@@ -224,15 +224,17 @@ export default class KimaiFormSelect extends KimaiPlugin {
title = title.replace(new RegExp('{' + field + '}', 'g'), value ?? '');
}
title = title.replace(/- \?-\?/, '');
title = title.replace(/\r\n|\r|\n/g, ' ');
title = title.substr(0, 110);
const chars = '- ';
let start = 0, end = title.length;
while(start < end && chars.indexOf(title[start]) >= 0) {
while (start < end && chars.indexOf(title[start]) >= 0) {
++start;
}
while(end > start && chars.indexOf(title[end - 1]) >= 0) {
while (end > start && chars.indexOf(title[end - 1]) >= 0) {
--end;
}

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@@ -3,7 +3,7 @@
"app": {
"js": [
"build/runtime.b8e7bb04.js",
"build/app.b91d3d99.js"
"build/app.30368b2e.js"
],
"css": [
"build/app.3bc2b4d9.css"

View File

@@ -1,6 +1,6 @@
{
"build/app.css": "build/app.3bc2b4d9.css",
"build/app.js": "build/app.b91d3d99.js",
"build/app.js": "build/app.30368b2e.js",
"build/invoice.css": "build/invoice.ff32661a.css",
"build/invoice.js": "build/invoice.19f36eca.js",
"build/invoice-pdf.css": "build/invoice-pdf.9a7468ef.css",

View File

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

View File

@@ -102,7 +102,7 @@ class Activity implements EntityWithMetaFields, EntityWithBudget
* @var string|null
*
* @Serializer\Expose()
* @Serializer\Groups({"Activity_Entity"})
* @Serializer\Groups({"Default"})
*
* @Exporter\Expose(label="label.comment")
*

View File

@@ -79,7 +79,7 @@ class Customer implements EntityWithMetaFields, EntityWithBudget
* @var string|null
*
* @Serializer\Expose()
* @Serializer\Groups({"Customer_Entity"})
* @Serializer\Groups({"Default"})
*
* @Exporter\Expose(label="label.comment")
*

View File

@@ -176,7 +176,7 @@ class Project implements EntityWithMetaFields, EntityWithBudget
* @var string|null
*
* @Serializer\Expose()
* @Serializer\Groups({"Project_Entity"})
* @Serializer\Groups({"Default"})
*
* @Exporter\Expose(label="label.comment")
*

View File

@@ -57,7 +57,7 @@ class ActivityType extends AbstractType
{
$name = $this->getPattern();
$name = str_replace(self::PATTERN_NAME, $activity->getName(), $name);
$name = str_replace(self::PATTERN_COMMENT, $activity->getComment(), $name);
$name = str_replace(self::PATTERN_COMMENT, $activity->getComment() ?? '', $name);
$name = ltrim($name, self::SPACER);
$name = rtrim($name, self::SPACER);
@@ -66,7 +66,7 @@ class ActivityType extends AbstractType
$name = $activity->getName();
}
return $name;
return substr($name, 0, 110);
}
/**

View File

@@ -60,9 +60,9 @@ class CustomerType extends AbstractType
{
$name = $this->getPattern();
$name = str_replace(self::PATTERN_NAME, $customer->getName(), $name);
$name = str_replace(self::PATTERN_COMMENT, $customer->getComment(), $name);
$name = str_replace(self::PATTERN_NUMBER, $customer->getNumber(), $name);
$name = str_replace(self::PATTERN_COMPANY, $customer->getCompany() ?? $customer->getName(), $name);
$name = str_replace(self::PATTERN_COMMENT, $customer->getComment() ?? '', $name);
$name = str_replace(self::PATTERN_NUMBER, $customer->getNumber() ?? '', $name);
$name = str_replace(self::PATTERN_COMPANY, $customer->getCompany() ?? '', $name);
$name = ltrim($name, self::SPACER);
$name = rtrim($name, self::SPACER);
@@ -71,7 +71,7 @@ class CustomerType extends AbstractType
$name = $customer->getName();
}
return $name;
return substr($name, 0, 110);
}
public function getChoiceAttributes(Customer $customer, $key, $value): array

View File

@@ -81,7 +81,7 @@ class ProjectType extends AbstractType
$name = $this->getPattern();
$name = str_replace(self::PATTERN_NAME, $project->getName(), $name);
$name = str_replace(self::PATTERN_COMMENT, $project->getComment(), $name);
$name = str_replace(self::PATTERN_COMMENT, $project->getComment() ?? '', $name);
$name = str_replace(self::PATTERN_ORDERNUMBER, $project->getOrderNumber(), $name);
$name = str_replace(self::PATTERN_START, $start, $name);
$name = str_replace(self::PATTERN_END, $end, $name);
@@ -94,7 +94,7 @@ class ProjectType extends AbstractType
$name = $project->getName();
}
return $name;
return substr($name, 0, 110);
}
/**

View File

@@ -376,6 +376,7 @@ abstract class APIControllerBaseTest extends ControllerBaseTest
'visible' => 'bool',
'color' => '@string',
'number' => '@string',
'comment' => '@string',
];
// if a list of customers is loaded
@@ -386,6 +387,7 @@ abstract class APIControllerBaseTest extends ControllerBaseTest
'visible' => 'boolean',
'color' => '@string',
'number' => '@string',
'comment' => '@string',
'metaFields' => ['result' => 'array', 'type' => 'CustomerMeta'],
'teams' => ['result' => 'array', 'type' => 'Team'],
'currency' => 'string', // since 1.10
@@ -427,6 +429,7 @@ abstract class APIControllerBaseTest extends ControllerBaseTest
'visible' => 'bool',
'color' => '@string',
'customer' => 'int',
'comment' => '@string',
];
// if a project is embedded in an expanded collection (here timesheet)
@@ -437,6 +440,7 @@ abstract class APIControllerBaseTest extends ControllerBaseTest
'visible' => 'bool',
'color' => '@string',
'customer' => ['result' => 'object', 'type' => 'Customer'],
'comment' => '@string',
];
// if a collection of projects is loaded
@@ -452,6 +456,7 @@ abstract class APIControllerBaseTest extends ControllerBaseTest
'start' => '@datetime',
'end' => '@datetime',
'teams' => ['result' => 'array', 'type' => 'Team'],
'comment' => '@string',
];
// if a project is explicitly loaded
@@ -483,6 +488,7 @@ abstract class APIControllerBaseTest extends ControllerBaseTest
'visible' => 'bool',
'project' => '@int',
'color' => '@string',
'comment' => '@string',
];
case 'ActivityExpanded':
@@ -492,6 +498,7 @@ abstract class APIControllerBaseTest extends ControllerBaseTest
'visible' => 'bool',
'project' => ['result' => 'object', 'type' => '@ProjectExpanded'],
'color' => '@string',
'comment' => '@string',
];
// collection of activities
@@ -504,6 +511,7 @@ abstract class APIControllerBaseTest extends ControllerBaseTest
'color' => '@string',
'metaFields' => ['result' => 'array', 'type' => 'ProjectMeta'],
'parentTitle' => '@string',
'comment' => '@string',
'teams' => ['result' => 'array', 'type' => 'Team'],
];