added project detail report (#2651)

- avatars via css only
- random colors for entities
- improves print view
- added colors for teams
- added color to tag
This commit is contained in:
Kevin Papst
2021-07-06 22:01:20 +02:00
committed by GitHub
parent cc6031bfde
commit 9ddb87a6fd
122 changed files with 2736 additions and 1549 deletions

View File

@@ -269,7 +269,7 @@ abstract class APIControllerBaseTest extends ControllerBaseTest
return [
'id' => 'int',
'name' => 'string',
'color' => 'string',
'color' => '@string',
];
// embedded meta data
@@ -290,6 +290,7 @@ abstract class APIControllerBaseTest extends ControllerBaseTest
'id' => 'int',
'username' => 'string',
'enabled' => 'bool',
'color' => '@string',
'alias' => '@string',
];
@@ -302,6 +303,7 @@ abstract class APIControllerBaseTest extends ControllerBaseTest
'alias' => '@string',
'title' => '@string',
'avatar' => '@string',
'color' => '@string',
'teams' => ['result' => 'array', 'type' => 'Team'],
'roles' => ['result' => 'array', 'type' => 'string'],
'language' => 'string',
@@ -315,6 +317,7 @@ abstract class APIControllerBaseTest extends ControllerBaseTest
return [
'id' => 'int',
'name' => 'string',
'color' => '@string',
];
// explicitly requested team
@@ -322,6 +325,7 @@ abstract class APIControllerBaseTest extends ControllerBaseTest
return [
'id' => 'int',
'name' => 'string',
'color' => '@string',
'teamlead' => ['result' => 'object', 'type' => 'User'],
'users' => ['result' => 'array', 'type' => 'User'],
'customers' => ['result' => 'array', 'type' => '@Customer'],

View File

@@ -70,7 +70,7 @@ class TagControllerTest extends APIControllerBaseTest
$this->importTagFixtures();
$data = [
'name' => 'foo',
'color' => '#000FFF'
'color' => '#00ff00'
];
$this->request($client, '/api/tags', 'POST', [], json_encode($data));
$this->assertTrue($client->getResponse()->isSuccessful());
@@ -79,7 +79,7 @@ class TagControllerTest extends APIControllerBaseTest
$this->assertIsArray($result);
self::assertApiResponseTypeStructure('TagEntity', $result);
$this->assertNotEmpty($result['id']);
self::assertEquals('#000FFF', $result['color']);
self::assertEquals('#00ff00', $result['color']);
}
public function testPostActionWithValidationErrors()

View File

@@ -653,13 +653,13 @@ class TeamControllerTest extends APIControllerBaseTest
$result = json_decode($client->getResponse()->getContent(), true);
// team not found
$this->request($client, '/api/teams/999/activities/999', 'DELETE');
$this->request($client, '/api/teams/999/activities/9999', 'DELETE');
self::assertEquals(Response::HTTP_NOT_FOUND, $client->getResponse()->getStatusCode());
$json = json_decode($client->getResponse()->getContent(), true);
self::assertEquals('Team not found', $json['message']);
// activity not found
$this->request($client, '/api/teams/' . $result['id'] . '/activities/999', 'DELETE');
$this->request($client, '/api/teams/' . $result['id'] . '/activities/9999', 'DELETE');
self::assertEquals(Response::HTTP_NOT_FOUND, $client->getResponse()->getStatusCode());
$json = json_decode($client->getResponse()->getContent(), true);
self::assertEquals('Activity not found', $json['message']);

View File

@@ -134,7 +134,6 @@ class UserControllerTest extends APIControllerBaseTest
$data = [
'username' => 'foo',
'email' => 'foo@example.com',
'avatar' => 'test123',
'title' => 'asdfghjkl',
'plainPassword' => 'foo@example.com',
'enabled' => true,
@@ -153,7 +152,6 @@ class UserControllerTest extends APIControllerBaseTest
self::assertApiResponseTypeStructure('UserEntity', $result);
$this->assertNotEmpty($result['id']);
self::assertEquals('foo', $result['username']);
self::assertEquals('test123', $result['avatar']);
self::assertEquals('asdfghjkl', $result['title']);
self::assertTrue($result['enabled']);
self::assertEquals('ru', $result['language']);
@@ -167,7 +165,6 @@ class UserControllerTest extends APIControllerBaseTest
$data = [
'username' => 'foo',
'email' => 'foo@example.com',
'avatar' => 'test123',
'title' => 'asdfghjkl',
'plainPassword' => '1234567',
'enabled' => true,
@@ -230,7 +227,6 @@ class UserControllerTest extends APIControllerBaseTest
$data = [
'username' => 'foo',
'email' => 'foo@example.com',
'avatar' => 'test123',
'title' => 'asdfghjkl',
'plainPassword' => 'foo@example.com',
'enabled' => true,
@@ -246,7 +242,6 @@ class UserControllerTest extends APIControllerBaseTest
$result = json_decode($client->getResponse()->getContent(), true);
$data = [
'avatar' => 'test321',
'title' => 'qwertzui',
'enabled' => false,
'language' => 'it',
@@ -263,7 +258,6 @@ class UserControllerTest extends APIControllerBaseTest
self::assertApiResponseTypeStructure('UserEntity', $result);
$this->assertNotEmpty($result['id']);
self::assertEquals('foo', $result['username']);
self::assertEquals('test321', $result['avatar']);
self::assertEquals('qwertzui', $result['title']);
self::assertFalse($result['enabled']);
self::assertEquals('it', $result['language']);
@@ -279,7 +273,7 @@ class UserControllerTest extends APIControllerBaseTest
public function testPatchActionWithInvalidUser()
{
$client = $this->getClientForAuthenticatedUser(User::ROLE_USER);
$this->request($client, '/api/users/1', 'PATCH', [], json_encode(['avatar' => 'asdasd']));
$this->request($client, '/api/users/1', 'PATCH', [], json_encode(['language' => 'hu']));
$this->assertApiResponseAccessDenied($client->getResponse(), 'Not allowed to edit user');
}