colors for visual grouping of customer, projects and activities (#751)

This commit is contained in:
Kevin Papst
2019-05-04 01:45:52 +02:00
committed by GitHub
parent e92c2d168e
commit 65df1ff909
40 changed files with 523 additions and 124 deletions

View File

@@ -224,7 +224,7 @@ class ActivityControllerTest extends APIControllerBaseTest
$expectedKeys = ['id', 'name', 'visible', 'project', 'hourlyRate', 'fixedRate'];
if ($full) {
$expectedKeys = array_merge($expectedKeys, ['comment']);
$expectedKeys = array_merge($expectedKeys, ['comment', 'color']);
}
$actual = array_keys($result);

View File

@@ -168,7 +168,7 @@ class CustomerControllerTest extends APIControllerBaseTest
if ($full) {
$expectedKeys = array_merge($expectedKeys, [
'homepage', 'number', 'comment', 'company', 'contact', 'address', 'country', 'currency', 'phone', 'fax', 'mobile', 'email', 'timezone'
'homepage', 'number', 'comment', 'company', 'contact', 'address', 'country', 'currency', 'phone', 'fax', 'mobile', 'email', 'timezone', 'color'
]);
}

View File

@@ -220,7 +220,7 @@ class ProjectControllerTest extends APIControllerBaseTest
if ($full) {
$expectedKeys = array_merge(
$expectedKeys,
['comment', 'budget', 'orderNumber']
['comment', 'budget', 'orderNumber', 'color']
);
}

View File

@@ -66,11 +66,11 @@ class TimesheetEntityTest extends TestCase
$sut->setActivity('cccccccc');
$this->assertEquals('cccccccc', $sut->getActivity());
$this->assertEquals('367fa9', $sut->getBorderColor());
$this->assertNull($sut->getBorderColor());
$sut->setBorderColor('#cccccc');
$this->assertEquals('#cccccc', $sut->getBorderColor());
$this->assertEquals('#3c8dbc', $sut->getBackgroundColor());
$this->assertNull($sut->getBackgroundColor());
$sut->setBackgroundColor('#ffffff');
$this->assertEquals('#ffffff', $sut->getBackgroundColor());

View File

@@ -27,6 +27,7 @@ class ActivityTest extends AbstractEntityTest
// timesheets
$this->assertNull($sut->getFixedRate());
$this->assertNull($sut->getHourlyRate());
$this->assertNull($sut->getColor());
}
public function testSetterAndGetter()
@@ -42,6 +43,9 @@ class ActivityTest extends AbstractEntityTest
$this->assertInstanceOf(Activity::class, $sut->setComment('hello world'));
$this->assertEquals('hello world', $sut->getComment());
$this->assertInstanceOf(Activity::class, $sut->setColor('#fffccc'));
$this->assertEquals('#fffccc', $sut->getColor());
$this->assertInstanceOf(Activity::class, $sut->setFixedRate(13.47));
$this->assertEquals(13.47, $sut->getFixedRate());
$this->assertInstanceOf(Activity::class, $sut->setHourlyRate(99));

View File

@@ -42,6 +42,7 @@ class CustomerTest extends AbstractEntityTest
$this->assertNull($sut->getFixedRate());
$this->assertNull($sut->getHourlyRate());
$this->assertNull($sut->getColor());
}
public function testSetterAndGetter()
@@ -57,6 +58,9 @@ class CustomerTest extends AbstractEntityTest
$this->assertInstanceOf(Customer::class, $sut->setComment('hello world'));
$this->assertEquals('hello world', $sut->getComment());
$this->assertInstanceOf(Customer::class, $sut->setColor('#fffccc'));
$this->assertEquals('#fffccc', $sut->getColor());
$projects = [(new Project())->setName('Test')];
$this->assertInstanceOf(Customer::class, $sut->setProjects($projects));
$this->assertSame($projects, $sut->getProjects());

View File

@@ -33,6 +33,7 @@ class ProjectTest extends AbstractEntityTest
$this->assertNull($sut->getFixedRate());
$this->assertNull($sut->getHourlyRate());
$this->assertNull($sut->getTimesheets());
$this->assertNull($sut->getColor());
}
public function testSetterAndGetter()
@@ -52,6 +53,9 @@ class ProjectTest extends AbstractEntityTest
$this->assertInstanceOf(Project::class, $sut->setComment('a comment'));
$this->assertEquals('a comment', $sut->getComment());
$this->assertInstanceOf(Project::class, $sut->setColor('#fffccc'));
$this->assertEquals('#fffccc', $sut->getColor());
$this->assertInstanceOf(Project::class, $sut->setVisible(false));
$this->assertFalse($sut->getVisible());