Added DocumentPrintButton to PrinterInfo component and updated objectData handling.

This commit is contained in:
Tom Butcher 2025-09-05 23:13:19 +01:00
parent 27a7acf68f
commit 6fedb9739f

View File

@ -19,6 +19,7 @@ import ActionHandler from '../../common/ActionHandler.jsx'
import ObjectActions from '../../common/ObjectActions.jsx' import ObjectActions from '../../common/ObjectActions.jsx'
import ObjectTable from '../../common/ObjectTable.jsx' import ObjectTable from '../../common/ObjectTable.jsx'
import InfoCollapsePlaceholder from '../../common/InfoCollapsePlaceholder.jsx' import InfoCollapsePlaceholder from '../../common/InfoCollapsePlaceholder.jsx'
import DocumentPrintButton from '../../common/DocumentPrintButton.jsx'
const log = loglevel.getLogger('PrinterInfo') const log = loglevel.getLogger('PrinterInfo')
log.setLevel(config.logLevel) log.setLevel(config.logLevel)
@ -40,7 +41,8 @@ const PrinterInfo = () => {
editLoading: false, editLoading: false,
formValid: false, formValid: false,
locked: false, locked: false,
loading: false loading: false,
objectData: {}
}) })
const actions = { const actions = {
@ -80,6 +82,7 @@ const PrinterInfo = () => {
type='printer' type='printer'
id={printerId} id={printerId}
disabled={objectFormState.loading} disabled={objectFormState.loading}
objectData={objectFormState.objectData}
/> />
<ViewButton <ViewButton
disabled={objectFormState.loading} disabled={objectFormState.loading}
@ -91,6 +94,11 @@ const PrinterInfo = () => {
visibleState={collapseState} visibleState={collapseState}
updateVisibleState={updateCollapseState} updateVisibleState={updateCollapseState}
/> />
<DocumentPrintButton
type='printer'
objectData={objectFormState.objectData}
disabled={objectFormState.loading}
/>
</Space> </Space>
<LockIndicator lock={objectFormState.lock} /> <LockIndicator lock={objectFormState.lock} />
</Space> </Space>
@ -146,6 +154,15 @@ const PrinterInfo = () => {
isEditing={isEditing} isEditing={isEditing}
type='printer' type='printer'
objectData={objectData} objectData={objectData}
visibleProperties={{
currentFilamentStock: false,
'currentFilamentStock._id': false,
currentJob: false,
'currentJob._id': false,
currentSubJob: false,
'currentSubJob._id': false,
alerts: false
}}
/> />
) )
}} }}