fix(planka): endpoints v2, tri intra-liste, drag&drop robuste
Deploy HouseHub / deploy (push) Successful in 2s

- create_card: POST /api/lists/{id}/cards + type=story (Planka v2 requis)
- create_list: type=active requis
- Drag & drop: zones pk-drop-before avant chaque carte pour tri intra-liste
- moveCard(): position calculée (avg prev/next) + gestion même liste
- Suppression variable dragCardId globale → dataTransfer propre

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
perco
2026-05-19 17:49:26 +02:00
co-authored by Claude Sonnet 4.6
parent 0db14560a5
commit 5828d1796d
3 changed files with 75 additions and 29 deletions
+12 -9
View File
@@ -99,25 +99,28 @@ if ($action === 'set_active_board') {
if ($action === 'create_list') {
$board_id = $_GET['board_id'] ?? null; if (!$board_id) tErr('board_id manquant');
$name = trim($_GET['name'] ?? ''); if (!$name) tErr('name manquant');
$position = (int) ($_GET['position'] ?? 65535);
$position = (float) ($_GET['position'] ?? 65535);
$resp = planka_api('POST', '/api/boards/' . $board_id . '/lists', [
'name' => $name,
'position' => $position,
'type' => 'active',
], $token);
if (empty($resp['item'])) tErr($resp['message'] ?? 'Planka n\'a pas créé la liste', 502);
if (empty($resp['item'])) tErr($resp['message'] ?? ($resp['problems'][0] ?? 'Erreur Planka'), 502);
tOk($resp['item']);
}
if ($action === 'create_card') {
$list_id = $_GET['list_id'] ?? null; if (!$list_id) tErr('list_id manquant');
$board_id = $_GET['board_id'] ?? null; if (!$board_id) tErr('board_id manquant');
$name = trim($_GET['name'] ?? ''); if (!$name) tErr('name manquant');
$resp = planka_api('POST', '/api/boards/' . $board_id . '/cards', [
'listId' => $list_id,
$list_id = $_GET['list_id'] ?? null; if (!$list_id) tErr('list_id manquant');
$name = trim($_GET['name'] ?? ''); if (!$name) tErr('name manquant');
$pos = (float) ($_GET['position'] ?? 65535);
// Planka v2+: POST /api/lists/{listId}/cards with type required
$resp = planka_api('POST', '/api/lists/' . $list_id . '/cards', [
'name' => $name,
'position' => 65535,
'position' => $pos,
'type' => 'story',
], $token);
tOk($resp['item'] ?? []);
if (empty($resp['item'])) tErr($resp['message'] ?? ($resp['problems'][0] ?? 'Erreur Planka'), 502);
tOk($resp['item']);
}
if ($action === 'update_card') {
+14
View File
@@ -488,3 +488,17 @@
background: var(--bg-panel, #f3f4f6);
color: var(--primary, #4361ee);
}
.pk-drop-before {
height: 4px;
border-radius: 4px;
transition: height .12s, background .12s;
margin: -2px 0;
}
.pk-drop-before.drop-before-active {
height: 28px;
background: rgba(59,130,246,.15);
border: 2px dashed var(--primary, #4361ee);
border-radius: 6px;
margin: 2px 0;
}