mirror of
https://github.com/kevinpapst/kimai2.git
synced 2025-04-17 18:42:44 +00:00
removed soft_limit config
This commit is contained in:
parent
b7bb6edb6f
commit
0db4908a71
13 changed files with 2 additions and 61 deletions
UPGRADING.md
src
API
Configuration
DependencyInjection
tests
API
Configuration
DependencyInjection
translations
|
@ -20,6 +20,7 @@ Perform EACH version specific task between your version and the new one, otherwi
|
|||
- dashboard default config
|
||||
- removed: theme.branding.translation
|
||||
- removed: kimai.plugin_dir
|
||||
- API: config/timesheet removed activeEntriesSoftLimit
|
||||
|
||||
## [1.16](https://github.com/kevinpapst/kimai2/releases/tag/1.16)
|
||||
|
||||
|
|
|
@ -100,7 +100,6 @@ final class ConfigurationController extends BaseApiController
|
|||
->setTrackingMode($configuration->getTimesheetTrackingMode())
|
||||
->setDefaultBeginTime($configuration->getTimesheetDefaultBeginTime())
|
||||
->setActiveEntriesHardLimit($configuration->getTimesheetActiveEntriesHardLimit())
|
||||
->setActiveEntriesSoftLimit($configuration->getTimesheetActiveEntriesSoftLimit())
|
||||
->setIsAllowFutureTimes($configuration->isTimesheetAllowFutureTimes())
|
||||
->setIsAllowOverlapping($configuration->isTimesheetAllowOverlappingRecords())
|
||||
;
|
||||
|
|
|
@ -51,17 +51,6 @@ final class TimesheetConfig
|
|||
* @phpstan-ignore-next-line
|
||||
*/
|
||||
private $activeEntriesHardLimit = 1;
|
||||
/**
|
||||
* How many running timesheets a user is allowed before a warning is shown
|
||||
*
|
||||
* @var int
|
||||
*
|
||||
* @Serializer\Expose()
|
||||
* @Serializer\Groups({"Default"})
|
||||
* @Serializer\Type(name="integer")
|
||||
* @phpstan-ignore-next-line
|
||||
*/
|
||||
private $activeEntriesSoftLimit = 1;
|
||||
/**
|
||||
* Whether entries for future times are allowed
|
||||
*
|
||||
|
@ -106,13 +95,6 @@ final class TimesheetConfig
|
|||
return $this;
|
||||
}
|
||||
|
||||
public function setActiveEntriesSoftLimit(int $activeEntriesSoftLimit): TimesheetConfig
|
||||
{
|
||||
$this->activeEntriesSoftLimit = $activeEntriesSoftLimit;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function setIsAllowFutureTimes(bool $isAllowFutureTimes): TimesheetConfig
|
||||
{
|
||||
$this->isAllowFutureTimes = $isAllowFutureTimes;
|
||||
|
|
|
@ -267,13 +267,6 @@ class SystemConfiguration implements SystemBundleConfiguration
|
|||
return (int) $this->find('timesheet.active_entries.hard_limit');
|
||||
}
|
||||
|
||||
public function getTimesheetActiveEntriesSoftLimit(): int
|
||||
{
|
||||
@trigger_error('The configuration timesheet.active_entries.soft_limit is deprecated since 1.15', E_USER_DEPRECATED);
|
||||
|
||||
return $this->getTimesheetActiveEntriesHardLimit();
|
||||
}
|
||||
|
||||
public function getTimesheetDefaultRoundingDays(): string
|
||||
{
|
||||
return (string) $this->find('timesheet.rounding.default.days');
|
||||
|
|
|
@ -65,11 +65,6 @@ class TimesheetConfiguration implements SystemBundleConfiguration
|
|||
return $this->configuration->getTimesheetActiveEntriesHardLimit();
|
||||
}
|
||||
|
||||
public function getActiveEntriesSoftLimit(): int
|
||||
{
|
||||
return $this->configuration->getTimesheetActiveEntriesSoftLimit();
|
||||
}
|
||||
|
||||
public function getDefaultRoundingDays(): string
|
||||
{
|
||||
return $this->configuration->getTimesheetDefaultRoundingDays();
|
||||
|
|
|
@ -208,16 +208,6 @@ class Configuration implements ConfigurationInterface
|
|||
->arrayNode('active_entries')
|
||||
->addDefaultsIfNotSet()
|
||||
->children()
|
||||
->integerNode('soft_limit')
|
||||
->defaultValue(1)
|
||||
->setDeprecated('The node "%node%" at path "%path%" is deprecated, please use "kimai.timesheet.active_entries.hard_limit" instead.')
|
||||
->validate()
|
||||
->ifTrue(function ($value) {
|
||||
return $value <= 0;
|
||||
})
|
||||
->thenInvalid('The soft_limit must be at least 1')
|
||||
->end()
|
||||
->end()
|
||||
->integerNode('hard_limit')
|
||||
->defaultValue(1)
|
||||
->validate()
|
||||
|
|
|
@ -62,7 +62,7 @@ class ConfigurationControllerTest extends APIControllerBaseTest
|
|||
|
||||
protected function assertTimesheetStructure(array $result)
|
||||
{
|
||||
$expectedKeys = ['activeEntriesHardLimit', 'activeEntriesSoftLimit', 'defaultBeginTime', 'isAllowFutureTimes', 'isAllowOverlapping', 'trackingMode'];
|
||||
$expectedKeys = ['activeEntriesHardLimit', 'defaultBeginTime', 'isAllowFutureTimes', 'isAllowOverlapping', 'trackingMode'];
|
||||
$actual = array_keys($result);
|
||||
sort($actual);
|
||||
sort($expectedKeys);
|
||||
|
|
|
@ -25,7 +25,6 @@ class TimesheetConfigTest extends TestCase
|
|||
$this->assertInstanceOf(TimesheetConfig::class, $sut->setIsAllowOverlapping(false));
|
||||
$this->assertInstanceOf(TimesheetConfig::class, $sut->setDefaultBeginTime('08:00'));
|
||||
$this->assertInstanceOf(TimesheetConfig::class, $sut->setTrackingMode('punch'));
|
||||
$this->assertInstanceOf(TimesheetConfig::class, $sut->setActiveEntriesSoftLimit(2));
|
||||
$this->assertInstanceOf(TimesheetConfig::class, $sut->setActiveEntriesHardLimit(3));
|
||||
}
|
||||
}
|
||||
|
|
|
@ -45,7 +45,6 @@ class SystemConfigurationTest extends TestCase
|
|||
'markdown_content' => false,
|
||||
'active_entries' => [
|
||||
'hard_limit' => 99,
|
||||
'soft_limit' => 15,
|
||||
],
|
||||
'default_begin' => 'now',
|
||||
'duration_increment' => 10,
|
||||
|
@ -257,15 +256,6 @@ class SystemConfigurationTest extends TestCase
|
|||
$this->assertEquals(5, $sut->getTimesheetIncrementEnd());
|
||||
}
|
||||
|
||||
/**
|
||||
* @group legacy
|
||||
*/
|
||||
public function testDeprecatedSettingsWithoutLoader()
|
||||
{
|
||||
$sut = $this->getSut($this->getDefaultSettings(), []);
|
||||
$this->assertEquals(99, $sut->getTimesheetActiveEntriesSoftLimit());
|
||||
}
|
||||
|
||||
public function testTimesheetWithLoader()
|
||||
{
|
||||
$sut = $this->getSut($this->getDefaultSettings(), $this->getDefaultLoaderSettings());
|
||||
|
|
|
@ -77,7 +77,6 @@ class TimesheetConfigurationTest extends TestCase
|
|||
$sut = $this->getSut($this->getDefaultSettings(), []);
|
||||
|
||||
$this->assertEquals(99, $sut->getActiveEntriesHardLimit());
|
||||
$this->assertEquals(99, $sut->getActiveEntriesSoftLimit());
|
||||
$this->assertFalse($sut->isAllowFutureTimes());
|
||||
$this->assertFalse($sut->isMarkdownEnabled());
|
||||
$this->assertEquals('duration_only', $sut->getTrackingMode());
|
||||
|
@ -98,7 +97,6 @@ class TimesheetConfigurationTest extends TestCase
|
|||
{
|
||||
$sut = $this->getSut($this->getDefaultSettings(), $this->getDefaultLoaderSettings());
|
||||
$this->assertEquals(7, $sut->getActiveEntriesHardLimit());
|
||||
$this->assertEquals(7, $sut->getActiveEntriesSoftLimit());
|
||||
$this->assertTrue($sut->isAllowFutureTimes());
|
||||
$this->assertTrue($sut->isMarkdownEnabled());
|
||||
$this->assertEquals('default', $sut->getTrackingMode());
|
||||
|
|
|
@ -204,7 +204,6 @@ class AppExtensionTest extends TestCase
|
|||
],
|
||||
'rates' => [],
|
||||
'active_entries' => [
|
||||
'soft_limit' => 1,
|
||||
'hard_limit' => 1,
|
||||
],
|
||||
'rules' => [
|
||||
|
|
|
@ -276,7 +276,6 @@ class ConfigurationTest extends TestCase
|
|||
],
|
||||
'rates' => [],
|
||||
'active_entries' => [
|
||||
'soft_limit' => 1,
|
||||
'hard_limit' => 1,
|
||||
],
|
||||
'rules' => [
|
||||
|
|
|
@ -62,10 +62,6 @@
|
|||
<source>label.timesheet.active_entries.hard_limit</source>
|
||||
<target>العدد المسموح به من إدخال وقت التشغيل في وقت واحد</target>
|
||||
</trans-unit>
|
||||
<trans-unit id="ebLK9d2" resname="label.timesheet.active_entries.soft_limit">
|
||||
<source>label.timesheet.active_entries.soft_limit</source>
|
||||
<target>عدد إدخال وقت التشغيل التي يتم من خلالها عرض تحذير</target>
|
||||
</trans-unit>
|
||||
<trans-unit id=".9O397A" resname="label.calendar.week_numbers">
|
||||
<source>label.calendar.week_numbers</source>
|
||||
<target>عرض أرقام الأسبوع</target>
|
||||
|
|
Loading…
Add table
Reference in a new issue