Skip to content

Commit 13b1945

Browse files
Fix tests to be in sync with external ID changes
Part of #3024
1 parent 290fa58 commit 13b1945

27 files changed

+72
-72
lines changed

webapp/src/Controller/API/BalloonController.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,14 +59,14 @@ public function listAction(
5959
foreach ($balloonsData as $b) {
6060
/** @var Team $team */
6161
$team = $b['data']['team'];
62-
$teamName = "t" . $team->getTeamid() . ": " . $team->getEffectiveName();
62+
$teamName = $team->getExternalid() . ": " . $team->getEffectiveName();
6363
$balloons[] = new Balloon(
6464
balloonid: $b['data']['balloonid'],
6565
time: $b['data']['time'],
6666
problem: $b['data']['problem'],
6767
contestproblem: $b['data']['contestproblem'],
6868
team: $teamName,
69-
teamid: $team->getTeamid(),
69+
teamid: $team->getExternalid(),
7070
location: $b['data']['location'],
7171
affiliation: $b['data']['affiliation'],
7272
affiliationid: $b['data']['affiliationid'],

webapp/src/Controller/Jury/ProblemController.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1016,7 +1016,7 @@ public function editAction(Request $request, string $probId): Response
10161016
}
10171017

10181018
#[IsGranted('ROLE_ADMIN')]
1019-
#[Route(path: '/delete-multiple', name: 'jury_problem_delete_multiple', methods: ['GET', 'POST'])]
1019+
#[Route(path: '/delete-multiple', name: 'jury_problem_delete_multiple', methods: ['GET', 'POST'], priority: 1)]
10201020
public function deleteMultipleAction(Request $request): Response
10211021
{
10221022
return $this->deleteMultiple(

webapp/src/Controller/Jury/TeamController.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -218,7 +218,7 @@ public function indexAction(): Response
218218
'data' => $teamdata,
219219
'actions' => $teamactions,
220220
'link' => $this->generateUrl('jury_team', ['teamId' => $t->getExternalid()]),
221-
'cssclass' => ($t->getCategory() ? ("category" . $t->getCategory()->getCategoryId()) : '') .
221+
'cssclass' => ($t->getCategory() ? ("category" . $t->getCategory()->getExternalid()) : '') .
222222
($t->getEnabled() ? '' : ' disabled'),
223223
];
224224
}

webapp/src/Controller/Jury/UserController.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -403,7 +403,7 @@ public function deleteMultipleAction(Request $request): Response
403403
return $this->deleteMultiple(
404404
$request,
405405
User::class,
406-
'userid',
406+
'externalid',
407407
'jury_users',
408408
'No users could be deleted (you cannot delete your own account).',
409409
fn(User $user) => $user->getUserid() !== $this->dj->getUser()->getUserid()

webapp/src/DataTransferObject/Balloon.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,12 +16,12 @@ public function __construct(
1616
public readonly string $problem,
1717
public readonly ContestProblem $contestproblem,
1818
public readonly string $team,
19-
public readonly int $teamid,
19+
public readonly string $teamid,
2020
public readonly ?string $location,
2121
public readonly ?string $affiliation,
22-
public readonly ?int $affiliationid,
22+
public readonly ?string $affiliationid,
2323
public readonly ?string $category,
24-
public readonly ?int $categoryid,
24+
public readonly ?string $categoryid,
2525
#[Serializer\Type('array<string, App\Entity\ContestProblem>')]
2626
public readonly array $total,
2727
public readonly bool $done,

webapp/src/Entity/User.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -214,7 +214,7 @@ public function getName(): ?string
214214

215215
public function getShortDescription(): string
216216
{
217-
return $this->getName();
217+
return $this->getName() ?: $this->getUsername();
218218
}
219219

220220
public function setEmail(?string $email): User

webapp/src/Service/BalloonService.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -85,8 +85,8 @@ public function updateBalloons(
8585

8686
/**
8787
* @return array<array{data: array{balloonid: int, time: string, problem: string, contestproblem: ContestProblem,
88-
* team: Team, teamid: int, location: string|null, affiliation: string|null,
89-
* affiliationid: int, category: string, categoryid: int, total: array<string, ContestProblem>,
88+
* team: Team, teamid: string, location: string|null, affiliation: string|null,
89+
* affiliationid: string, category: string, categoryid: string, total: array<string, ContestProblem>,
9090
* done: bool}}>
9191
*/
9292
public function collectBalloonTable(Contest $contest, bool $todo = false): array

webapp/templates/jury/versions.html.twig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
Language <code>{{ lang.language.langid }}</code>
1818
{% if is_granted('ROLE_ADMIN') %}
1919
<span style="float: right">
20-
{{ button(path('jury_language_edit', {'langId': lang.language.langid}), 'Edit version command(s)', 'primary btn-sm', 'edit') }}
20+
{{ button(path('jury_language_edit', {'langId': lang.language.externalid}), 'Edit version command(s)', 'primary btn-sm', 'edit') }}
2121
</span>
2222
{% endif %}
2323
</div>

webapp/templates/partials/scoreboard_summary.html.twig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@
3232
<td style="text-align: left;">
3333
{% set link = null %}
3434
{% if jury %}
35-
{% set link = path('jury_problem', {'probId': problem.probid}) %}
35+
{% set link = path('jury_problem', {'probId': problem.externalid}) %}
3636
{% endif %}
3737
<a {% if link %}href="{{ link }}"{% endif %}>
3838
<i class="fas fa-thumbs-up fa-fw"></i>

webapp/tests/Unit/Controller/API/BalloonsControllerTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ public function testBalloonsNoJudgings(): void
3737

3838
public function testMarkAsDone(): void
3939
{
40-
$expectedBalloon = ['team'=>'t2: Example teamname', 'problem'=>'U'];
40+
$expectedBalloon = ['team'=>'exteam: Example teamname', 'problem'=>'U'];
4141
$contestId = $this->getUnitContestId();
4242
$url = "/contests/$contestId/balloons?todo=1";
4343
$this->loadFixtures([BalloonCorrectSubmissionFixture::class,BalloonUserFixture::class]);

0 commit comments

Comments
 (0)