fix: require app template environment values

This commit is contained in:
2026-04-28 15:07:13 +00:00
parent 3da7e431c2
commit 0f5ce708d9
2 changed files with 13 additions and 2 deletions
+12 -1
View File
@@ -486,7 +486,7 @@ export class ObViewAppStore extends DeesElement {
@input=${(e: Event) => this.handleServiceDomainChange((e.target as HTMLInputElement).value)}
/>
<div style="font-size: 12px; color: var(--ci-shade-4, #71717a); margin-top: 6px;">
Optional. When configured, Onebox routes this domain to the deployed app.
Onebox routes this domain to the deployed app. Required when the app uses SERVICE_DOMAIN.
</div>
<div class="actions-row">
@@ -599,6 +599,17 @@ export class ObViewAppStore extends DeesElement {
const app = this.selectedApp;
const config = this.selectedAppConfig;
if (!app || !config) return;
const missingRequiredEnvVars = this.editableEnvVars.filter((envVarArg) => {
return envVarArg.required && !envVarArg.platformInjected && !envVarArg.value.trim();
});
if (missingRequiredEnvVars.length > 0) {
console.error(
`Missing required environment variables: ${missingRequiredEnvVars
.map((envVarArg) => envVarArg.key)
.join(', ')}`,
);
return;
}
const needsServiceDomain = (config.envVars || []).some((envVarArg) => {
return envVarArg.value?.includes('${SERVICE_DOMAIN}');
});