diff --git a/apps/web/src/app/(private)/projects/[projectId]/versions/[commitUuid]/_components/Sidebar/PublishDraftCommitModal/index.tsx b/apps/web/src/app/(private)/projects/[projectId]/versions/[commitUuid]/_components/Sidebar/PublishDraftCommitModal/index.tsx index 86040781d..4f6987534 100644 --- a/apps/web/src/app/(private)/projects/[projectId]/versions/[commitUuid]/_components/Sidebar/PublishDraftCommitModal/index.tsx +++ b/apps/web/src/app/(private)/projects/[projectId]/versions/[commitUuid]/_components/Sidebar/PublishDraftCommitModal/index.tsx @@ -224,14 +224,16 @@ function confirmDescription({ isLoading, anyChanges, hasErrors, + title, }: { anyChanges: boolean hasErrors: boolean isLoading: boolean + title: string }) { if (isLoading) return undefined if (!anyChanges) return 'No changes to publish.' - + if (!title.trim()) return 'Please provide a version name.' if (hasErrors) return 'Some documents has errors, please click on those documents to see the errors.' return 'Publishing a new version will update all your prompts in production.' @@ -335,14 +337,20 @@ export default function PublishDraftCommitModal({ } confirm={{ label: isLoading ? 'Validating...' : 'Publish to production', - description: confirmDescription({ isLoading, anyChanges, hasErrors }), - disabled: isLoading || hasErrors, + description: confirmDescription({ + isLoading, + anyChanges, + hasErrors, + title, + }), + disabled: isLoading || hasErrors || !title.trim(), isConfirming: isPublishing, }} >
setTitle(e.target.value)}