feat(project-editor): footer validation rules (contact email, social link URLs, payment icons)
Some checks failed
Architecture Governance / architecture (push) Has been cancelled
Some checks failed
Architecture Governance / architecture (push) Has been cancelled
Real gaps, not fabricated: isValidEmail existed in primitives.ts but was never called anywhere; social-link URL check only lived as a per-row template hint (never blocked publish or set the nav badge); payment icons with only src or only alt set were silently accepted. - invalid-contact-email: company.contacts.email must be a valid email (error) - invalid-social-link-url: footer.socialLinks entries need a valid http(s) URL (warning) - incomplete-payment-icon: a payment icon needs both src and alt, or neither (warning) Wired into footer-section via the existing fieldError() pattern. Header has no equivalent gap today (every header field is a bool/enum, always valid by construction) so nothing was added there. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
@@ -2,6 +2,7 @@ import { ChangeDetectionStrategy, Component, computed, inject } from '@angular/c
|
||||
import { FormsModule } from '@angular/forms';
|
||||
import { ProjectEditorFacade } from '../facade/project-editor.facade';
|
||||
import { TranslatePipe } from '../../../i18n/translate.pipe';
|
||||
import { TranslateService } from '../../../i18n/translate.service';
|
||||
import { InputComponent } from '../../../shared/ui/input/input.component';
|
||||
import { FormFieldComponent } from '../../../shared/ui/form-field/form-field.component';
|
||||
import { SectionCardComponent } from '../../../shared/ui/section-card/section-card.component';
|
||||
@@ -28,7 +29,12 @@ import { isValidHttpUrl } from '../schema/validators/primitives';
|
||||
})
|
||||
export class ProjectEditorFooterSectionComponent {
|
||||
private readonly facade = inject(ProjectEditorFacade);
|
||||
private readonly translate = inject(TranslateService);
|
||||
readonly bootstrap = this.facade.bootstrap;
|
||||
readonly fieldError = (key: string): string | null => {
|
||||
const messageKey = this.facade.fieldError(key);
|
||||
return messageKey ? this.translate.t(messageKey) : null;
|
||||
};
|
||||
|
||||
readonly staticPagesValue = computed(() => (this.bootstrap()?.footer?.staticPageKeys ?? this.bootstrap()?.footer?.legalPageKeys ?? []).join(', '));
|
||||
readonly copyrightValue = computed(() => {
|
||||
|
||||
Reference in New Issue
Block a user