nodebb-plugin-onekite-calendar 1.0.1 → 1.0.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +16 -14
- package/lib/admin.js +1 -13
- package/lib/api.js +0 -5
- package/package.json +1 -1
- package/plugin.json +2 -2
- package/public/admin.js +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,19 +1,21 @@
|
|
|
1
1
|
# Changelog – calendar-onekite
|
|
2
2
|
|
|
3
|
+
## 1.0.3
|
|
4
|
+
- Suppression du texte d’archivage dans le toast de purge (plus de « 0 archivés »)
|
|
5
|
+
- Renommage du plugin : nodebb-plugin-onekite-calendar
|
|
6
|
+
|
|
7
|
+
## 1.0.2
|
|
8
|
+
- Purge calendrier : suppression réelle des réservations (aucune logique d’archivage)
|
|
9
|
+
- Compta conservée séparément (la purge n’y touche jamais)
|
|
10
|
+
|
|
3
11
|
## 1.0.1
|
|
4
|
-
-
|
|
5
|
-
-
|
|
6
|
-
-
|
|
7
|
-
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
-
|
|
11
|
-
- utilisation d’embeds
|
|
12
|
-
- icônes ⏳ pour les demandes de réservation
|
|
13
|
-
- icônes 💳 pour les paiements reçus
|
|
14
|
-
- 1 action = 1 message
|
|
15
|
-
- Nettoyage du code et suppression des fichiers internes (refactor / review)
|
|
16
|
-
- Fonctionnement CDN conservé
|
|
12
|
+
- ACP : modales Valider / Refuser OK (plus de retour au premier onglet)
|
|
13
|
+
- Scheduler : optimisation (batch DB, scans réduits)
|
|
14
|
+
- API events : pagination interne + ETag optimisé
|
|
15
|
+
- HelloAsso : token mis en cache + protection rate-limit (429 / Cloudflare 1015), sans logs supplémentaires
|
|
16
|
+
- Discord : notifications en embeds + icônes ⏳ (demande) et 💳 (paiement)
|
|
17
|
+
- Widget : suppression de “2 semaines” dans le titre affiché
|
|
18
|
+
- Correctifs divers de stabilité/performance (dont crash au démarrage)
|
|
17
19
|
|
|
18
20
|
## 1.0.0
|
|
19
21
|
- Première version stable du plugin calendar-onekite
|
|
@@ -21,4 +23,4 @@
|
|
|
21
23
|
- Calendrier FullCalendar via CDN
|
|
22
24
|
- Validation / refus des demandes depuis l’ACP
|
|
23
25
|
- Notifications Discord
|
|
24
|
-
- Intégration paiements HelloAsso
|
|
26
|
+
- Intégration paiements HelloAsso
|
package/lib/admin.js
CHANGED
|
@@ -264,26 +264,14 @@ admin.purgeByYear = async function (req, res) {
|
|
|
264
264
|
|
|
265
265
|
const ids = await dbLayer.listReservationIdsByStartRange(startTs, endTs, 100000);
|
|
266
266
|
let removed = 0;
|
|
267
|
-
let archivedForAccounting = 0;
|
|
268
|
-
const ts = Date.now();
|
|
269
267
|
for (const rid of ids) {
|
|
270
268
|
const r = await dbLayer.getReservation(rid);
|
|
271
269
|
if (!r) continue;
|
|
272
270
|
|
|
273
|
-
// Keep paid reservations for accounting; just hide them from the calendar.
|
|
274
|
-
if (String(r.status) === 'paid') {
|
|
275
|
-
if (!r.calendarPurgedAt) {
|
|
276
|
-
r.calendarPurgedAt = ts;
|
|
277
|
-
await dbLayer.saveReservation(r);
|
|
278
|
-
}
|
|
279
|
-
archivedForAccounting++;
|
|
280
|
-
continue;
|
|
281
|
-
}
|
|
282
|
-
|
|
283
271
|
await dbLayer.removeReservation(rid);
|
|
284
272
|
removed++;
|
|
285
273
|
}
|
|
286
|
-
res.json({ ok: true, removed
|
|
274
|
+
res.json({ ok: true, removed });
|
|
287
275
|
};
|
|
288
276
|
|
|
289
277
|
admin.purgeSpecialEventsByYear = async function (req, res) {
|
package/lib/api.js
CHANGED
|
@@ -342,8 +342,6 @@ api.getEvents = async function (req, res) {
|
|
|
342
342
|
const reservations = await dbLayer.getReservations(ids);
|
|
343
343
|
for (const r of (reservations || [])) {
|
|
344
344
|
if (!r) continue;
|
|
345
|
-
// Purged from calendar view (kept for accounting)
|
|
346
|
-
if (r.calendarPurgedAt) continue;
|
|
347
345
|
// Only show active statuses
|
|
348
346
|
if (!['pending', 'awaiting_payment', 'paid'].includes(r.status)) continue;
|
|
349
347
|
const rStart = parseInt(r.start, 10);
|
|
@@ -641,9 +639,6 @@ api.createReservation = async function (req, res) {
|
|
|
641
639
|
const existingRows = await dbLayer.getReservations(candidateIds);
|
|
642
640
|
for (const existing of (existingRows || [])) {
|
|
643
641
|
if (!existing || !blocking.has(existing.status)) continue;
|
|
644
|
-
// Reservations can be purged from the calendar view (kept for accounting).
|
|
645
|
-
// Those must not block new booking requests.
|
|
646
|
-
if (existing.calendarPurgedAt) continue;
|
|
647
642
|
const exStart = parseInt(existing.start, 10);
|
|
648
643
|
const exEnd = parseInt(existing.end, 10);
|
|
649
644
|
if (!(exStart < end && start < exEnd)) continue;
|
package/package.json
CHANGED
package/plugin.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"id": "nodebb-plugin-onekite-calendar",
|
|
3
|
-
"name": "Calendar
|
|
3
|
+
"name": "OneKite Calendar",
|
|
4
4
|
"description": "Equipment reservation calendar (FullCalendar) with admin approval & HelloAsso checkout",
|
|
5
5
|
"url": "https://www.onekite.com/calendar",
|
|
6
6
|
"hooks": [
|
|
@@ -39,5 +39,5 @@
|
|
|
39
39
|
"acpScripts": [
|
|
40
40
|
"public/admin.js"
|
|
41
41
|
],
|
|
42
|
-
"version": "1.3
|
|
42
|
+
"version": "1.0.3"
|
|
43
43
|
}
|
package/public/admin.js
CHANGED
|
@@ -643,7 +643,7 @@ define('admin/plugins/calendar-onekite', ['alerts', 'bootbox'], function (alerts
|
|
|
643
643
|
if (!ok) return;
|
|
644
644
|
try {
|
|
645
645
|
const r = await purge(year);
|
|
646
|
-
showAlert('success', `Purge OK (${r.removed || 0} supprimées
|
|
646
|
+
showAlert('success', `Purge OK (${r.removed || 0} supprimées).`);
|
|
647
647
|
await refreshPending();
|
|
648
648
|
} catch (e) {
|
|
649
649
|
showAlert('error', 'Purge impossible.');
|