feat(builder): add project editor
This commit is contained in:
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user