feat: add validation check to prevent document processing when names are missing
Build and Push Multi-Platform Images / build-and-push (push) Successful in 33s
Build and Push Multi-Platform Images / build-and-push (push) Successful in 33s
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
import { useCallback, useEffect, useMemo, useRef, useState, type ReactNode } from 'react';
|
||||
import { cloneElement, useCallback, useEffect, useMemo, useRef, useState, type ReactElement, type ReactNode } from 'react';
|
||||
import { WysiwygEditor, type WysiwygEditorHandle } from '../components/WysiwygEditor';
|
||||
import { useNavigate, useParams } from 'react-router-dom';
|
||||
import { Button, Dropdown, Empty, Form, Input, Modal, Popconfirm, Select, Space, Spin, Steps, Tag, Tooltip, Typography, message } from 'antd';
|
||||
@@ -1096,6 +1096,7 @@ export default function InboxDetailPage() {
|
||||
const canSplit = selectedPage !== currentDoc?.pages[0];
|
||||
const rotationCount = Object.keys(file.rotations ?? {}).length;
|
||||
const manualSplitCount = file.manualSplitPages.length;
|
||||
const canProcess = documents.length > 0 && documents.every((doc) => doc.belegname);
|
||||
const pendingEdits = file.deletedPages.length + rotationCount + manualSplitCount;
|
||||
const editsLabel = (() => {
|
||||
const parts: string[] = [];
|
||||
@@ -1121,8 +1122,11 @@ export default function InboxDetailPage() {
|
||||
style={{ marginLeft: 'auto' }}
|
||||
type="primary"
|
||||
icon={<DownOutlined />}
|
||||
disabled={documents.length === 0}
|
||||
onClick={() => setWizardOpen(true)}
|
||||
onClick={() => { if (canProcess) setWizardOpen(true); }}
|
||||
buttonsRender={([leftButton, rightButton]) => [
|
||||
cloneElement(leftButton as ReactElement<{ disabled?: boolean }>, { disabled: !canProcess }),
|
||||
rightButton,
|
||||
]}
|
||||
menu={{
|
||||
items: [
|
||||
{ key: 'save', label: 'Speichern', icon: <SaveOutlined /> },
|
||||
|
||||
Reference in New Issue
Block a user