feat: add default label template setting and apply it to print dialog selection
Build and Push Multi-Platform Images / build-and-push (push) Successful in 35s

This commit is contained in:
2026-05-09 12:41:05 +02:00
parent e4f765fcfd
commit 0318fe8e7a
5 changed files with 82 additions and 5 deletions
@@ -28,4 +28,7 @@ export class UserSettings {
@Column({ type: 'text', nullable: true })
MailSignatureHtml!: string | null;
@Column({ type: 'int', nullable: true })
DefaultLabelTemplateId!: number | null;
}
@@ -17,6 +17,7 @@ export interface UserSettingsDto {
smtpFrom: string | null;
smtpFromName: string | null;
mailSignatureHtml: string | null;
defaultLabelTemplateId: number | null;
}
@Injectable()
@@ -78,6 +79,7 @@ export class UserSettingsService {
smtpFrom?: string | null;
smtpFromName?: string | null;
mailSignatureHtml?: string | null;
defaultLabelTemplateId?: number | null;
},
): Promise<UserSettingsDto> {
let entity = await this.repo.findOne({ where: { UserId: userId } });
@@ -95,6 +97,7 @@ export class UserSettingsService {
if (data.smtpFrom !== undefined) entity.SmtpFrom = data.smtpFrom;
if (data.smtpFromName !== undefined) entity.SmtpFromName = data.smtpFromName;
if (data.mailSignatureHtml !== undefined) entity.MailSignatureHtml = data.mailSignatureHtml;
if (data.defaultLabelTemplateId !== undefined) entity.DefaultLabelTemplateId = data.defaultLabelTemplateId;
await this.repo.save(entity);
return this.toDto(entity);
@@ -164,6 +167,7 @@ export class UserSettingsService {
smtpFrom: entity?.SmtpFrom ?? null,
smtpFromName: entity?.SmtpFromName ?? null,
mailSignatureHtml: entity?.MailSignatureHtml ?? null,
defaultLabelTemplateId: entity?.DefaultLabelTemplateId ?? null,
};
}
}