Compare commits

..

No commits in common. "39f1b31ac8aafaaa818402feded3d746a2d09e79" and "cc1048fcaa6339fe8f8c4f92e7529008a00e6345" have entirely different histories.

6 changed files with 18 additions and 67 deletions

View File

@ -691,11 +691,6 @@ body {
top: 1.5px;
}
.object-select .ant-select-selection-item .object-display-tag .iddisplay,
.ant-select-dropdown .object-display-tag .iddisplay {
margin-bottom: -1px;
}
.ant-select-tree-title .object-display-tag {
top: 0.5px;
}

View File

@ -36,11 +36,7 @@ const NewDocumentTemplate = ({ onOk, defaultValues }) => {
bordered={false}
isEditing={true}
required={false}
visibleProperties={{
content: false,
testObject: false,
referencedTemplates: false
}}
visibleProperties={{ content: false, testObject: false }}
objectData={objectData}
/>
)
@ -57,8 +53,7 @@ const NewDocumentTemplate = ({ onOk, defaultValues }) => {
_id: false,
_reference: false,
createdAt: false,
updatedAt: false,
referencedTemplates: false
updatedAt: false
}}
isEditing={false}
objectData={objectData}

View File

@ -1,48 +1,33 @@
import PropTypes from 'prop-types'
import ObjectDisplay from './ObjectDisplay'
import { Flex, Typography } from 'antd'
import ScrollBox from './ScrollBox'
import { Space, Typography } from 'antd'
const { Text } = Typography
const ObjectList = ({
value,
objectType,
style,
showHyperlink = false,
scrollHorizontal = false
}) => {
const ObjectList = ({ value, objectType, style, showHyperlink = false }) => {
if (!value || !Array.isArray(value) || value.length === 0) {
return <Text type='secondary'>n/a</Text>
}
const listContents = (
<Flex gap={'4px'} wrap={!scrollHorizontal} style={style} justify={'start'}>
return (
<Space size={'small'} wrap style={style}>
{value.map((item) => (
<div key={item._id} style={{ flexShrink: 0 }}>
<ObjectDisplay
object={item}
objectType={objectType}
showHyperlink={showHyperlink}
/>
</div>
<ObjectDisplay
object={item}
objectType={objectType}
key={item._id}
showHyperlink={showHyperlink}
/>
))}
</Flex>
</Space>
)
if (scrollHorizontal) {
return <ScrollBox horizontalBottomPadding={10}>{listContents}</ScrollBox>
} else {
return listContents
}
}
ObjectList.propTypes = {
value: PropTypes.array,
objectType: PropTypes.string,
style: PropTypes.object,
showHyperlink: PropTypes.bool,
scrollHorizontal: PropTypes.bool
showHyperlink: PropTypes.bool
}
export default ObjectList

View File

@ -480,7 +480,6 @@ const ObjectProperty = ({
value={value}
objectType={objectType}
showHyperlink={showHyperlink}
scrollHorizontal={inTable}
/>
)
}

View File

@ -28,11 +28,6 @@ const getOptionKey = (option) => {
const getDisplayValue = (option, property) => {
if (!property) return option
if (property.type === 'objectList') {
if (Array.isArray(option)) return option
if (option && typeof option === 'object' && option._id) return [option]
if (option != null) return [{ _id: option }]
}
if (property.type === 'object') {
if (option && typeof option === 'object' && option._id) return option
if (option != null) return { _id: option }

View File

@ -5,8 +5,7 @@ const DocumentTemplateInfo = lazy(
import('../../components/Dashboard/Management/DocumentTemplates/DocumentTemplateInfo')
)
const NewDocumentTemplate = lazy(
() =>
import('../../components/Dashboard/Management/DocumentTemplates/NewDocumentTemplate')
() => import('../../components/Dashboard/Management/DocumentTemplates/NewDocumentTemplate')
)
import InfoCircleIcon from '../../components/Icons/InfoCircleIcon'
import PlusIcon from '../../components/Icons/PlusIcon'
@ -33,11 +32,7 @@ export const DocumentTemplate = {
label: 'New Document Template',
icon: PlusIcon,
content: (objectData, { onOk } = {}) => {
return createElement(NewDocumentTemplate, {
defaultValues: objectData,
onOk,
reset: true
})
return createElement(NewDocumentTemplate, { defaultValues: objectData, onOk, reset: true })
}
},
{
@ -111,7 +106,6 @@ export const DocumentTemplate = {
'tags',
'parent',
'documentSize',
'referencedTemplates',
'createdAt',
'updatedAt'
],
@ -122,7 +116,6 @@ export const DocumentTemplate = {
'global',
'parent',
'documentSize',
'referencedTemplates',
'objectType',
'createdAt',
'updatedAt',
@ -185,7 +178,7 @@ export const DocumentTemplate = {
label: 'Object Type',
required: true,
type: 'objectType',
columnWidth: 180,
columnWidth: 150,
empty: (documentTemplate) => {
return documentTemplate.global
}
@ -228,7 +221,7 @@ export const DocumentTemplate = {
masterFilter: { global: true, active: true },
objectType: 'documentTemplate',
showHyperlink: true,
columnWidth: 230,
columnWidth: 200,
empty: (documentTemplate) => {
return documentTemplate.global
}
@ -238,20 +231,9 @@ export const DocumentTemplate = {
label: 'Document Printers',
required: false,
type: 'objectList',
columnWidth: 230,
objectType: 'documentPrinter',
showHyperlink: true
},
{
name: 'referencedTemplates',
label: 'Referenced Templates',
required: false,
type: 'objectList',
columnWidth: 230,
objectType: 'documentTemplate',
readOnly: true,
showHyperlink: true
},
{
name: 'content',
label: 'Content',