feat(builder): add project editor
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
import { Component, ChangeDetectionStrategy, Renderer2, inject, DOCUMENT } from '@angular/core';
|
||||
import { Component, ChangeDetectionStrategy, Renderer2, inject, DOCUMENT, computed } from '@angular/core';
|
||||
import { Router, RouterLink, RouterLinkActive } from '@angular/router';
|
||||
import { CartService } from '../../services/cart.service';
|
||||
import { LanguageService } from '../../services/language.service';
|
||||
@@ -10,7 +10,7 @@ import { TranslatePipe } from '../../i18n/translate.pipe';
|
||||
import { UiRuntimeFacade } from '../../facades/runtime/ui-runtime.facade';
|
||||
import { UserExperienceFacade } from '../../facades/platform/user-experience.facade';
|
||||
import { ConfigService } from '../../core/config/config.service';
|
||||
import { DEFAULT_USER_EXPERIENCE_CONFIG } from '../../shared/models/config';
|
||||
import { DEFAULT_HEADER_CONFIG, DEFAULT_USER_EXPERIENCE_CONFIG } from '../../shared/models/config';
|
||||
|
||||
@Component({
|
||||
selector: 'app-header',
|
||||
@@ -33,7 +33,8 @@ export class HeaderComponent {
|
||||
|
||||
readonly wishlistCount = this.uxFacade.wishlistCount;
|
||||
readonly compareCount = this.uxFacade.compareCount;
|
||||
readonly userExperienceConfig = this.resolveUserExperienceConfig();
|
||||
readonly userExperienceConfig = computed(() => this.resolveUserExperienceConfig());
|
||||
readonly headerConfig = computed(() => this.resolveHeaderConfig());
|
||||
|
||||
constructor(private cartService: CartService, private router: Router) {
|
||||
this.cartItemCount = this.cartService.itemCount;
|
||||
@@ -127,6 +128,7 @@ export class HeaderComponent {
|
||||
}
|
||||
|
||||
private resolveUserExperienceConfig() {
|
||||
this.configService.bootstrapRevision();
|
||||
const raw = (this.configService.getBootstrapSnapshot() as any)?.userExperience ?? {};
|
||||
|
||||
return {
|
||||
@@ -142,6 +144,16 @@ export class HeaderComponent {
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
private resolveHeaderConfig() {
|
||||
this.configService.bootstrapRevision();
|
||||
const raw = (this.configService.getBootstrapSnapshot() as any)?.header ?? {};
|
||||
|
||||
return {
|
||||
...DEFAULT_HEADER_CONFIG,
|
||||
...raw,
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user