2026-07-10 13:43:53 +04:00
|
|
|
import { Component, ChangeDetectionStrategy, effect, inject, signal } from '@angular/core';
|
2026-07-05 03:37:35 +04:00
|
|
|
import { RouterLink } from '@angular/router';
|
2026-02-26 23:09:20 +04:00
|
|
|
import { TranslatePipe } from '../../i18n/translate.pipe';
|
2026-07-02 02:22:00 +04:00
|
|
|
import { LogoComponent } from '../logo/logo.component';
|
2026-07-03 01:58:08 +04:00
|
|
|
import { UiRuntimeFacade } from '../../facades/runtime/ui-runtime.facade';
|
2026-07-05 03:37:35 +04:00
|
|
|
import { LangRoutePipe } from '../../pipes/lang-route.pipe';
|
2026-07-05 04:17:31 +04:00
|
|
|
import { FooterPaymentIcon, FooterResolvedGroup, FooterResolverService } from '../../core/config/footer-resolver.service';
|
2026-07-10 13:43:53 +04:00
|
|
|
import { ConfigService } from '../../core/config/config.service';
|
2026-07-26 12:01:26 +04:00
|
|
|
import { onImageError } from '../../utils/item.utils';
|
2026-01-18 18:57:06 +04:00
|
|
|
|
|
|
|
|
@Component({
|
|
|
|
|
selector: 'app-footer',
|
2026-07-05 03:37:35 +04:00
|
|
|
imports: [TranslatePipe, LogoComponent, RouterLink, LangRoutePipe],
|
2026-01-18 18:57:06 +04:00
|
|
|
templateUrl: './footer.component.html',
|
2026-02-19 01:23:25 +04:00
|
|
|
styleUrls: ['./footer.component.scss'],
|
|
|
|
|
changeDetection: ChangeDetectionStrategy.OnPush
|
2026-01-18 18:57:06 +04:00
|
|
|
})
|
|
|
|
|
export class FooterComponent {
|
2026-07-26 12:01:26 +04:00
|
|
|
readonly onImageError = onImageError;
|
|
|
|
|
|
2026-07-05 03:37:35 +04:00
|
|
|
readonly footerGroups = signal<FooterResolvedGroup[]>([]);
|
2026-07-05 04:17:31 +04:00
|
|
|
readonly paymentIcons = signal<FooterPaymentIcon[]>([]);
|
|
|
|
|
readonly copyrightText = signal('');
|
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
|
|
|
readonly footerLogoUrl = signal<string | undefined>(undefined);
|
2026-07-05 03:37:35 +04:00
|
|
|
|
2026-07-10 13:43:53 +04:00
|
|
|
private readonly configService = inject(ConfigService);
|
|
|
|
|
|
2026-07-05 03:37:35 +04:00
|
|
|
constructor(
|
|
|
|
|
private readonly uiRuntime: UiRuntimeFacade,
|
2026-07-05 04:17:31 +04:00
|
|
|
private readonly footerResolver: FooterResolverService
|
2026-07-05 03:37:35 +04:00
|
|
|
) {
|
2026-07-10 13:43:53 +04:00
|
|
|
effect(() => {
|
|
|
|
|
this.configService.bootstrapRevision();
|
|
|
|
|
const bootstrap = this.configService.getBootstrapSnapshot();
|
|
|
|
|
if (!bootstrap) {
|
2026-07-05 03:37:35 +04:00
|
|
|
this.footerGroups.set([]);
|
2026-07-05 04:17:31 +04:00
|
|
|
this.paymentIcons.set([]);
|
|
|
|
|
this.copyrightText.set('');
|
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
|
|
|
this.footerLogoUrl.set(undefined);
|
2026-07-10 13:43:53 +04:00
|
|
|
return;
|
2026-07-05 03:37:35 +04:00
|
|
|
}
|
2026-07-10 13:43:53 +04:00
|
|
|
|
|
|
|
|
const model = this.footerResolver.resolveFooterModelFromBootstrap(bootstrap);
|
|
|
|
|
this.footerGroups.set(model.groups);
|
|
|
|
|
this.paymentIcons.set(model.paymentIcons);
|
|
|
|
|
this.copyrightText.set(model.copyrightText);
|
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
|
|
|
this.footerLogoUrl.set(model.logoUrl);
|
2026-07-05 03:37:35 +04:00
|
|
|
});
|
2026-07-10 13:43:53 +04:00
|
|
|
|
|
|
|
|
this.configService.loadBootstrap().subscribe();
|
2026-07-05 03:37:35 +04:00
|
|
|
}
|
2026-07-03 01:58:08 +04:00
|
|
|
|
2026-01-18 18:57:06 +04:00
|
|
|
currentYear = new Date().getFullYear();
|
2026-07-03 01:58:08 +04:00
|
|
|
|
|
|
|
|
get brandName(): string {
|
2026-07-05 00:38:21 +04:00
|
|
|
return this.uiRuntime.marketplaceName();
|
2026-07-03 01:58:08 +04:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
get contactEmail(): string {
|
|
|
|
|
return this.uiRuntime.contactEmail();
|
|
|
|
|
}
|
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
|
|
|
|
|
|
|
|
get contactPhone(): string {
|
|
|
|
|
return this.uiRuntime.contactPhone();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
get companyAddress(): string {
|
|
|
|
|
return this.uiRuntime.companyAddress();
|
|
|
|
|
}
|
2026-01-18 18:57:06 +04:00
|
|
|
}
|