diff --git a/src/app/[id]/versions/VersionCard.tsx b/src/app/[id]/versions/VersionCard.tsx index 4045b825..30a35625 100644 --- a/src/app/[id]/versions/VersionCard.tsx +++ b/src/app/[id]/versions/VersionCard.tsx @@ -17,6 +17,7 @@ import { getFileContent } from '@/lib/utils'; import { Step } from '../store'; import DragAndDropFile from '@/app/components/DragAndDropFile'; import { useEmlStore } from '@/lib/stores/useEmlStore'; +import { Checkbox } from '@/components/ui/checkbox'; interface VersionCardProps { blueprint: Blueprint; @@ -533,6 +534,17 @@ const VersionCard = ({ router.push(`/create/${blueprint.props.id}`); }} /> +
+ { + router.push(`/create/${blueprint.props.id}?skipEmlUpload=true`); + }} + /> +

+ Skip EML upload and use the default .eml file +

+
)} diff --git a/src/app/create/[id]/page.tsx b/src/app/create/[id]/page.tsx index 1b0fd667..9700d78a 100644 --- a/src/app/create/[id]/page.tsx +++ b/src/app/create/[id]/page.tsx @@ -31,6 +31,7 @@ const CreateBlueprint = ({ params }: { params: Promise<{ id: string }> }) => { const { id } = use(params); const router = useRouter(); const store = useCreateBlueprintStore(); + const searchParams = useSearchParams(); const posthog = usePostHog(); const pathname = usePathname(); const token = useAuthStore((state) => state.token); @@ -71,9 +72,8 @@ const CreateBlueprint = ({ params }: { params: Promise<{ id: string }> }) => { const [isConfirmInputsUpdateModalOpen, setIsConfirmInputsUpdateModalOpen] = useState(false); const [isUpdateInputsLoading, setIsUpdateInputsLoading] = useState(false); const [isNextButtonClicked, setIsNextButtonClicked] = useState(false); - const [skipEmlUpload, setSkipEmlUpload] = useState(false); + const [skipEmlUpload, setSkipEmlUpload] = useState(searchParams.get('skipEmlUpload') === 'true' ? true : false); - const searchParams = useSearchParams(); let step = searchParams.get('step') || '0'; const setStep = (step: Step, id?: string) => { @@ -312,12 +312,12 @@ const CreateBlueprint = ({ params }: { params: Promise<{ id: string }> }) => { console.log('skipEmlUpload', skipEmlUpload); if (step === '1') { return ( - !store.emailQuery || !store.emailBodyMaxLength || store.ignoreBodyHashCheck === undefined + !store.emailQuery || (!store.emailBodyMaxLength && store.ignoreBodyHashCheck) || store.ignoreBodyHashCheck === undefined ); } if (step === '2') { - return !store.decomposedRegexes.length; + return !store.decomposedRegexes.length || !skipEmlUpload; } return !!errors.length || isDKIMMissing;