fix: allow app creation without JAR when deploy is disabled
All checks were successful
CI / cleanup-branch (push) Has been skipped
CI / build (push) Successful in 1m21s
CI / docker (push) Successful in 1m7s
CI / deploy-feature (push) Has been skipped
CI / deploy (push) Successful in 36s

canSubmit no longer requires a JAR file when "Create only" is selected.
JAR upload and deploy steps are skipped when no file is provided.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
hsiegeln
2026-04-15 20:38:53 +02:00
parent 457650012b
commit e4b8f1bab4

View File

@@ -251,7 +251,7 @@ function CreateAppView({ environments, selectedEnv }: { environments: Environmen
if (p && !ports.includes(p)) { setPorts([...ports, p]); setNewPort(''); } if (p && !ports.includes(p)) { setPorts([...ports, p]); setNewPort(''); }
} }
const canSubmit = name.trim() && slug.trim() && envId && file; const canSubmit = name.trim() && slug.trim() && envId && (file || !deploy);
async function handleSubmit() { async function handleSubmit() {
if (!canSubmit) return; if (!canSubmit) return;
@@ -261,9 +261,12 @@ function CreateAppView({ environments, selectedEnv }: { environments: Environmen
setStep('Creating app...'); setStep('Creating app...');
const app = await createApp.mutateAsync({ environmentId: envId, slug: slug.trim(), displayName: name.trim() }); const app = await createApp.mutateAsync({ environmentId: envId, slug: slug.trim(), displayName: name.trim() });
// 2. Upload JAR // 2. Upload JAR (if provided)
setStep('Uploading JAR...'); let version: AppVersion | null = null;
const version = await uploadJar.mutateAsync({ appId: app.slug, file: file! }); if (file) {
setStep('Uploading JAR...');
version = await uploadJar.mutateAsync({ appId: app.slug, file });
}
// 3. Save container config // 3. Save container config
setStep('Saving configuration...'); setStep('Saving configuration...');
@@ -307,8 +310,8 @@ function CreateAppView({ environments, selectedEnv }: { environments: Environmen
environment: selectedEnv, environment: selectedEnv,
}); });
// 5. Deploy (if requested) // 5. Deploy (if requested and JAR was uploaded)
if (deploy) { if (deploy && version) {
setStep('Starting deployment...'); setStep('Starting deployment...');
await createDeployment.mutateAsync({ appId: app.slug, appVersionId: version.id, environmentId: envId }); await createDeployment.mutateAsync({ appId: app.slug, appVersionId: version.id, environmentId: envId });
} }