diff --git a/server/pruef-haus-seiten.mjs b/server/pruef-haus-seiten.mjs index 9529ab3e..92977a2e 100644 --- a/server/pruef-haus-seiten.mjs +++ b/server/pruef-haus-seiten.mjs @@ -81,6 +81,22 @@ const jetzt = new Date().toISOString(); anlegen("Rieke", "hand", "CODE-HAND-0001"); anlegen("Frida", "modi", "CODE-MODI-0001"); anlegen("Mara", "manager", "CODE-MANA-0001"); + anlegen("Sam", "creator", "CODE-CREA-0001"); + const idSam = d.prepare("SELECT id FROM personen WHERE name = 'Sam'").get().id; + /* EIN ECHTER ANLASS FÜR DEN HINWEIS. Ohne ihn gäbe es ihn nirgends, + und „er steht nicht auf crew.“ wäre ein grüner Haken über der Null. + + DIE TABELLE NICHT SELBST ANLEGEN: Der erste Entwurf schrieb hier + ein CREATE TABLE IF NOT EXISTS mit erfundenen Spalten hin. Die + echte Tabelle war längst da, das IF NOT EXISTS schwieg, und der + INSERT scheiterte an „no column named schluessel“ -- die Prüfung + hätte gemeldet, der Hinweis stehe nirgends, und das wäre richtig + und wertlos gewesen. Gefunden hat es die Gegenprobe. */ + const spalten = d.prepare("PRAGMA table_info(startcheck)").all().map((x) => x.name); + if (!spalten.includes("bewertung")) throw new Error("startcheck sieht anders aus als erwartet"); + d.prepare("INSERT INTO startcheck (creator_id, feld, punkt, bewertung, geaendert)" + + " VALUES (?,?,?,?,?)") + .run(idSam, "technik", "licht", "handlung", jetzt); d.close(); } @@ -262,6 +278,73 @@ melde("=== 5. Der Durchgang über alle Seiten ==="); `für einen Modi mehr als für DogFather (${zu.modi.length})`); } +/* ======================================================================= + 6. EIN HINWEIS AUF EINE SEITE, DIE ES HIER NICHT GIBT + + Filipe, nach dem Ausliefern: „wieso steht es noch da?" -- „1 Punkt im + Start-Check braucht Handlung", auf crew., mit einem Pfeil auf eine + Seite, die dort gesperrt ist. + + Das war die dritte Stelle: nicht Seite, nicht Schnittstelle, sondern + eine Liste von VERWEISEN. Sie bekommt jetzt dieselbe Regel. + ======================================================================= */ +melde(""); +melde("=== 6. Hinweise und Suche ==="); +{ + const hinweise = async (host, keks) => { + const a = await ruf("/workspace/api/hinweise", host, "GET", { cookie: keks }); + try { return JSON.parse(a.text).hinweise || []; } catch { return []; } + }; + + /* ZUERST DIE GEGENPROBE: Auf der Agenturadresse MUSS er dastehen. + Ohne sie beweist „er ist auf crew. weg" nur, dass es ihn nirgends + gibt. */ + const drueben = await hinweise(HAUS, kDogi); + const dort = drueben.find((h) => h.art === "startcheck_handlung"); + ok(!!dort, `auf der Agenturadresse steht der Hinweis (${dort?.text || "—"})`); + ok(dort?.ziel === "startcheck.html", `und zeigt auf den Start-Check (${dort?.ziel})`); + + /* UND HIER IST DER GEMELDETE FEHLER. */ + const hier = await hinweise(CREW, kDogiCrew); + ok(!hier.some((h) => h.art === "startcheck_handlung"), + "auf der Team-Adresse steht er nicht mehr"); + ok(!hier.some((h) => /startcheck|scouting|content|profil|calls/.test(String(h.ziel || ""))), + `und kein einziger Hinweis zeigt dorthin (${hier.length} Hinweise insgesamt)`); + + /* ABER DIE HINWEISE DES TEAMS BLEIBEN. Eine Regel, die alle + wegnimmt, wäre keine Lösung, sondern eine leere Startseite. */ + ok(hier.every((h) => !h.ziel + || ws.gehoertAufDieseAdresse({ rolle: "admin", haus: "crew" }, + "/workspace/" + String(h.ziel).split("?")[0])), + "jeder verbliebene Hinweis führt auf eine Seite, die es hier gibt"); + + /* DIESELBE SORTE VERWEIS: die Suche. */ + const suche = async (host, keks, q) => { + const a = await ruf(`/workspace/api/suche?q=${encodeURIComponent(q)}`, host, "GET", + { cookie: keks }); + try { return JSON.parse(a.text); } catch { return { gruppen: [] }; } + }; + /* ZUERST WIEDER DIE GEGENPROBE. „Kein Treffer zeigt dorthin“ ist + wertlos, solange es gar keinen Treffer gibt -- genau der grüne + Haken über der Null, vor dem die Hausregel warnt. Also erst + nachweisen, dass die Suche diesen Menschen auf der Agenturadresse + WIRKLICH findet. */ + const s0 = await suche(HAUS, kDogi, "Sam"); + const zieleH = (s0.gruppen || []).flatMap((g) => g.treffer || []).map((t) => t.ziel || ""); + ok(zieleH.length > 0, `auf der Agenturadresse findet die Suche Sam (${zieleH.length} Treffer)`); + ok(zieleH.some((z) => /profil.html/.test(z)), + `und ein Treffer führt auf sein Creator-Profil (${zieleH.join(", ")})`); + + const s1 = await suche(CREW, kDogiCrew, "Sam"); + const ziele = (s1.gruppen || []).flatMap((g) => g.treffer || []).map((t) => t.ziel || ""); + ok(!ziele.some((z) => /profil|scouting|calls|content/.test(z)), + `auf der Team-Adresse verweist keiner dorthin (${ziele.length} Treffer)`); + ok(s1.gesamt === ziele.length, + `und die Zahl nennt nur, was wirklich dasteht (${s1.gesamt})`); + ok((s1.gruppen || []).every((g) => (g.treffer || []).length > 0), + "keine Überschrift ohne Treffer darunter"); +} + /* ------------------------------------------------------------------- */ melde(""); melde(`${geprueft} Pruefungen, ${fehler} Fehler`); diff --git a/server/workspace-hinweise.js b/server/workspace-hinweise.js index f2d414a5..2260301e 100644 --- a/server/workspace-hinweise.js +++ b/server/workspace-hinweise.js @@ -25,6 +25,7 @@ import express from "express"; import { db, sitzungLesen, betreuteIds, istLeitung, istDogFather, siehtAlles, pipelineIds, + gehoertAufDieseAdresse, } from "./workspace.js"; import { sichtbar as sichtbarAufgaben } from "./workspace-aufgaben.js"; import { sichtbar as sichtbarTermine } from "./workspace-kalender.js"; @@ -80,8 +81,33 @@ hinweisRouter.get("/workspace/api/hinweise", (req, res) => { const jetzt = jetztLokal(); const hinweise = []; + /* DIE ADRESSE IST IMMER DIE ECHTE (15.09.2026). + + `person` kann die angesehene sein -- der Sicht-Umschalter zeigt + die Lage eines anderen. Das aendert, WESSEN Zahlen dastehen, + nicht, auf welcher Wand man steht. */ + const hier = { ...person, haus: (req.person || person)?.haus }; + const dazu = (art, stufe, text, ziel, anzahl) => { if (!anzahl) return; + /* EIN HINWEIS AUF EINE SEITE, DIE ES HIER NICHT GIBT, IST KEIN + HINWEIS (15.09.2026). + + Filipe, mit dem Bildschirmfoto auf crew.: „wieso steht es noch + da?" -- „1 Punkt im Start-Check braucht Handlung". Die Seite + war da schon gesperrt; der Hinweis zeigte ins Leere. + + Das war MEIN Fehler von heute Mittag: Ich hatte die Seiten + gesperrt und ausdruecklich dazugeschrieben „nur die Seiten, + nicht die Schnittstellen" -- und dabei uebersehen, dass die + Hinweise eine DRITTE Stelle sind. Sie sind keine Seite und + keine Schnittstelle, sondern eine Liste von Verweisen. + + DIESELBE REGEL, NICHT EINE ZWEITE: Was auf dieser Adresse + keine Seite hat, bekommt hier auch keinen Hinweis. Eine eigene + Liste hier waere die, die beim naechsten Umbau auseinanderlaeuft. */ + if (ziel && !gehoertAufDieseAdresse(hier, + "/workspace/" + String(ziel).split("?")[0])) return; hinweise.push({ art, stufe, text, ziel, anzahl }); }; diff --git a/server/workspace-suche.js b/server/workspace-suche.js index dec0738f..b22e36e0 100644 --- a/server/workspace-suche.js +++ b/server/workspace-suche.js @@ -25,7 +25,7 @@ import express from "express"; import { db, sitzungLesen, betreuteIds, istLeitung, istDogFather, siehtAlles, pipelineIds, - sichtbareCreatorIds, + sichtbareCreatorIds, gehoertAufDieseAdresse, } from "./workspace.js"; import { sichtbar as sichtbarAufgaben } from "./workspace-aufgaben.js"; import { sichtbar as sichtbarTermine } from "./workspace-kalender.js"; @@ -278,11 +278,35 @@ sucheRouter.get("/workspace/api/suche", (req, res) => { } } + /* UND HIER GILT SIE AUCH (15.09.2026). + + Ein Suchtreffer ist ein Verweis auf eine Seite. Zeigt er auf eine, + die es auf dieser Adresse nicht gibt, fuehrt er zur Startseite + zurueck -- und man sucht ihn beim naechsten Mal wieder. + + Die Daten waren nie das Problem: Die filtert die Haustrennung seit + dem 10.09. Das Ziel war es. Gefunden habe ich das nicht durch + Nachdenken, sondern beim Nachsehen, WER SONST NOCH Seitenziele + ausliefert, nachdem Filipe den Hinweis gemeldet hatte. + + LEERE GRUPPEN FALLEN MIT WEG. Eine Ueberschrift ohne Treffer + darunter sieht aus, als waere etwas kaputtgegangen. */ + const hier = { ...person, haus: (req.person || person)?.haus }; + const erlaubt = gruppen + .map((g) => ({ + ...g, + treffer: (g.treffer || []).filter((t) => !t?.ziel + || gehoertAufDieseAdresse(hier, "/workspace/" + String(t.ziel).split("?")[0])), + })) + .filter((g) => g.treffer.length); + res.json({ frage: q, zu_kurz: false, - gruppen, - gesamt: gruppen.reduce((s, g) => s + g.treffer.length, 0), + gruppen: erlaubt, + /* Abgeleitet, nicht mitgezaehlt -- sonst nennt die Zahl Treffer, + die gar nicht dastehen. */ + gesamt: erlaubt.reduce((s, g) => s + g.treffer.length, 0), }); } catch (fehler) { console.error("[workspace] Suche:", fehler?.message); diff --git a/workspace/app.webmanifest b/workspace/app.webmanifest index ff056be9..0f00e6f8 100644 --- a/workspace/app.webmanifest +++ b/workspace/app.webmanifest @@ -13,25 +13,25 @@ "theme_color": "#06090f", "icons": [ { - "src": "/assets/img/app-symbole/workspace-192.png?v=202609151417", + "src": "/assets/img/app-symbole/workspace-192.png?v=202609151430", "sizes": "192x192", "type": "image/png", "purpose": "any" }, { - "src": "/assets/img/app-symbole/workspace-512.png?v=202609151417", + "src": "/assets/img/app-symbole/workspace-512.png?v=202609151430", "sizes": "512x512", "type": "image/png", "purpose": "any" }, { - "src": "/assets/img/app-symbole/workspace-192-maskable.png?v=202609151417", + "src": "/assets/img/app-symbole/workspace-192-maskable.png?v=202609151430", "sizes": "192x192", "type": "image/png", "purpose": "maskable" }, { - "src": "/assets/img/app-symbole/workspace-512-maskable.png?v=202609151417", + "src": "/assets/img/app-symbole/workspace-512-maskable.png?v=202609151430", "sizes": "512x512", "type": "image/png", "purpose": "maskable" diff --git a/workspace/aufgaben.html b/workspace/aufgaben.html index 5b166fe5..d8056446 100644 --- a/workspace/aufgaben.html +++ b/workspace/aufgaben.html @@ -12,19 +12,19 @@ Ton wie die Kopfleiste darunter (#06090f), damit Leiste und Seite eine Flaeche sind statt zweier. --> - - - - - - + + + + + + - + @@ -282,10 +282,10 @@ - - - - - + + + + + diff --git a/workspace/automation.html b/workspace/automation.html index d965d3c4..2e71bc53 100644 --- a/workspace/automation.html +++ b/workspace/automation.html @@ -12,20 +12,20 @@ Ton wie die Kopfleiste darunter (#06090f), damit Leiste und Seite eine Flaeche sind statt zweier. --> - - - - - - - + + + + + + + - + @@ -168,10 +168,10 @@ - - - - - + + + + + diff --git a/workspace/befinden.html b/workspace/befinden.html index 29622c9e..80431225 100644 --- a/workspace/befinden.html +++ b/workspace/befinden.html @@ -7,14 +7,14 @@ - - - - - - - - + + + + + + + + @@ -84,9 +84,9 @@ - - - - + + + + diff --git a/workspace/bereich.html b/workspace/bereich.html index be467e35..29a2c438 100644 --- a/workspace/bereich.html +++ b/workspace/bereich.html @@ -12,20 +12,20 @@ Ton wie die Kopfleiste darunter (#06090f), damit Leiste und Seite eine Flaeche sind statt zweier. --> - - - - - - - + + + + + + + - + @@ -181,14 +181,14 @@ - - - - - - - - - + + + + + + + + + diff --git a/workspace/calls.html b/workspace/calls.html index 1f6c90a0..adcf809d 100644 --- a/workspace/calls.html +++ b/workspace/calls.html @@ -12,20 +12,20 @@ Ton wie die Kopfleiste darunter (#06090f), damit Leiste und Seite eine Flaeche sind statt zweier. --> - - - - - - - + + + + + + + - + @@ -89,11 +89,11 @@ - - - - - - + + + + + + diff --git a/workspace/chat.html b/workspace/chat.html index 67e1903b..b02c8a9a 100644 --- a/workspace/chat.html +++ b/workspace/chat.html @@ -12,26 +12,26 @@ Ton wie die Kopfleiste darunter (#06090f), damit Leiste und Seite eine Flaeche sind statt zweier. --> - - - - + + + + - - - + + + - + @@ -341,10 +341,10 @@ - - - - - + + + + + diff --git a/workspace/content.html b/workspace/content.html index 433a8dd5..97c82f6f 100644 --- a/workspace/content.html +++ b/workspace/content.html @@ -12,20 +12,20 @@ Ton wie die Kopfleiste darunter (#06090f), damit Leiste und Seite eine Flaeche sind statt zweier. --> - - - - - - - + + + + + + + - + @@ -179,12 +179,12 @@ - - - - - - - + + + + + + + diff --git a/workspace/crew-index.html b/workspace/crew-index.html index fb29f8df..c359f32e 100644 --- a/workspace/crew-index.html +++ b/workspace/crew-index.html @@ -36,15 +36,15 @@ - - - + + + - + @@ -339,6 +339,6 @@ - + diff --git a/workspace/crew.webmanifest b/workspace/crew.webmanifest index f717f780..fffb4773 100644 --- a/workspace/crew.webmanifest +++ b/workspace/crew.webmanifest @@ -13,25 +13,25 @@ "theme_color": "#06090f", "icons": [ { - "src": "/assets/img/app-symbole/crew-192.png?v=202609151417", + "src": "/assets/img/app-symbole/crew-192.png?v=202609151430", "sizes": "192x192", "type": "image/png", "purpose": "any" }, { - "src": "/assets/img/app-symbole/crew-512.png?v=202609151417", + "src": "/assets/img/app-symbole/crew-512.png?v=202609151430", "sizes": "512x512", "type": "image/png", "purpose": "any" }, { - "src": "/assets/img/app-symbole/crew-192-maskable.png?v=202609151417", + "src": "/assets/img/app-symbole/crew-192-maskable.png?v=202609151430", "sizes": "192x192", "type": "image/png", "purpose": "maskable" }, { - "src": "/assets/img/app-symbole/crew-512-maskable.png?v=202609151417", + "src": "/assets/img/app-symbole/crew-512-maskable.png?v=202609151430", "sizes": "512x512", "type": "image/png", "purpose": "maskable" diff --git a/workspace/dateien.html b/workspace/dateien.html index 2807ba5f..4080fb12 100644 --- a/workspace/dateien.html +++ b/workspace/dateien.html @@ -12,20 +12,20 @@ Ton wie die Kopfleiste darunter (#06090f), damit Leiste und Seite eine Flaeche sind statt zweier. --> - - - - - - - + + + + + + + - + @@ -108,10 +108,10 @@ - - - - - + + + + + diff --git a/workspace/entwicklung.html b/workspace/entwicklung.html index b0681f92..fbc6dc4a 100644 --- a/workspace/entwicklung.html +++ b/workspace/entwicklung.html @@ -7,14 +7,14 @@ - - - - - - - - + + + + + + + + @@ -102,9 +102,9 @@ - - - - + + + + diff --git a/workspace/index.html b/workspace/index.html index ddc3f523..978ef506 100644 --- a/workspace/index.html +++ b/workspace/index.html @@ -30,9 +30,9 @@ - - - + + + @@ -401,6 +401,6 @@ - + diff --git a/workspace/kalender.html b/workspace/kalender.html index 19f734ce..d3ed1cee 100644 --- a/workspace/kalender.html +++ b/workspace/kalender.html @@ -12,20 +12,20 @@ Ton wie die Kopfleiste darunter (#06090f), damit Leiste und Seite eine Flaeche sind statt zweier. --> - - - - - - - + + + + + + + - + @@ -377,11 +377,11 @@ - - - - - - + + + + + + diff --git a/workspace/leistung.html b/workspace/leistung.html index 9a1e89fd..7b6ba433 100644 --- a/workspace/leistung.html +++ b/workspace/leistung.html @@ -12,20 +12,20 @@ Ton wie die Kopfleiste darunter (#06090f), damit Leiste und Seite eine Flaeche sind statt zweier. --> - - - - - - - + + + + + + + - + @@ -423,10 +423,10 @@ - - - - - + + + + + diff --git a/workspace/personen.html b/workspace/personen.html index fae4cd5a..036e6b17 100644 --- a/workspace/personen.html +++ b/workspace/personen.html @@ -12,20 +12,20 @@ Ton wie die Kopfleiste darunter (#06090f), damit Leiste und Seite eine Flaeche sind statt zweier. --> - - - - - - - + + + + + + + - + @@ -423,10 +423,10 @@ - - - - - + + + + + diff --git a/workspace/profil.html b/workspace/profil.html index 3f287977..e9cf8a42 100644 --- a/workspace/profil.html +++ b/workspace/profil.html @@ -12,20 +12,20 @@ Ton wie die Kopfleiste darunter (#06090f), damit Leiste und Seite eine Flaeche sind statt zweier. --> - - - - - - - + + + + + + + - + @@ -214,11 +214,11 @@ - - - - - - + + + + + + diff --git a/workspace/rechte.html b/workspace/rechte.html index 5ce95b1f..d1f69fa5 100644 --- a/workspace/rechte.html +++ b/workspace/rechte.html @@ -7,14 +7,14 @@ - - - - - - - - + + + + + + + + @@ -134,9 +134,9 @@ Beim ersten Anlauf fehlte die Zeile auf genau diesen beiden neuen Seiten. Gefunden hat das nicht das Auge, sondern pruef-css-klassen, die seit dem 07.09. jede Seite danach absucht. --> - - - - + + + + diff --git a/workspace/report.html b/workspace/report.html index 3935b00f..277e0711 100644 --- a/workspace/report.html +++ b/workspace/report.html @@ -12,20 +12,20 @@ Ton wie die Kopfleiste darunter (#06090f), damit Leiste und Seite eine Flaeche sind statt zweier. --> - - - - - - - + + + + + + + - + @@ -106,11 +106,11 @@ - - - - - - + + + + + + diff --git a/workspace/scouting.html b/workspace/scouting.html index 2f9f8325..651a486e 100644 --- a/workspace/scouting.html +++ b/workspace/scouting.html @@ -12,20 +12,20 @@ Ton wie die Kopfleiste darunter (#06090f), damit Leiste und Seite eine Flaeche sind statt zweier. --> - - - - - - - + + + + + + + - + @@ -173,10 +173,10 @@ - - - - - + + + + + diff --git a/workspace/start.html b/workspace/start.html index 28e96f18..dadd0daf 100644 --- a/workspace/start.html +++ b/workspace/start.html @@ -12,21 +12,21 @@ Ton wie die Kopfleiste darunter (#06090f), damit Leiste und Seite eine Flaeche sind statt zweier. --> - - - - + + + + - - + + - + @@ -674,10 +674,10 @@

- - - - - + + + + + diff --git a/workspace/startcheck.html b/workspace/startcheck.html index 210ffe78..78708040 100644 --- a/workspace/startcheck.html +++ b/workspace/startcheck.html @@ -12,20 +12,20 @@ Ton wie die Kopfleiste darunter (#06090f), damit Leiste und Seite eine Flaeche sind statt zweier. --> - - - - - - - + + + + + + + - + @@ -85,11 +85,11 @@ - - - - - - + + + + + + diff --git a/workspace/steckbrief.html b/workspace/steckbrief.html index cab22252..b3071594 100644 --- a/workspace/steckbrief.html +++ b/workspace/steckbrief.html @@ -12,20 +12,20 @@ Ton wie die Kopfleiste darunter (#06090f), damit Leiste und Seite eine Flaeche sind statt zweier. --> - - - - - - - + + + + + + + - + @@ -146,11 +146,11 @@ - - - - - - + + + + + + diff --git a/workspace/talente.html b/workspace/talente.html index 1447778b..929004fa 100644 --- a/workspace/talente.html +++ b/workspace/talente.html @@ -7,14 +7,14 @@ - - - - - - - - + + + + + + + + @@ -94,9 +94,9 @@ - - - - + + + + diff --git a/workspace/team.html b/workspace/team.html index ae78c750..34c2193a 100644 --- a/workspace/team.html +++ b/workspace/team.html @@ -7,20 +7,20 @@ - - - - - - - + + + + + + + - + @@ -110,10 +110,10 @@ - - - - - + + + + + diff --git a/workspace/teamlage.html b/workspace/teamlage.html index fae94c5b..44686973 100644 --- a/workspace/teamlage.html +++ b/workspace/teamlage.html @@ -7,20 +7,20 @@ - - - - - - - + + + + + + + - + - - - - + + + + diff --git a/workspace/treff-moderation.html b/workspace/treff-moderation.html index 7714567c..c59381fa 100644 --- a/workspace/treff-moderation.html +++ b/workspace/treff-moderation.html @@ -7,14 +7,14 @@ - - - - - - - - + + + + + + + + @@ -110,9 +110,9 @@ - - - - + + + + diff --git a/workspace/treff-regeln.html b/workspace/treff-regeln.html index 85ba4155..10f3fea2 100644 --- a/workspace/treff-regeln.html +++ b/workspace/treff-regeln.html @@ -7,18 +7,18 @@ - - - - - - - + + + + + + + - + @@ -210,10 +210,10 @@ Beim ersten Anlauf fehlte die Zeile auf genau diesen beiden neuen Seiten. Gefunden hat das nicht das Auge, sondern pruef-css-klassen, die seit dem 07.09. jede Seite danach absucht. --> - - - - - + + + + + diff --git a/workspace/uebersicht.html b/workspace/uebersicht.html index da1528f7..36cf67c7 100644 --- a/workspace/uebersicht.html +++ b/workspace/uebersicht.html @@ -12,22 +12,22 @@ Ton wie die Kopfleiste darunter (#06090f), damit Leiste und Seite eine Flaeche sind statt zweier. --> - - - - + + + + - - - + + + - + @@ -149,11 +149,11 @@ - + - - - - + + + + diff --git a/workspace/wissen.html b/workspace/wissen.html index 6cb666bb..9b3608c3 100644 --- a/workspace/wissen.html +++ b/workspace/wissen.html @@ -12,20 +12,20 @@ Ton wie die Kopfleiste darunter (#06090f), damit Leiste und Seite eine Flaeche sind statt zweier. --> - - - - - - - + + + + + + + - + @@ -190,10 +190,10 @@ - - - - - + + + + +