Skip to content
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
2 changes: 0 additions & 2 deletions api/config/packages/api_platform.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,6 @@ api_platform:
input_formats: [ 'jsonld', 'jsonapi', 'json' ]
normalization_context:
skip_null_values: false
order:
createTime: DESC

# On API-Platform Update - test, if this config is still needed.
# See PR 5948: https://github.com/ecamp/ecamp3/pull/5948
Expand Down
8 changes: 0 additions & 8 deletions api/migrations/dev-data/Version202504130046.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,6 @@ public function getDescription(): string {

public function up(Schema $schema): void {
// START PHP CODE
$this->addSql(createTruncateDatabaseCommand());

$statements = getStatementsForMigrationFile();
foreach ($statements as $statement) {
if (trim($statement)) {
$this->addSql($statement);
}
}
// END PHP CODE
}

Expand Down
31 changes: 31 additions & 0 deletions api/migrations/dev-data/Version202505151020.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
<?php

declare(strict_types=1);

namespace DataMigrations;

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

require_once __DIR__.'/helpers.php';

final class Version202505151020 extends AbstractMigration {
public function getDescription(): string {
return 'Move dev data camps one year forward';
}

public function up(Schema $schema): void {
// START PHP CODE
$this->addSql(createTruncateDatabaseCommand());

$statements = getStatementsForMigrationFile();
foreach ($statements as $statement) {
if (trim($statement)) {
$this->addSql($statement);
}
}
// END PHP CODE
}

public function down(Schema $schema): void {}
}
12 changes: 6 additions & 6 deletions api/migrations/dev-data/data.sql
Original file line number Diff line number Diff line change
Expand Up @@ -1968,16 +1968,16 @@ INSERT INTO public.checklistnode_checklistitem (checklistnode_id, checklistitem_


INSERT INTO public.period (id, description, start, "end", createtime, updatetime, campid) VALUES
('ff755e56fe79', 'Hauptlager', '2025-02-20', '2025-02-20', '2022-01-23 16:19:10', '2022-01-23 16:19:10', '6430aecc5422'),
('ff755e56fe79', 'Hauptlager', '2026-02-20', '2026-02-20', '2022-01-23 16:19:10', '2022-01-23 16:19:10', '6430aecc5422'),
('a12a9154b43b', 'Hauptlager', '2022-01-01', '2022-01-01', '2022-01-23 16:19:10', '2022-01-23 16:19:10', 'e5027d852487'),
('76be24bce434', 'Hauptlager', '2025-05-10', '2025-05-13', '2023-08-08 07:53:12', '2023-08-08 07:53:12', '3c79b99ab424'),
('fe47dfd2b541', 'Hauptlager', '2025-07-13', '2025-07-20', '2023-08-08 09:22:58', '2023-08-08 09:48:01', '6973c230d6b1'),
('76be24bce434', 'Hauptlager', '2026-05-10', '2026-05-13', '2023-08-08 07:53:12', '2023-08-08 07:53:12', '3c79b99ab424'),
('fe47dfd2b541', 'Hauptlager', '2026-07-13', '2026-07-20', '2023-08-08 09:22:58', '2023-08-08 09:48:01', '6973c230d6b1'),
('7c39a8ebf82f', 'Main', '2029-01-03', '2029-01-09', '2023-08-12 17:41:55', '2023-08-13 06:23:45', '9c2447aefe38'),
('c085d1d5ddfa', 'Die Jedi-Akademie', '2026-07-14', '2026-07-16', '2023-08-13 06:32:29', '2023-08-13 06:32:29', '0969e3c95dfc'),
('c085d1d5ddfa', 'Die Jedi-Akademie', '2027-07-14', '2027-07-16', '2023-08-13 06:32:29', '2023-08-13 06:32:29', '0969e3c95dfc'),
('7fa4564a5d5d', 'Main', '2031-01-24', '2031-01-30', '2023-09-29 23:24:38', '2023-09-29 23:24:38', '70ca971c992f'),
('88f1f55a69d7', 'Hauptlager', '2025-07-13', '2025-07-20', '2023-08-08 09:22:58', '2023-08-08 09:48:01', '5d28f99890bc'),
('88f1f55a69d7', 'Hauptlager', '2026-07-13', '2026-07-20', '2023-08-08 09:22:58', '2023-08-08 09:48:01', '5d28f99890bc'),
('05938f2a5372', 'Hauptlager', '2022-01-02', '2022-01-02', '2024-09-28 21:19:13', '2024-09-28 21:22:24', '25a82475e0b7'),
('c550b8707c26', 'Nachweekend', '2025-08-09', '2025-08-10', '2025-04-12 22:30:55', '2025-04-12 22:30:55', '6973c230d6b1');
('c550b8707c26', 'Nachweekend', '2026-08-09', '2026-08-10', '2025-04-12 22:30:55', '2025-04-12 22:30:55', '6973c230d6b1');



Expand Down
3 changes: 2 additions & 1 deletion api/src/Entity/Period.php
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,8 @@
),
],
denormalizationContext: ['groups' => ['write']],
normalizationContext: ['groups' => ['read']]
normalizationContext: ['groups' => ['read']],
order: ['start']
)]
#[ApiFilter(filterClass: SearchFilter::class, properties: ['camp'])]
#[ORM\Entity(repositoryClass: PeriodRepository::class)]
Expand Down
20 changes: 10 additions & 10 deletions e2e/specs/httpCache/activities.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -119,8 +119,8 @@ describe('cache test: /camps/{campId}/activities', () => {
scheduleEntries: [
{
period: '/periods/76be24bce434',
start: '2025-05-10T08:00:00+00:00',
end: '2025-05-10T09:00:00+00:00',
start: '2026-05-10T08:00:00+00:00',
end: '2026-05-10T09:00:00+00:00',
},
],
}).then((response) => {
Expand Down Expand Up @@ -152,9 +152,9 @@ describe('cache test: /camps/{campId}/activities', () => {
// add new scheduleEntry
cy.apiPost('/api/schedule_entries', {
activity: '/activities/ffd08c52288c',
end: '2025-05-11T06:00:00+00:00',
end: '2026-05-11T06:00:00+00:00',
period: '/periods/76be24bce434',
start: '2025-05-11T05:00:00+00:00',
start: '2026-05-11T05:00:00+00:00',
}).then((response) => {
const newScheduleEntryUri = response.body._links.self.href

Expand Down Expand Up @@ -238,8 +238,8 @@ describe('cache test: /camps/{campId}/activities', () => {

// move period start date
cy.apiPatch(`/api/periods/${grgrPeriodId}`, {
start: '2025-05-09',
end: '2025-05-12',
start: '2026-05-09',
end: '2026-05-12',
moveScheduleEntries: true,
})

Expand All @@ -249,8 +249,8 @@ describe('cache test: /camps/{campId}/activities', () => {

// move period start date
cy.apiPatch(`/api/periods/${grgrPeriodId}`, {
start: '2025-05-10',
end: '2025-05-13',
start: '2026-05-10',
end: '2026-05-13',
moveScheduleEntries: true,
})

Expand All @@ -271,7 +271,7 @@ describe('cache test: /camps/{campId}/activities', () => {

// move period start date
cy.apiPatch(`/api/periods/${grgrPeriodId}`, {
start: '2025-05-09',
start: '2026-05-09',
moveScheduleEntries: false,
})

Expand All @@ -281,7 +281,7 @@ describe('cache test: /camps/{campId}/activities', () => {

// move period start date
cy.apiPatch(`/api/periods/${grgrPeriodId}`, {
start: '2025-05-10',
start: '2026-05-10',
moveScheduleEntries: false,
})

Expand Down
2 changes: 1 addition & 1 deletion e2e/specs/httpCache/content-types.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import itemResponse from './responses/content_types_entity.json'
import { bipiUser, cachedEndpoint, castorUser } from '../constants'

const collectionXKeys =
'a4211c11211c c462edd869f3 5e2028c55ee4 a4211c112939 f17470519474 1a0f84e322c8 3ef17bd1df72 4f0c657fecef 44dcc7493c65 cfccaecd4bad 318e064ea0c9 /api/content_types'
'a4211c11211c f17470519474 1a0f84e322c8 c462edd869f3 5e2028c55ee4 3ef17bd1df72 4f0c657fecef a4211c112939 44dcc7493c65 cfccaecd4bad 318e064ea0c9 /api/content_types'

describe('cache test: /content-types', () => {
it('caches collection separately for each login', () => {
Expand Down
70 changes: 35 additions & 35 deletions e2e/specs/httpCache/responses/content_types_collection.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,26 +8,26 @@
"href": "/api/content_types/a4211c11211c"
},
{
"href": "/api/content_types/c462edd869f3"
},
{
"href": "/api/content_types/5e2028c55ee4"
"href": "/api/content_types/f17470519474"
},
{
"href": "/api/content_types/a4211c112939"
"href": "/api/content_types/1a0f84e322c8"
},
{
"href": "/api/content_types/f17470519474"
"href": "/api/content_types/c462edd869f3"
},
{
"href": "/api/content_types/1a0f84e322c8"
"href": "/api/content_types/5e2028c55ee4"
},
{
"href": "/api/content_types/3ef17bd1df72"
},
{
"href": "/api/content_types/4f0c657fecef"
},
{
"href": "/api/content_types/a4211c112939"
},
{
"href": "/api/content_types/44dcc7493c65"
},
Expand Down Expand Up @@ -58,93 +58,93 @@
{
"_links": {
"self": {
"href": "/api/content_types/c462edd869f3"
"href": "/api/content_types/f17470519474"
},
"contentNodes": {
"href": "/api/content_node/single_texts?contentType=%2Fapi%2Fcontent_types%2Fc462edd869f3"
"href": "/api/content_node/column_layouts?contentType=%2Fapi%2Fcontent_types%2Ff17470519474"
}
},
"name": "LearningObjectives",
"name": "ColumnLayout",
"active": true,
"id": "c462edd869f3"
"id": "f17470519474"
},
{
"_links": {
"self": {
"href": "/api/content_types/5e2028c55ee4"
"href": "/api/content_types/1a0f84e322c8"
},
"contentNodes": {
"href": "/api/content_node/single_texts?contentType=%2Fapi%2Fcontent_types%2F5e2028c55ee4"
"href": "/api/content_node/multi_selects?contentType=%2Fapi%2Fcontent_types%2F1a0f84e322c8"
}
},
"name": "LearningTopics",
"name": "LAThematicArea",
"active": true,
"id": "5e2028c55ee4"
"id": "1a0f84e322c8"
},
{
"_links": {
"self": {
"href": "/api/content_types/a4211c112939"
"href": "/api/content_types/c462edd869f3"
},
"contentNodes": {
"href": "/api/content_node/responsive_layouts?contentType=%2Fapi%2Fcontent_types%2Fa4211c112939"
"href": "/api/content_node/single_texts?contentType=%2Fapi%2Fcontent_types%2Fc462edd869f3"
}
},
"name": "ResponsiveLayout",
"name": "LearningObjectives",
"active": true,
"id": "a4211c112939"
"id": "c462edd869f3"
},
{
"_links": {
"self": {
"href": "/api/content_types/f17470519474"
"href": "/api/content_types/5e2028c55ee4"
},
"contentNodes": {
"href": "/api/content_node/column_layouts?contentType=%2Fapi%2Fcontent_types%2Ff17470519474"
"href": "/api/content_node/single_texts?contentType=%2Fapi%2Fcontent_types%2F5e2028c55ee4"
}
},
"name": "ColumnLayout",
"name": "LearningTopics",
"active": true,
"id": "f17470519474"
"id": "5e2028c55ee4"
},
{
"_links": {
"self": {
"href": "/api/content_types/1a0f84e322c8"
"href": "/api/content_types/3ef17bd1df72"
},
"contentNodes": {
"href": "/api/content_node/multi_selects?contentType=%2Fapi%2Fcontent_types%2F1a0f84e322c8"
"href": "/api/content_node/material_nodes?contentType=%2Fapi%2Fcontent_types%2F3ef17bd1df72"
}
},
"name": "LAThematicArea",
"name": "Material",
"active": true,
"id": "1a0f84e322c8"
"id": "3ef17bd1df72"
},
{
"_links": {
"self": {
"href": "/api/content_types/3ef17bd1df72"
"href": "/api/content_types/4f0c657fecef"
},
"contentNodes": {
"href": "/api/content_node/material_nodes?contentType=%2Fapi%2Fcontent_types%2F3ef17bd1df72"
"href": "/api/content_node/single_texts?contentType=%2Fapi%2Fcontent_types%2F4f0c657fecef"
}
},
"name": "Material",
"name": "Notes",
"active": true,
"id": "3ef17bd1df72"
"id": "4f0c657fecef"
},
{
"_links": {
"self": {
"href": "/api/content_types/4f0c657fecef"
"href": "/api/content_types/a4211c112939"
},
"contentNodes": {
"href": "/api/content_node/single_texts?contentType=%2Fapi%2Fcontent_types%2F4f0c657fecef"
"href": "/api/content_node/responsive_layouts?contentType=%2Fapi%2Fcontent_types%2Fa4211c112939"
}
},
"name": "Notes",
"name": "ResponsiveLayout",
"active": true,
"id": "4f0c657fecef"
"id": "a4211c112939"
},
{
"_links": {
Expand Down
24 changes: 12 additions & 12 deletions e2e/specs/httpCache/scheduleEntries.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ describe('cache test: /periods/{periodId}/scheduleEntries', () => {
Cypress.session.clearAllSavedSessions()
cy.login(bipiUser)
cy.apiPatch(`/api/schedule_entries/${scheduleEntryId}`, {
start: '2025-05-10T16:00:00+00:00',
start: '2026-05-10T16:00:00+00:00',
})

// warm up cache
Expand All @@ -69,7 +69,7 @@ describe('cache test: /periods/{periodId}/scheduleEntries', () => {

// touch scheduleEntry
cy.apiPatch(`/api/schedule_entries/${scheduleEntryId}`, {
start: '2025-05-10T17:00:00+00:00',
start: '2026-05-10T17:00:00+00:00',
})

// ensure cache was invalidated
Expand All @@ -92,8 +92,8 @@ describe('cache test: /periods/{periodId}/scheduleEntries', () => {

// add new scheduleEntry to period
cy.apiPost('/api/schedule_entries', {
start: '2025-05-10T10:00:00+00:00',
end: '2025-05-10T11:00:00+00:00',
start: '2026-05-10T10:00:00+00:00',
end: '2026-05-10T11:00:00+00:00',
period: `/api/periods/${grgrPeriodId}`,
activity: `/api/activities/ffd08c52288c`,
}).then((response) => {
Expand Down Expand Up @@ -128,8 +128,8 @@ describe('cache test: /periods/{periodId}/scheduleEntries', () => {

// move scheduleEntry to 2nd period
cy.apiPatch(`/api/schedule_entries/${scheduleEntryId}`, {
start: '2025-08-09T15:00:00+00:00',
end: '2025-08-09T17:00:00+00:00',
start: '2026-08-09T15:00:00+00:00',
end: '2026-08-09T17:00:00+00:00',
period: `/periods/${harrySecondPeriodId}`,
})

Expand All @@ -141,8 +141,8 @@ describe('cache test: /periods/{periodId}/scheduleEntries', () => {

// move scheduleEntry back
cy.apiPatch(`/api/schedule_entries/${scheduleEntryId}`, {
start: '2025-07-20T15:00:00+00:00',
end: '2025-07-20T17:00:00+00:00',
start: '2026-07-20T15:00:00+00:00',
end: '2026-07-20T17:00:00+00:00',
period: `/periods/${harryMainPeriodId}`,
})

Expand All @@ -165,8 +165,8 @@ describe('cache test: /periods/{periodId}/scheduleEntries', () => {

// move period start date
cy.apiPatch(`/api/periods/${grgrPeriodId}`, {
start: '2025-05-09',
end: '2025-05-12',
start: '2026-05-09',
end: '2026-05-12',
moveScheduleEntries: true,
})

Expand All @@ -176,8 +176,8 @@ describe('cache test: /periods/{periodId}/scheduleEntries', () => {

// move period start date
cy.apiPatch(`/api/periods/${grgrPeriodId}`, {
start: '2025-05-10',
end: '2025-05-13',
start: '2026-05-10',
end: '2026-05-13',
moveScheduleEntries: true,
})

Expand Down