diff --git a/src/components/Dashboard/common/ObjectProperty.jsx b/src/components/Dashboard/common/ObjectProperty.jsx
index 38d6e71..ce531d5 100644
--- a/src/components/Dashboard/common/ObjectProperty.jsx
+++ b/src/components/Dashboard/common/ObjectProperty.jsx
@@ -20,14 +20,10 @@ import CountrySelect from './CountrySelect'
import TagsDisplay from './TagsDisplay'
import TagsInput from './TagsInput'
import BoolDisplay from './BoolDisplay'
-import PrinterState from './PrinterState'
-import SubJobState from './SubJobState'
-import JobState from './JobState'
import ColorSelector from './ColorSelector'
import SecretDisplay from './SecretDisplay'
import EyeIcon from '../../Icons/EyeIcon'
import EyeSlashIcon from '../../Icons/EyeSlashIcon'
-import FilamentStockState from './FilamentStockState'
import { getPropertyValue } from '../../../database/ObjectModels'
import PropertyChanges from './PropertyChanges'
import NetGrossDisplay from './NetGrossDisplay'
@@ -38,6 +34,10 @@ import OperationDisplay from './OperationDisplay'
import MarkdownDisplay from './MarkdownDisplay'
import ObjectSelect from './ObjectSelect'
import ObjectDisplay from './ObjectDisplay'
+import ObjectTypeSelect from './ObjectTypeSelect'
+import ObjectTypeDisplay from './ObjectTypeDisplay'
+import CodeBlockEditor from './CodeBlockEditor'
+import StateDisplay from './StateDisplay'
const { Text } = Typography
@@ -65,11 +65,16 @@ const ObjectProperty = ({
name,
label,
showLabel = false,
+ masterFilter = {},
+ language = '',
objectData = null,
objectType = 'unknown',
readOnly = false,
disabled = false,
+ empty = false,
initial = false,
+ height = 'auto',
+ minimal = false,
...rest
}) => {
if (value && typeof value == 'function' && objectData) {
@@ -84,6 +89,10 @@ const ObjectProperty = ({
disabled = disabled(objectData)
}
+ if (empty && typeof empty == 'function' && objectData) {
+ empty = empty(objectData)
+ }
+
if (difference && typeof difference == 'function' && objectData) {
difference = difference(objectData)
}
@@ -114,6 +123,9 @@ const ObjectProperty = ({
}
const renderProperty = () => {
+ if (empty == true) {
+ return n/a
+ }
if (!isEditing || (readOnly && !initial)) {
switch (type) {
case 'netGross':
@@ -256,6 +268,24 @@ const ObjectProperty = ({
)
}
+ case 'codeBlock':
+ if (value != null && value != '') {
+ return (
+
+ )
+ } else {
+ return (
+
+ n/a
+
+ )
+ }
case 'markdown':
if (value != null && value != '') {
return
@@ -297,27 +327,23 @@ const ObjectProperty = ({
)
}
}
+ case 'objectType': {
+ if (value) {
+ return
+ } else {
+ return (
+
+ n/a
+
+ )
+ }
+ }
case 'objectList': {
return
}
case 'state': {
if (value && value?.type) {
- switch (objectType) {
- case 'printer':
- return
- case 'job':
- return
- case 'subJob':
- return
- case 'filamentStock':
- return
- default:
- return (
-
- No Object Type Specified
-
- )
- }
+ return
} else {
return (
@@ -566,6 +592,18 @@ const ObjectProperty = ({
/>
)
+ case 'codeBlock':
+ return (
+
+
+
+ )
case 'material':
return (
@@ -590,13 +628,23 @@ const ObjectProperty = ({
case 'object':
return (
-
+
+
+ )
+ case 'objectType':
+ return (
+
+
)
case 'objectList':
return (
-
+
)
case 'tags':
@@ -624,8 +672,10 @@ ObjectProperty.propTypes = {
value: PropTypes.oneOfType([PropTypes.any, PropTypes.func]),
isEditing: PropTypes.bool,
formItemProps: PropTypes.object,
+ masterFilter: PropTypes.object,
required: PropTypes.bool,
name: PropTypes.string,
+ language: PropTypes.string,
prefix: PropTypes.oneOfType([PropTypes.string, PropTypes.func]),
suffix: PropTypes.oneOfType([PropTypes.string, PropTypes.func]),
min: PropTypes.number,
@@ -635,8 +685,10 @@ ObjectProperty.propTypes = {
objectType: PropTypes.oneOfType([PropTypes.string, PropTypes.func]),
readOnly: PropTypes.bool,
disabled: PropTypes.oneOfType([PropTypes.bool, PropTypes.func]),
+ empty: PropTypes.oneOfType([PropTypes.bool, PropTypes.func]),
difference: PropTypes.oneOfType([PropTypes.any, PropTypes.func]),
- objectData: PropTypes.object
+ objectData: PropTypes.object,
+ height: PropTypes.string
}
export default ObjectProperty
diff --git a/src/components/Dashboard/common/PrinterState.jsx b/src/components/Dashboard/common/StateDisplay.jsx
similarity index 75%
rename from src/components/Dashboard/common/PrinterState.jsx
rename to src/components/Dashboard/common/StateDisplay.jsx
index dca0b84..bf0c1c9 100644
--- a/src/components/Dashboard/common/PrinterState.jsx
+++ b/src/components/Dashboard/common/StateDisplay.jsx
@@ -4,7 +4,7 @@ import { Progress, Flex, Space } from 'antd'
import React from 'react'
import StateTag from './StateTag'
-const PrinterState = ({ state, showProgress = true, showState = true }) => {
+const StateDisplay = ({ state, showProgress = true, showState = true }) => {
const currentState = state || {
type: 'unknown',
progress: 0
@@ -17,9 +17,7 @@ const PrinterState = ({ state, showProgress = true, showState = true }) => {
)}
- {showProgress &&
- (currentState.type === 'printing' ||
- currentState.type === 'deploying') ? (
+ {showProgress && currentState?.progress && currentState?.progress > 0 ? (
) : null}
- {model.type == 'printer' ? (
-
) : null}
- {model.type == 'job' ? (
-
- ) : null}
- {model.type == 'subjob' ? (
-
- ) : null}
- {model.type == 'filamentstock' ? (
-
-
-
- ) : null}