Files
marketplaces/src/app/components/footer/footer.component.ts
sdarbinyan ce63931bc2
Some checks failed
Architecture Governance / architecture (push) Has been cancelled
feat: dead-config sweep, test suite foundation, widget settingsSchema validation
Sprint G: audited every BootstrapConfig field for a real runtime consumer
(docs/DEAD-CONFIG-AUDIT.md). Wired 3 previously-dead editable fields:
footer.logoUrl, company.address.street/contacts.phone, catalog.suggestionsEnabled.
Remaining dead fields needing a business/design decision tracked in
PRODUCT_BACKLOG.md/KNOWN-ISSUES.md, not silently left.

Sprint H: 6 new spec files (test count 57 -> 83), covering ProjectEditorFacade
(undo/redo, draft persistence, publish gating), AdminAnalyticsFacade
(never-fabricate-a-number contract), and regression coverage for this
session's carousel/hero/profile-toggle fixes.

Sprint I: widget settingsSchema (declared in widget-manifest.json, never
validated) now enforced via a new lightweight schema check in
ProjectValidator, surfaced through the existing issuesByField pipeline.
Same check reused in diagnostics so editor and diagnostics can't disagree.

Verification: tsc clean, ng build clean, 83/83 tests pass, barry-cache
validate clean (2 pre-existing unrelated warnings only).

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-08-05 20:47:13 +04:00

71 lines
2.3 KiB
TypeScript

import { Component, ChangeDetectionStrategy, effect, inject, signal } from '@angular/core';
import { RouterLink } from '@angular/router';
import { TranslatePipe } from '../../i18n/translate.pipe';
import { LogoComponent } from '../logo/logo.component';
import { UiRuntimeFacade } from '../../facades/runtime/ui-runtime.facade';
import { LangRoutePipe } from '../../pipes/lang-route.pipe';
import { FooterPaymentIcon, FooterResolvedGroup, FooterResolverService } from '../../core/config/footer-resolver.service';
import { ConfigService } from '../../core/config/config.service';
import { onImageError } from '../../utils/item.utils';
@Component({
selector: 'app-footer',
imports: [TranslatePipe, LogoComponent, RouterLink, LangRoutePipe],
templateUrl: './footer.component.html',
styleUrls: ['./footer.component.scss'],
changeDetection: ChangeDetectionStrategy.OnPush
})
export class FooterComponent {
readonly onImageError = onImageError;
readonly footerGroups = signal<FooterResolvedGroup[]>([]);
readonly paymentIcons = signal<FooterPaymentIcon[]>([]);
readonly copyrightText = signal('');
readonly footerLogoUrl = signal<string | undefined>(undefined);
private readonly configService = inject(ConfigService);
constructor(
private readonly uiRuntime: UiRuntimeFacade,
private readonly footerResolver: FooterResolverService
) {
effect(() => {
this.configService.bootstrapRevision();
const bootstrap = this.configService.getBootstrapSnapshot();
if (!bootstrap) {
this.footerGroups.set([]);
this.paymentIcons.set([]);
this.copyrightText.set('');
this.footerLogoUrl.set(undefined);
return;
}
const model = this.footerResolver.resolveFooterModelFromBootstrap(bootstrap);
this.footerGroups.set(model.groups);
this.paymentIcons.set(model.paymentIcons);
this.copyrightText.set(model.copyrightText);
this.footerLogoUrl.set(model.logoUrl);
});
this.configService.loadBootstrap().subscribe();
}
currentYear = new Date().getFullYear();
get brandName(): string {
return this.uiRuntime.marketplaceName();
}
get contactEmail(): string {
return this.uiRuntime.contactEmail();
}
get contactPhone(): string {
return this.uiRuntime.contactPhone();
}
get companyAddress(): string {
return this.uiRuntime.companyAddress();
}
}