Compare commits

..

4 Commits

Author SHA1 Message Date
8438757db5 Refactor Invoices Component for Improved Readability and Structure
All checks were successful
farmcontrol/farmcontrol-ui/pipeline/head This commit looks good
- Streamlined the JSX structure in the Invoices component for better readability.
- Removed unnecessary line breaks and adjusted indentation for consistent formatting.
- Enhanced the organization of child components within the ObjectListViewProvider for clearer hierarchy.
2026-09-05 01:59:30 +01:00
5ad0008122 Refactor Database Models for Improved Readability and Consistency
- Updated lazy loading syntax for component imports across multiple models to enhance code clarity.
- Reformatted content return statements in various components for better readability.
- Adjusted column widths for date fields from 175 to 200 to improve layout consistency across models.
- Ensured consistent formatting and structure in model definitions for better maintainability.
2026-09-05 01:59:21 +01:00
4cae70b5e8 Integrate AuthContext into ObjectKanban and ObjectTimeline for Enhanced Subscription Management
- Added AuthContext to both ObjectKanban and ObjectTimeline components to manage subscriptions based on user authentication status.
- Updated useEffect hooks to conditionally subscribe to updates only when the user is connected and authenticated, improving performance and reliability.
- Refactored dependency arrays in useEffect hooks to include token checks, ensuring proper cleanup and subscription management.
2026-09-05 01:58:55 +01:00
fe2d257653 Enhance ObjectTable and Sidebar Functionality with Dynamic Width Management
- Introduced a new custom hook, useSidebarWidth, to manage and persist sidebar widths based on user settings, improving user experience and customization.
- Updated ObjectTable to utilize the sidebar width dynamically, enhancing layout responsiveness.
- Implemented visibility logic for vertical scrollbars in the ObjectTable, ensuring better usability during data interaction.
- Enhanced CSS styles for scrollbar transitions and sidebar components, improving visual feedback and interaction.
2026-09-05 01:58:44 +01:00
55 changed files with 506 additions and 211 deletions

View File

@ -739,6 +739,7 @@ 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 {
@ -1612,23 +1613,23 @@ span.ant-skeleton-input.ant-skeleton-input-sm.text-skeleton {
top: 0; top: 0;
right: -11px; right: -11px;
bottom: 0; bottom: 0;
width: 11px; width: 6px;
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: 11px; top: 11.15px;
bottom: 11px; bottom: 10.85px;
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;
} }
@ -1640,16 +1641,9 @@ 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);
} }
@ -1658,16 +1652,30 @@ span.ant-skeleton-input.ant-skeleton-input-sm.text-skeleton {
background: rgba(255, 255, 255, 0.08); background: rgba(255, 255, 255, 0.08);
} }
.dark-mode .objectKanbanColumnResizeHandle.active::before, .light-mode .objectKanbanColumnResizeHandle::after {
.dark-mode .objectKanbanColumnResizeHandle.active::after { background: rgba(0, 0, 0, 0.15);
background: #0b4c7e;
opacity: 1;
} }
.objectKanbanColumnResizeHandle:hover::before { .light-mode .objectKanbanColumnResizeHandle::before {
background: rgba(0, 0, 0, 0.04);
}
.dark-mode .objectKanbanColumnResizeHandle:hover::before {
background: #0e3a5b; background: #0e3a5b;
} }
.light-mode .objectKanbanColumnResizeHandle:hover::before {
background: #e6f8ff;
}
.dark-mode .objectKanbanColumnResizeHandle.active::before {
background: #0b4c7e;
}
.light-mode .objectKanbanColumnResizeHandle.active::before {
background: #a3e3ff;
}
body.objectKanbanColumnResizing, body.objectKanbanColumnResizing,
body.objectKanbanColumnResizing * { body.objectKanbanColumnResizing * {
cursor: col-resize !important; cursor: col-resize !important;
@ -2313,6 +2321,15 @@ 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,12 +26,8 @@ const Invoices = () => {
const [showSortSidebar, setShowSortSidebar] = const [showSortSidebar, setShowSortSidebar] =
useSortSidebarVisibility('Invoices') useSortSidebarVisibility('Invoices')
return ( return (
<ObjectListViewProvider <ObjectListViewProvider objectType='invoice' tableRef={tableRef}>
objectType='invoice'
tableRef={tableRef}
>
<Flex vertical={'true'} gap='large' className='h-100'> <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'>
@ -58,9 +54,7 @@ const Invoices = () => {
active={showFilterSidebar} active={showFilterSidebar}
onClick={() => setShowFilterSidebar(!showFilterSidebar)} onClick={() => setShowFilterSidebar(!showFilterSidebar)}
/> />
<ObjectTableViewButton <ObjectTableViewButton objectType='invoice' />
objectType='invoice'
/>
<ListViewEditButtons showStartingDivider={true} /> <ListViewEditButtons showStartingDivider={true} />
</Space> </Space>
</Flex> </Flex>

View File

@ -13,6 +13,7 @@ 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'
@ -285,6 +286,7 @@ 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)
@ -698,19 +700,27 @@ const ObjectKanban = forwardRef(
useEffect(() => { useEffect(() => {
return () => { return () => {
if (connected == true && subscribeToObjectTypeUpdatesRef.current) { if (
connected == true &&
token &&
subscribeToObjectTypeUpdatesRef.current
) {
subscribeToObjectTypeUpdatesRef.current() subscribeToObjectTypeUpdatesRef.current()
subscribeToObjectTypeUpdatesRef.current = null subscribeToObjectTypeUpdatesRef.current = null
} }
if (connected == true && subscribeToAllObjectUpdatesRef.current) { if (
connected == true &&
token &&
subscribeToAllObjectUpdatesRef.current
) {
subscribeToAllObjectUpdatesRef.current() subscribeToAllObjectUpdatesRef.current()
subscribeToAllObjectUpdatesRef.current = null subscribeToAllObjectUpdatesRef.current = null
} }
} }
}, [connected]) }, [connected, token])
useEffect(() => { useEffect(() => {
if (connected !== true || !type) return if (connected !== true || !type || !token) return
const unsubscribe = subscribeToAllObjectUpdates( const unsubscribe = subscribeToAllObjectUpdates(
type, type,
@ -725,10 +735,10 @@ const ObjectKanban = forwardRef(
subscribeToAllObjectUpdatesRef.current = null subscribeToAllObjectUpdatesRef.current = null
} }
} }
}, [type, connected, subscribeToAllObjectUpdates]) }, [type, connected, subscribeToAllObjectUpdates, token])
useEffect(() => { useEffect(() => {
if (connected !== true) return if (connected !== true || !token) return
if (subscribedTypeRef.current === type) return if (subscribedTypeRef.current === type) return
const unsubscribe = subscribeToObjectTypeUpdatesFnRef.current( const unsubscribe = subscribeToObjectTypeUpdatesFnRef.current(
@ -747,7 +757,7 @@ const ObjectKanban = forwardRef(
subscribedTypeRef.current = null subscribedTypeRef.current = null
} }
} }
}, [type, connected]) }, [type, connected, token])
useImperativeHandle( useImperativeHandle(
ref, ref,

View File

@ -69,6 +69,9 @@ 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)
@ -412,6 +415,10 @@ 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.
@ -1929,7 +1936,11 @@ const ObjectTable = forwardRef(
const cardsContainerNodeRef = useRef(null) const cardsContainerNodeRef = useRef(null)
const cardsResizeObserverRef = useRef(null) const cardsResizeObserverRef = useRef(null)
const measureCardColSpan = useCallback(() => { const measureCardColSpan = useCallback((sizes) => {
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')
@ -2107,17 +2118,53 @@ const ObjectTable = forwardRef(
) )
useEffect(() => { useEffect(() => {
console.log('loading', loading) const container = tableContentRef.current
}, [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={'farmcontrol-splitter large'} className={classNames('farmcontrol-splitter large', {
'vertical-scroll-visible': verticalScrollVisible
})}
onResize={measureCardColSpan} onResize={measureCardColSpan}
onResizeEnd={measureCardColSpan} onResizeEnd={measureCardColSpan}
> >
@ -2214,8 +2261,8 @@ const ObjectTable = forwardRef(
</Spin> </Spin>
)} )}
</Splitter.Panel> </Splitter.Panel>
{(showSortSidebar || showFilterSidebar) && ( {(showSortSidebar || showFilterSidebar) && initialized && (
<Splitter.Panel defaultSize={'25%'}> <Splitter.Panel size={sidebarWidth}>
<Flex <Flex
vertical vertical
gap='large' gap='large'

View File

@ -16,6 +16,7 @@ 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
@ -40,7 +41,8 @@ const ObjectTimeline = ({
onScroll, onScroll,
rowWrapper rowWrapper
}) => { }) => {
const { getModelPropertyValues } = useContext(ApiServerContext) const { getModelPropertyValues, connected } = useContext(ApiServerContext)
const { token } = useContext(AuthContext)
const getModelPropertyValuesRef = useRef(getModelPropertyValues) const getModelPropertyValuesRef = useRef(getModelPropertyValues)
getModelPropertyValuesRef.current = getModelPropertyValues getModelPropertyValuesRef.current = getModelPropertyValues
@ -60,6 +62,8 @@ const ObjectTimeline = ({
) )
useEffect(() => { useEffect(() => {
if (connected !== true || !token) return
if (!type || !startDate) { if (!type || !startDate) {
setStartValues([]) setStartValues([])
setEndValues([]) setEndValues([])
@ -105,7 +109,7 @@ const ObjectTimeline = ({
return () => { return () => {
cancelled = true cancelled = true
} }
}, [endDate, rangeQueryKey, startDate, type]) }, [endDate, rangeQueryKey, startDate, type, connected, token])
const [showShadow, setShowShadow] = useState(false) const [showShadow, setShowShadow] = useState(false)

View File

@ -0,0 +1,128 @@
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,7 +5,8 @@ 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(
() => () =>
@ -36,7 +37,11 @@ export const AppPassword = {
label: 'New App Password', label: 'New App Password',
icon: PlusIcon, icon: PlusIcon,
content: (objectData, { onOk } = {}) => { content: (objectData, { onOk } = {}) => {
return createElement(NewAppPassword, { defaultValues: objectData, onOk, reset: true }) return createElement(NewAppPassword, {
defaultValues: objectData,
onOk,
reset: true
})
} }
}, },
{ {
@ -140,7 +145,7 @@ export const AppPassword = {
label: 'Created At', label: 'Created At',
type: 'dateTime', type: 'dateTime',
readOnly: true, readOnly: true,
columnWidth: 175 columnWidth: 200
}, },
{ {
name: '_reference', name: '_reference',
@ -166,7 +171,7 @@ export const AppPassword = {
label: 'Updated At', label: 'Updated At',
type: 'dateTime', type: 'dateTime',
readOnly: true, readOnly: true,
columnWidth: 175 columnWidth: 200
}, },
{ {
name: 'user', name: 'user',

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -5,7 +5,8 @@ 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')
@ -35,7 +36,11 @@ export const FilamentProfile = {
label: 'New Filament Profile', label: 'New Filament Profile',
icon: PlusIcon, icon: PlusIcon,
content: (objectData, { onOk } = {}) => { content: (objectData, { onOk } = {}) => {
return createElement(NewFilamentProfile, { defaultValues: objectData, onOk, reset: true }) return createElement(NewFilamentProfile, {
defaultValues: objectData,
onOk,
reset: true
})
} }
}, },
{ {
@ -131,7 +136,7 @@ export const FilamentProfile = {
label: 'Created At', label: 'Created At',
type: 'dateTime', type: 'dateTime',
readOnly: true, readOnly: true,
columnWidth: 175 columnWidth: 200
}, },
{ {
name: '_reference', name: '_reference',
@ -148,7 +153,7 @@ export const FilamentProfile = {
label: 'Updated At', label: 'Updated At',
type: 'dateTime', type: 'dateTime',
readOnly: true, readOnly: true,
columnWidth: 175 columnWidth: 200
}, },
{ {
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: 175 columnWidth: 200
}, },
{ {
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: 175 columnWidth: 200
}, },
{ {
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: 175 columnWidth: 200
}, },
{ {
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: 175 columnWidth: 200
}, },
{ {
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: 175 columnWidth: 200
}, },
{ {
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: 175 columnWidth: 200
}, },
{ {
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: 175 columnWidth: 200
}, },
{ {
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: 175 columnWidth: 200
}, },
{ {
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: 175 columnWidth: 200
}, },
{ {
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: 175 columnWidth: 200
}, },
{ {
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: 175 columnWidth: 200
}, },
{ {
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: 175 columnWidth: 200
}, },
{ {
name: 'state', name: 'state',

View File

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

View File

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

View File

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

View File

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

View File

@ -5,7 +5,8 @@ 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')
@ -36,7 +37,11 @@ export const PermissionSetting = {
label: 'New Permission Setting', label: 'New Permission Setting',
icon: PlusIcon, icon: PlusIcon,
content: (objectData, { onOk } = {}) => { content: (objectData, { onOk } = {}) => {
return createElement(NewPermissionSetting, { defaultValues: objectData, onOk, reset: true }) return createElement(NewPermissionSetting, {
defaultValues: objectData,
onOk,
reset: true
})
} }
}, },
{ {
@ -124,7 +129,7 @@ export const PermissionSetting = {
label: 'Created At', label: 'Created At',
type: 'dateTime', type: 'dateTime',
readOnly: true, readOnly: true,
columnWidth: 175 columnWidth: 200
}, },
{ {
name: '_reference', name: '_reference',
@ -141,7 +146,7 @@ export const PermissionSetting = {
label: 'Updated At', label: 'Updated At',
type: 'dateTime', type: 'dateTime',
readOnly: true, readOnly: true,
columnWidth: 175 columnWidth: 200
}, },
{ {
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: 175 columnWidth: 200
}, },
{ {
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: 175 columnWidth: 200
}, },
{ {
name: 'name', name: 'name',

View File

@ -1,10 +1,12 @@
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')
@ -299,7 +301,11 @@ export const PrinterProfile = {
label: 'New Printer Profile', label: 'New Printer Profile',
icon: PlusIcon, icon: PlusIcon,
content: (objectData, { onOk } = {}) => { content: (objectData, { onOk } = {}) => {
return createElement(NewPrinterProfile, { defaultValues: objectData, onOk, reset: true }) return createElement(NewPrinterProfile, {
defaultValues: objectData,
onOk,
reset: true
})
} }
}, },
{ {
@ -410,7 +416,7 @@ export const PrinterProfile = {
label: 'Created At', label: 'Created At',
type: 'dateTime', type: 'dateTime',
readOnly: true, readOnly: true,
columnWidth: 175 columnWidth: 200
}, },
{ {
name: '_reference', name: '_reference',
@ -427,7 +433,7 @@ export const PrinterProfile = {
label: 'Updated At', label: 'Updated At',
type: 'dateTime', type: 'dateTime',
readOnly: true, readOnly: true,
columnWidth: 175 columnWidth: 200
}, },
{ {
name: 'name', name: 'name',

View File

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

View File

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

View File

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

View File

@ -1,10 +1,12 @@
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'
@ -30,7 +32,11 @@ export const StockLocation = {
label: 'New Stock Location', label: 'New Stock Location',
icon: PlusIcon, icon: PlusIcon,
content: (objectData, { onOk } = {}) => { content: (objectData, { onOk } = {}) => {
return createElement(NewStockLocation, { defaultValues: objectData, onOk, reset: true }) return createElement(NewStockLocation, {
defaultValues: objectData,
onOk,
reset: true
})
} }
}, },
{ {
@ -79,7 +85,7 @@ export const StockLocation = {
visible: (objectData) => { visible: (objectData) => {
return objectData?._isEditing && objectData?._isEditing == true return objectData?._isEditing && objectData?._isEditing == true
} }
}, }
], ],
pages: [ pages: [
{ {
@ -105,7 +111,7 @@ export const StockLocation = {
label: 'Created At', label: 'Created At',
type: 'dateTime', type: 'dateTime',
readOnly: true, readOnly: true,
columnWidth: 175 columnWidth: 200
}, },
{ {
name: '_reference', name: '_reference',
@ -122,7 +128,7 @@ export const StockLocation = {
label: 'Updated At', label: 'Updated At',
type: 'dateTime', type: 'dateTime',
readOnly: true, readOnly: true,
columnWidth: 175 columnWidth: 200
}, },
{ {
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: 175 columnWidth: 200
}, },
{ {
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: 175 columnWidth: 200
}, },
{ {
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: 175 columnWidth: 200
}, },
{ {
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: 175 columnWidth: 200
}, },
{ {
name: 'state', name: 'state',

View File

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

View File

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

View File

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

View File

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