All checks were successful
farmcontrol/farmcontrol-ui/pipeline/head This commit looks good
- Integrated BulkObjectActions component across various management and dashboard components for improved batch processing capabilities. - Updated components including Invoices, PaymentPolicies, Payments, TaxRecords, and multiple Inventory and Management sections to include bulk action functionality. - Enhanced user experience by allowing users to perform actions on multiple items simultaneously, streamlining workflows and improving efficiency.
277 lines
5.8 KiB
JavaScript
277 lines
5.8 KiB
JavaScript
import { createElement, lazy } from 'react'
|
|
|
|
const DocumentSizeInfo = lazy(
|
|
() =>
|
|
import('../../components/Dashboard/Management/DocumentSizes/DocumentSizeInfo')
|
|
)
|
|
const NewDocumentSize = lazy(
|
|
() =>
|
|
import('../../components/Dashboard/Management/DocumentSizes/NewDocumentSize')
|
|
)
|
|
const DeleteObject = lazy(
|
|
() => import('../../components/Dashboard/common/DeleteObject')
|
|
)
|
|
import InfoCircleIcon from '../../components/Icons/InfoCircleIcon'
|
|
import PlusIcon from '../../components/Icons/PlusIcon'
|
|
import EditIcon from '../../components/Icons/EditIcon'
|
|
import CheckIcon from '../../components/Icons/CheckIcon'
|
|
import XMarkIcon from '../../components/Icons/XMarkIcon'
|
|
import DocumentSizeIcon from '../../components/Icons/DocumentSizeIcon'
|
|
import ListIcon from '../../components/Icons/ListIcon'
|
|
import DuplicateIcon from '../../components/Icons/DuplicateIcon'
|
|
import BinIcon from '../../components/Icons/BinIcon'
|
|
|
|
export const DocumentSize = {
|
|
name: 'documentSize',
|
|
label: 'Document Size',
|
|
labelPlural: 'Document Sizes',
|
|
url: '/dashboard/management/documentsizes',
|
|
prefix: 'DSZ',
|
|
icon: DocumentSizeIcon,
|
|
actions: [
|
|
{
|
|
name: 'new',
|
|
type: 'modal',
|
|
pageName: 'list',
|
|
modalWidth: 700,
|
|
label: 'New Document Size',
|
|
icon: PlusIcon,
|
|
content: (objectData, { onOk } = {}) => {
|
|
return createElement(NewDocumentSize, {
|
|
defaultValues: objectData,
|
|
onOk,
|
|
reset: true
|
|
})
|
|
}
|
|
},
|
|
{
|
|
name: 'duplicate',
|
|
type: 'alias',
|
|
objectType: 'documentSize',
|
|
aliasAction: 'new',
|
|
pageName: 'info',
|
|
label: 'Duplicate',
|
|
icon: DuplicateIcon,
|
|
objectData: (objectData) => objectData
|
|
},
|
|
{
|
|
name: 'list',
|
|
type: 'page',
|
|
pageName: 'list',
|
|
label: 'List',
|
|
icon: ListIcon
|
|
},
|
|
{
|
|
name: 'info',
|
|
type: 'page',
|
|
pageName: 'info',
|
|
label: 'Info',
|
|
default: true,
|
|
row: true,
|
|
icon: InfoCircleIcon
|
|
},
|
|
{
|
|
name: 'edit',
|
|
type: 'page',
|
|
pageName: 'info',
|
|
label: 'Edit',
|
|
row: true,
|
|
icon: EditIcon,
|
|
visible: (objectData) => {
|
|
return !(objectData?._isEditing && objectData?._isEditing == true)
|
|
}
|
|
},
|
|
{
|
|
name: 'cancelEdit',
|
|
label: 'Cancel Edits',
|
|
type: 'page',
|
|
pageName: 'info',
|
|
icon: XMarkIcon,
|
|
visible: (objectData) => {
|
|
return objectData?._isEditing && objectData?._isEditing == true
|
|
}
|
|
},
|
|
{
|
|
name: 'finishEdit',
|
|
label: 'Save Edits',
|
|
type: 'page',
|
|
pageName: 'info',
|
|
icon: CheckIcon,
|
|
visible: (objectData) => {
|
|
return objectData?._isEditing && objectData?._isEditing == true
|
|
}
|
|
},
|
|
{ type: 'divider' },
|
|
{
|
|
name: 'delete',
|
|
bulk: true,
|
|
type: 'modal',
|
|
modalWidth: 520,
|
|
modalCentered: true,
|
|
label: 'Delete',
|
|
icon: BinIcon,
|
|
danger: true,
|
|
content: (objectData, { onOk } = {}) => {
|
|
return createElement(DeleteObject, { objectData, onOk })
|
|
}
|
|
}
|
|
],
|
|
pages: [
|
|
{
|
|
name: 'info',
|
|
content: () => createElement(DocumentSizeInfo)
|
|
}
|
|
],
|
|
columns: [
|
|
'_reference',
|
|
'name',
|
|
'width',
|
|
'height',
|
|
'infiniteHeight',
|
|
'printPadding',
|
|
'paddingLeft',
|
|
'paddingRight',
|
|
'paddingTop',
|
|
'paddingBottom',
|
|
'createdAt',
|
|
'updatedAt'
|
|
],
|
|
filters: [
|
|
'name',
|
|
'width',
|
|
'height',
|
|
'printPadding',
|
|
'paddingLeft',
|
|
'paddingRight',
|
|
'paddingTop',
|
|
'paddingBottom',
|
|
'createdAt',
|
|
'updatedAt',
|
|
'_reference'
|
|
],
|
|
sorters: [
|
|
'name',
|
|
'width',
|
|
'height',
|
|
'infiniteHeight',
|
|
'printPadding',
|
|
'paddingLeft',
|
|
'paddingRight',
|
|
'paddingTop',
|
|
'paddingBottom',
|
|
'createdAt',
|
|
'updatedAt'
|
|
],
|
|
properties: [
|
|
{
|
|
name: '_id',
|
|
label: 'ID',
|
|
type: 'id',
|
|
objectType: 'documentSize',
|
|
showCopy: true,
|
|
columnWidth: 140
|
|
},
|
|
{
|
|
name: 'createdAt',
|
|
label: 'Created At',
|
|
type: 'dateTime',
|
|
readOnly: true,
|
|
columnWidth: 200
|
|
},
|
|
{
|
|
name: '_reference',
|
|
label: 'Reference',
|
|
type: 'reference',
|
|
columnFixed: 'left',
|
|
objectType: 'documentSize',
|
|
showCopy: true,
|
|
readOnly: true,
|
|
columnWidth: 180
|
|
},
|
|
{
|
|
name: 'updatedAt',
|
|
label: 'Updated At',
|
|
type: 'dateTime',
|
|
readOnly: true,
|
|
columnWidth: 200
|
|
},
|
|
{
|
|
name: 'name',
|
|
label: 'Name',
|
|
required: true,
|
|
type: 'text',
|
|
columnWidth: 200,
|
|
columnFixed: 'left'
|
|
},
|
|
{
|
|
name: 'infiniteHeight',
|
|
label: 'Infinite Height',
|
|
required: true,
|
|
columnWidth: 150,
|
|
type: 'bool'
|
|
},
|
|
{
|
|
name: 'width',
|
|
label: 'Width',
|
|
required: true,
|
|
columnWidth: 150,
|
|
type: 'number',
|
|
suffix: 'mm'
|
|
},
|
|
{
|
|
name: 'height',
|
|
label: 'Height',
|
|
required: true,
|
|
columnWidth: 150,
|
|
type: 'number',
|
|
suffix: 'mm',
|
|
visible: (objectData) => {
|
|
return !objectData.infiniteHeight
|
|
}
|
|
},
|
|
{
|
|
name: 'printPadding',
|
|
label: 'Print Padding',
|
|
required: true,
|
|
columnWidth: 160,
|
|
type: 'bool'
|
|
},
|
|
{
|
|
name: 'paddingLeft',
|
|
label: 'Padding Left',
|
|
required: true,
|
|
columnWidth: 150,
|
|
type: 'number',
|
|
suffix: 'mm',
|
|
min: 0
|
|
},
|
|
{
|
|
name: 'paddingRight',
|
|
label: 'Padding Right',
|
|
required: true,
|
|
columnWidth: 162,
|
|
type: 'number',
|
|
suffix: 'mm',
|
|
min: 0
|
|
},
|
|
{
|
|
name: 'paddingTop',
|
|
label: 'Padding Top',
|
|
required: true,
|
|
columnWidth: 155,
|
|
type: 'number',
|
|
suffix: 'mm',
|
|
min: 0
|
|
},
|
|
{
|
|
name: 'paddingBottom',
|
|
label: 'Padding Bottom',
|
|
required: true,
|
|
columnWidth: 180,
|
|
type: 'number',
|
|
suffix: 'mm',
|
|
min: 0
|
|
}
|
|
]
|
|
}
|