feat(project-editor): finish field descriptions + enum dropdowns across all sections
Some checks failed
Architecture Governance / architecture (push) Has been cancelled
Some checks failed
Architecture Governance / architecture (push) Has been cancelled
Wires up the remaining editor sections (theme, header, footer, homepage, widgets, features, languages, navigation) with the description text and dropdown UX started for General/Branding: - Every enum-backed field is now a <select> with a description per option, not free text: theme.mode, the new site-wide layout.type (previously had no editor at all - added to the Theme section, and added to that section's reset-scope), homepage section layout.strategy, and catalog.navigationMode (also previously unedited, added to Features). - Every other field (colors, header toggles, footer contact/company fields, widget props, feature flags, language add, nav link label/url/visible) gets a one-line plain-language description under its label via the new *Desc i18n keys (en/ru/hy) prepared earlier. - Genuinely open text (widget layout variant strings, JSON props) stays free text, description-only, per the existing widgetLayoutDesc/widgetJsonDesc wording - not force-fit into a dropdown. Verified: tsc --noEmit and ng build both clean.
This commit is contained in:
@@ -1,11 +1,18 @@
|
||||
import { ChangeDetectionStrategy, Component, inject } from '@angular/core';
|
||||
import { FormsModule } from '@angular/forms';
|
||||
import { ProjectEditorFacade } from '../facade/project-editor.facade';
|
||||
import { TranslatePipe } from '../../../i18n/translate.pipe';
|
||||
|
||||
export interface CatalogNavigationOption {
|
||||
value: 'default' | 'left-category-navigation' | 'mega-category-layout' | 'top-category-carousel';
|
||||
labelKey: string;
|
||||
descKey: string;
|
||||
}
|
||||
|
||||
@Component({
|
||||
selector: 'app-project-editor-features-section',
|
||||
standalone: true,
|
||||
imports: [TranslatePipe],
|
||||
imports: [FormsModule, TranslatePipe],
|
||||
templateUrl: './features-section.component.html',
|
||||
styleUrls: ['./section.shared.scss'],
|
||||
changeDetection: ChangeDetectionStrategy.OnPush
|
||||
@@ -14,6 +21,24 @@ export class ProjectEditorFeaturesSectionComponent {
|
||||
private readonly facade = inject(ProjectEditorFacade);
|
||||
readonly bootstrap = this.facade.bootstrap;
|
||||
|
||||
readonly catalogNavigationOptions: CatalogNavigationOption[] = [
|
||||
{ value: 'default', labelKey: 'builder.catalogNavDefault', descKey: 'builder.catalogNavDefaultDesc' },
|
||||
{ value: 'left-category-navigation', labelKey: 'builder.catalogNavLeftCategory', descKey: 'builder.catalogNavLeftCategoryDesc' },
|
||||
{ value: 'mega-category-layout', labelKey: 'builder.catalogNavMegaCategory', descKey: 'builder.catalogNavMegaCategoryDesc' },
|
||||
{ value: 'top-category-carousel', labelKey: 'builder.catalogNavTopCarousel', descKey: 'builder.catalogNavTopCarouselDesc' },
|
||||
];
|
||||
|
||||
catalogNavigationDescKey(mode: string | undefined): string {
|
||||
return this.catalogNavigationOptions.find(option => option.value === mode)?.descKey ?? '';
|
||||
}
|
||||
|
||||
updateCatalogNavigationMode(mode: string): void {
|
||||
this.facade.updateBootstrap(current => ({
|
||||
...current,
|
||||
catalog: { ...current.catalog, navigationMode: mode as CatalogNavigationOption['value'] }
|
||||
}));
|
||||
}
|
||||
|
||||
toggleFeature(key: string, checked: boolean): void {
|
||||
this.facade.updateBootstrap(current => ({ ...current, featureFlags: { ...current.featureFlags, [key]: checked } }));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user