feat(builder): add project editor
This commit is contained in:
@@ -1,11 +1,11 @@
|
||||
import { Component, ChangeDetectionStrategy, signal } from '@angular/core';
|
||||
import { take } from 'rxjs/operators';
|
||||
import { Component, ChangeDetectionStrategy, effect, inject, signal } from '@angular/core';
|
||||
import { RouterLink } from '@angular/router';
|
||||
import { TranslatePipe } from '../../i18n/translate.pipe';
|
||||
import { LogoComponent } from '../logo/logo.component';
|
||||
import { UiRuntimeFacade } from '../../facades/runtime/ui-runtime.facade';
|
||||
import { LangRoutePipe } from '../../pipes/lang-route.pipe';
|
||||
import { FooterPaymentIcon, FooterResolvedGroup, FooterResolverService } from '../../core/config/footer-resolver.service';
|
||||
import { ConfigService } from '../../core/config/config.service';
|
||||
|
||||
@Component({
|
||||
selector: 'app-footer',
|
||||
@@ -19,22 +19,29 @@ export class FooterComponent {
|
||||
readonly paymentIcons = signal<FooterPaymentIcon[]>([]);
|
||||
readonly copyrightText = signal('');
|
||||
|
||||
private readonly configService = inject(ConfigService);
|
||||
|
||||
constructor(
|
||||
private readonly uiRuntime: UiRuntimeFacade,
|
||||
private readonly footerResolver: FooterResolverService
|
||||
) {
|
||||
this.footerResolver.resolveFooterModel().pipe(take(1)).subscribe({
|
||||
next: model => {
|
||||
this.footerGroups.set(model.groups);
|
||||
this.paymentIcons.set(model.paymentIcons);
|
||||
this.copyrightText.set(model.copyrightText);
|
||||
},
|
||||
error: () => {
|
||||
effect(() => {
|
||||
this.configService.bootstrapRevision();
|
||||
const bootstrap = this.configService.getBootstrapSnapshot();
|
||||
if (!bootstrap) {
|
||||
this.footerGroups.set([]);
|
||||
this.paymentIcons.set([]);
|
||||
this.copyrightText.set('');
|
||||
return;
|
||||
}
|
||||
|
||||
const model = this.footerResolver.resolveFooterModelFromBootstrap(bootstrap);
|
||||
this.footerGroups.set(model.groups);
|
||||
this.paymentIcons.set(model.paymentIcons);
|
||||
this.copyrightText.set(model.copyrightText);
|
||||
});
|
||||
|
||||
this.configService.loadBootstrap().subscribe();
|
||||
}
|
||||
|
||||
currentYear = new Date().getFullYear();
|
||||
|
||||
Reference in New Issue
Block a user