improved duration and minute selector (#2264)

* do not close modal if form is dirty
* deprecated TimesheetConfiguration
* inject timezone in form types
* cleanup usage of UserDateTimeFactory
* allow to configure increment steps for minutes
* use 15 minutes step for datetimepicker in project edit form
* use rounding rules for increments in minute select for begin and end
* allow duration in multi user and admin timesheet forms
* make dropdown values configurable
This commit is contained in:
Kevin Papst
2021-01-17 14:04:13 +01:00
committed by GitHub
parent e2324b7d51
commit 8d72d114c7
95 changed files with 1381 additions and 510 deletions

View File

@@ -10,7 +10,7 @@
namespace App\Tests\Timesheet\TrackingMode;
use App\Entity\Timesheet;
use App\Tests\Mocks\Security\UserDateTimeFactoryFactory;
use App\Entity\User;
use App\Timesheet\TrackingMode\PunchInOutMode;
use PHPUnit\Framework\TestCase;
use Symfony\Component\HttpFoundation\Request;
@@ -22,8 +22,7 @@ class PunchInOutModeTest extends TestCase
{
public function testDefaultValues()
{
$dateTime = (new UserDateTimeFactoryFactory($this))->create();
$sut = new PunchInOutMode($dateTime);
$sut = new PunchInOutMode();
self::assertFalse($sut->canEditBegin());
self::assertFalse($sut->canEditEnd());
@@ -40,19 +39,17 @@ class PunchInOutModeTest extends TestCase
$timesheet->setBegin($startingTime);
$request = new Request();
$dateTime = (new UserDateTimeFactoryFactory($this))->create();
$sut = new PunchInOutMode($dateTime);
$sut = new PunchInOutMode();
$sut->create($timesheet, $request);
self::assertEquals($timesheet->getBegin(), $startingTime);
}
public function testCreateWithoutBegin()
{
$timesheet = new Timesheet();
$timesheet = (new Timesheet())->setUser(new User());
$request = new Request();
$dateTime = (new UserDateTimeFactoryFactory($this))->create();
$sut = new PunchInOutMode($dateTime);
$sut = new PunchInOutMode();
$sut->create($timesheet, $request);
self::assertInstanceOf(\DateTime::class, $timesheet->getBegin());
}