Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions src/app/[id]/versions/VersionCard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -533,6 +534,17 @@ const VersionCard = ({
router.push(`/create/${blueprint.props.id}`);
}}
/>
<div className="flex items-center gap-2 w-full">
<Checkbox
checked={false}
onCheckedChange={(checked) => {
router.push(`/create/${blueprint.props.id}?skipEmlUpload=true`);
}}
/>
<p className="text-sm text-grey-700">
Skip EML upload and use the default .eml file
</p>
</div>
</div>
)}
</div>
Expand Down
8 changes: 4 additions & 4 deletions src/app/create/[id]/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -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) => {
Expand Down Expand Up @@ -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;
Expand Down
Loading