fix: allow app creation without JAR when deploy is disabled
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:
@@ -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 });
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user