feat(builder): add project editor

This commit is contained in:
sdarbinyan
2026-07-10 13:43:53 +04:00
parent 7161a81068
commit e2c8747fcc
50 changed files with 1656 additions and 42 deletions

View File

@@ -1,6 +1,6 @@
import { Injectable, signal } from '@angular/core';
import { take } from 'rxjs/operators';
import { Injectable, effect, signal } from '@angular/core';
import { ConfigService } from '../../core/config/config.service';
import { BootstrapConfig } from '../../shared/models/config';
interface UiRuntimeState {
marketplaceName: string;
@@ -21,17 +21,25 @@ export class UiRuntimeFacade {
});
constructor(private readonly configService: ConfigService) {
this.configService.loadBootstrap().pipe(take(1)).subscribe({
next: (bootstrap) => {
this.state.set({
marketplaceName: bootstrap.branding.brandName,
marketplaceDisplayName: bootstrap.branding.brandName,
logoUrl: bootstrap.branding.logoUrl,
contactEmail: bootstrap.branding.supportEmail ?? '',
themeId: bootstrap.theme.themeId
});
effect(() => {
this.configService.bootstrapRevision();
const bootstrap = this.configService.getBootstrapSnapshot();
if (bootstrap) {
this.reloadFromBootstrap(bootstrap);
}
});
this.configService.loadBootstrap().subscribe();
}
reloadFromBootstrap(bootstrap: BootstrapConfig): void {
this.state.set({
marketplaceName: bootstrap.branding.brandName,
marketplaceDisplayName: bootstrap.branding.brandName,
logoUrl: bootstrap.branding.logoUrl,
contactEmail: bootstrap.branding.supportEmail ?? bootstrap.company?.contacts?.email ?? '',
themeId: bootstrap.theme.themeId
});
}
marketplaceName(): string {