From 052ade3e9120773084360a89cc451103f7375d10 Mon Sep 17 00:00:00 2001 From: printcalc-ci Date: Wed, 11 Mar 2026 09:59:12 +0000 Subject: [PATCH] style: apply prettier formatting --- .../admin/pages/admin-shop.component.ts | 26 ++++++++++++++----- .../features/shop/product-detail.component.ts | 3 ++- 2 files changed, 22 insertions(+), 7 deletions(-) diff --git a/frontend/src/app/features/admin/pages/admin-shop.component.ts b/frontend/src/app/features/admin/pages/admin-shop.component.ts index d65f9ad..d53cee2 100644 --- a/frontend/src/app/features/admin/pages/admin-shop.component.ts +++ b/frontend/src/app/features/admin/pages/admin-shop.component.ts @@ -1448,7 +1448,9 @@ export class AdminShopComponent implements OnInit, OnDestroy { excerptEn: this.optionalValue(this.productForm.excerpts['en']), excerptDe: this.optionalValue(this.productForm.excerpts['de']), excerptFr: this.optionalValue(this.productForm.excerpts['fr']), - description: this.optionalRichTextValue(this.productForm.descriptions['it']), + description: this.optionalRichTextValue( + this.productForm.descriptions['it'], + ), descriptionIt: this.optionalRichTextValue( this.productForm.descriptions['it'], ), @@ -1852,7 +1854,8 @@ export class AdminShopComponent implements OnInit, OnDestroy { if (!editor) { return; } - const html = this.productForm.descriptions[this.activeContentLanguage] ?? ''; + const html = + this.productForm.descriptions[this.activeContentLanguage] ?? ''; if (editor.innerHTML !== html) { editor.innerHTML = html; } @@ -1868,7 +1871,9 @@ export class AdminShopComponent implements OnInit, OnDestroy { this.syncDescriptionFromEditor(editor, false); } - private normalizeDescriptionForEditor(value: string | null | undefined): string { + private normalizeDescriptionForEditor( + value: string | null | undefined, + ): string { return this.normalizeRichTextStorageValue(value ?? '') ?? ''; } @@ -1951,7 +1956,9 @@ export class AdminShopComponent implements OnInit, OnDestroy { const element = outputDocument.createElement(tagName.toLowerCase()); if (tagName === 'A') { - const href = this.sanitizeRichTextHref(sourceElement.getAttribute('href')); + const href = this.sanitizeRichTextHref( + sourceElement.getAttribute('href'), + ); if (href) { element.setAttribute('href', href); if (href.startsWith('http://') || href.startsWith('https://')) { @@ -1967,7 +1974,10 @@ export class AdminShopComponent implements OnInit, OnDestroy { if (tagName === 'A' && !element.textContent?.trim()) { return null; } - if ((tagName === 'UL' || tagName === 'OL') && !element.querySelector('li')) { + if ( + (tagName === 'UL' || tagName === 'OL') && + !element.querySelector('li') + ) { return null; } if (tagName === 'LI' && !element.textContent?.trim()) { @@ -1998,7 +2008,11 @@ export class AdminShopComponent implements OnInit, OnDestroy { } private hasMeaningfulRichText(value: string): boolean { - return this.extractTextFromHtml(value).replace(/\u00a0/g, ' ').trim().length > 0; + return ( + this.extractTextFromHtml(value) + .replace(/\u00a0/g, ' ') + .trim().length > 0 + ); } private extractTextFromHtml(value: string): string { diff --git a/frontend/src/app/features/shop/product-detail.component.ts b/frontend/src/app/features/shop/product-detail.component.ts index e7a96bd..ae2fb3f 100644 --- a/frontend/src/app/features/shop/product-detail.component.ts +++ b/frontend/src/app/features/shop/product-detail.component.ts @@ -53,7 +53,8 @@ interface ShopMaterialProperty { styleUrl: './product-detail.component.scss', }) export class ProductDetailComponent { - private static readonly HEX_COLOR_PATTERN = /^#([0-9a-fA-F]{3}|[0-9a-fA-F]{6})$/; + private static readonly HEX_COLOR_PATTERN = + /^#([0-9a-fA-F]{3}|[0-9a-fA-F]{6})$/; private readonly destroyRef = inject(DestroyRef); private readonly injector = inject(Injector); private readonly router = inject(Router);