feat(project-editor): per-field inline validation for languages, homepage, widgets, navigation, static-pages
Extends the fieldError() wiring pattern (already used in theme/general/branding) to the remaining sections that have matching ProjectValidator fieldKeys: - languages: localization.supportedLocales (no-languages, missing-translations) - homepage: pages (empty-homepage, missing-widget, duplicate-routes) - widgets: pages (invalid-widget-config) - navigation: navigation.header (duplicate-nav-links) - static-pages: staticPages (duplicate-slugs, invalid-css) Header/footer/features sections have no matching validator issues today, so nothing to wire there yet. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
@@ -3,6 +3,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 { SectionCardComponent } from '../../../shared/ui/section-card/section-card.component';
|
||||
import { ToggleComponent } from '../../../shared/ui/toggle/toggle.component';
|
||||
@@ -23,7 +24,12 @@ export interface LayoutStrategyOption {
|
||||
})
|
||||
export class ProjectEditorHomepageSectionComponent {
|
||||
private readonly facade = inject(ProjectEditorFacade);
|
||||
private readonly translate = inject(TranslateService);
|
||||
readonly homePage = this.facade.homepagePage;
|
||||
readonly fieldError = (key: string): string | null => {
|
||||
const messageKey = this.facade.fieldError(key);
|
||||
return messageKey ? this.translate.t(messageKey) : null;
|
||||
};
|
||||
readonly sections = computed(() => [...(this.homePage()?.sections ?? [])].sort((a, b) => a.order - b.order));
|
||||
|
||||
readonly layoutStrategyOptions: LayoutStrategyOption[] = [
|
||||
|
||||
Reference in New Issue
Block a user