feat(admin): Anmeldehinweise der Willkommensmail in der Vorlage bearbeitbar
Neue Felder loginHintDirectory/loginHintLocal (Platzhalter, Pflicht, max. 1000), Migration 20260930170000 (nullable, leer = Standard aus @tessera/shared). Knopf Passwort festlegen und Gueltigkeitshinweis bleiben fest; local-no-link wird nie erzeugt und bleibt fest. Vorschau springt beim Bearbeiten auf die passende Kontoart. Lokal im Browser nachgewiesen. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -18,6 +18,8 @@ type Row = {
|
||||
subject: string;
|
||||
heading: string;
|
||||
intro: string;
|
||||
loginHintDirectory?: string | null;
|
||||
loginHintLocal?: string | null;
|
||||
closing: string;
|
||||
updatedBy: string | null;
|
||||
updatedAt: Date;
|
||||
@@ -66,7 +68,14 @@ function makePrisma(rows: Row[] = []) {
|
||||
};
|
||||
}
|
||||
|
||||
const texts = { subject: 'S {{name}}', heading: 'H', intro: 'I', closing: 'C' };
|
||||
const texts = {
|
||||
subject: 'S {{name}}',
|
||||
heading: 'H',
|
||||
intro: 'I',
|
||||
loginHintDirectory: 'LD {{benutzername}}',
|
||||
loginHintLocal: 'LL',
|
||||
closing: 'C',
|
||||
};
|
||||
|
||||
let prisma: ReturnType<typeof makePrisma>;
|
||||
let service: WelcomeMailTemplateService;
|
||||
@@ -98,6 +107,25 @@ describe('WelcomeMailTemplateService', () => {
|
||||
expect(await service.getCustomTexts('t1')).toEqual(texts);
|
||||
});
|
||||
|
||||
it('aeltere Vorlage ohne Anmeldehinweise (NULL) → Standardtexte fuer diese Felder, Rest bleibt eigen', async () => {
|
||||
prisma.__rows.push({
|
||||
tenantId: 't1',
|
||||
subject: 'Alt',
|
||||
heading: 'H',
|
||||
intro: 'I',
|
||||
loginHintDirectory: null,
|
||||
loginHintLocal: null,
|
||||
closing: 'C',
|
||||
updatedBy: null,
|
||||
updatedAt: new Date(),
|
||||
});
|
||||
const state = await service.getState('t1');
|
||||
expect(state.custom).toBe(true);
|
||||
expect(state.texts.subject).toBe('Alt');
|
||||
expect(state.texts.loginHintDirectory).toBe(DEFAULT_WELCOME_MAIL_TEXTS.loginHintDirectory);
|
||||
expect(state.texts.loginHintLocal).toBe(DEFAULT_WELCOME_MAIL_TEXTS.loginHintLocal);
|
||||
});
|
||||
|
||||
it('Mandantenbindung: Vorlage von t1 ist fuer t2 nicht sichtbar', async () => {
|
||||
await service.save('t1', texts, 'ada');
|
||||
expect(await service.getCustomTexts('t2')).toBeNull();
|
||||
|
||||
Reference in New Issue
Block a user