Compare commits

..

No commits in common. "8438757db536506fd83a332a93b6ac995e79ad6d" and "becd5d5e82de20e5b0334b9b761d84bd521bdb41" have entirely different histories.

55 changed files with 211 additions and 506 deletions

View File

@ -739,7 +739,6 @@ body {
.simplebar-scrollbar:before { .simplebar-scrollbar:before {
background: #78787854 !important; background: #78787854 !important;
transition: opacity 0.3s ease;
} }
.printer-alerts-display-popover .ant-popover-inner { .printer-alerts-display-popover .ant-popover-inner {
@ -1613,23 +1612,23 @@ span.ant-skeleton-input.ant-skeleton-input-sm.text-skeleton {
top: 0; top: 0;
right: -11px; right: -11px;
bottom: 0; bottom: 0;
width: 6px; width: 11px;
z-index: 3; z-index: 3;
cursor: col-resize; cursor: col-resize;
touch-action: none; touch-action: none;
user-select: none; user-select: none;
pointer-events: auto; pointer-events: auto;
opacity: 0.6;
} }
.objectKanbanColumnResizeHandle::before { .objectKanbanColumnResizeHandle::before {
content: ''; content: '';
position: absolute; position: absolute;
top: 11.15px; top: 11px;
bottom: 10.85px; bottom: 11px;
right: 1px; right: 1px;
width: 2px; width: 2px;
transform: translateX(-50%); transform: translateX(-50%);
opacity: 0.6;
transition: opacity 0.15s ease; transition: opacity 0.15s ease;
} }
@ -1641,9 +1640,16 @@ span.ant-skeleton-input.ant-skeleton-input-sm.text-skeleton {
width: 2px; width: 2px;
height: 20px; height: 20px;
transform: translate(-50%, -50%); transform: translate(-50%, -50%);
opacity: 0.6;
transition: opacity 0.15s ease; transition: opacity 0.15s ease;
} }
.objectKanbanColumnResizeHandle.active::before,
.objectKanbanColumnResizeHandle.active::after {
background: #0e3a5b;
opacity: 1;
}
.dark-mode .objectKanbanColumnResizeHandle::after { .dark-mode .objectKanbanColumnResizeHandle::after {
background: rgba(255, 255, 255, 0.18); background: rgba(255, 255, 255, 0.18);
} }
@ -1652,28 +1658,14 @@ span.ant-skeleton-input.ant-skeleton-input-sm.text-skeleton {
background: rgba(255, 255, 255, 0.08); background: rgba(255, 255, 255, 0.08);
} }
.light-mode .objectKanbanColumnResizeHandle::after { .dark-mode .objectKanbanColumnResizeHandle.active::before,
background: rgba(0, 0, 0, 0.15); .dark-mode .objectKanbanColumnResizeHandle.active::after {
}
.light-mode .objectKanbanColumnResizeHandle::before {
background: rgba(0, 0, 0, 0.04);
}
.dark-mode .objectKanbanColumnResizeHandle:hover::before {
background: #0e3a5b;
}
.light-mode .objectKanbanColumnResizeHandle:hover::before {
background: #e6f8ff;
}
.dark-mode .objectKanbanColumnResizeHandle.active::before {
background: #0b4c7e; background: #0b4c7e;
opacity: 1;
} }
.light-mode .objectKanbanColumnResizeHandle.active::before { .objectKanbanColumnResizeHandle:hover::before {
background: #a3e3ff; background: #0e3a5b;
} }
body.objectKanbanColumnResizing, body.objectKanbanColumnResizing,
@ -2321,15 +2313,6 @@ body.objectKanbanColumnResizing * {
content: none; content: none;
} }
.farmcontrol-splitter .ant-splitter-bar-dragger {
transition: opacity 0.3s ease;
opacity: 1;
}
.farmcontrol-splitter.vertical-scroll-visible .ant-splitter-bar-dragger {
opacity: 0;
}
.object-display-tag .object-display-tag
.elipsis-text-wrapper.ant-typography .elipsis-text-wrapper.ant-typography
code.elipsis-text-measure, code.elipsis-text-measure,

View File

@ -26,9 +26,13 @@ const Invoices = () => {
const [showSortSidebar, setShowSortSidebar] = const [showSortSidebar, setShowSortSidebar] =
useSortSidebarVisibility('Invoices') useSortSidebarVisibility('Invoices')
return ( return (
<ObjectListViewProvider objectType='invoice' tableRef={tableRef}> <ObjectListViewProvider
<Flex vertical={'true'} gap='large' className='h-100'> objectType='invoice'
tableRef={tableRef}
>
<Flex vertical={'true'} gap='large' className='h-100'>
<Flex justify='space-between' style={{ minHeight: 0 }} gap='small'> <Flex justify='space-between' style={{ minHeight: 0 }} gap='small'>
<Space size='small'> <Space size='small'>
<ObjectActions <ObjectActions
@ -54,7 +58,9 @@ const Invoices = () => {
active={showFilterSidebar} active={showFilterSidebar}
onClick={() => setShowFilterSidebar(!showFilterSidebar)} onClick={() => setShowFilterSidebar(!showFilterSidebar)}
/> />
<ObjectTableViewButton objectType='invoice' /> <ObjectTableViewButton
objectType='invoice'
/>
<ListViewEditButtons showStartingDivider={true} /> <ListViewEditButtons showStartingDivider={true} />
</Space> </Space>
</Flex> </Flex>

View File

@ -13,7 +13,6 @@ import { Flex } from 'antd'
import PropTypes from 'prop-types' import PropTypes from 'prop-types'
import classNames from 'classnames' import classNames from 'classnames'
import { ApiServerContext } from '../context/ApiServerContext' import { ApiServerContext } from '../context/ApiServerContext'
import { AuthContext } from '../context/AuthContext'
import ObjectCard from './ObjectCard' import ObjectCard from './ObjectCard'
import ObjectKanbanColumn from './ObjectKanbanColumn' import ObjectKanbanColumn from './ObjectKanbanColumn'
import ObjectKanbanHeader from './ObjectKanbanHeader' import ObjectKanbanHeader from './ObjectKanbanHeader'
@ -286,7 +285,6 @@ const ObjectKanban = forwardRef(
subscribeToAllObjectUpdates, subscribeToAllObjectUpdates,
subscribeToObjectTypeUpdates subscribeToObjectTypeUpdates
} = useContext(ApiServerContext) } = useContext(ApiServerContext)
const { token } = useContext(AuthContext)
const columnRefs = useRef({}) const columnRefs = useRef({})
const headerTrackRef = useRef(null) const headerTrackRef = useRef(null)
const skeletonTrackRef = useRef(null) const skeletonTrackRef = useRef(null)
@ -700,27 +698,19 @@ const ObjectKanban = forwardRef(
useEffect(() => { useEffect(() => {
return () => { return () => {
if ( if (connected == true && subscribeToObjectTypeUpdatesRef.current) {
connected == true &&
token &&
subscribeToObjectTypeUpdatesRef.current
) {
subscribeToObjectTypeUpdatesRef.current() subscribeToObjectTypeUpdatesRef.current()
subscribeToObjectTypeUpdatesRef.current = null subscribeToObjectTypeUpdatesRef.current = null
} }
if ( if (connected == true && subscribeToAllObjectUpdatesRef.current) {
connected == true &&
token &&
subscribeToAllObjectUpdatesRef.current
) {
subscribeToAllObjectUpdatesRef.current() subscribeToAllObjectUpdatesRef.current()
subscribeToAllObjectUpdatesRef.current = null subscribeToAllObjectUpdatesRef.current = null
} }
} }
}, [connected, token]) }, [connected])
useEffect(() => { useEffect(() => {
if (connected !== true || !type || !token) return if (connected !== true || !type) return
const unsubscribe = subscribeToAllObjectUpdates( const unsubscribe = subscribeToAllObjectUpdates(
type, type,
@ -735,10 +725,10 @@ const ObjectKanban = forwardRef(
subscribeToAllObjectUpdatesRef.current = null subscribeToAllObjectUpdatesRef.current = null
} }
} }
}, [type, connected, subscribeToAllObjectUpdates, token]) }, [type, connected, subscribeToAllObjectUpdates])
useEffect(() => { useEffect(() => {
if (connected !== true || !token) return if (connected !== true) return
if (subscribedTypeRef.current === type) return if (subscribedTypeRef.current === type) return
const unsubscribe = subscribeToObjectTypeUpdatesFnRef.current( const unsubscribe = subscribeToObjectTypeUpdatesFnRef.current(
@ -757,7 +747,7 @@ const ObjectKanban = forwardRef(
subscribedTypeRef.current = null subscribedTypeRef.current = null
} }
} }
}, [type, connected, token]) }, [type, connected])
useImperativeHandle( useImperativeHandle(
ref, ref,

View File

@ -69,9 +69,6 @@ import {
import { areValuesEqual } from '../utils/Utils' import { areValuesEqual } from '../utils/Utils'
import MissingPlaceholder from './MissingPlaceholder' import MissingPlaceholder from './MissingPlaceholder'
import LoadingPlaceholder from './LoadingPlaceholder' import LoadingPlaceholder from './LoadingPlaceholder'
import useSidebarWidth from '../hooks/useSidebarWidth'
import classNames from 'classnames'
const logger = loglevel.getLogger('DasboardTable') const logger = loglevel.getLogger('DasboardTable')
logger.setLevel(config.logLevel) logger.setLevel(config.logLevel)
@ -415,10 +412,6 @@ const ObjectTable = forwardRef(
const [sidebarFilter, setSidebarFilter] = useState({}) const [sidebarFilter, setSidebarFilter] = useState({})
const [tableSorter, setTableSorter] = useState({}) const [tableSorter, setTableSorter] = useState({})
const [initialized, setInitialized] = useState(false) const [initialized, setInitialized] = useState(false)
const [sidebarWidth, setSidebarWidth] = useSidebarWidth(type)
const [verticalScrollVisible, setVerticalScrollVisible] = useState(false)
const tableContentRef = useRef(null)
// Keep refs in sync with props. applyViewState may update them earlier in // Keep refs in sync with props. applyViewState may update them earlier in
// the same tick; props remain the source of truth after commit. // the same tick; props remain the source of truth after commit.
@ -1936,11 +1929,7 @@ const ObjectTable = forwardRef(
const cardsContainerNodeRef = useRef(null) const cardsContainerNodeRef = useRef(null)
const cardsResizeObserverRef = useRef(null) const cardsResizeObserverRef = useRef(null)
const measureCardColSpan = useCallback((sizes) => { const measureCardColSpan = useCallback(() => {
if (sizes?.[1]) {
setSidebarWidth(sizes[1])
}
const node = cardsContainerNodeRef.current const node = cardsContainerNodeRef.current
if (!node) return if (!node) return
const panel = node.closest('.ant-splitter-panel') const panel = node.closest('.ant-splitter-panel')
@ -2118,53 +2107,17 @@ const ObjectTable = forwardRef(
) )
useEffect(() => { useEffect(() => {
const container = tableContentRef.current console.log('loading', loading)
}, [loading])
if (!container) return
const updateVisibility = () => {
const scrollableY = container.querySelector('.simplebar-scrollable-y')
const scrollableX = container.querySelector('.simplebar-scrollable-x')
const scrollbar = container.querySelector(
'.simplebar-vertical .simplebar-scrollbar'
)
setVerticalScrollVisible(
scrollbar?.classList.contains('simplebar-visible') ||
scrollableY?.classList.contains('simplebar-mouse-entered') ||
scrollableX?.classList.contains('simplebar-mouse-entered')
)
}
// Initial state
updateVisibility()
const observer = new MutationObserver(updateVisibility)
observer.observe(container, {
subtree: true,
attributes: true,
attributeFilter: ['class']
})
return () => {
observer.disconnect()
}
}, [])
const tableContent = ( const tableContent = (
<Flex <Flex
gap={'middle'} gap={'middle'}
vertical vertical
style={{ flex: 1, minWidth: 0, minHeight: 0 }} style={{ flex: 1, minWidth: 0, minHeight: 0 }}
ref={tableContentRef}
> >
<Splitter <Splitter
className={classNames('farmcontrol-splitter large', { className={'farmcontrol-splitter large'}
'vertical-scroll-visible': verticalScrollVisible
})}
onResize={measureCardColSpan} onResize={measureCardColSpan}
onResizeEnd={measureCardColSpan} onResizeEnd={measureCardColSpan}
> >
@ -2261,8 +2214,8 @@ const ObjectTable = forwardRef(
</Spin> </Spin>
)} )}
</Splitter.Panel> </Splitter.Panel>
{(showSortSidebar || showFilterSidebar) && initialized && ( {(showSortSidebar || showFilterSidebar) && (
<Splitter.Panel size={sidebarWidth}> <Splitter.Panel defaultSize={'25%'}>
<Flex <Flex
vertical vertical
gap='large' gap='large'

View File

@ -16,7 +16,6 @@ import ObjectTimelineRow from './ObjectTimelineRow'
import { getTimelineRangeFromValues, getTimelineTicks } from './timelineUtils' import { getTimelineRangeFromValues, getTimelineTicks } from './timelineUtils'
import cn from 'classnames' import cn from 'classnames'
import { getStateTagInfo } from '../utils/Utils' import { getStateTagInfo } from '../utils/Utils'
import { AuthContext } from '../context/AuthContext'
const { Text } = Typography const { Text } = Typography
const LABEL_WIDTH = 226 const LABEL_WIDTH = 226
@ -41,8 +40,7 @@ const ObjectTimeline = ({
onScroll, onScroll,
rowWrapper rowWrapper
}) => { }) => {
const { getModelPropertyValues, connected } = useContext(ApiServerContext) const { getModelPropertyValues } = useContext(ApiServerContext)
const { token } = useContext(AuthContext)
const getModelPropertyValuesRef = useRef(getModelPropertyValues) const getModelPropertyValuesRef = useRef(getModelPropertyValues)
getModelPropertyValuesRef.current = getModelPropertyValues getModelPropertyValuesRef.current = getModelPropertyValues
@ -62,8 +60,6 @@ const ObjectTimeline = ({
) )
useEffect(() => { useEffect(() => {
if (connected !== true || !token) return
if (!type || !startDate) { if (!type || !startDate) {
setStartValues([]) setStartValues([])
setEndValues([]) setEndValues([])
@ -109,7 +105,7 @@ const ObjectTimeline = ({
return () => { return () => {
cancelled = true cancelled = true
} }
}, [endDate, rangeQueryKey, startDate, type, connected, token]) }, [endDate, rangeQueryKey, startDate, type])
const [showShadow, setShowShadow] = useState(false) const [showShadow, setShowShadow] = useState(false)

View File

@ -1,128 +0,0 @@
import { useCallback, useContext, useEffect, useRef, useState } from 'react'
import { ApiServerContext } from '../context/ApiServerContext'
const useSidebarWidth = (componentName, defaultValue = 300) => {
const { userSettings, updateUserSettings } = useContext(ApiServerContext)
const savedSidebarWidth =
userSettings?.sidebarWidths?.[componentName] ?? defaultValue
const [localSidebarWidth, setLocalSidebarWidth] = useState(savedSidebarWidth)
const pendingValueRef = useRef(null)
const lastUpdateRef = useRef(0)
const timeoutRef = useRef(null)
/*
* Keep the latest updateUserSettings arguments in refs so the
* cleanup function always has the correct component name/value.
*/
const componentNameRef = useRef(componentName)
const updateUserSettingsRef = useRef(updateUserSettings)
componentNameRef.current = componentName
updateUserSettingsRef.current = updateUserSettings
const callUpdateUserSettings = useCallback((name, value) => {
lastUpdateRef.current = Date.now()
updateUserSettingsRef.current('sidebarWidths', name, value)
}, [])
const flush = useCallback(() => {
if (timeoutRef.current) {
clearTimeout(timeoutRef.current)
timeoutRef.current = null
}
const pending = pendingValueRef.current
if (!pending) return
pendingValueRef.current = null
callUpdateUserSettings(pending.componentName, pending.value)
}, [callUpdateUserSettings])
/*
* Flush the previous component's value when the component is
* unmounted OR componentName changes.
*/
useEffect(() => {
const name = componentName
return () => {
const pending = pendingValueRef.current
if (pending && pending.componentName === name) {
flush()
}
}
}, [componentName, flush])
/*
* Load the saved width when the component name changes.
*/
useEffect(() => {
setLocalSidebarWidth(savedSidebarWidth)
}, [componentName, savedSidebarWidth])
const setSidebarWidth = useCallback(
(nextValue) => {
const value =
typeof nextValue === 'function'
? nextValue(localSidebarWidth)
: nextValue
if (value === localSidebarWidth) return
// Always update the UI immediately.
setLocalSidebarWidth(value)
// Keep only the latest value waiting to be persisted.
pendingValueRef.current = {
componentName,
value
}
const elapsed = Date.now() - lastUpdateRef.current
/*
* We haven't called updateUserSettings recently, so call it
* immediately.
*/
if (elapsed >= 1000) {
const pending = pendingValueRef.current
pendingValueRef.current = null
callUpdateUserSettings(pending.componentName, pending.value)
return
}
/*
* Already rate limited. Schedule the next call for exactly
* when the 1 second window expires.
*/
if (!timeoutRef.current) {
timeoutRef.current = setTimeout(() => {
timeoutRef.current = null
const pending = pendingValueRef.current
if (!pending) return
pendingValueRef.current = null
callUpdateUserSettings(pending.componentName, pending.value)
}, 1000 - elapsed)
}
},
[componentName, localSidebarWidth, callUpdateUserSettings]
)
return [localSidebarWidth, setSidebarWidth]
}
export default useSidebarWidth

View File

@ -5,8 +5,7 @@ const AppPasswordInfo = lazy(
import('../../components/Dashboard/Management/AppPasswords/AppPasswordInfo') import('../../components/Dashboard/Management/AppPasswords/AppPasswordInfo')
) )
const NewAppPassword = lazy( const NewAppPassword = lazy(
() => () => import('../../components/Dashboard/Management/AppPasswords/NewAppPassword')
import('../../components/Dashboard/Management/AppPasswords/NewAppPassword')
) )
const RegenerateAppPasswordSecret = lazy( const RegenerateAppPasswordSecret = lazy(
() => () =>
@ -37,11 +36,7 @@ export const AppPassword = {
label: 'New App Password', label: 'New App Password',
icon: PlusIcon, icon: PlusIcon,
content: (objectData, { onOk } = {}) => { content: (objectData, { onOk } = {}) => {
return createElement(NewAppPassword, { return createElement(NewAppPassword, { defaultValues: objectData, onOk, reset: true })
defaultValues: objectData,
onOk,
reset: true
})
} }
}, },
{ {
@ -145,7 +140,7 @@ export const AppPassword = {
label: 'Created At', label: 'Created At',
type: 'dateTime', type: 'dateTime',
readOnly: true, readOnly: true,
columnWidth: 200 columnWidth: 175
}, },
{ {
name: '_reference', name: '_reference',
@ -171,7 +166,7 @@ export const AppPassword = {
label: 'Updated At', label: 'Updated At',
type: 'dateTime', type: 'dateTime',
readOnly: true, readOnly: true,
columnWidth: 200 columnWidth: 175
}, },
{ {
name: 'user', name: 'user',

View File

@ -34,11 +34,7 @@ export const Client = {
label: 'New Client', label: 'New Client',
icon: PlusIcon, icon: PlusIcon,
content: (objectData, { onOk } = {}) => { content: (objectData, { onOk } = {}) => {
return createElement(NewClient, { return createElement(NewClient, { defaultValues: objectData, onOk, reset: true })
defaultValues: objectData,
onOk,
reset: true
})
} }
}, },
{ {
@ -152,7 +148,7 @@ export const Client = {
label: 'Created At', label: 'Created At',
type: 'dateTime', type: 'dateTime',
readOnly: true, readOnly: true,
columnWidth: 200 columnWidth: 175
}, },
{ {
name: '_reference', name: '_reference',
@ -177,7 +173,7 @@ export const Client = {
label: 'Updated At', label: 'Updated At',
type: 'dateTime', type: 'dateTime',
readOnly: true, readOnly: true,
columnWidth: 200 columnWidth: 175
}, },
{ {
name: 'active', name: 'active',

View File

@ -34,11 +34,7 @@ export const Courier = {
label: 'New Courier', label: 'New Courier',
icon: PlusIcon, icon: PlusIcon,
content: (objectData, { onOk } = {}) => { content: (objectData, { onOk } = {}) => {
return createElement(NewCourier, { return createElement(NewCourier, { defaultValues: objectData, onOk, reset: true })
defaultValues: objectData,
onOk,
reset: true
})
} }
}, },
{ {
@ -108,15 +104,7 @@ export const Courier = {
content: () => createElement(CourierInfo) content: () => createElement(CourierInfo)
} }
], ],
columns: [ columns: ['_reference', 'name', 'country', 'email', 'website', 'createdAt', 'updatedAt'],
'_reference',
'name',
'country',
'email',
'website',
'createdAt',
'updatedAt'
],
filters: [ filters: [
'name', 'name',
'website', 'website',
@ -128,7 +116,14 @@ export const Courier = {
'updatedAt', 'updatedAt',
'_reference' '_reference'
], ],
sorters: ['name', 'country', 'email', 'createdAt', '_id', 'updatedAt'], sorters: [
'name',
'country',
'email',
'createdAt',
'_id',
'updatedAt'
],
group: ['country'], group: ['country'],
properties: [ properties: [
{ {
@ -145,7 +140,7 @@ export const Courier = {
label: 'Created At', label: 'Created At',
type: 'dateTime', type: 'dateTime',
readOnly: true, readOnly: true,
columnWidth: 200 columnWidth: 175
}, },
{ {
name: '_reference', name: '_reference',
@ -180,7 +175,7 @@ export const Courier = {
label: 'Updated At', label: 'Updated At',
type: 'dateTime', type: 'dateTime',
readOnly: true, readOnly: true,
columnWidth: 200 columnWidth: 175
}, },
{ {
name: 'contact', name: 'contact',

View File

@ -168,7 +168,7 @@ export const CourierService = {
label: 'Created At', label: 'Created At',
type: 'dateTime', type: 'dateTime',
readOnly: true, readOnly: true,
columnWidth: 200 columnWidth: 175
}, },
{ {
name: '_reference', name: '_reference',
@ -193,7 +193,7 @@ export const CourierService = {
label: 'Updated At', label: 'Updated At',
type: 'dateTime', type: 'dateTime',
readOnly: true, readOnly: true,
columnWidth: 200 columnWidth: 175
}, },
{ {
name: 'courier', name: 'courier',

View File

@ -1,12 +1,10 @@
import { createElement, lazy } from 'react' import { createElement, lazy } from 'react'
const DocumentJobInfo = lazy( const DocumentJobInfo = lazy(
() => () => import('../../components/Dashboard/Management/DocumentJobs/DocumentJobInfo')
import('../../components/Dashboard/Management/DocumentJobs/DocumentJobInfo')
) )
const NewDocumentJob = lazy( const NewDocumentJob = lazy(
() => () => import('../../components/Dashboard/Management/DocumentJobs/NewDocumentJob')
import('../../components/Dashboard/Management/DocumentJobs/NewDocumentJob')
) )
import InfoCircleIcon from '../../components/Icons/InfoCircleIcon' import InfoCircleIcon from '../../components/Icons/InfoCircleIcon'
import PlusIcon from '../../components/Icons/PlusIcon' import PlusIcon from '../../components/Icons/PlusIcon'
@ -33,11 +31,7 @@ export const DocumentJob = {
label: 'New Document Job', label: 'New Document Job',
icon: PlusIcon, icon: PlusIcon,
content: (objectData, { onOk } = {}) => { content: (objectData, { onOk } = {}) => {
return createElement(NewDocumentJob, { return createElement(NewDocumentJob, { defaultValues: objectData, onOk, reset: true })
defaultValues: objectData,
onOk,
reset: true
})
} }
}, },
{ {
@ -86,7 +80,7 @@ export const DocumentJob = {
visible: (objectData) => { visible: (objectData) => {
return objectData?._isEditing && objectData?._isEditing == true return objectData?._isEditing && objectData?._isEditing == true
} }
} },
], ],
pages: [ pages: [
{ {
@ -94,14 +88,7 @@ export const DocumentJob = {
content: () => createElement(DocumentJobInfo) content: () => createElement(DocumentJobInfo)
} }
], ],
columns: [ columns: ['_reference', 'name', 'quantity', 'state', 'createdAt', 'updatedAt'],
'_reference',
'name',
'quantity',
'state',
'createdAt',
'updatedAt'
],
filters: [ filters: [
'name', 'name',
'quantity', 'quantity',
@ -127,7 +114,7 @@ export const DocumentJob = {
label: 'Created At', label: 'Created At',
type: 'dateTime', type: 'dateTime',
readOnly: true, readOnly: true,
columnWidth: 200 columnWidth: 175
}, },
{ {
name: '_reference', name: '_reference',
@ -144,7 +131,7 @@ export const DocumentJob = {
label: 'Updated At', label: 'Updated At',
type: 'dateTime', type: 'dateTime',
readOnly: true, readOnly: true,
columnWidth: 200 columnWidth: 175
}, },
{ {
name: 'name', name: 'name',
@ -227,10 +214,7 @@ export const DocumentJob = {
step: 1, step: 1,
columnWidth: 125, columnWidth: 125,
value: (objectData) => { value: (objectData) => {
if ( if (objectData?.createdAt == undefined && objectData?.quantity == null) {
objectData?.createdAt == undefined &&
objectData?.quantity == null
) {
return 1 return 1
} }
} }

View File

@ -1,12 +1,10 @@
import { createElement, lazy } from 'react' import { createElement, lazy } from 'react'
const DocumentPrinterInfo = lazy( const DocumentPrinterInfo = lazy(
() => () => import('../../components/Dashboard/Management/DocumentPrinters/DocumentPrinterInfo')
import('../../components/Dashboard/Management/DocumentPrinters/DocumentPrinterInfo')
) )
const NewDocumentPrinter = lazy( const NewDocumentPrinter = lazy(
() => () => import('../../components/Dashboard/Management/DocumentPrinters/NewDocumentPrinter')
import('../../components/Dashboard/Management/DocumentPrinters/NewDocumentPrinter')
) )
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,11 +30,7 @@ export const DocumentPrinter = {
label: 'New Document Printer', label: 'New Document Printer',
icon: PlusIcon, icon: PlusIcon,
content: (objectData, { onOk } = {}) => { content: (objectData, { onOk } = {}) => {
return createElement(NewDocumentPrinter, { return createElement(NewDocumentPrinter, { defaultValues: objectData, onOk, reset: true })
defaultValues: objectData,
onOk,
reset: true
})
} }
}, },
{ {
@ -85,7 +79,7 @@ export const DocumentPrinter = {
visible: (objectData) => { visible: (objectData) => {
return objectData?._isEditing && objectData?._isEditing == true return objectData?._isEditing && objectData?._isEditing == true
} }
} },
], ],
pages: [ pages: [
{ {
@ -137,7 +131,7 @@ export const DocumentPrinter = {
label: 'Created At', label: 'Created At',
type: 'dateTime', type: 'dateTime',
readOnly: true, readOnly: true,
columnWidth: 200 columnWidth: 175
}, },
{ {
name: '_reference', name: '_reference',
@ -154,7 +148,7 @@ export const DocumentPrinter = {
label: 'Updated At', label: 'Updated At',
type: 'dateTime', type: 'dateTime',
readOnly: true, readOnly: true,
columnWidth: 200 columnWidth: 175
}, },
{ {
name: 'name', name: 'name',

View File

@ -147,7 +147,7 @@ export const DocumentSize = {
label: 'Created At', label: 'Created At',
type: 'dateTime', type: 'dateTime',
readOnly: true, readOnly: true,
columnWidth: 200 columnWidth: 175
}, },
{ {
name: '_reference', name: '_reference',
@ -164,7 +164,7 @@ export const DocumentSize = {
label: 'Updated At', label: 'Updated At',
type: 'dateTime', type: 'dateTime',
readOnly: true, readOnly: true,
columnWidth: 200 columnWidth: 175
}, },
{ {
name: 'name', name: 'name',

View File

@ -153,7 +153,7 @@ export const DocumentTemplate = {
label: 'Created At', label: 'Created At',
type: 'dateTime', type: 'dateTime',
readOnly: true, readOnly: true,
columnWidth: 200 columnWidth: 175
}, },
{ {
name: '_reference', name: '_reference',
@ -178,7 +178,7 @@ export const DocumentTemplate = {
label: 'Updated At', label: 'Updated At',
type: 'dateTime', type: 'dateTime',
readOnly: true, readOnly: true,
columnWidth: 200 columnWidth: 175
}, },
{ {
name: 'objectType', name: 'objectType',

View File

@ -34,11 +34,7 @@ export const Filament = {
label: 'New Filament', label: 'New Filament',
icon: PlusIcon, icon: PlusIcon,
content: (objectData, { onOk } = {}) => { content: (objectData, { onOk } = {}) => {
return createElement(NewFilament, { return createElement(NewFilament, { defaultValues: objectData, onOk, reset: true })
defaultValues: objectData,
onOk,
reset: true
})
} }
}, },
{ {
@ -175,7 +171,7 @@ export const Filament = {
label: 'Created At', label: 'Created At',
type: 'dateTime', type: 'dateTime',
readOnly: true, readOnly: true,
columnWidth: 200 columnWidth: 175
}, },
{ {
name: '_reference', name: '_reference',
@ -192,7 +188,7 @@ export const Filament = {
label: 'Updated At', label: 'Updated At',
type: 'dateTime', type: 'dateTime',
readOnly: true, readOnly: true,
columnWidth: 200 columnWidth: 175
}, },
{ {
name: 'name', name: 'name',

View File

@ -5,8 +5,7 @@ const FilamentProfileInfo = lazy(
import('../../components/Dashboard/Production/FilamentProfiles/FilamentProfileInfo') import('../../components/Dashboard/Production/FilamentProfiles/FilamentProfileInfo')
) )
const NewFilamentProfile = lazy( const NewFilamentProfile = lazy(
() => () => import('../../components/Dashboard/Production/FilamentProfiles/NewFilamentProfile')
import('../../components/Dashboard/Production/FilamentProfiles/NewFilamentProfile')
) )
const DeleteObject = lazy( const DeleteObject = lazy(
() => import('../../components/Dashboard/common/DeleteObject') () => import('../../components/Dashboard/common/DeleteObject')
@ -36,11 +35,7 @@ export const FilamentProfile = {
label: 'New Filament Profile', label: 'New Filament Profile',
icon: PlusIcon, icon: PlusIcon,
content: (objectData, { onOk } = {}) => { content: (objectData, { onOk } = {}) => {
return createElement(NewFilamentProfile, { return createElement(NewFilamentProfile, { defaultValues: objectData, onOk, reset: true })
defaultValues: objectData,
onOk,
reset: true
})
} }
}, },
{ {
@ -136,7 +131,7 @@ export const FilamentProfile = {
label: 'Created At', label: 'Created At',
type: 'dateTime', type: 'dateTime',
readOnly: true, readOnly: true,
columnWidth: 200 columnWidth: 175
}, },
{ {
name: '_reference', name: '_reference',
@ -153,7 +148,7 @@ export const FilamentProfile = {
label: 'Updated At', label: 'Updated At',
type: 'dateTime', type: 'dateTime',
readOnly: true, readOnly: true,
columnWidth: 200 columnWidth: 175
}, },
{ {
name: 'name', name: 'name',

View File

@ -162,7 +162,7 @@ export const FilamentSku = {
label: 'Created At', label: 'Created At',
type: 'dateTime', type: 'dateTime',
readOnly: true, readOnly: true,
columnWidth: 200 columnWidth: 175
}, },
{ {
name: '_reference', name: '_reference',
@ -187,7 +187,7 @@ export const FilamentSku = {
label: 'Updated At', label: 'Updated At',
type: 'dateTime', type: 'dateTime',
readOnly: true, readOnly: true,
columnWidth: 200 columnWidth: 175
}, },
{ {
name: 'filament', name: 'filament',

View File

@ -179,7 +179,7 @@ export const FilamentStock = {
label: 'Created At', label: 'Created At',
type: 'dateTime', type: 'dateTime',
readOnly: true, readOnly: true,
columnWidth: 200 columnWidth: 175
}, },
{ {
name: '_reference', name: '_reference',
@ -196,7 +196,7 @@ export const FilamentStock = {
label: 'Updated At', label: 'Updated At',
type: 'dateTime', type: 'dateTime',
readOnly: true, readOnly: true,
columnWidth: 200 columnWidth: 175
}, },
{ {
name: 'state', name: 'state',

View File

@ -143,7 +143,7 @@ export const File = {
label: 'Created At', label: 'Created At',
type: 'dateTime', type: 'dateTime',
readOnly: true, readOnly: true,
columnWidth: 200 columnWidth: 175
}, },
{ {
name: '_reference', name: '_reference',
@ -168,7 +168,7 @@ export const File = {
label: 'Updated At', label: 'Updated At',
type: 'dateTime', type: 'dateTime',
readOnly: true, readOnly: true,
columnWidth: 200 columnWidth: 175
}, },
{ {
name: 'type', name: 'type',

View File

@ -145,7 +145,7 @@ export const FulfillmentPolicy = {
label: 'Created At', label: 'Created At',
type: 'dateTime', type: 'dateTime',
readOnly: true, readOnly: true,
columnWidth: 200 columnWidth: 175
}, },
{ {
name: '_reference', name: '_reference',
@ -162,7 +162,7 @@ export const FulfillmentPolicy = {
label: 'Updated At', label: 'Updated At',
type: 'dateTime', type: 'dateTime',
readOnly: true, readOnly: true,
columnWidth: 200 columnWidth: 175
}, },
{ {
name: 'name', name: 'name',

View File

@ -159,7 +159,7 @@ export const Host = {
label: 'Created At', label: 'Created At',
type: 'dateTime', type: 'dateTime',
readOnly: true, readOnly: true,
columnWidth: 200 columnWidth: 175
}, },
{ {
name: '_reference', name: '_reference',
@ -176,7 +176,7 @@ export const Host = {
label: 'Updated At', label: 'Updated At',
type: 'dateTime', type: 'dateTime',
readOnly: true, readOnly: true,
columnWidth: 200 columnWidth: 175
}, },
{ {
name: 'name', name: 'name',

View File

@ -230,7 +230,7 @@ export const Invoice = {
label: 'Created At', label: 'Created At',
type: 'dateTime', type: 'dateTime',
readOnly: true, readOnly: true,
columnWidth: 200 columnWidth: 175
}, },
{ {
name: '_reference', name: '_reference',
@ -248,7 +248,7 @@ export const Invoice = {
label: 'Updated At', label: 'Updated At',
type: 'dateTime', type: 'dateTime',
readOnly: true, readOnly: true,
columnWidth: 200 columnWidth: 175
}, },
{ {
name: 'state', name: 'state',

View File

@ -38,11 +38,7 @@ export const Job = {
label: 'New Job', label: 'New Job',
icon: PlusIcon, icon: PlusIcon,
content: (objectData, { onOk } = {}) => { content: (objectData, { onOk } = {}) => {
return createElement(NewJob, { return createElement(NewJob, { defaultValues: objectData, onOk, reset: true })
defaultValues: objectData,
onOk,
reset: true
})
} }
}, },
{ {
@ -181,7 +177,7 @@ export const Job = {
label: 'Created At', label: 'Created At',
type: 'dateTime', type: 'dateTime',
readOnly: true, readOnly: true,
columnWidth: 200 columnWidth: 175
}, },
{ {
name: '_reference', name: '_reference',
@ -198,7 +194,7 @@ export const Job = {
label: 'Updated At', label: 'Updated At',
type: 'dateTime', type: 'dateTime',
readOnly: true, readOnly: true,
columnWidth: 200 columnWidth: 175
}, },
{ {
name: 'state', name: 'state',

View File

@ -220,7 +220,7 @@ export const Listing = {
label: 'Created At', label: 'Created At',
type: 'dateTime', type: 'dateTime',
readOnly: true, readOnly: true,
columnWidth: 200 columnWidth: 175
}, },
{ {
name: '_reference', name: '_reference',
@ -237,7 +237,7 @@ export const Listing = {
label: 'Updated At', label: 'Updated At',
type: 'dateTime', type: 'dateTime',
readOnly: true, readOnly: true,
columnWidth: 200 columnWidth: 175
}, },
{ {
name: 'title', name: 'title',

View File

@ -201,7 +201,7 @@ export const ListingVarient = {
label: 'Created At', label: 'Created At',
type: 'dateTime', type: 'dateTime',
readOnly: true, readOnly: true,
columnWidth: 200 columnWidth: 175
}, },
{ {
name: '_reference', name: '_reference',
@ -218,7 +218,7 @@ export const ListingVarient = {
label: 'Updated At', label: 'Updated At',
type: 'dateTime', type: 'dateTime',
readOnly: true, readOnly: true,
columnWidth: 200 columnWidth: 175
}, },
{ {
name: 'listing', name: 'listing',

View File

@ -337,7 +337,7 @@ export const Marketplace = {
label: 'Created At', label: 'Created At',
type: 'dateTime', type: 'dateTime',
readOnly: true, readOnly: true,
columnWidth: 200 columnWidth: 175
}, },
{ {
name: '_reference', name: '_reference',
@ -354,7 +354,7 @@ export const Marketplace = {
label: 'Updated At', label: 'Updated At',
type: 'dateTime', type: 'dateTime',
readOnly: true, readOnly: true,
columnWidth: 200 columnWidth: 175
}, },
{ {
name: 'name', name: 'name',

View File

@ -34,11 +34,7 @@ export const Material = {
label: 'New Material', label: 'New Material',
icon: PlusIcon, icon: PlusIcon,
content: (objectData, { onOk } = {}) => { content: (objectData, { onOk } = {}) => {
return createElement(NewMaterial, { return createElement(NewMaterial, { defaultValues: objectData, onOk, reset: true })
defaultValues: objectData,
onOk,
reset: true
})
} }
}, },
{ {
@ -109,7 +105,14 @@ export const Material = {
} }
], ],
columns: ['_reference', 'name', 'tags', 'createdAt', 'updatedAt'], columns: ['_reference', 'name', 'tags', 'createdAt', 'updatedAt'],
filters: ['_id', 'name', 'tags', 'createdAt', 'updatedAt', '_reference'], filters: [
'_id',
'name',
'tags',
'createdAt',
'updatedAt',
'_reference'
],
sorters: ['name', 'createdAt', 'updatedAt', '_id'], sorters: ['name', 'createdAt', 'updatedAt', '_id'],
group: ['tags'], group: ['tags'],
properties: [ properties: [
@ -127,7 +130,7 @@ export const Material = {
label: 'Created At', label: 'Created At',
type: 'dateTime', type: 'dateTime',
readOnly: true, readOnly: true,
columnWidth: 200 columnWidth: 175
}, },
{ {
name: '_reference', name: '_reference',
@ -152,7 +155,7 @@ export const Material = {
label: 'Updated At', label: 'Updated At',
type: 'dateTime', type: 'dateTime',
readOnly: true, readOnly: true,
columnWidth: 200 columnWidth: 175
}, },
{ {
name: 'tags', name: 'tags',

View File

@ -30,11 +30,7 @@ export const NoteType = {
label: 'New Note Type', label: 'New Note Type',
icon: PlusIcon, icon: PlusIcon,
content: (objectData, { onOk } = {}) => { content: (objectData, { onOk } = {}) => {
return createElement(NewNoteType, { return createElement(NewNoteType, { defaultValues: objectData, onOk, reset: true })
defaultValues: objectData,
onOk,
reset: true
})
} }
}, },
{ {
@ -83,7 +79,7 @@ export const NoteType = {
visible: (objectData) => { visible: (objectData) => {
return objectData?._isEditing && objectData?._isEditing == true return objectData?._isEditing && objectData?._isEditing == true
} }
} },
], ],
pages: [ pages: [
{ {
@ -116,7 +112,7 @@ export const NoteType = {
label: 'Created At', label: 'Created At',
type: 'dateTime', type: 'dateTime',
readOnly: true, readOnly: true,
columnWidth: 200 columnWidth: 175
}, },
{ {
name: '_reference', name: '_reference',
@ -141,7 +137,7 @@ export const NoteType = {
label: 'Updated At', label: 'Updated At',
type: 'dateTime', type: 'dateTime',
readOnly: true, readOnly: true,
columnWidth: 200 columnWidth: 175
}, },
{ {
name: 'color', name: 'color',

View File

@ -178,7 +178,7 @@ export const OrderItem = {
label: 'Created At', label: 'Created At',
type: 'dateTime', type: 'dateTime',
readOnly: true, readOnly: true,
columnWidth: 200 columnWidth: 175
}, },
{ {
name: '_reference', name: '_reference',
@ -195,7 +195,7 @@ export const OrderItem = {
label: 'Updated At', label: 'Updated At',
type: 'dateTime', type: 'dateTime',
readOnly: true, readOnly: true,
columnWidth: 200 columnWidth: 175
}, },
{ {
name: 'name', name: 'name',

View File

@ -30,11 +30,7 @@ export const Part = {
label: 'New Part', label: 'New Part',
icon: PlusIcon, icon: PlusIcon,
content: (objectData, { onOk } = {}) => { content: (objectData, { onOk } = {}) => {
return createElement(NewPart, { return createElement(NewPart, { defaultValues: objectData, onOk, reset: true })
defaultValues: objectData,
onOk,
reset: true
})
} }
}, },
{ {
@ -154,7 +150,7 @@ export const Part = {
label: 'Created At', label: 'Created At',
type: 'dateTime', type: 'dateTime',
readOnly: true, readOnly: true,
columnWidth: 200 columnWidth: 175
}, },
{ {
name: '_reference', name: '_reference',
@ -171,7 +167,7 @@ export const Part = {
label: 'Updated At', label: 'Updated At',
type: 'dateTime', type: 'dateTime',
readOnly: true, readOnly: true,
columnWidth: 200 columnWidth: 175
}, },
{ {
name: 'name', name: 'name',

View File

@ -167,7 +167,7 @@ export const PartSku = {
label: 'Created At', label: 'Created At',
type: 'dateTime', type: 'dateTime',
readOnly: true, readOnly: true,
columnWidth: 200 columnWidth: 175
}, },
{ {
name: '_reference', name: '_reference',
@ -184,7 +184,7 @@ export const PartSku = {
label: 'Updated At', label: 'Updated At',
type: 'dateTime', type: 'dateTime',
readOnly: true, readOnly: true,
columnWidth: 200 columnWidth: 175
}, },
{ {
name: 'name', name: 'name',

View File

@ -181,7 +181,7 @@ export const PartStock = {
label: 'Created At', label: 'Created At',
type: 'dateTime', type: 'dateTime',
readOnly: true, readOnly: true,
columnWidth: 200 columnWidth: 175
}, },
{ {
name: '_reference', name: '_reference',
@ -198,7 +198,7 @@ export const PartStock = {
label: 'Updated At', label: 'Updated At',
type: 'dateTime', type: 'dateTime',
readOnly: true, readOnly: true,
columnWidth: 200 columnWidth: 175
}, },
{ {
name: 'state', name: 'state',

View File

@ -231,7 +231,7 @@ export const Payment = {
label: 'Created At', label: 'Created At',
type: 'dateTime', type: 'dateTime',
readOnly: true, readOnly: true,
columnWidth: 200 columnWidth: 175
}, },
{ {
name: '_reference', name: '_reference',
@ -249,7 +249,7 @@ export const Payment = {
label: 'Updated At', label: 'Updated At',
type: 'dateTime', type: 'dateTime',
readOnly: true, readOnly: true,
columnWidth: 200 columnWidth: 175
}, },
{ {
name: 'state', name: 'state',

View File

@ -130,7 +130,7 @@ export const PaymentPolicy = {
label: 'Created At', label: 'Created At',
type: 'dateTime', type: 'dateTime',
readOnly: true, readOnly: true,
columnWidth: 200 columnWidth: 175
}, },
{ {
name: '_reference', name: '_reference',
@ -147,7 +147,7 @@ export const PaymentPolicy = {
label: 'Updated At', label: 'Updated At',
type: 'dateTime', type: 'dateTime',
readOnly: true, readOnly: true,
columnWidth: 200 columnWidth: 175
}, },
{ {
name: 'name', name: 'name',

View File

@ -5,8 +5,7 @@ const PermissionSettingInfo = lazy(
import('../../components/Dashboard/Management/PermissionSettings/PermissionSettingInfo') import('../../components/Dashboard/Management/PermissionSettings/PermissionSettingInfo')
) )
const NewPermissionSetting = lazy( const NewPermissionSetting = lazy(
() => () => import('../../components/Dashboard/Management/PermissionSettings/NewPermissionSetting')
import('../../components/Dashboard/Management/PermissionSettings/NewPermissionSetting')
) )
const DeleteObject = lazy( const DeleteObject = lazy(
() => import('../../components/Dashboard/common/DeleteObject') () => import('../../components/Dashboard/common/DeleteObject')
@ -37,11 +36,7 @@ export const PermissionSetting = {
label: 'New Permission Setting', label: 'New Permission Setting',
icon: PlusIcon, icon: PlusIcon,
content: (objectData, { onOk } = {}) => { content: (objectData, { onOk } = {}) => {
return createElement(NewPermissionSetting, { return createElement(NewPermissionSetting, { defaultValues: objectData, onOk, reset: true })
defaultValues: objectData,
onOk,
reset: true
})
} }
}, },
{ {
@ -129,7 +124,7 @@ export const PermissionSetting = {
label: 'Created At', label: 'Created At',
type: 'dateTime', type: 'dateTime',
readOnly: true, readOnly: true,
columnWidth: 200 columnWidth: 175
}, },
{ {
name: '_reference', name: '_reference',
@ -146,7 +141,7 @@ export const PermissionSetting = {
label: 'Updated At', label: 'Updated At',
type: 'dateTime', type: 'dateTime',
readOnly: true, readOnly: true,
columnWidth: 200 columnWidth: 175
}, },
{ {
name: 'name', name: 'name',

View File

@ -338,7 +338,7 @@ export const Printer = {
label: 'Created At', label: 'Created At',
type: 'dateTime', type: 'dateTime',
readOnly: true, readOnly: true,
columnWidth: 200 columnWidth: 175
}, },
{ {
name: '_reference', name: '_reference',
@ -355,7 +355,7 @@ export const Printer = {
label: 'Updated At', label: 'Updated At',
type: 'dateTime', type: 'dateTime',
readOnly: true, readOnly: true,
columnWidth: 200 columnWidth: 175
}, },
{ {
name: 'name', name: 'name',

View File

@ -1,12 +1,10 @@
import { createElement, lazy } from 'react' import { createElement, lazy } from 'react'
const PrinterProfileInfo = lazy( const PrinterProfileInfo = lazy(
() => () => import('../../components/Dashboard/Production/PrinterProfiles/PrinterProfileInfo')
import('../../components/Dashboard/Production/PrinterProfiles/PrinterProfileInfo')
) )
const NewPrinterProfile = lazy( const NewPrinterProfile = lazy(
() => () => import('../../components/Dashboard/Production/PrinterProfiles/NewPrinterProfile')
import('../../components/Dashboard/Production/PrinterProfiles/NewPrinterProfile')
) )
const DeleteObject = lazy( const DeleteObject = lazy(
() => import('../../components/Dashboard/common/DeleteObject') () => import('../../components/Dashboard/common/DeleteObject')
@ -301,11 +299,7 @@ export const PrinterProfile = {
label: 'New Printer Profile', label: 'New Printer Profile',
icon: PlusIcon, icon: PlusIcon,
content: (objectData, { onOk } = {}) => { content: (objectData, { onOk } = {}) => {
return createElement(NewPrinterProfile, { return createElement(NewPrinterProfile, { defaultValues: objectData, onOk, reset: true })
defaultValues: objectData,
onOk,
reset: true
})
} }
}, },
{ {
@ -391,7 +385,7 @@ export const PrinterProfile = {
'createdAt', 'createdAt',
'updatedAt' 'updatedAt'
], ],
filters: ['_id', 'name', 'createdAt', 'updatedAt', '_reference'], filters: ['_id','name','createdAt','updatedAt','_reference'],
sorters: [ sorters: [
'name', 'name',
'printBedWidth', 'printBedWidth',
@ -416,7 +410,7 @@ export const PrinterProfile = {
label: 'Created At', label: 'Created At',
type: 'dateTime', type: 'dateTime',
readOnly: true, readOnly: true,
columnWidth: 200 columnWidth: 175
}, },
{ {
name: '_reference', name: '_reference',
@ -433,7 +427,7 @@ export const PrinterProfile = {
label: 'Updated At', label: 'Updated At',
type: 'dateTime', type: 'dateTime',
readOnly: true, readOnly: true,
columnWidth: 200 columnWidth: 175
}, },
{ {
name: 'name', name: 'name',

View File

@ -30,11 +30,7 @@ export const Product = {
label: 'New Product', label: 'New Product',
icon: PlusIcon, icon: PlusIcon,
content: (objectData, { onOk } = {}) => { content: (objectData, { onOk } = {}) => {
return createElement(NewProduct, { return createElement(NewProduct, { defaultValues: objectData, onOk, reset: true })
defaultValues: objectData,
onOk,
reset: true
})
} }
}, },
{ {
@ -159,7 +155,7 @@ export const Product = {
label: 'Created At', label: 'Created At',
type: 'dateTime', type: 'dateTime',
readOnly: true, readOnly: true,
columnWidth: 200 columnWidth: 175
}, },
{ {
name: '_reference', name: '_reference',
@ -176,7 +172,7 @@ export const Product = {
label: 'Updated At', label: 'Updated At',
type: 'dateTime', type: 'dateTime',
readOnly: true, readOnly: true,
columnWidth: 200 columnWidth: 175
}, },
{ {
name: 'name', name: 'name',

View File

@ -138,7 +138,7 @@ export const ProductCategory = {
label: 'Created At', label: 'Created At',
type: 'dateTime', type: 'dateTime',
readOnly: true, readOnly: true,
columnWidth: 200 columnWidth: 175
}, },
{ {
name: '_reference', name: '_reference',
@ -156,7 +156,7 @@ export const ProductCategory = {
label: 'Updated At', label: 'Updated At',
type: 'dateTime', type: 'dateTime',
readOnly: true, readOnly: true,
columnWidth: 200 columnWidth: 175
}, },
{ {
name: 'name', name: 'name',

View File

@ -169,7 +169,7 @@ export const ProductSku = {
label: 'Created At', label: 'Created At',
type: 'dateTime', type: 'dateTime',
readOnly: true, readOnly: true,
columnWidth: 200 columnWidth: 175
}, },
{ {
name: '_reference', name: '_reference',
@ -195,7 +195,7 @@ export const ProductSku = {
label: 'Updated At', label: 'Updated At',
type: 'dateTime', type: 'dateTime',
readOnly: true, readOnly: true,
columnWidth: 200 columnWidth: 175
}, },
{ {
name: 'product', name: 'product',

View File

@ -187,7 +187,7 @@ export const ProductStock = {
label: 'Created At', label: 'Created At',
type: 'dateTime', type: 'dateTime',
readOnly: true, readOnly: true,
columnWidth: 200 columnWidth: 175
}, },
{ {
name: '_reference', name: '_reference',
@ -204,7 +204,7 @@ export const ProductStock = {
label: 'Updated At', label: 'Updated At',
type: 'dateTime', type: 'dateTime',
readOnly: true, readOnly: true,
columnWidth: 200 columnWidth: 175
}, },
{ {
name: 'state', name: 'state',

View File

@ -296,7 +296,7 @@ export const PurchaseOrder = {
label: 'Created At', label: 'Created At',
type: 'dateTime', type: 'dateTime',
readOnly: true, readOnly: true,
columnWidth: 200 columnWidth: 175
}, },
{ {
name: '_reference', name: '_reference',
@ -314,7 +314,7 @@ export const PurchaseOrder = {
label: 'Updated At', label: 'Updated At',
type: 'dateTime', type: 'dateTime',
readOnly: true, readOnly: true,
columnWidth: 200 columnWidth: 175
}, },
{ {
name: 'state', name: 'state',

View File

@ -154,7 +154,7 @@ export const ReturnPolicy = {
label: 'Created At', label: 'Created At',
type: 'dateTime', type: 'dateTime',
readOnly: true, readOnly: true,
columnWidth: 200 columnWidth: 175
}, },
{ {
name: '_reference', name: '_reference',
@ -171,7 +171,7 @@ export const ReturnPolicy = {
label: 'Updated At', label: 'Updated At',
type: 'dateTime', type: 'dateTime',
readOnly: true, readOnly: true,
columnWidth: 200 columnWidth: 175
}, },
{ {
name: 'name', name: 'name',

View File

@ -43,11 +43,7 @@ export const SalesOrder = {
label: 'New Sales Order', label: 'New Sales Order',
icon: PlusIcon, icon: PlusIcon,
content: (objectData, { onOk } = {}) => { content: (objectData, { onOk } = {}) => {
return createElement(NewSalesOrder, { return createElement(NewSalesOrder, { defaultValues: objectData, onOk, reset: true })
defaultValues: objectData,
onOk,
reset: true
})
} }
}, },
{ {
@ -164,10 +160,7 @@ export const SalesOrder = {
] ]
return !allowedStates.includes(objectData?.state?.type) return !allowedStates.includes(objectData?.state?.type)
}, },
objectData: (objectData) => ({ objectData: (objectData) => ({ orderType: 'salesOrder', order: objectData })
orderType: 'salesOrder',
order: objectData
})
}, },
{ type: 'divider' }, { type: 'divider' },
{ {
@ -240,7 +233,14 @@ export const SalesOrder = {
} }
], ],
group: ['client'], group: ['client'],
filters: ['client', 'state', 'value', 'createdAt', 'updatedAt', '_reference'], filters: [
'client',
'state',
'value',
'createdAt',
'updatedAt',
'_reference'
],
sorters: ['createdAt', 'state', 'updatedAt'], sorters: ['createdAt', 'state', 'updatedAt'],
columns: [ columns: [
'_reference', '_reference',
@ -272,7 +272,7 @@ export const SalesOrder = {
label: 'Created At', label: 'Created At',
type: 'dateTime', type: 'dateTime',
readOnly: true, readOnly: true,
columnWidth: 200 columnWidth: 175
}, },
{ {
name: '_reference', name: '_reference',
@ -290,7 +290,7 @@ export const SalesOrder = {
label: 'Updated At', label: 'Updated At',
type: 'dateTime', type: 'dateTime',
readOnly: true, readOnly: true,
columnWidth: 200 columnWidth: 175
}, },
{ {
name: 'state', name: 'state',

View File

@ -43,11 +43,7 @@ export const Shipment = {
label: 'New Shipment', label: 'New Shipment',
icon: PlusIcon, icon: PlusIcon,
content: (objectData, { onOk } = {}) => { content: (objectData, { onOk } = {}) => {
return createElement(NewShipment, { return createElement(NewShipment, { defaultValues: objectData, onOk, reset: true })
defaultValues: objectData,
onOk,
reset: true
})
} }
}, },
{ {
@ -229,7 +225,7 @@ export const Shipment = {
label: 'Created At', label: 'Created At',
type: 'dateTime', type: 'dateTime',
readOnly: true, readOnly: true,
columnWidth: 200 columnWidth: 175
}, },
{ {
name: '_reference', name: '_reference',
@ -247,7 +243,7 @@ export const Shipment = {
label: 'Updated At', label: 'Updated At',
type: 'dateTime', type: 'dateTime',
readOnly: true, readOnly: true,
columnWidth: 200 columnWidth: 175
}, },
{ {
name: 'state', name: 'state',

View File

@ -173,7 +173,7 @@ export const StockAudit = {
label: 'Created At', label: 'Created At',
type: 'dateTime', type: 'dateTime',
readOnly: true, readOnly: true,
columnWidth: 200 columnWidth: 175
}, },
{ {
name: '_reference', name: '_reference',
@ -190,7 +190,7 @@ export const StockAudit = {
label: 'Updated At', label: 'Updated At',
type: 'dateTime', type: 'dateTime',
readOnly: true, readOnly: true,
columnWidth: 200 columnWidth: 175
}, },
{ {
name: 'state', name: 'state',

View File

@ -129,7 +129,7 @@ export const StockAuditLevel = {
label: 'Created At', label: 'Created At',
type: 'dateTime', type: 'dateTime',
readOnly: true, readOnly: true,
columnWidth: 200 columnWidth: 175
}, },
{ {
name: '_reference', name: '_reference',
@ -146,7 +146,7 @@ export const StockAuditLevel = {
label: 'Updated At', label: 'Updated At',
type: 'dateTime', type: 'dateTime',
readOnly: true, readOnly: true,
columnWidth: 200 columnWidth: 175
}, },
{ {
name: 'name', name: 'name',

View File

@ -1,12 +1,10 @@
import { createElement, lazy } from 'react' import { createElement, lazy } from 'react'
const StockLocationInfo = lazy( const StockLocationInfo = lazy(
() => () => import('../../components/Dashboard/Inventory/StockLocations/StockLocationInfo')
import('../../components/Dashboard/Inventory/StockLocations/StockLocationInfo')
) )
const NewStockLocation = lazy( const NewStockLocation = lazy(
() => () => import('../../components/Dashboard/Inventory/StockLocations/NewStockLocation')
import('../../components/Dashboard/Inventory/StockLocations/NewStockLocation')
) )
import StockLocationIcon from '../../components/Icons/StockLocationIcon' import StockLocationIcon from '../../components/Icons/StockLocationIcon'
import PlusIcon from '../../components/Icons/PlusIcon' import PlusIcon from '../../components/Icons/PlusIcon'
@ -32,11 +30,7 @@ export const StockLocation = {
label: 'New Stock Location', label: 'New Stock Location',
icon: PlusIcon, icon: PlusIcon,
content: (objectData, { onOk } = {}) => { content: (objectData, { onOk } = {}) => {
return createElement(NewStockLocation, { return createElement(NewStockLocation, { defaultValues: objectData, onOk, reset: true })
defaultValues: objectData,
onOk,
reset: true
})
} }
}, },
{ {
@ -85,7 +79,7 @@ export const StockLocation = {
visible: (objectData) => { visible: (objectData) => {
return objectData?._isEditing && objectData?._isEditing == true return objectData?._isEditing && objectData?._isEditing == true
} }
} },
], ],
pages: [ pages: [
{ {
@ -93,8 +87,8 @@ export const StockLocation = {
content: () => createElement(StockLocationInfo) content: () => createElement(StockLocationInfo)
} }
], ],
filters: ['name', 'createdAt', 'updatedAt', '_reference'], filters: ['name','createdAt','updatedAt','_reference'],
sorters: ['name', 'createdAt', 'updatedAt'], sorters: ['name','createdAt','updatedAt'],
columns: ['_reference', 'name', 'address', 'createdAt', 'updatedAt'], columns: ['_reference', 'name', 'address', 'createdAt', 'updatedAt'],
properties: [ properties: [
{ {
@ -111,7 +105,7 @@ export const StockLocation = {
label: 'Created At', label: 'Created At',
type: 'dateTime', type: 'dateTime',
readOnly: true, readOnly: true,
columnWidth: 200 columnWidth: 175
}, },
{ {
name: '_reference', name: '_reference',
@ -128,7 +122,7 @@ export const StockLocation = {
label: 'Updated At', label: 'Updated At',
type: 'dateTime', type: 'dateTime',
readOnly: true, readOnly: true,
columnWidth: 200 columnWidth: 175
}, },
{ {
name: 'name', name: 'name',

View File

@ -172,7 +172,7 @@ export const StockTransfer = {
label: 'Created At', label: 'Created At',
type: 'dateTime', type: 'dateTime',
readOnly: true, readOnly: true,
columnWidth: 200 columnWidth: 175
}, },
{ {
name: '_reference', name: '_reference',
@ -189,7 +189,7 @@ export const StockTransfer = {
label: 'Updated At', label: 'Updated At',
type: 'dateTime', type: 'dateTime',
readOnly: true, readOnly: true,
columnWidth: 200 columnWidth: 175
}, },
{ {
name: 'state', name: 'state',

View File

@ -97,7 +97,7 @@ export const SubJob = {
label: 'Created At', label: 'Created At',
type: 'dateTime', type: 'dateTime',
readOnly: true, readOnly: true,
columnWidth: 200 columnWidth: 175
}, },
{ {
name: '_reference', name: '_reference',
@ -114,7 +114,7 @@ export const SubJob = {
label: 'Updated At', label: 'Updated At',
type: 'dateTime', type: 'dateTime',
readOnly: true, readOnly: true,
columnWidth: 200 columnWidth: 175
}, },
{ {
name: 'state', name: 'state',

View File

@ -35,11 +35,7 @@ export const TaxRate = {
label: 'New Tax Rate', label: 'New Tax Rate',
icon: PlusIcon, icon: PlusIcon,
content: (objectData, { onOk } = {}) => { content: (objectData, { onOk } = {}) => {
return createElement(NewTaxRate, { return createElement(NewTaxRate, { defaultValues: objectData, onOk, reset: true })
defaultValues: objectData,
onOk,
reset: true
})
} }
}, },
{ {
@ -158,7 +154,7 @@ export const TaxRate = {
label: 'Created At', label: 'Created At',
type: 'dateTime', type: 'dateTime',
readOnly: true, readOnly: true,
columnWidth: 200 columnWidth: 175
}, },
{ {
name: '_reference', name: '_reference',
@ -183,7 +179,7 @@ export const TaxRate = {
label: 'Updated At', label: 'Updated At',
type: 'dateTime', type: 'dateTime',
readOnly: true, readOnly: true,
columnWidth: 200 columnWidth: 175
}, },
{ {
name: 'active', name: 'active',

View File

@ -34,11 +34,7 @@ export const TaxRecord = {
label: 'New Tax Record', label: 'New Tax Record',
icon: PlusIcon, icon: PlusIcon,
content: (objectData, { onOk } = {}) => { content: (objectData, { onOk } = {}) => {
return createElement(NewTaxRecord, { return createElement(NewTaxRecord, { defaultValues: objectData, onOk, reset: true })
defaultValues: objectData,
onOk,
reset: true
})
} }
}, },
{ {
@ -152,7 +148,7 @@ export const TaxRecord = {
label: 'Created At', label: 'Created At',
type: 'dateTime', type: 'dateTime',
readOnly: true, readOnly: true,
columnWidth: 200 columnWidth: 175
}, },
{ {
name: '_reference', name: '_reference',

View File

@ -121,7 +121,7 @@ export const User = {
label: 'Created At', label: 'Created At',
type: 'dateTime', type: 'dateTime',
readOnly: true, readOnly: true,
columnWidth: 200 columnWidth: 175
}, },
{ {
name: '_reference', name: '_reference',
@ -138,7 +138,7 @@ export const User = {
label: 'Updated At', label: 'Updated At',
type: 'dateTime', type: 'dateTime',
readOnly: true, readOnly: true,
columnWidth: 200 columnWidth: 175
}, },
{ {
name: 'name', name: 'name',

View File

@ -35,11 +35,7 @@ export const UserGroup = {
label: 'New User Group', label: 'New User Group',
icon: PlusIcon, icon: PlusIcon,
content: (objectData, { onOk } = {}) => { content: (objectData, { onOk } = {}) => {
return createElement(NewUserGroup, { return createElement(NewUserGroup, { defaultValues: objectData, onOk, reset: true })
defaultValues: objectData,
onOk,
reset: true
})
} }
}, },
{ {
@ -139,7 +135,7 @@ export const UserGroup = {
label: 'Created At', label: 'Created At',
type: 'dateTime', type: 'dateTime',
readOnly: true, readOnly: true,
columnWidth: 200 columnWidth: 175
}, },
{ {
name: '_reference', name: '_reference',
@ -156,7 +152,7 @@ export const UserGroup = {
label: 'Updated At', label: 'Updated At',
type: 'dateTime', type: 'dateTime',
readOnly: true, readOnly: true,
columnWidth: 200 columnWidth: 175
}, },
{ {
name: 'name', name: 'name',

View File

@ -34,11 +34,7 @@ export const Vendor = {
label: 'New Vendor', label: 'New Vendor',
icon: PlusIcon, icon: PlusIcon,
content: (objectData, { onOk } = {}) => { content: (objectData, { onOk } = {}) => {
return createElement(NewVendor, { return createElement(NewVendor, { defaultValues: objectData, onOk, reset: true })
defaultValues: objectData,
onOk,
reset: true
})
} }
}, },
{ {
@ -151,7 +147,7 @@ export const Vendor = {
label: 'Created At', label: 'Created At',
type: 'dateTime', type: 'dateTime',
readOnly: true, readOnly: true,
columnWidth: 200 columnWidth: 175
}, },
{ {
name: '_reference', name: '_reference',
@ -176,7 +172,7 @@ export const Vendor = {
label: 'Updated At', label: 'Updated At',
type: 'dateTime', type: 'dateTime',
readOnly: true, readOnly: true,
columnWidth: 200 columnWidth: 175
}, },
{ {
name: 'contact', name: 'contact',