diff --git a/src/components/Dashboard/Management/DocumentJobs/NewDocumentJob.jsx b/src/components/Dashboard/Management/DocumentJobs/NewDocumentJob.jsx index 94b5704..022c248 100644 --- a/src/components/Dashboard/Management/DocumentJobs/NewDocumentJob.jsx +++ b/src/components/Dashboard/Management/DocumentJobs/NewDocumentJob.jsx @@ -68,12 +68,14 @@ const NewDocumentJob = ({ onOk, defaultValues = {} }) => { } onSubmit={async () => { const newDocumentJob = await handleSubmit() - if (newDocumentJob.sendToFile == true) { - sendObjectAction(newDocumentJob._id, 'documentJob', { - type: 'print', + await sendObjectAction( + newDocumentJob.documentPrinter._id, + 'documentPrinter', + { + type: 'deploy', data: newDocumentJob - }) - } + } + ) if (onOk) { onOk() } diff --git a/src/components/Dashboard/Management/Hosts/HostInfo.jsx b/src/components/Dashboard/Management/Hosts/HostInfo.jsx index f52759a..8ee402a 100644 --- a/src/components/Dashboard/Management/Hosts/HostInfo.jsx +++ b/src/components/Dashboard/Management/Hosts/HostInfo.jsx @@ -22,6 +22,7 @@ import InfoCollapsePlaceholder from '../../common/InfoCollapsePlaceholder.jsx' import HostOTP from './HostOtp.jsx' import DocumentPrintButton from '../../common/DocumentPrintButton.jsx' import PrinterIcon from '../../../Icons/PrinterIcon.jsx' +import DocumentPrinterIcon from '../../../Icons/DocumentPrinterIcon.jsx' const log = loglevel.getLogger('HostInfo') log.setLevel(config.logLevel) @@ -34,6 +35,7 @@ const HostInfo = () => { const [collapseState, updateCollapseState] = useCollapseState('HostInfo', { info: true, printers: true, + documentPrinters: true, notes: true, auditLogs: true }) @@ -95,6 +97,7 @@ const HostInfo = () => { items={[ { key: 'info', label: 'Host Information' }, { key: 'printers', label: 'Printers' }, + { key: 'documentPrinters', label: 'Document Printers' }, { key: 'notes', label: 'Notes' }, { key: 'auditLogs', label: 'Audit Logs' } ]} @@ -149,7 +152,6 @@ const HostInfo = () => { style={{ height: '100%' }} ref={objectFormRef} onStateChange={(state) => { - console.log('Got edit form state change', state) setEditFormState((prev) => ({ ...prev, ...state })) }} > @@ -188,6 +190,28 @@ const HostInfo = () => { /> )} + } + active={collapseState.documentPrinters} + onToggle={(expanded) => + updateCollapseState('documentPrinters', expanded) + } + collapseKey='documentPrinters' + > + {objectFormState.loading ? ( + + ) : ( + + )} + { if (value && typeof value == 'function' && objectData) { @@ -117,6 +119,9 @@ const ObjectProperty = ({ if (masterFilter && typeof masterFilter == 'function' && objectData) { masterFilter = masterFilter(objectData) } + if (options && typeof options == 'function' && objectData) { + options = options(objectData) + } if (!value) { value = getPropertyValue(objectData, name) @@ -169,8 +174,9 @@ const ObjectProperty = ({ ) } case 'select': { - const selectValue = options.find((option) => option.value === value) - if (selectValue) { + if (options && Array.isArray(options)) { + const selectValue = + options.find((option) => option.value === value) || 'n/a' return {selectValue.label} } else { return ( @@ -206,7 +212,9 @@ const ObjectProperty = ({ } case 'dateTime': { if (value != null) { - return + return ( + + ) } else { return ( @@ -249,7 +257,7 @@ const ObjectProperty = ({ ) } else { var roundedValue = value - if (roundNumber != false) { + if (roundNumber != false && typeof value === 'number') { roundedValue = value.toFixed(roundNumber) } @@ -508,7 +516,10 @@ const ObjectProperty = ({ // Editable mode: wrap in Form.Item // Merge required rule if needed - let mergedFormItemProps = { ...formItemProps, style: { flexGrow: 1 } } + let mergedFormItemProps = { + ...formItemProps, + style: { flexGrow: 1, width: '100%' } + } if (required && disabled == false) { let rules if (mergedFormItemProps.rules) { @@ -575,11 +586,10 @@ const ObjectProperty = ({ case 'select': return ( -