fixed calendar for empty timesheet descriptions (#265)
This commit is contained in:
@@ -155,7 +155,7 @@ class TimesheetEntity
|
||||
/**
|
||||
* @return string
|
||||
*/
|
||||
public function getDescription(): string
|
||||
public function getDescription(): ?string
|
||||
{
|
||||
return $this->description;
|
||||
}
|
||||
|
||||
@@ -66,10 +66,18 @@ class TimesheetFixtures extends Fixture implements DependentFixtureInterface
|
||||
if ($i > self::MAX_TIMESHEETS_TOTAL) {
|
||||
break;
|
||||
}
|
||||
|
||||
$description = null;
|
||||
if ($i % 3 == 0) {
|
||||
$description = $faker->text;
|
||||
} elseif ($i % 7 == 0) {
|
||||
$description = '';
|
||||
}
|
||||
|
||||
$entry = $this->createTimesheetEntry(
|
||||
$user,
|
||||
$activities[array_rand($activities)],
|
||||
($i % 3 == 0 ? $faker->text : ''),
|
||||
$description,
|
||||
round($i / 2),
|
||||
true
|
||||
);
|
||||
@@ -89,7 +97,7 @@ class TimesheetFixtures extends Fixture implements DependentFixtureInterface
|
||||
$entry = $this->createTimesheetEntry(
|
||||
$user,
|
||||
$activities[array_rand($activities)],
|
||||
$faker->text
|
||||
null
|
||||
);
|
||||
$manager->persist($entry);
|
||||
}
|
||||
|
||||
@@ -97,10 +97,16 @@ class TimesheetFixtures extends Fixture
|
||||
$user = $this->user;
|
||||
|
||||
for ($i = 0; $i < $this->amount; $i++) {
|
||||
$description = null;
|
||||
if ($i % 3 == 0) {
|
||||
$description = $faker->text;
|
||||
} elseif ($i % 2 == 0) {
|
||||
$description = '';
|
||||
}
|
||||
$entry = $this->createTimesheetEntry(
|
||||
$user,
|
||||
$activities[array_rand($activities)],
|
||||
($i % 3 == 0 ? $faker->text : ''),
|
||||
$description,
|
||||
$this->getDateTime($i)
|
||||
);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user