Compare commits
3 Commits
cc1048fcaa
...
39f1b31ac8
| Author | SHA1 | Date | |
|---|---|---|---|
| 39f1b31ac8 | |||
| b917636bf1 | |||
| 39d5206130 |
@ -691,6 +691,11 @@ body {
|
|||||||
top: 1.5px;
|
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 {
|
.ant-select-tree-title .object-display-tag {
|
||||||
top: 0.5px;
|
top: 0.5px;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -36,7 +36,11 @@ const NewDocumentTemplate = ({ onOk, defaultValues }) => {
|
|||||||
bordered={false}
|
bordered={false}
|
||||||
isEditing={true}
|
isEditing={true}
|
||||||
required={false}
|
required={false}
|
||||||
visibleProperties={{ content: false, testObject: false }}
|
visibleProperties={{
|
||||||
|
content: false,
|
||||||
|
testObject: false,
|
||||||
|
referencedTemplates: false
|
||||||
|
}}
|
||||||
objectData={objectData}
|
objectData={objectData}
|
||||||
/>
|
/>
|
||||||
)
|
)
|
||||||
@ -53,7 +57,8 @@ const NewDocumentTemplate = ({ onOk, defaultValues }) => {
|
|||||||
_id: false,
|
_id: false,
|
||||||
_reference: false,
|
_reference: false,
|
||||||
createdAt: false,
|
createdAt: false,
|
||||||
updatedAt: false
|
updatedAt: false,
|
||||||
|
referencedTemplates: false
|
||||||
}}
|
}}
|
||||||
isEditing={false}
|
isEditing={false}
|
||||||
objectData={objectData}
|
objectData={objectData}
|
||||||
|
|||||||
@ -1,33 +1,48 @@
|
|||||||
import PropTypes from 'prop-types'
|
import PropTypes from 'prop-types'
|
||||||
import ObjectDisplay from './ObjectDisplay'
|
import ObjectDisplay from './ObjectDisplay'
|
||||||
import { Space, Typography } from 'antd'
|
import { Flex, Typography } from 'antd'
|
||||||
|
import ScrollBox from './ScrollBox'
|
||||||
|
|
||||||
const { Text } = Typography
|
const { Text } = Typography
|
||||||
|
|
||||||
const ObjectList = ({ value, objectType, style, showHyperlink = false }) => {
|
const ObjectList = ({
|
||||||
|
value,
|
||||||
|
objectType,
|
||||||
|
style,
|
||||||
|
showHyperlink = false,
|
||||||
|
scrollHorizontal = false
|
||||||
|
}) => {
|
||||||
if (!value || !Array.isArray(value) || value.length === 0) {
|
if (!value || !Array.isArray(value) || value.length === 0) {
|
||||||
return <Text type='secondary'>n/a</Text>
|
return <Text type='secondary'>n/a</Text>
|
||||||
}
|
}
|
||||||
|
|
||||||
return (
|
const listContents = (
|
||||||
<Space size={'small'} wrap style={style}>
|
<Flex gap={'4px'} wrap={!scrollHorizontal} style={style} justify={'start'}>
|
||||||
{value.map((item) => (
|
{value.map((item) => (
|
||||||
<ObjectDisplay
|
<div key={item._id} style={{ flexShrink: 0 }}>
|
||||||
object={item}
|
<ObjectDisplay
|
||||||
objectType={objectType}
|
object={item}
|
||||||
key={item._id}
|
objectType={objectType}
|
||||||
showHyperlink={showHyperlink}
|
showHyperlink={showHyperlink}
|
||||||
/>
|
/>
|
||||||
|
</div>
|
||||||
))}
|
))}
|
||||||
</Space>
|
</Flex>
|
||||||
)
|
)
|
||||||
|
|
||||||
|
if (scrollHorizontal) {
|
||||||
|
return <ScrollBox horizontalBottomPadding={10}>{listContents}</ScrollBox>
|
||||||
|
} else {
|
||||||
|
return listContents
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
ObjectList.propTypes = {
|
ObjectList.propTypes = {
|
||||||
value: PropTypes.array,
|
value: PropTypes.array,
|
||||||
objectType: PropTypes.string,
|
objectType: PropTypes.string,
|
||||||
style: PropTypes.object,
|
style: PropTypes.object,
|
||||||
showHyperlink: PropTypes.bool
|
showHyperlink: PropTypes.bool,
|
||||||
|
scrollHorizontal: PropTypes.bool
|
||||||
}
|
}
|
||||||
|
|
||||||
export default ObjectList
|
export default ObjectList
|
||||||
|
|||||||
@ -480,6 +480,7 @@ const ObjectProperty = ({
|
|||||||
value={value}
|
value={value}
|
||||||
objectType={objectType}
|
objectType={objectType}
|
||||||
showHyperlink={showHyperlink}
|
showHyperlink={showHyperlink}
|
||||||
|
scrollHorizontal={inTable}
|
||||||
/>
|
/>
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|||||||
@ -28,6 +28,11 @@ const getOptionKey = (option) => {
|
|||||||
|
|
||||||
const getDisplayValue = (option, property) => {
|
const getDisplayValue = (option, property) => {
|
||||||
if (!property) return option
|
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 (property.type === 'object') {
|
||||||
if (option && typeof option === 'object' && option._id) return option
|
if (option && typeof option === 'object' && option._id) return option
|
||||||
if (option != null) return { _id: option }
|
if (option != null) return { _id: option }
|
||||||
|
|||||||
@ -5,7 +5,8 @@ const DocumentTemplateInfo = lazy(
|
|||||||
import('../../components/Dashboard/Management/DocumentTemplates/DocumentTemplateInfo')
|
import('../../components/Dashboard/Management/DocumentTemplates/DocumentTemplateInfo')
|
||||||
)
|
)
|
||||||
const NewDocumentTemplate = lazy(
|
const NewDocumentTemplate = lazy(
|
||||||
() => import('../../components/Dashboard/Management/DocumentTemplates/NewDocumentTemplate')
|
() =>
|
||||||
|
import('../../components/Dashboard/Management/DocumentTemplates/NewDocumentTemplate')
|
||||||
)
|
)
|
||||||
import InfoCircleIcon from '../../components/Icons/InfoCircleIcon'
|
import InfoCircleIcon from '../../components/Icons/InfoCircleIcon'
|
||||||
import PlusIcon from '../../components/Icons/PlusIcon'
|
import PlusIcon from '../../components/Icons/PlusIcon'
|
||||||
@ -32,7 +33,11 @@ export const DocumentTemplate = {
|
|||||||
label: 'New Document Template',
|
label: 'New Document Template',
|
||||||
icon: PlusIcon,
|
icon: PlusIcon,
|
||||||
content: (objectData, { onOk } = {}) => {
|
content: (objectData, { onOk } = {}) => {
|
||||||
return createElement(NewDocumentTemplate, { defaultValues: objectData, onOk, reset: true })
|
return createElement(NewDocumentTemplate, {
|
||||||
|
defaultValues: objectData,
|
||||||
|
onOk,
|
||||||
|
reset: true
|
||||||
|
})
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@ -106,6 +111,7 @@ export const DocumentTemplate = {
|
|||||||
'tags',
|
'tags',
|
||||||
'parent',
|
'parent',
|
||||||
'documentSize',
|
'documentSize',
|
||||||
|
'referencedTemplates',
|
||||||
'createdAt',
|
'createdAt',
|
||||||
'updatedAt'
|
'updatedAt'
|
||||||
],
|
],
|
||||||
@ -116,6 +122,7 @@ export const DocumentTemplate = {
|
|||||||
'global',
|
'global',
|
||||||
'parent',
|
'parent',
|
||||||
'documentSize',
|
'documentSize',
|
||||||
|
'referencedTemplates',
|
||||||
'objectType',
|
'objectType',
|
||||||
'createdAt',
|
'createdAt',
|
||||||
'updatedAt',
|
'updatedAt',
|
||||||
@ -178,7 +185,7 @@ export const DocumentTemplate = {
|
|||||||
label: 'Object Type',
|
label: 'Object Type',
|
||||||
required: true,
|
required: true,
|
||||||
type: 'objectType',
|
type: 'objectType',
|
||||||
columnWidth: 150,
|
columnWidth: 180,
|
||||||
empty: (documentTemplate) => {
|
empty: (documentTemplate) => {
|
||||||
return documentTemplate.global
|
return documentTemplate.global
|
||||||
}
|
}
|
||||||
@ -221,7 +228,7 @@ export const DocumentTemplate = {
|
|||||||
masterFilter: { global: true, active: true },
|
masterFilter: { global: true, active: true },
|
||||||
objectType: 'documentTemplate',
|
objectType: 'documentTemplate',
|
||||||
showHyperlink: true,
|
showHyperlink: true,
|
||||||
columnWidth: 200,
|
columnWidth: 230,
|
||||||
empty: (documentTemplate) => {
|
empty: (documentTemplate) => {
|
||||||
return documentTemplate.global
|
return documentTemplate.global
|
||||||
}
|
}
|
||||||
@ -231,9 +238,20 @@ export const DocumentTemplate = {
|
|||||||
label: 'Document Printers',
|
label: 'Document Printers',
|
||||||
required: false,
|
required: false,
|
||||||
type: 'objectList',
|
type: 'objectList',
|
||||||
|
columnWidth: 230,
|
||||||
objectType: 'documentPrinter',
|
objectType: 'documentPrinter',
|
||||||
showHyperlink: true
|
showHyperlink: true
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
name: 'referencedTemplates',
|
||||||
|
label: 'Referenced Templates',
|
||||||
|
required: false,
|
||||||
|
type: 'objectList',
|
||||||
|
columnWidth: 230,
|
||||||
|
objectType: 'documentTemplate',
|
||||||
|
readOnly: true,
|
||||||
|
showHyperlink: true
|
||||||
|
},
|
||||||
{
|
{
|
||||||
name: 'content',
|
name: 'content',
|
||||||
label: 'Content',
|
label: 'Content',
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user