Terminplaner: Warnung im Dialog, wenn K16 mit den Unterlagen nicht rausging

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
ClaudeandClaude Opus 5.5 committed 2026-10-05 07:05:44 +00:00
1 parent 72eedeb59c
commit 878a530bd7
3 files changed
+20 -4

No files matched your search

@@ -6,7 +6,7 @@ import { copyText } from '../CopyableCredential'
import { getFunktionen, setFeature, getTermineAnleitung } from '../../lib/teamApi'
import {
FUNKTIONEN, ZUSTAND, AKTION_LABEL, funktionOf, aktionen, mergeFunktion, siteKeyOf, abgeschaltetText,
hindernisText, panelModell, anleitungOffen, textformNoetig, textformAnsicht, textformBereit,
hindernisText, panelModell, anleitungOffen, textformNoetig, textformAnsicht, textformBereit, speicherStatus,
} from '../../lib/funktionenView'
import { CHANNELS, channelLabel } from '../../lib/analyseView'
import { berlinYmd } from '../../lib/format'
@@ -186,17 +186,17 @@ export default function CustomerFunktionen({ customerId }) {
setStatus(null)
try {
const mitTextform = textformNoetig(key, action, termine)
const { projects: changed } = await setFeature(customerId, key, {
const antwort = await setFeature(customerId, key, {
projectId, action, note: note.trim(),
...(mitTextform ? { textformDate: textform.date, textformChannel: textform.channel } : {}),
})
// Die Antwort enthaelt das ganze Projekt; uebernommen wird nur die geaenderte Funktion
const updated = changed?.[0]
const updated = antwort?.projects?.[0]
if (updated) setProjects((list) => mergeFunktion(list, updated.projectId, key, updated))
setConfirm(null)
setNote('')
setTextform(LEERE_TEXTFORM)
setStatus({ ok: true, text: 'Gespeichert.' })
setStatus(speicherStatus(antwort))
} catch (err) {
setConfirm(null)
setStatus({ ok: false, text: err.message })
+6
View File
@@ -223,3 +223,9 @@ export function featureBody({ projectId, action, note, textformDate, textformCha
}
return body
}
/** K16 (Unterlagen an den Kunden) ging beim Aktivieren nicht raus: Antwort mit warnung: true (Portal, funktionenAdmin). */
export const K16_WARNUNG = 'Eingeschaltet, aber die E-Mail mit den Unterlagen (K16) ging nicht raus. Bitte die Leistungsbeschreibung und den AVV von Hand an den Kunden senden.'
/** Statuszeile nach dem Speichern einer Aktion: Warnung statt "Gespeichert.", wenn die Antwort warnung: true traegt. */
export const speicherStatus = (antwort) => (antwort?.warnung === true ? { ok: false, text: K16_WARNUNG } : { ok: true, text: 'Gespeichert.' })
+10
View File
@@ -23,6 +23,8 @@ const {
textformAnsicht,
textformBereit,
featureBody,
speicherStatus,
K16_WARNUNG,
} = await loadModule('src/lib/funktionenView.js')
test('FUNKTIONEN: News und Terminplaner mit den Bestätigungstexten', () => {
@@ -460,3 +462,11 @@ test('featureBody: Aktivieren mit Textform trägt Datum und Weg, sonst bleibt de
'halbe Angaben gehen nicht mit',
)
})
test('speicherStatus: warnung true (K16 nicht gesendet) wird zur Warnung, sonst "Gespeichert."', () => {
assert.deepEqual(speicherStatus({ projects: [], warnung: true }), { ok: false, text: K16_WARNUNG })
assert.match(K16_WARNUNG, /K16/)
assert.match(K16_WARNUNG, /von Hand/)
assert.deepEqual(speicherStatus({ projects: [] }), { ok: true, text: 'Gespeichert.' })
assert.deepEqual(speicherStatus(undefined), { ok: true, text: 'Gespeichert.' })
})