feat(platform): sprint 11.5 standardization
Some checks failed
Architecture Governance / architecture (push) Has been cancelled
Some checks failed
Architecture Governance / architecture (push) Has been cancelled
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
import { ChangeDetectionStrategy, Component, Input } from '@angular/core';
|
||||
import { ChangeDetectionStrategy, Component, Input, inject } from '@angular/core';
|
||||
import { SectionConfig } from '../../shared/models/config';
|
||||
import { RecentlyViewedStripComponent } from '../../features/website/user-experience/components/recently-viewed-strip/recently-viewed-strip.component';
|
||||
import { TranslateService } from '../../i18n/translate.service';
|
||||
|
||||
@Component({
|
||||
selector: 'app-recently-viewed-widget',
|
||||
@@ -16,12 +17,14 @@ import { RecentlyViewedStripComponent } from '../../features/website/user-experi
|
||||
changeDetection: ChangeDetectionStrategy.OnPush
|
||||
})
|
||||
export class RecentlyViewedWidgetComponent {
|
||||
private readonly translate = inject(TranslateService);
|
||||
|
||||
@Input() section: SectionConfig | null = null;
|
||||
@Input() data: { settings?: Record<string, unknown> } | null = null;
|
||||
|
||||
get title(): string {
|
||||
const raw = this.data?.settings?.['title'];
|
||||
return typeof raw === 'string' && raw.trim().length > 0 ? raw : 'Recently Viewed';
|
||||
return typeof raw === 'string' && raw.trim().length > 0 ? raw : this.translate.t('ux.recentlyViewedTitle');
|
||||
}
|
||||
|
||||
get maxItems(): number {
|
||||
|
||||
@@ -1,11 +1,13 @@
|
||||
import { ChangeDetectionStrategy, Component, Input } from '@angular/core';
|
||||
import { TranslatePipe } from '../../i18n/translate.pipe';
|
||||
|
||||
@Component({
|
||||
selector: 'app-unknown-widget',
|
||||
standalone: true,
|
||||
imports: [TranslatePipe],
|
||||
template: `
|
||||
<section class="unknown-widget" role="status" aria-live="polite">
|
||||
<strong>Widget unavailable</strong>
|
||||
<strong>{{ 'widgets.unavailable' | translate }}</strong>
|
||||
<p>{{ widgetType }}@{{ widgetVersion }}</p>
|
||||
</section>
|
||||
`,
|
||||
|
||||
Reference in New Issue
Block a user