Skip to content

Commit d97f52f

Browse files
committed
Merge branch 'release/5.3.0'
2 parents 09b4882 + 3d19dbd commit d97f52f

109 files changed

Lines changed: 3432 additions & 2583 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.ddev/config.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ web_environment:
1818
- typo3DatabaseName=t3func
1919
- typo3DatabasePassword=root
2020
- typo3DatabaseUsername=root
21-
nodejs_version: "16"
21+
nodejs_version: "v24"
2222
corepack_enable: false
2323
host_db_port: "59013"
2424

.gitattributes

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,15 @@
11
# Folders
22
/.ddev export-ignore
33
/.github export-ignore
4-
/.vscode export-ignore
54
/Build export-ignore
65
/Tests export-ignore
76

87
# Files
98
.editorconfig export-ignore
109
.gitattributes export-ignore
1110
.gitignore export-ignore
12-
.php-cs-fixer.dist.php export-ignore
13-
.phplint.yml export-ignore
14-
.stylelintrc export-ignore
1511

16-
# Enforce checkout with linux lf consistent over all plattforms
12+
# Enforce checkout with linux lf consistent over all platforms
1713
*.xml text eol=lf
1814
*.html text eol=lf
1915
*.css text eol=lf

Build/Scripts/runTests.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -184,6 +184,7 @@ cleanTestFiles() {
184184
typo3/sysext/core/Tests/AcceptanceTests-Job-* \
185185
typo3/sysext/core/Tests/Acceptance/Support/_generated \
186186
typo3temp/ \
187+
var/ \
187188
config \
188189
composer.lock
189190
git checkout composer.json

Build/Sources/Sass/backend.scss

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,4 @@
1-
//
2-
// Variables
3-
//
4-
@import 'variables';
5-
61
//
72
// Specific
83
//
9-
@import 'backend/sessionplaner';
4+
@use 'backend/sessionplaner';

Build/Sources/Sass/backend/_sessionplaner.scss

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
@use "sass:map";
1+
@use '../variables' as v;
2+
@use 'sass:map';
23

34
//
45
// Sessionplaner
@@ -295,8 +296,8 @@
295296
border-radius: var(--sessionplaner-tag-border-radius);
296297
box-shadow: var(--sessionplaner-tag-shadow);
297298
}
298-
@each $name, $color in $session-colors {
299-
.sessionbox-tag-#{$name} {
299+
@each $name, $color in v.$session-colors {
300+
.sessionbox-tag-#{"" + $name} {
300301
--sessionplaner-tag-color: #{map.get($color, text)};
301302
--sessionplaner-tag-bg: #{map.get($color, bg)};
302303
}

Build/Sources/Sass/frontend.scss

Lines changed: 11 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,14 @@
1-
//
2-
// Variables
3-
//
4-
@import 'variables';
5-
61
//
72
// Imports
83
//
9-
@import 'frontend/general';
10-
@import 'frontend/day';
11-
@import 'frontend/tag';
12-
@import 'frontend/track';
13-
@import 'frontend/room';
14-
@import 'frontend/session';
15-
@import 'frontend/slot';
16-
@import 'frontend/speaker';
17-
@import 'frontend/bio';
18-
@import 'frontend/list';
19-
@import 'frontend/connect';
4+
@use 'frontend/general';
5+
@use 'frontend/day';
6+
@use 'frontend/tag';
7+
@use 'frontend/track';
8+
@use 'frontend/room';
9+
@use 'frontend/session';
10+
@use 'frontend/slot';
11+
@use 'frontend/speaker';
12+
@use 'frontend/bio';
13+
@use 'frontend/list';
14+
@use 'frontend/connect';

Build/Sources/Sass/frontend/_day.scss

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
@use '../variables' as v;
2+
13
//
24
// Day
35
//
@@ -24,7 +26,7 @@
2426
.sessionplaner-day-list-item {
2527
padding: 10px;
2628
width: 100%;
27-
@media only screen and (min-width: $session-breakpoint-md) {
29+
@media only screen and (min-width: v.$session-breakpoint-md) {
2830
width: calc(100% / 2);
2931
}
3032
}

Build/Sources/Sass/frontend/_slot.scss

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
@use '../variables' as v;
2+
13
//
24
// Slot
35
//
@@ -67,7 +69,7 @@
6769
// Variants
6870
//
6971
[data-sessionplaner-columns="2"] {
70-
@media only screen and (min-width: $session-breakpoint-sm) {
72+
@media only screen and (min-width: v.$session-breakpoint-sm) {
7173
&.sessionplaner-slot-header {
7274
display: flex;
7375
}
@@ -80,7 +82,7 @@
8082
}
8183
}
8284
[data-sessionplaner-columns="3"] {
83-
@media only screen and (min-width: $session-breakpoint-md) {
85+
@media only screen and (min-width: v.$session-breakpoint-md) {
8486
&.sessionplaner-slot-header {
8587
display: flex;
8688
}
@@ -93,12 +95,12 @@
9395
}
9496
}
9597
[data-sessionplaner-columns="4"] {
96-
@media only screen and (min-width: $session-breakpoint-sm) {
98+
@media only screen and (min-width: v.$session-breakpoint-sm) {
9799
.sessionplaner-slot-track {
98100
width: calc(100% / 2);
99101
}
100102
}
101-
@media only screen and (min-width: $session-breakpoint-md) {
103+
@media only screen and (min-width: v.$session-breakpoint-md) {
102104
&.sessionplaner-slot-header {
103105
display: flex;
104106
}
@@ -111,12 +113,12 @@
111113
}
112114
}
113115
[data-sessionplaner-columns="5"] {
114-
@media only screen and (min-width: $session-breakpoint-sm) {
116+
@media only screen and (min-width: v.$session-breakpoint-sm) {
115117
.sessionplaner-slot-track {
116118
width: calc(100% / 2);
117119
}
118120
}
119-
@media only screen and (min-width: $session-breakpoint-lg) {
121+
@media only screen and (min-width: v.$session-breakpoint-lg) {
120122
&.sessionplaner-slot-header {
121123
display: flex;
122124
}

Build/Sources/Sass/frontend/_tag.scss

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
@use "sass:map";
1+
@use '../variables' as v;
2+
@use 'sass:map';
23

34
//
45
// Tag
@@ -30,7 +31,7 @@
3031
text-decoration-color: var(--session-tag-title-decoration-color);
3132
}
3233

33-
@each $name, $color in $session-colors {
34+
@each $name, $color in v.$session-colors {
3435
.sessionplaner-tag-#{"" + $name} {
3536
--session-tag-bg: #{map.get($color, bg)};
3637
--session-tag-color: #{map.get($color, text)};
Lines changed: 109 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,109 @@
1+
// @ts-expect-error package is not available as a source in a composer installation
2+
import Notification from '@typo3/backend/notification.js';
3+
4+
class Sessionplaner {
5+
constructor() {
6+
document.querySelectorAll('[data-sessionplaner-draggable="true"]').forEach((element: HTMLElement) => {
7+
element.addEventListener('dragstart', (event: DragEvent) => {
8+
const target = event.target as HTMLElement;
9+
const session = {
10+
uid: target.dataset.sessionUid
11+
};
12+
event.dataTransfer.setData('application/json', JSON.stringify(session));
13+
event.dataTransfer.effectAllowed = 'move';
14+
});
15+
});
16+
17+
document.querySelectorAll('[data-sessionplaner-dragtarget]').forEach((element: HTMLElement) => {
18+
element.addEventListener('dragleave', (event: DragEvent) => {
19+
event.stopPropagation();
20+
element.classList.remove('dragtarget');
21+
}, { capture: true, passive: true });
22+
23+
element.addEventListener('dragover', (event: DragEvent) => {
24+
event.stopPropagation();
25+
const type = element.dataset.sessionplanerDragtarget;
26+
let allowDrop = false;
27+
if (type === 'slot' && element.children.length === 0) {
28+
allowDrop = true;
29+
} else if (type === 'stash') {
30+
allowDrop = true;
31+
}
32+
if (allowDrop) {
33+
event.preventDefault();
34+
event.dataTransfer.dropEffect = 'move';
35+
element.classList.add('dragtarget');
36+
}
37+
}, { capture: true });
38+
39+
element.addEventListener('drop', (event: DragEvent) => {
40+
event.stopPropagation();
41+
element.classList.remove('dragtarget');
42+
const target = event.target as HTMLElement;
43+
const session = JSON.parse(event.dataTransfer.getData('application/json') ?? '{}');
44+
const sessionElement: HTMLElement = document.querySelector('[data-session-uid="' + session.uid + '"]');
45+
if (sessionElement) {
46+
this.updateSession(sessionElement, {
47+
room: target.dataset.roomUid ?? null,
48+
slot: target.dataset.slotUid ?? null,
49+
day: target.dataset.dayUid ?? null,
50+
});
51+
}
52+
});
53+
});
54+
}
55+
56+
updateSession(element: HTMLElement, data: {room: string | null, slot: string | null, day: string | null}) {
57+
const endpoint = 'evoweb_sessionplaner_update';
58+
const payload = {
59+
session: {
60+
uid: element.dataset.sessionUid,
61+
room: data.room ?? null,
62+
slot: data.slot ?? null,
63+
day: data.day ?? null,
64+
}
65+
};
66+
this.postData(endpoint, payload).then((response) => {
67+
if (response.status === 'success') {
68+
element.dataset.sessionRoom = response.data.session.room ?? null;
69+
element.dataset.sessionSlot = response.data.session.slot ?? null;
70+
element.dataset.sessionDay = response.data.session.day ?? null;
71+
this.updateSessionPosition(element);
72+
} else {
73+
Notification.error('Error', response.message);
74+
}
75+
});
76+
}
77+
78+
updateSessionPosition(element: HTMLElement) {
79+
let slotSelector = '';
80+
slotSelector += '[data-sessionplaner-dragtarget="slot"]';
81+
slotSelector += '[data-room-uid="' + element.dataset.sessionRoom + '"]';
82+
slotSelector += '[data-slot-uid="' + element.dataset.sessionSlot + '"]';
83+
slotSelector += '[data-slot-uid="' + element.dataset.sessionSlot + '"]';
84+
85+
const slotElement = document.querySelector(slotSelector);
86+
const stashElement = document.querySelector('[data-sessionplaner-dragtarget="stash"]');
87+
88+
if (slotElement) {
89+
slotElement.append(element);
90+
} else if (stashElement) {
91+
stashElement.append(element);
92+
}
93+
}
94+
95+
async postData(endpoint: string = '', data = {}) {
96+
const response = await fetch(TYPO3.settings.ajaxUrls[endpoint], {
97+
method: 'POST',
98+
cache: 'no-cache',
99+
credentials: 'same-origin',
100+
headers: {
101+
'Content-Type': 'application/json',
102+
},
103+
body: JSON.stringify(data),
104+
});
105+
return response.json();
106+
}
107+
}
108+
109+
new Sessionplaner();

0 commit comments

Comments
 (0)