Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add custom color campcollaboration #5281

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
60 changes: 30 additions & 30 deletions api/migrations/dev-data/data.sql
Original file line number Diff line number Diff line change
Expand Up @@ -988,36 +988,36 @@ INSERT INTO public.activity (id, title, location, campid, categoryid, rootconten



INSERT INTO public.camp_collaboration (id, inviteemail, invitekeyhash, status, role, collaborationacceptedby, createtime, updatetime, userid, campid) VALUES
('237abf0bd057', 'e.mail2@test.com', 'myInviteKey2', 'invited', 'member', NULL, '2022-01-23 16:19:10', '2022-01-23 16:19:10', NULL, '6430aecc5422'),
('0e524d43e799', NULL, NULL, 'established', 'manager', NULL, '2022-01-23 16:19:10', '2022-01-23 16:19:10', 'e7b00084dabf', '6430aecc5422'),
('2c313fa367b3', NULL, NULL, 'established', 'manager', NULL, '2022-01-23 16:19:10', '2022-01-23 16:19:10', '3b41dca5c568', 'e5027d852487'),
('2b3cf1ce6341', 'x@z.com', 'd12ntPWBK0qmPxfMGg/QRWh98XE=', 'invited', 'member', NULL, '2023-08-08 08:03:06', '2023-08-08 08:03:06', NULL, '3c79b99ab424'),
('dba39edd9910', NULL, NULL, 'established', 'member', NULL, '2023-08-08 07:59:24', '2023-08-08 08:11:28', 'bee7cf5b3871', '3c79b99ab424'),
('c88fd78c90ea', NULL, NULL, 'established', 'manager', NULL, '2023-08-08 07:58:53', '2023-08-08 08:12:12', 'caeba9f7e728', '3c79b99ab424'),
('5111b2972441', 'inactive@test.com', 'Vazgl+0DsuUKrcTezKxA+KmBgOA=', 'inactive', 'member', NULL, '2023-08-08 07:59:53', '2023-08-08 09:18:22', NULL, '3c79b99ab424'),
('68694999fa8d', NULL, NULL, 'established', 'manager', NULL, '2023-08-08 09:22:58', '2023-08-08 09:22:58', '9145944210a7', '6973c230d6b1'),
('3229d273decd', NULL, '5eO+mQd6F+AQwCITx5mV8dX9/6U=', 'invited', 'manager', NULL, '2023-08-08 09:38:27', '2023-08-08 09:43:11', '130684395770', '6973c230d6b1'),
('7cae64a7800c', 'e.mail@test.com', '7FUv2lrEcRjMbW/Nb1mTkBaAPOs=', 'invited', 'member', NULL, '2023-08-08 09:37:38', '2023-08-08 09:43:21', NULL, '6973c230d6b1'),
('878426563205', NULL, NULL, 'established', 'guest', NULL, '2023-08-08 09:36:41', '2023-08-08 09:43:52', '48f00685a292', '6973c230d6b1'),
('d27ca1d0e6e4', NULL, NULL, 'established', 'member', NULL, '2023-08-08 09:36:01', '2023-08-08 09:44:19', 'bae69a1c9fcc', '6973c230d6b1'),
('c463d2a19847', NULL, NULL, 'established', 'member', NULL, '2023-08-08 09:38:01', '2023-08-08 09:44:50', 'caeba9f7e728', '6973c230d6b1'),
('763c0d181b63', NULL, NULL, 'established', 'manager', NULL, '2023-08-08 09:37:16', '2023-08-08 09:45:21', 'bee7cf5b3871', '6973c230d6b1'),
('b7d93b2fa1be', NULL, 'mLdsTtaGGptPYSZLUDgX8sAFO54=', 'established', 'member', NULL, '2023-08-12 19:10:49', '2023-08-12 19:10:49', 'a2f4f3879c85', '9c2447aefe38'),
('ac1cd0bcbd69', NULL, 'V30YTcBqBqs5xS7HrFM4ODRrzbw=', 'established', 'member', NULL, '2023-08-12 19:10:28', '2023-08-12 19:10:28', 'a3d9d86dc23b', '9c2447aefe38'),
('8be6d2f6f7dc', NULL, 'ru6jsdD9fODk8+p8wmI909rJPkQ=', 'established', 'manager', NULL, '2023-08-12 19:11:03', '2023-08-12 19:11:03', '566aea2c2759', '9c2447aefe38'),
('0e26982c9895', NULL, 'ao9OQRgXWBpCVaD4lGQaUFzvKwI=', 'established', 'member', NULL, '2023-08-12 19:10:14', '2023-08-12 19:10:14', 'dac7116e02ed', '9c2447aefe38'),
('b2f127cb410f', NULL, NULL, 'established', 'manager', NULL, '2023-08-13 06:32:29', '2023-08-13 06:32:29', 'dac7116e02ed', '0969e3c95dfc'),
('d806a59915f8', NULL, 'SuP47raE2s/2hGLsdBiO/icIU0E=', 'established', 'member', NULL, '2023-08-13 10:29:25', '2023-08-13 10:29:25', 'a3d9d86dc23b', '0969e3c95dfc'),
('7db6a9ffc210', NULL, 'yyXTSd6kGh7kNENlcGDeYtq4ftQ=', 'established', 'guest', NULL, '2023-08-13 10:29:47', '2023-08-13 10:29:47', 'a2f4f3879c85', '0969e3c95dfc'),
('60a470e1aff6', NULL, 'uGXywHjal9lK+rcdtRBcXh8y5qA=', 'established', 'manager', NULL, '2023-08-13 10:29:55', '2023-08-13 10:29:55', '566aea2c2759', '0969e3c95dfc'),
('d1c0a4522283', NULL, NULL, 'established', 'manager', NULL, '2023-09-29 23:24:38', '2023-09-29 23:24:38', 'dac7116e02ed', '70ca971c992f'),
('5b24ce470d9f', NULL, 'XisYzAgXUozfJA1M/y39ow8t5Vw=', 'established', 'member', NULL, '2023-09-29 23:27:54', '2023-09-29 23:27:54', 'a3d9d86dc23b', '70ca971c992f'),
('46d14f7c072c', NULL, '4KCuIMWvkGVAjSBtAnG5QcesOrI=', 'established', 'manager', NULL, '2023-09-29 23:41:30', '2023-09-29 23:41:30', 'a2f4f3879c85', '70ca971c992f'),
('b0bdb7202a9d', NULL, NULL, 'established', 'manager', NULL, '2023-08-08 07:53:12', '2023-08-08 07:53:12', '9145944210a7', '3c79b99ab424'),
('b00054c3c03e', NULL, 'XC/b4erYO0iZZTBEXOi3n/4AH9w=', 'established', 'guest', NULL, '2023-08-13 10:29:08', '2023-08-13 10:29:08', '9145944210a7', '0969e3c95dfc'),
('10d8f02ce5b4', NULL, 'n1MKxMj1RWkrcSmNfHdjUxKV3QY=', 'established', 'guest', NULL, '2023-09-29 23:25:49', '2023-09-29 23:25:49', '9145944210a7', '70ca971c992f'),
('b32db30637c8', NULL, 'AC/b4erYO0iZZTBEXOi3n/4AH9w=', 'invited', 'manager', NULL, '2023-08-12 17:41:55', '2023-08-12 17:41:55', '9145944210a7', '9c2447aefe38');
INSERT INTO public.camp_collaboration (id, inviteemail, invitekeyhash, status, role, createtime, updatetime, userid, campid) VALUES
('237abf0bd057', 'e.mail2@test.com', 'myInviteKey2', 'invited', 'member', '2022-01-23 16:19:10', '2022-01-23 16:19:10', NULL, '6430aecc5422'),
('0e524d43e799', NULL, NULL, 'established', 'manager', '2022-01-23 16:19:10', '2022-01-23 16:19:10', 'e7b00084dabf', '6430aecc5422'),
('2c313fa367b3', NULL, NULL, 'established', 'manager', '2022-01-23 16:19:10', '2022-01-23 16:19:10', '3b41dca5c568', 'e5027d852487'),
('2b3cf1ce6341', 'x@z.com', 'd12ntPWBK0qmPxfMGg/QRWh98XE=', 'invited', 'member', '2023-08-08 08:03:06', '2023-08-08 08:03:06', NULL, '3c79b99ab424'),
('dba39edd9910', NULL, NULL, 'established', 'member', '2023-08-08 07:59:24', '2023-08-08 08:11:28', 'bee7cf5b3871', '3c79b99ab424'),
('c88fd78c90ea', NULL, NULL, 'established', 'manager', '2023-08-08 07:58:53', '2023-08-08 08:12:12', 'caeba9f7e728', '3c79b99ab424'),
('5111b2972441', 'inactive@test.com', 'Vazgl+0DsuUKrcTezKxA+KmBgOA=', 'inactive', 'member', '2023-08-08 07:59:53', '2023-08-08 09:18:22', NULL, '3c79b99ab424'),
('68694999fa8d', NULL, NULL, 'established', 'manager', '2023-08-08 09:22:58', '2023-08-08 09:22:58', '9145944210a7', '6973c230d6b1'),
('3229d273decd', NULL, '5eO+mQd6F+AQwCITx5mV8dX9/6U=', 'invited', 'manager', '2023-08-08 09:38:27', '2023-08-08 09:43:11', '130684395770', '6973c230d6b1'),
('7cae64a7800c', 'e.mail@test.com', '7FUv2lrEcRjMbW/Nb1mTkBaAPOs=', 'invited', 'member', '2023-08-08 09:37:38', '2023-08-08 09:43:21', NULL, '6973c230d6b1'),
('878426563205', NULL, NULL, 'established', 'guest', '2023-08-08 09:36:41', '2023-08-08 09:43:52', '48f00685a292', '6973c230d6b1'),
('d27ca1d0e6e4', NULL, NULL, 'established', 'member', '2023-08-08 09:36:01', '2023-08-08 09:44:19', 'bae69a1c9fcc', '6973c230d6b1'),
('c463d2a19847', NULL, NULL, 'established', 'member', '2023-08-08 09:38:01', '2023-08-08 09:44:50', 'caeba9f7e728', '6973c230d6b1'),
('763c0d181b63', NULL, NULL, 'established', 'manager', '2023-08-08 09:37:16', '2023-08-08 09:45:21', 'bee7cf5b3871', '6973c230d6b1'),
('b7d93b2fa1be', NULL, 'mLdsTtaGGptPYSZLUDgX8sAFO54=', 'established', 'member', '2023-08-12 19:10:49', '2023-08-12 19:10:49', 'a2f4f3879c85', '9c2447aefe38'),
('ac1cd0bcbd69', NULL, 'V30YTcBqBqs5xS7HrFM4ODRrzbw=', 'established', 'member', '2023-08-12 19:10:28', '2023-08-12 19:10:28', 'a3d9d86dc23b', '9c2447aefe38'),
('8be6d2f6f7dc', NULL, 'ru6jsdD9fODk8+p8wmI909rJPkQ=', 'established', 'manager', '2023-08-12 19:11:03', '2023-08-12 19:11:03', '566aea2c2759', '9c2447aefe38'),
('0e26982c9895', NULL, 'ao9OQRgXWBpCVaD4lGQaUFzvKwI=', 'established', 'member', '2023-08-12 19:10:14', '2023-08-12 19:10:14', 'dac7116e02ed', '9c2447aefe38'),
('b2f127cb410f', NULL, NULL, 'established', 'manager', '2023-08-13 06:32:29', '2023-08-13 06:32:29', 'dac7116e02ed', '0969e3c95dfc'),
('d806a59915f8', NULL, 'SuP47raE2s/2hGLsdBiO/icIU0E=', 'established', 'member', '2023-08-13 10:29:25', '2023-08-13 10:29:25', 'a3d9d86dc23b', '0969e3c95dfc'),
('7db6a9ffc210', NULL, 'yyXTSd6kGh7kNENlcGDeYtq4ftQ=', 'established', 'guest', '2023-08-13 10:29:47', '2023-08-13 10:29:47', 'a2f4f3879c85', '0969e3c95dfc'),
('60a470e1aff6', NULL, 'uGXywHjal9lK+rcdtRBcXh8y5qA=', 'established', 'manager', '2023-08-13 10:29:55', '2023-08-13 10:29:55', '566aea2c2759', '0969e3c95dfc'),
('d1c0a4522283', NULL, NULL, 'established', 'manager', '2023-09-29 23:24:38', '2023-09-29 23:24:38', 'dac7116e02ed', '70ca971c992f'),
('5b24ce470d9f', NULL, 'XisYzAgXUozfJA1M/y39ow8t5Vw=', 'established', 'member', '2023-09-29 23:27:54', '2023-09-29 23:27:54', 'a3d9d86dc23b', '70ca971c992f'),
('46d14f7c072c', NULL, '4KCuIMWvkGVAjSBtAnG5QcesOrI=', 'established', 'manager', '2023-09-29 23:41:30', '2023-09-29 23:41:30', 'a2f4f3879c85', '70ca971c992f'),
('b0bdb7202a9d', NULL, NULL, 'established', 'manager', '2023-08-08 07:53:12', '2023-08-08 07:53:12', '9145944210a7', '3c79b99ab424'),
('b00054c3c03e', NULL, 'XC/b4erYO0iZZTBEXOi3n/4AH9w=', 'established', 'guest', '2023-08-13 10:29:08', '2023-08-13 10:29:08', '9145944210a7', '0969e3c95dfc'),
('10d8f02ce5b4', NULL, 'n1MKxMj1RWkrcSmNfHdjUxKV3QY=', 'established', 'guest', '2023-09-29 23:25:49', '2023-09-29 23:25:49', '9145944210a7', '70ca971c992f'),
('b32db30637c8', NULL, 'AC/b4erYO0iZZTBEXOi3n/4AH9w=', 'invited', 'manager', '2023-08-12 17:41:55', '2023-08-12 17:41:55', '9145944210a7', '9c2447aefe38');



Expand Down
8 changes: 4 additions & 4 deletions api/migrations/prod-data/data.sql
Original file line number Diff line number Diff line change
Expand Up @@ -95,10 +95,10 @@ INSERT INTO public.category (id, categoryprototypeid, short, name, color, number



INSERT INTO public.camp_collaboration (id, inviteemail, invitekeyhash, status, role, collaborationacceptedby, createtime, updatetime, userid, campid) VALUES
('71c07d3be9f3', NULL, NULL, 'established', 'manager', NULL, '2022-10-08 20:13:50', '2022-10-08 20:13:50', '8adf80011c2b', '75b3572a338e'),
('77b7a7e51080', NULL, NULL, 'established', 'manager', NULL, '2022-10-08 20:41:53', '2022-10-08 20:41:53', '8adf80011c2b', '497f974e7d5d'),
('1c7985ab4c7a', NULL, NULL, 'established', 'manager', NULL, '2022-10-08 20:49:03', '2022-10-08 20:49:03', '8adf80011c2b', 'f92fe1cd1ae9');
INSERT INTO public.camp_collaboration (id, inviteemail, invitekeyhash, status, role, createtime, updatetime, userid, campid) VALUES
('71c07d3be9f3', NULL, NULL, 'established', 'manager', '2022-10-08 20:13:50', '2022-10-08 20:13:50', '8adf80011c2b', '75b3572a338e'),
('77b7a7e51080', NULL, NULL, 'established', 'manager', '2022-10-08 20:41:53', '2022-10-08 20:41:53', '8adf80011c2b', '497f974e7d5d'),
('1c7985ab4c7a', NULL, NULL, 'established', 'manager', '2022-10-08 20:49:03', '2022-10-08 20:49:03', '8adf80011c2b', 'f92fe1cd1ae9');



Expand Down
27 changes: 27 additions & 0 deletions api/migrations/schema/Version20240507154923.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
<?php

declare(strict_types=1);

namespace DoctrineMigrations;

use Doctrine\DBAL\Schema\Schema;
use Doctrine\Migrations\AbstractMigration;

/**
* Auto-generated Migration: Please modify to your needs!
*/
final class Version20240507154923 extends AbstractMigration {
public function getDescription(): string {
return 'Add color and abbreviation to camp_collaboration';
}

public function up(Schema $schema): void {
$this->addSql('ALTER TABLE camp_collaboration ADD color VARCHAR(8) DEFAULT NULL');
$this->addSql('ALTER TABLE camp_collaboration ADD abbreviation TEXT DEFAULT NULL');
}

public function down(Schema $schema): void {
$this->addSql('ALTER TABLE camp_collaboration DROP abbreviation');
$this->addSql('ALTER TABLE camp_collaboration DROP color');
}
}
25 changes: 25 additions & 0 deletions api/migrations/schema/Version20240619081247.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
<?php

declare(strict_types=1);

namespace DoctrineMigrations;

use Doctrine\DBAL\Schema\Schema;
use Doctrine\Migrations\AbstractMigration;

/**
* Auto-generated Migration: Please modify to your needs!
*/
final class Version20240619081247 extends AbstractMigration {
public function getDescription(): string {
return 'Remove unused column collaborationacceptedby from camp_collaboration';
}

public function up(Schema $schema): void {
$this->addSql('ALTER TABLE camp_collaboration DROP collaborationacceptedby');
}

public function down(Schema $schema): void {
$this->addSql('ALTER TABLE camp_collaboration ADD collaborationacceptedby TEXT DEFAULT NULL');
}
}
20 changes: 18 additions & 2 deletions api/src/Entity/CampCollaboration.php
Original file line number Diff line number Diff line change
Expand Up @@ -202,9 +202,25 @@ class CampCollaboration extends BaseEntity implements BelongsToCampInterface {
#[ORM\Column(type: 'string', length: 16, nullable: false)]
public string $role;

#[ApiProperty(readable: false, writable: false)]
/**
* The color of the avatar as a hex color string.
*/
#[InputFilter\Trim]
#[Assert\Regex(pattern: '/^#[0-9a-zA-Z]{6}$/')]
#[ApiProperty(example: '#4DBB52')]
#[Groups(['read', 'write'])]
#[ORM\Column(type: 'string', length: 8, nullable: true)]
public ?string $color = null;

/**
* The abbreviation in the avatar.
*/
#[InputFilter\Trim]
#[Assert\Length(max: 2, countUnit: Assert\Length::COUNT_GRAPHEMES)]
carlobeltrame marked this conversation as resolved.
Show resolved Hide resolved
#[ApiProperty(example: 'AB')]
#[Groups(['read', 'write'])]
#[ORM\Column(type: 'text', nullable: true)]
public ?string $collaborationAcceptedBy = null;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why was this removed? Is was not used?

Copy link
Member Author

@manuelmeister manuelmeister Jun 19, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It was fully dead code. Unused, and not even tested.

public ?string $abbreviation = null;

public function __construct() {
parent::__construct();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,8 @@
},
"user": "escaped_value"
},
"abbreviation": "escaped_value",
"color": "escaped_value",
"id": "escaped_value",
"inviteEmail": "escaped_value",
"role": "escaped_value",
Expand Down Expand Up @@ -139,6 +141,8 @@
"href": "escaped_value"
}
},
"abbreviation": "escaped_value",
"color": "escaped_value",
"id": "escaped_value",
"inviteEmail": "escaped_value",
"role": "escaped_value",
Expand Down Expand Up @@ -217,6 +221,8 @@
"href": "escaped_value"
}
},
"abbreviation": "escaped_value",
"color": "escaped_value",
"id": "escaped_value",
"inviteEmail": "escaped_value",
"role": "escaped_value",
Expand Down Expand Up @@ -295,6 +301,8 @@
"href": "escaped_value"
}
},
"abbreviation": "escaped_value",
"color": "escaped_value",
"id": "escaped_value",
"inviteEmail": "escaped_value",
"role": "escaped_value",
Expand Down Expand Up @@ -373,6 +381,8 @@
"href": "escaped_value"
}
},
"abbreviation": "escaped_value",
"color": "escaped_value",
"id": "escaped_value",
"inviteEmail": "escaped_value",
"role": "escaped_value",
Expand Down Expand Up @@ -451,6 +461,8 @@
"href": "escaped_value"
}
},
"abbreviation": "escaped_value",
"color": "escaped_value",
"id": "escaped_value",
"inviteEmail": "escaped_value",
"role": "escaped_value",
Expand Down Expand Up @@ -529,6 +541,8 @@
"href": "escaped_value"
}
},
"abbreviation": "escaped_value",
"color": "escaped_value",
"id": "escaped_value",
"inviteEmail": "escaped_value",
"role": "escaped_value",
Expand Down Expand Up @@ -607,6 +621,8 @@
"href": "escaped_value"
}
},
"abbreviation": "escaped_value",
"color": "escaped_value",
"id": "escaped_value",
"inviteEmail": "escaped_value",
"role": "escaped_value",
Expand Down Expand Up @@ -685,6 +701,8 @@
"href": "escaped_value"
}
},
"abbreviation": "escaped_value",
"color": "escaped_value",
"id": "escaped_value",
"inviteEmail": "escaped_value",
"role": "escaped_value",
Expand Down Expand Up @@ -763,6 +781,8 @@
"href": "escaped_value"
}
},
"abbreviation": "escaped_value",
"color": "escaped_value",
"id": "escaped_value",
"inviteEmail": "escaped_value",
"role": "escaped_value",
Expand Down Expand Up @@ -841,6 +861,8 @@
"href": "escaped_value"
}
},
"abbreviation": "escaped_value",
"color": "escaped_value",
"id": "escaped_value",
"inviteEmail": "escaped_value",
"role": "escaped_value",
Expand Down Expand Up @@ -919,6 +941,8 @@
"href": "escaped_value"
}
},
"abbreviation": "escaped_value",
"color": "escaped_value",
"id": "escaped_value",
"inviteEmail": "escaped_value",
"role": "escaped_value",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,8 @@
"href": "escaped_value"
}
},
"abbreviation": "escaped_value",
"color": "escaped_value",
"id": "escaped_value",
"inviteEmail": "escaped_value",
"role": "escaped_value",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@
},
"user": "escaped_value"
},
"abbreviation": "escaped_value",
"color": "escaped_value",
"id": "escaped_value",
"inviteEmail": "escaped_value",
"role": "escaped_value",
Expand Down Expand Up @@ -45,6 +47,8 @@
"href": "escaped_value"
}
},
"abbreviation": "escaped_value",
"color": "escaped_value",
"id": "escaped_value",
"inviteEmail": "escaped_value",
"role": "escaped_value",
Expand Down Expand Up @@ -76,6 +80,8 @@
"href": "escaped_value"
}
},
"abbreviation": "escaped_value",
"color": "escaped_value",
"id": "escaped_value",
"inviteEmail": "escaped_value",
"role": "escaped_value",
Expand Down Expand Up @@ -107,6 +113,8 @@
"href": "escaped_value"
}
},
"abbreviation": "escaped_value",
"color": "escaped_value",
"id": "escaped_value",
"inviteEmail": "escaped_value",
"role": "escaped_value",
Expand Down Expand Up @@ -138,6 +146,8 @@
"href": "escaped_value"
}
},
"abbreviation": "escaped_value",
"color": "escaped_value",
"id": "escaped_value",
"inviteEmail": "escaped_value",
"role": "escaped_value",
Expand Down Expand Up @@ -169,6 +179,8 @@
"href": "escaped_value"
}
},
"abbreviation": "escaped_value",
"color": "escaped_value",
"id": "escaped_value",
"inviteEmail": "escaped_value",
"role": "escaped_value",
Expand Down
Loading
Loading