cleanup: remove tenant variant logic and enforce config-driven UI

This commit is contained in:
sdarbinyan
2026-07-05 04:07:25 +04:00
parent 79a12c0ec2
commit 6550250d13
19 changed files with 153 additions and 1102 deletions

View File

@@ -1,7 +1,6 @@
import { Injectable, signal } from '@angular/core';
import { take } from 'rxjs/operators';
import { ConfigService } from '../../core/config/config.service';
import { environment } from '../../../environments/environment';
interface UiRuntimeState {
marketplaceName: string;
@@ -9,18 +8,16 @@ interface UiRuntimeState {
logoUrl: string;
contactEmail: string;
themeId: string;
marketplaceVariant: string;
}
@Injectable({ providedIn: 'root' })
export class UiRuntimeFacade {
private readonly state = signal<UiRuntimeState>({
marketplaceName: environment.brandName,
marketplaceDisplayName: environment.brandFullName,
logoUrl: environment.logo,
contactEmail: environment.contactEmail,
themeId: environment.theme,
marketplaceVariant: this.resolveMarketplaceVariant(environment.theme)
marketplaceName: '',
marketplaceDisplayName: '',
logoUrl: '',
contactEmail: '',
themeId: ''
});
constructor(private readonly configService: ConfigService) {
@@ -30,9 +27,8 @@ export class UiRuntimeFacade {
marketplaceName: bootstrap.branding.brandName,
marketplaceDisplayName: bootstrap.branding.brandName,
logoUrl: bootstrap.branding.logoUrl,
contactEmail: bootstrap.branding.supportEmail ?? environment.contactEmail,
themeId: bootstrap.theme.themeId,
marketplaceVariant: this.resolveMarketplaceVariant(bootstrap.theme.themeId)
contactEmail: bootstrap.branding.supportEmail ?? '',
themeId: bootstrap.theme.themeId
});
}
});
@@ -57,17 +53,4 @@ export class UiRuntimeFacade {
themeId(): string {
return this.state().themeId;
}
marketplaceVariant(): string {
return this.state().marketplaceVariant;
}
isMarketplaceVariant(variant: string): boolean {
return this.marketplaceVariant() === variant;
}
private resolveMarketplaceVariant(themeId: string): string {
void themeId;
return 'default';
}
}