fix: require app template environment values
This commit is contained in:
File diff suppressed because one or more lines are too long
@@ -486,7 +486,7 @@ export class ObViewAppStore extends DeesElement {
|
|||||||
@input=${(e: Event) => this.handleServiceDomainChange((e.target as HTMLInputElement).value)}
|
@input=${(e: Event) => this.handleServiceDomainChange((e.target as HTMLInputElement).value)}
|
||||||
/>
|
/>
|
||||||
<div style="font-size: 12px; color: var(--ci-shade-4, #71717a); margin-top: 6px;">
|
<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>
|
||||||
|
|
||||||
<div class="actions-row">
|
<div class="actions-row">
|
||||||
@@ -599,6 +599,17 @@ export class ObViewAppStore extends DeesElement {
|
|||||||
const app = this.selectedApp;
|
const app = this.selectedApp;
|
||||||
const config = this.selectedAppConfig;
|
const config = this.selectedAppConfig;
|
||||||
if (!app || !config) return;
|
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) => {
|
const needsServiceDomain = (config.envVars || []).some((envVarArg) => {
|
||||||
return envVarArg.value?.includes('${SERVICE_DOMAIN}');
|
return envVarArg.value?.includes('${SERVICE_DOMAIN}');
|
||||||
});
|
});
|
||||||
|
|||||||
Reference in New Issue
Block a user