Adds website theme serialization system

This commit is contained in:
Your Name
2026-07-06 06:52:18 +00:00
parent b932d65658
commit 8cd54459ec
29 changed files with 418 additions and 4 deletions
+35
View File
@@ -13,6 +13,7 @@ import { Underwriter } from '../interfaces/underwriter';
import {
MobileBuildDefaults,
MobileBuildRequest,
ThemeStatus,
} from '../interfaces/mobile-build';
import { ShowService } from '../services/show.service';
import { EventService } from '../services/event.service';
@@ -126,6 +127,10 @@ export class AdminComponent implements OnInit {
mobileBuildPreflightIssues: string[] = [];
mobileBuildBusy = false;
// ── Theme JSON status (mobile build tab) ────────────────────
readonly themeJsonStatus$ = new BehaviorSubject<ThemeStatus | null>(null);
readonly themeJsonLoading$ = new BehaviorSubject<boolean>(false);
buildAndroid = true;
buildIos = true;
androidApplicationId = '';
@@ -412,6 +417,36 @@ export class AdminComponent implements OnInit {
this.onMobileBuildSelected(this.selectedMobileBuildId);
}
// ── Theme JSON status ──────────────────────────────────────
async loadThemeJsonStatus(): Promise<void> {
try {
this.themeJsonLoading$.next(true);
this.themeJsonStatus$.next(await firstValueFrom(
this.mobileBuildService.getThemeStatus(),
));
} catch {
this.themeJsonStatus$.next(null);
} finally {
this.themeJsonLoading$.next(false);
}
}
async regenerateThemeJson(): Promise<void> {
try {
this.themeJsonLoading$.next(true);
await firstValueFrom(this.mobileBuildService.regenerateTheme());
await this.loadThemeJsonStatus();
} catch (err) {
this.mobileBuildErrorMessage = this.getErrorMessage(
err,
'Failed to regenerate theme.json.',
);
} finally {
this.themeJsonLoading$.next(false);
}
}
getArtifactDownloadHref(path: string): string {
return `${getAppConfig().apiBaseUrl}${path}`;
}