Refactor finance and inventory components to enhance modal handling and state management
All checks were successful
farmcontrol/farmcontrol-ui/pipeline/head This commit looks good
All checks were successful
farmcontrol/farmcontrol-ui/pipeline/head This commit looks good
- Integrated useEffect hooks in InvoiceInfo, PaymentInfo, and other components to utilize ActionsContext for managing modal states. - Removed unused modal states and related code to streamline component logic. - Added setCurrentObject prop to various components for improved object handling during state changes. - Enhanced overall code maintainability and readability by consolidating modal logic and reducing redundancy.
This commit is contained in:
parent
89b6f476c1
commit
f4635d9188
@ -1,6 +1,6 @@
|
|||||||
import { useRef, useState } from 'react'
|
import { useRef, useState, useEffect } from 'react'
|
||||||
import { useLocation } from 'react-router-dom'
|
import { useLocation } from 'react-router-dom'
|
||||||
import { Card, Flex, Modal, Space } from 'antd'
|
import { Card, Flex, Space } from 'antd'
|
||||||
import { LoadingOutlined } from '@ant-design/icons'
|
import { LoadingOutlined } from '@ant-design/icons'
|
||||||
import loglevel from 'loglevel'
|
import loglevel from 'loglevel'
|
||||||
import config from '../../../../config.js'
|
import config from '../../../../config.js'
|
||||||
@ -19,6 +19,7 @@ import EditButtons from '../../common/EditButtons.jsx'
|
|||||||
import ObjectTableNavigationButtons from '../../common/ObjectTableNavigationButtons.jsx'
|
import ObjectTableNavigationButtons from '../../common/ObjectTableNavigationButtons.jsx'
|
||||||
import ActivityIndicator from '../../common/ActivityIndicator.jsx'
|
import ActivityIndicator from '../../common/ActivityIndicator.jsx'
|
||||||
import ActionHandler from '../../common/ActionHandler.jsx'
|
import ActionHandler from '../../common/ActionHandler.jsx'
|
||||||
|
import { useActions } from '../../context/ActionsContext'
|
||||||
import ObjectActions from '../../common/ObjectActions.jsx'
|
import ObjectActions from '../../common/ObjectActions.jsx'
|
||||||
import ObjectTable from '../../common/ObjectTable.jsx'
|
import ObjectTable from '../../common/ObjectTable.jsx'
|
||||||
import InfoCollapsePlaceholder from '../../common/InfoCollapsePlaceholder.jsx'
|
import InfoCollapsePlaceholder from '../../common/InfoCollapsePlaceholder.jsx'
|
||||||
@ -31,9 +32,6 @@ import {
|
|||||||
} from '../../../../database/ObjectModels.js'
|
} from '../../../../database/ObjectModels.js'
|
||||||
import OrderItemIcon from '../../../Icons/OrderItemIcon.jsx'
|
import OrderItemIcon from '../../../Icons/OrderItemIcon.jsx'
|
||||||
import ShipmentIcon from '../../../Icons/ShipmentIcon.jsx'
|
import ShipmentIcon from '../../../Icons/ShipmentIcon.jsx'
|
||||||
import PostInvoice from './PostInvoice.jsx'
|
|
||||||
import AcknowledgeInvoice from './AcknowledgeInvoice.jsx'
|
|
||||||
import NewPayment from '../Payments/NewPayment.jsx'
|
|
||||||
|
|
||||||
const log = loglevel.getLogger('InvoiceInfo')
|
const log = loglevel.getLogger('InvoiceInfo')
|
||||||
log.setLevel(config.logLevel)
|
log.setLevel(config.logLevel)
|
||||||
@ -42,6 +40,15 @@ const InvoiceInfo = () => {
|
|||||||
const location = useLocation()
|
const location = useLocation()
|
||||||
const objectFormRef = useRef(null)
|
const objectFormRef = useRef(null)
|
||||||
const actionHandlerRef = useRef(null)
|
const actionHandlerRef = useRef(null)
|
||||||
|
|
||||||
|
|
||||||
|
const { setOnModalOk } = useActions()
|
||||||
|
useEffect(() => {
|
||||||
|
setOnModalOk(() => () => {
|
||||||
|
objectFormRef.current?.handleFetchObject?.()
|
||||||
|
})
|
||||||
|
return () => setOnModalOk(null)
|
||||||
|
}, [setOnModalOk])
|
||||||
const invoiceId = new URLSearchParams(location.search).get('invoiceId')
|
const invoiceId = new URLSearchParams(location.search).get('invoiceId')
|
||||||
const [collapseState, updateCollapseState] = useCollapseState('InvoiceInfo', {
|
const [collapseState, updateCollapseState] = useCollapseState('InvoiceInfo', {
|
||||||
info: true,
|
info: true,
|
||||||
@ -60,9 +67,6 @@ const InvoiceInfo = () => {
|
|||||||
loading: false,
|
loading: false,
|
||||||
objectData: {}
|
objectData: {}
|
||||||
})
|
})
|
||||||
const [postInvoiceOpen, setPostInvoiceOpen] = useState(false)
|
|
||||||
const [acknowledgeInvoiceOpen, setAcknowledgeInvoiceOpen] = useState(false)
|
|
||||||
const [newPaymentOpen, setNewPaymentOpen] = useState(false)
|
|
||||||
|
|
||||||
const actions = {
|
const actions = {
|
||||||
edit: () => {
|
edit: () => {
|
||||||
@ -81,18 +85,6 @@ const InvoiceInfo = () => {
|
|||||||
objectFormRef?.current?.handleDelete?.()
|
objectFormRef?.current?.handleDelete?.()
|
||||||
return true
|
return true
|
||||||
},
|
},
|
||||||
post: () => {
|
|
||||||
setPostInvoiceOpen(true)
|
|
||||||
return true
|
|
||||||
},
|
|
||||||
acknowledge: () => {
|
|
||||||
setAcknowledgeInvoiceOpen(true)
|
|
||||||
return true
|
|
||||||
},
|
|
||||||
newPayment: () => {
|
|
||||||
setNewPaymentOpen(true)
|
|
||||||
return true
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
const editDisabled =
|
const editDisabled =
|
||||||
@ -101,7 +93,6 @@ const InvoiceInfo = () => {
|
|||||||
?.disabled(objectFormState.objectData) ?? false
|
?.disabled(objectFormState.objectData) ?? false
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
|
||||||
<Flex
|
<Flex
|
||||||
gap='large'
|
gap='large'
|
||||||
vertical='true'
|
vertical='true'
|
||||||
@ -190,6 +181,7 @@ const InvoiceInfo = () => {
|
|||||||
type='invoice'
|
type='invoice'
|
||||||
style={{ height: '100%' }}
|
style={{ height: '100%' }}
|
||||||
ref={objectFormRef}
|
ref={objectFormRef}
|
||||||
|
setCurrentObject={true}
|
||||||
onStateChange={(state) => {
|
onStateChange={(state) => {
|
||||||
setEditFormState((prev) => ({ ...prev, ...state }))
|
setEditFormState((prev) => ({ ...prev, ...state }))
|
||||||
}}
|
}}
|
||||||
@ -306,65 +298,6 @@ const InvoiceInfo = () => {
|
|||||||
</Flex>
|
</Flex>
|
||||||
</ScrollBox>
|
</ScrollBox>
|
||||||
</Flex>
|
</Flex>
|
||||||
<Modal
|
|
||||||
open={postInvoiceOpen}
|
|
||||||
onCancel={() => {
|
|
||||||
setPostInvoiceOpen(false)
|
|
||||||
}}
|
|
||||||
width={500}
|
|
||||||
footer={null}
|
|
||||||
destroyOnHidden={true}
|
|
||||||
centered={true}
|
|
||||||
>
|
|
||||||
<PostInvoice
|
|
||||||
onOk={() => {
|
|
||||||
setPostInvoiceOpen(false)
|
|
||||||
objectFormRef?.current.handleFetchObject()
|
|
||||||
}}
|
|
||||||
objectData={objectFormState.objectData}
|
|
||||||
/>
|
|
||||||
</Modal>
|
|
||||||
<Modal
|
|
||||||
open={acknowledgeInvoiceOpen}
|
|
||||||
onCancel={() => {
|
|
||||||
setAcknowledgeInvoiceOpen(false)
|
|
||||||
}}
|
|
||||||
width={515}
|
|
||||||
footer={null}
|
|
||||||
destroyOnHidden={true}
|
|
||||||
centered={true}
|
|
||||||
>
|
|
||||||
<AcknowledgeInvoice
|
|
||||||
onOk={() => {
|
|
||||||
setAcknowledgeInvoiceOpen(false)
|
|
||||||
objectFormRef?.current.handleFetchObject()
|
|
||||||
}}
|
|
||||||
objectData={objectFormState.objectData}
|
|
||||||
/>
|
|
||||||
</Modal>
|
|
||||||
<Modal
|
|
||||||
open={newPaymentOpen}
|
|
||||||
styles={{ content: { paddingBottom: '24px' } }}
|
|
||||||
footer={null}
|
|
||||||
width={800}
|
|
||||||
onCancel={() => {
|
|
||||||
setNewPaymentOpen(false)
|
|
||||||
}}
|
|
||||||
destroyOnHidden={true}
|
|
||||||
>
|
|
||||||
<NewPayment
|
|
||||||
onOk={() => {
|
|
||||||
setNewPaymentOpen(false)
|
|
||||||
objectFormRef?.current.handleFetchObject()
|
|
||||||
}}
|
|
||||||
reset={newPaymentOpen}
|
|
||||||
defaultValues={{
|
|
||||||
invoice: { ...objectFormState.objectData },
|
|
||||||
amount: objectFormState.objectData?.grandTotalAmount
|
|
||||||
}}
|
|
||||||
/>
|
|
||||||
</Modal>
|
|
||||||
</>
|
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
import { useRef, useState } from 'react'
|
import { useRef, useState, useEffect } from 'react'
|
||||||
import { useLocation } from 'react-router-dom'
|
import { useLocation } from 'react-router-dom'
|
||||||
import { Card, Flex, Modal, Space } from 'antd'
|
import { Card, Flex, Space } from 'antd'
|
||||||
import { LoadingOutlined } from '@ant-design/icons'
|
import { LoadingOutlined } from '@ant-design/icons'
|
||||||
import loglevel from 'loglevel'
|
import loglevel from 'loglevel'
|
||||||
import config from '../../../../config.js'
|
import config from '../../../../config.js'
|
||||||
@ -17,6 +17,7 @@ import EditButtons from '../../common/EditButtons.jsx'
|
|||||||
import ObjectTableNavigationButtons from '../../common/ObjectTableNavigationButtons.jsx'
|
import ObjectTableNavigationButtons from '../../common/ObjectTableNavigationButtons.jsx'
|
||||||
import ActivityIndicator from '../../common/ActivityIndicator.jsx'
|
import ActivityIndicator from '../../common/ActivityIndicator.jsx'
|
||||||
import ActionHandler from '../../common/ActionHandler.jsx'
|
import ActionHandler from '../../common/ActionHandler.jsx'
|
||||||
|
import { useActions } from '../../context/ActionsContext'
|
||||||
import ObjectActions from '../../common/ObjectActions.jsx'
|
import ObjectActions from '../../common/ObjectActions.jsx'
|
||||||
import ObjectTable from '../../common/ObjectTable.jsx'
|
import ObjectTable from '../../common/ObjectTable.jsx'
|
||||||
import InfoCollapsePlaceholder from '../../common/InfoCollapsePlaceholder.jsx'
|
import InfoCollapsePlaceholder from '../../common/InfoCollapsePlaceholder.jsx'
|
||||||
@ -24,10 +25,6 @@ import DocumentPrintButton from '../../common/DocumentPrintButton.jsx'
|
|||||||
import UserNotifierToggle from '../../common/UserNotifierToggle.jsx'
|
import UserNotifierToggle from '../../common/UserNotifierToggle.jsx'
|
||||||
import ScrollBox from '../../common/ScrollBox.jsx'
|
import ScrollBox from '../../common/ScrollBox.jsx'
|
||||||
import { getModelByName } from '../../../../database/ObjectModels.js'
|
import { getModelByName } from '../../../../database/ObjectModels.js'
|
||||||
import PostPayment from './PostPayment.jsx'
|
|
||||||
import AuthorisePayment from './AuthorisePayment.jsx'
|
|
||||||
import DeclinePayment from './DeclinePayment.jsx'
|
|
||||||
import CancelPayment from './CancelPayment.jsx'
|
|
||||||
|
|
||||||
const log = loglevel.getLogger('PaymentInfo')
|
const log = loglevel.getLogger('PaymentInfo')
|
||||||
log.setLevel(config.logLevel)
|
log.setLevel(config.logLevel)
|
||||||
@ -36,6 +33,15 @@ const PaymentInfo = () => {
|
|||||||
const location = useLocation()
|
const location = useLocation()
|
||||||
const objectFormRef = useRef(null)
|
const objectFormRef = useRef(null)
|
||||||
const actionHandlerRef = useRef(null)
|
const actionHandlerRef = useRef(null)
|
||||||
|
|
||||||
|
|
||||||
|
const { setOnModalOk } = useActions()
|
||||||
|
useEffect(() => {
|
||||||
|
setOnModalOk(() => () => {
|
||||||
|
objectFormRef.current?.handleFetchObject?.()
|
||||||
|
})
|
||||||
|
return () => setOnModalOk(null)
|
||||||
|
}, [setOnModalOk])
|
||||||
const paymentId = new URLSearchParams(location.search).get('paymentId')
|
const paymentId = new URLSearchParams(location.search).get('paymentId')
|
||||||
const [collapseState, updateCollapseState] = useCollapseState('PaymentInfo', {
|
const [collapseState, updateCollapseState] = useCollapseState('PaymentInfo', {
|
||||||
info: true,
|
info: true,
|
||||||
@ -51,10 +57,6 @@ const PaymentInfo = () => {
|
|||||||
loading: false,
|
loading: false,
|
||||||
objectData: {}
|
objectData: {}
|
||||||
})
|
})
|
||||||
const [postPaymentOpen, setPostPaymentOpen] = useState(false)
|
|
||||||
const [authorisePaymentOpen, setAuthorisePaymentOpen] = useState(false)
|
|
||||||
const [declinePaymentOpen, setDeclinePaymentOpen] = useState(false)
|
|
||||||
const [cancelPaymentOpen, setCancelPaymentOpen] = useState(false)
|
|
||||||
|
|
||||||
const actions = {
|
const actions = {
|
||||||
edit: () => {
|
edit: () => {
|
||||||
@ -73,22 +75,6 @@ const PaymentInfo = () => {
|
|||||||
objectFormRef?.current?.handleDelete?.()
|
objectFormRef?.current?.handleDelete?.()
|
||||||
return true
|
return true
|
||||||
},
|
},
|
||||||
post: () => {
|
|
||||||
setPostPaymentOpen(true)
|
|
||||||
return true
|
|
||||||
},
|
|
||||||
authorise: () => {
|
|
||||||
setAuthorisePaymentOpen(true)
|
|
||||||
return true
|
|
||||||
},
|
|
||||||
decline: () => {
|
|
||||||
setDeclinePaymentOpen(true)
|
|
||||||
return true
|
|
||||||
},
|
|
||||||
cancel: () => {
|
|
||||||
setCancelPaymentOpen(true)
|
|
||||||
return true
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
const editDisabled =
|
const editDisabled =
|
||||||
@ -97,7 +83,6 @@ const PaymentInfo = () => {
|
|||||||
?.disabled(objectFormState.objectData) ?? false
|
?.disabled(objectFormState.objectData) ?? false
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
|
||||||
<Flex
|
<Flex
|
||||||
gap='large'
|
gap='large'
|
||||||
vertical='true'
|
vertical='true'
|
||||||
@ -183,6 +168,7 @@ const PaymentInfo = () => {
|
|||||||
type='payment'
|
type='payment'
|
||||||
style={{ height: '100%' }}
|
style={{ height: '100%' }}
|
||||||
ref={objectFormRef}
|
ref={objectFormRef}
|
||||||
|
setCurrentObject={true}
|
||||||
onStateChange={(state) => {
|
onStateChange={(state) => {
|
||||||
setEditFormState((prev) => ({ ...prev, ...state }))
|
setEditFormState((prev) => ({ ...prev, ...state }))
|
||||||
}}
|
}}
|
||||||
@ -244,79 +230,6 @@ const PaymentInfo = () => {
|
|||||||
</Flex>
|
</Flex>
|
||||||
</ScrollBox>
|
</ScrollBox>
|
||||||
</Flex>
|
</Flex>
|
||||||
<Modal
|
|
||||||
open={postPaymentOpen}
|
|
||||||
onCancel={() => {
|
|
||||||
setPostPaymentOpen(false)
|
|
||||||
}}
|
|
||||||
width={500}
|
|
||||||
footer={null}
|
|
||||||
destroyOnHidden={true}
|
|
||||||
centered={true}
|
|
||||||
>
|
|
||||||
<PostPayment
|
|
||||||
onOk={() => {
|
|
||||||
setPostPaymentOpen(false)
|
|
||||||
objectFormRef?.current.handleFetchObject()
|
|
||||||
}}
|
|
||||||
objectData={objectFormState.objectData}
|
|
||||||
/>
|
|
||||||
</Modal>
|
|
||||||
<Modal
|
|
||||||
open={authorisePaymentOpen}
|
|
||||||
onCancel={() => {
|
|
||||||
setAuthorisePaymentOpen(false)
|
|
||||||
}}
|
|
||||||
width={515}
|
|
||||||
footer={null}
|
|
||||||
destroyOnHidden={true}
|
|
||||||
centered={true}
|
|
||||||
>
|
|
||||||
<AuthorisePayment
|
|
||||||
onOk={() => {
|
|
||||||
setAuthorisePaymentOpen(false)
|
|
||||||
objectFormRef?.current.handleFetchObject()
|
|
||||||
}}
|
|
||||||
objectData={objectFormState.objectData}
|
|
||||||
/>
|
|
||||||
</Modal>
|
|
||||||
<Modal
|
|
||||||
open={declinePaymentOpen}
|
|
||||||
onCancel={() => {
|
|
||||||
setDeclinePaymentOpen(false)
|
|
||||||
}}
|
|
||||||
width={515}
|
|
||||||
footer={null}
|
|
||||||
destroyOnHidden={true}
|
|
||||||
centered={true}
|
|
||||||
>
|
|
||||||
<DeclinePayment
|
|
||||||
onOk={() => {
|
|
||||||
setDeclinePaymentOpen(false)
|
|
||||||
objectFormRef?.current.handleFetchObject()
|
|
||||||
}}
|
|
||||||
objectData={objectFormState.objectData}
|
|
||||||
/>
|
|
||||||
</Modal>
|
|
||||||
<Modal
|
|
||||||
open={cancelPaymentOpen}
|
|
||||||
onCancel={() => {
|
|
||||||
setCancelPaymentOpen(false)
|
|
||||||
}}
|
|
||||||
width={515}
|
|
||||||
footer={null}
|
|
||||||
destroyOnHidden={true}
|
|
||||||
centered={true}
|
|
||||||
>
|
|
||||||
<CancelPayment
|
|
||||||
onOk={() => {
|
|
||||||
setCancelPaymentOpen(false)
|
|
||||||
objectFormRef?.current.handleFetchObject()
|
|
||||||
}}
|
|
||||||
objectData={objectFormState.objectData}
|
|
||||||
/>
|
|
||||||
</Modal>
|
|
||||||
</>
|
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -155,6 +155,7 @@ const TaxRecordInfo = () => {
|
|||||||
type='taxRecord'
|
type='taxRecord'
|
||||||
style={{ height: '100%' }}
|
style={{ height: '100%' }}
|
||||||
ref={objectFormRef}
|
ref={objectFormRef}
|
||||||
|
setCurrentObject={true}
|
||||||
onStateChange={(state) => {
|
onStateChange={(state) => {
|
||||||
setEditFormState((prev) => ({ ...prev, ...state }))
|
setEditFormState((prev) => ({ ...prev, ...state }))
|
||||||
}}
|
}}
|
||||||
|
|||||||
@ -153,6 +153,7 @@ const FilamentStockInfo = () => {
|
|||||||
type='filamentStock'
|
type='filamentStock'
|
||||||
style={{ height: '100%' }}
|
style={{ height: '100%' }}
|
||||||
ref={objectFormRef}
|
ref={objectFormRef}
|
||||||
|
setCurrentObject={true}
|
||||||
onStateChange={(state) => {
|
onStateChange={(state) => {
|
||||||
setEditFormState((prev) => ({ ...prev, ...state }))
|
setEditFormState((prev) => ({ ...prev, ...state }))
|
||||||
}}
|
}}
|
||||||
|
|||||||
@ -215,6 +215,7 @@ const LoadFilamentStock = ({
|
|||||||
showBed={false}
|
showBed={false}
|
||||||
showMoreInfo={false}
|
showMoreInfo={false}
|
||||||
id={loadFilamentStockFormValues.printer._id}
|
id={loadFilamentStockFormValues.printer._id}
|
||||||
|
offline={!connected}
|
||||||
/>
|
/>
|
||||||
) : null}
|
) : null}
|
||||||
</Flex>
|
</Flex>
|
||||||
|
|||||||
@ -175,6 +175,7 @@ const UnloadFilamentStock = ({ onOk, reset, printer = null }) => {
|
|||||||
showBed={false}
|
showBed={false}
|
||||||
showMoreInfo={false}
|
showMoreInfo={false}
|
||||||
id={unloadFilamentStockFormValues.printer._id}
|
id={unloadFilamentStockFormValues.printer._id}
|
||||||
|
offline={!connected}
|
||||||
/>
|
/>
|
||||||
) : null}
|
) : null}
|
||||||
</Flex>
|
</Flex>
|
||||||
|
|||||||
@ -148,6 +148,7 @@ const OrderItemInfo = () => {
|
|||||||
type='orderItem'
|
type='orderItem'
|
||||||
style={{ height: '100%' }}
|
style={{ height: '100%' }}
|
||||||
ref={objectFormRef}
|
ref={objectFormRef}
|
||||||
|
setCurrentObject={true}
|
||||||
onStateChange={(state) => {
|
onStateChange={(state) => {
|
||||||
setEditFormState((prev) => ({ ...prev, ...state }))
|
setEditFormState((prev) => ({ ...prev, ...state }))
|
||||||
}}
|
}}
|
||||||
|
|||||||
@ -164,6 +164,7 @@ const PartStockInfo = () => {
|
|||||||
type='partStock'
|
type='partStock'
|
||||||
style={{ height: '100%' }}
|
style={{ height: '100%' }}
|
||||||
ref={objectFormRef}
|
ref={objectFormRef}
|
||||||
|
setCurrentObject={true}
|
||||||
onStateChange={(state) => {
|
onStateChange={(state) => {
|
||||||
setEditFormState((prev) => ({ ...prev, ...state }))
|
setEditFormState((prev) => ({ ...prev, ...state }))
|
||||||
}}
|
}}
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
import { useRef, useState } from 'react'
|
import { useRef, useState, useEffect } from 'react'
|
||||||
import { useLocation } from 'react-router-dom'
|
import { useLocation } from 'react-router-dom'
|
||||||
import { Card, Flex, Modal, Space } from 'antd'
|
import { Card, Flex, Space } from 'antd'
|
||||||
import { LoadingOutlined } from '@ant-design/icons'
|
import { LoadingOutlined } from '@ant-design/icons'
|
||||||
import loglevel from 'loglevel'
|
import loglevel from 'loglevel'
|
||||||
import config from '../../../../config.js'
|
import config from '../../../../config.js'
|
||||||
@ -14,7 +14,6 @@ import {
|
|||||||
getModelProperty,
|
getModelProperty,
|
||||||
getModelByName
|
getModelByName
|
||||||
} from '../../../../database/ObjectModels.js'
|
} from '../../../../database/ObjectModels.js'
|
||||||
import PostProductStock from './PostProductStock.jsx'
|
|
||||||
import InfoCircleIcon from '../../../Icons/InfoCircleIcon.jsx'
|
import InfoCircleIcon from '../../../Icons/InfoCircleIcon.jsx'
|
||||||
import NoteIcon from '../../../Icons/NoteIcon.jsx'
|
import NoteIcon from '../../../Icons/NoteIcon.jsx'
|
||||||
import AuditLogIcon from '../../../Icons/AuditLogIcon.jsx'
|
import AuditLogIcon from '../../../Icons/AuditLogIcon.jsx'
|
||||||
@ -26,6 +25,7 @@ import EditButtons from '../../common/EditButtons.jsx'
|
|||||||
import ObjectTableNavigationButtons from '../../common/ObjectTableNavigationButtons.jsx'
|
import ObjectTableNavigationButtons from '../../common/ObjectTableNavigationButtons.jsx'
|
||||||
import ActivityIndicator from '../../common/ActivityIndicator.jsx'
|
import ActivityIndicator from '../../common/ActivityIndicator.jsx'
|
||||||
import ActionHandler from '../../common/ActionHandler.jsx'
|
import ActionHandler from '../../common/ActionHandler.jsx'
|
||||||
|
import { useActions } from '../../context/ActionsContext'
|
||||||
import ObjectActions from '../../common/ObjectActions.jsx'
|
import ObjectActions from '../../common/ObjectActions.jsx'
|
||||||
import ObjectTable from '../../common/ObjectTable.jsx'
|
import ObjectTable from '../../common/ObjectTable.jsx'
|
||||||
import InfoCollapsePlaceholder from '../../common/InfoCollapsePlaceholder.jsx'
|
import InfoCollapsePlaceholder from '../../common/InfoCollapsePlaceholder.jsx'
|
||||||
@ -41,10 +41,18 @@ const ProductStockInfo = () => {
|
|||||||
const location = useLocation()
|
const location = useLocation()
|
||||||
const objectFormRef = useRef(null)
|
const objectFormRef = useRef(null)
|
||||||
const actionHandlerRef = useRef(null)
|
const actionHandlerRef = useRef(null)
|
||||||
|
|
||||||
|
|
||||||
|
const { setOnModalOk } = useActions()
|
||||||
|
useEffect(() => {
|
||||||
|
setOnModalOk(() => () => {
|
||||||
|
objectFormRef.current?.handleFetchObject?.()
|
||||||
|
})
|
||||||
|
return () => setOnModalOk(null)
|
||||||
|
}, [setOnModalOk])
|
||||||
const productStockId = new URLSearchParams(location.search).get(
|
const productStockId = new URLSearchParams(location.search).get(
|
||||||
'productStockId'
|
'productStockId'
|
||||||
)
|
)
|
||||||
const [postProductStockOpen, setPostProductStockOpen] = useState(false)
|
|
||||||
const [collapseState, updateCollapseState] = useCollapseState(
|
const [collapseState, updateCollapseState] = useCollapseState(
|
||||||
'ProductStockInfo',
|
'ProductStockInfo',
|
||||||
{
|
{
|
||||||
@ -83,10 +91,6 @@ const ProductStockInfo = () => {
|
|||||||
objectFormRef?.current.handleDelete?.()
|
objectFormRef?.current.handleDelete?.()
|
||||||
return true
|
return true
|
||||||
},
|
},
|
||||||
post: () => {
|
|
||||||
setPostProductStockOpen(true)
|
|
||||||
return true
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
const editDisabled =
|
const editDisabled =
|
||||||
@ -95,7 +99,6 @@ const ProductStockInfo = () => {
|
|||||||
?.disabled(objectFormState.objectData) ?? false
|
?.disabled(objectFormState.objectData) ?? false
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
|
||||||
<Flex
|
<Flex
|
||||||
gap='large'
|
gap='large'
|
||||||
vertical='true'
|
vertical='true'
|
||||||
@ -184,6 +187,7 @@ const ProductStockInfo = () => {
|
|||||||
type='productStock'
|
type='productStock'
|
||||||
style={{ height: '100%' }}
|
style={{ height: '100%' }}
|
||||||
ref={objectFormRef}
|
ref={objectFormRef}
|
||||||
|
setCurrentObject={true}
|
||||||
onStateChange={(state) => {
|
onStateChange={(state) => {
|
||||||
setEditFormState((prev) => ({ ...prev, ...state }))
|
setEditFormState((prev) => ({ ...prev, ...state }))
|
||||||
}}
|
}}
|
||||||
@ -302,25 +306,6 @@ const ProductStockInfo = () => {
|
|||||||
</Flex>
|
</Flex>
|
||||||
</ScrollBox>
|
</ScrollBox>
|
||||||
</Flex>
|
</Flex>
|
||||||
<Modal
|
|
||||||
open={postProductStockOpen}
|
|
||||||
onCancel={() => {
|
|
||||||
setPostProductStockOpen(false)
|
|
||||||
}}
|
|
||||||
width={500}
|
|
||||||
footer={null}
|
|
||||||
destroyOnHidden={true}
|
|
||||||
centered={true}
|
|
||||||
>
|
|
||||||
<PostProductStock
|
|
||||||
onOk={() => {
|
|
||||||
setPostProductStockOpen(false)
|
|
||||||
objectFormRef?.current.handleFetchObject()
|
|
||||||
}}
|
|
||||||
objectData={objectFormState.objectData}
|
|
||||||
/>
|
|
||||||
</Modal>
|
|
||||||
</>
|
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
import { useRef, useState } from 'react'
|
import { useRef, useState, useEffect } from 'react'
|
||||||
import { useLocation } from 'react-router-dom'
|
import { useLocation } from 'react-router-dom'
|
||||||
import { Card, Flex, Modal, Space } from 'antd'
|
import { Card, Flex, Space } from 'antd'
|
||||||
import { LoadingOutlined } from '@ant-design/icons'
|
import { LoadingOutlined } from '@ant-design/icons'
|
||||||
import loglevel from 'loglevel'
|
import loglevel from 'loglevel'
|
||||||
import config from '../../../../config.js'
|
import config from '../../../../config.js'
|
||||||
@ -17,6 +17,7 @@ import EditButtons from '../../common/EditButtons.jsx'
|
|||||||
import ObjectTableNavigationButtons from '../../common/ObjectTableNavigationButtons.jsx'
|
import ObjectTableNavigationButtons from '../../common/ObjectTableNavigationButtons.jsx'
|
||||||
import ActivityIndicator from '../../common/ActivityIndicator.jsx'
|
import ActivityIndicator from '../../common/ActivityIndicator.jsx'
|
||||||
import ActionHandler from '../../common/ActionHandler.jsx'
|
import ActionHandler from '../../common/ActionHandler.jsx'
|
||||||
|
import { useActions } from '../../context/ActionsContext'
|
||||||
import ObjectActions from '../../common/ObjectActions.jsx'
|
import ObjectActions from '../../common/ObjectActions.jsx'
|
||||||
import ObjectTable from '../../common/ObjectTable.jsx'
|
import ObjectTable from '../../common/ObjectTable.jsx'
|
||||||
import InfoCollapsePlaceholder from '../../common/InfoCollapsePlaceholder.jsx'
|
import InfoCollapsePlaceholder from '../../common/InfoCollapsePlaceholder.jsx'
|
||||||
@ -24,16 +25,10 @@ import DocumentPrintButton from '../../common/DocumentPrintButton.jsx'
|
|||||||
import UserNotifierToggle from '../../common/UserNotifierToggle.jsx'
|
import UserNotifierToggle from '../../common/UserNotifierToggle.jsx'
|
||||||
import ScrollBox from '../../common/ScrollBox.jsx'
|
import ScrollBox from '../../common/ScrollBox.jsx'
|
||||||
import OrderItemsIcon from '../../../Icons/OrderItemIcon.jsx'
|
import OrderItemsIcon from '../../../Icons/OrderItemIcon.jsx'
|
||||||
import NewOrderItem from '../OrderItems/NewOrderItem.jsx'
|
|
||||||
import NewShipment from '../Shipments/NewShipment.jsx'
|
|
||||||
import PostPurchaseOrder from './PostPurchaseOrder.jsx'
|
|
||||||
import AcknowledgePurchaseOrder from './AcknowledgePurchaseOrder.jsx'
|
|
||||||
import CancelPurchaseOrder from './CancelPurchaseOrder.jsx'
|
|
||||||
import ShipmentIcon from '../../../Icons/ShipmentIcon.jsx'
|
import ShipmentIcon from '../../../Icons/ShipmentIcon.jsx'
|
||||||
import InvoiceIcon from '../../../Icons/InvoiceIcon.jsx'
|
import InvoiceIcon from '../../../Icons/InvoiceIcon.jsx'
|
||||||
import StockEventIcon from '../../../Icons/StockEventIcon.jsx'
|
import StockEventIcon from '../../../Icons/StockEventIcon.jsx'
|
||||||
import { getModelByName } from '../../../../database/ObjectModels.js'
|
import { getModelByName } from '../../../../database/ObjectModels.js'
|
||||||
import NewInvoice from '../../Finance/Invoices/NewInvoice.jsx'
|
|
||||||
|
|
||||||
const log = loglevel.getLogger('PurchaseOrderInfo')
|
const log = loglevel.getLogger('PurchaseOrderInfo')
|
||||||
log.setLevel(config.logLevel)
|
log.setLevel(config.logLevel)
|
||||||
@ -44,13 +39,15 @@ const PurchaseOrderInfo = () => {
|
|||||||
const orderItemsTableRef = useRef(null)
|
const orderItemsTableRef = useRef(null)
|
||||||
const shipmentsTableRef = useRef(null)
|
const shipmentsTableRef = useRef(null)
|
||||||
const actionHandlerRef = useRef(null)
|
const actionHandlerRef = useRef(null)
|
||||||
const [newOrderItemOpen, setNewOrderItemOpen] = useState(false)
|
|
||||||
const [newShipmentOpen, setNewShipmentOpen] = useState(false)
|
|
||||||
const [postPurchaseOrderOpen, setPostPurchaseOrderOpen] = useState(false)
|
const { setOnModalOk } = useActions()
|
||||||
const [acknowledgePurchaseOrderOpen, setAcknowledgePurchaseOrderOpen] =
|
useEffect(() => {
|
||||||
useState(false)
|
setOnModalOk(() => () => {
|
||||||
const [cancelPurchaseOrderOpen, setCancelPurchaseOrderOpen] = useState(false)
|
objectFormRef.current?.handleFetchObject?.()
|
||||||
const [newInvoiceOpen, setNewInvoiceOpen] = useState(false)
|
})
|
||||||
|
return () => setOnModalOk(null)
|
||||||
|
}, [setOnModalOk])
|
||||||
const purchaseOrderId = new URLSearchParams(location.search).get(
|
const purchaseOrderId = new URLSearchParams(location.search).get(
|
||||||
'purchaseOrderId'
|
'purchaseOrderId'
|
||||||
)
|
)
|
||||||
@ -96,30 +93,6 @@ const PurchaseOrderInfo = () => {
|
|||||||
objectFormRef?.current?.handleDelete?.()
|
objectFormRef?.current?.handleDelete?.()
|
||||||
return true
|
return true
|
||||||
},
|
},
|
||||||
newOrderItem: () => {
|
|
||||||
setNewOrderItemOpen(true)
|
|
||||||
return true
|
|
||||||
},
|
|
||||||
newShipment: () => {
|
|
||||||
setNewShipmentOpen(true)
|
|
||||||
return true
|
|
||||||
},
|
|
||||||
newInvoice: () => {
|
|
||||||
setNewInvoiceOpen(true)
|
|
||||||
return true
|
|
||||||
},
|
|
||||||
post: () => {
|
|
||||||
setPostPurchaseOrderOpen(true)
|
|
||||||
return true
|
|
||||||
},
|
|
||||||
acknowledge: () => {
|
|
||||||
setAcknowledgePurchaseOrderOpen(true)
|
|
||||||
return true
|
|
||||||
},
|
|
||||||
cancel: () => {
|
|
||||||
setCancelPurchaseOrderOpen(true)
|
|
||||||
return true
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
const editDisabled = getModelByName('purchaseOrder')
|
const editDisabled = getModelByName('purchaseOrder')
|
||||||
@ -127,7 +100,6 @@ const PurchaseOrderInfo = () => {
|
|||||||
.disabled(objectFormState.objectData)
|
.disabled(objectFormState.objectData)
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
|
||||||
<Flex
|
<Flex
|
||||||
gap='large'
|
gap='large'
|
||||||
vertical='true'
|
vertical='true'
|
||||||
@ -217,6 +189,7 @@ const PurchaseOrderInfo = () => {
|
|||||||
type='purchaseOrder'
|
type='purchaseOrder'
|
||||||
style={{ height: '100%' }}
|
style={{ height: '100%' }}
|
||||||
ref={objectFormRef}
|
ref={objectFormRef}
|
||||||
|
setCurrentObject={true}
|
||||||
onStateChange={(state) => {
|
onStateChange={(state) => {
|
||||||
setEditFormState((prev) => ({ ...prev, ...state }))
|
setEditFormState((prev) => ({ ...prev, ...state }))
|
||||||
}}
|
}}
|
||||||
@ -361,122 +334,6 @@ const PurchaseOrderInfo = () => {
|
|||||||
</Flex>
|
</Flex>
|
||||||
</ScrollBox>
|
</ScrollBox>
|
||||||
</Flex>
|
</Flex>
|
||||||
<Modal
|
|
||||||
open={newOrderItemOpen}
|
|
||||||
onCancel={() => {
|
|
||||||
setNewOrderItemOpen(false)
|
|
||||||
}}
|
|
||||||
width={800}
|
|
||||||
footer={null}
|
|
||||||
destroyOnHidden={true}
|
|
||||||
>
|
|
||||||
<NewOrderItem
|
|
||||||
onOk={() => {
|
|
||||||
setNewOrderItemOpen(false)
|
|
||||||
}}
|
|
||||||
reset={newOrderItemOpen}
|
|
||||||
defaultValues={{
|
|
||||||
order: { _id: purchaseOrderId },
|
|
||||||
orderType: 'purchaseOrder',
|
|
||||||
syncAmount: 'itemCost'
|
|
||||||
}}
|
|
||||||
/>
|
|
||||||
</Modal>
|
|
||||||
<Modal
|
|
||||||
open={newShipmentOpen}
|
|
||||||
onCancel={() => {
|
|
||||||
setNewShipmentOpen(false)
|
|
||||||
}}
|
|
||||||
width={800}
|
|
||||||
footer={null}
|
|
||||||
destroyOnHidden={true}
|
|
||||||
>
|
|
||||||
<NewShipment
|
|
||||||
onOk={() => {
|
|
||||||
setNewShipmentOpen(false)
|
|
||||||
}}
|
|
||||||
reset={newShipmentOpen}
|
|
||||||
defaultValues={{
|
|
||||||
orderType: 'purchaseOrder',
|
|
||||||
order: { _id: purchaseOrderId }
|
|
||||||
}}
|
|
||||||
/>
|
|
||||||
</Modal>
|
|
||||||
<Modal
|
|
||||||
open={newInvoiceOpen}
|
|
||||||
onCancel={() => {
|
|
||||||
setNewInvoiceOpen(false)
|
|
||||||
}}
|
|
||||||
width={800}
|
|
||||||
footer={null}
|
|
||||||
destroyOnHidden={true}
|
|
||||||
>
|
|
||||||
<NewInvoice
|
|
||||||
onOk={() => {
|
|
||||||
setNewInvoiceOpen(false)
|
|
||||||
}}
|
|
||||||
reset={newInvoiceOpen}
|
|
||||||
defaultValues={{
|
|
||||||
orderType: 'purchaseOrder',
|
|
||||||
order: { ...objectFormState.objectData }
|
|
||||||
}}
|
|
||||||
/>
|
|
||||||
</Modal>
|
|
||||||
<Modal
|
|
||||||
open={postPurchaseOrderOpen}
|
|
||||||
onCancel={() => {
|
|
||||||
setPostPurchaseOrderOpen(false)
|
|
||||||
}}
|
|
||||||
width={500}
|
|
||||||
footer={null}
|
|
||||||
destroyOnHidden={true}
|
|
||||||
centered={true}
|
|
||||||
>
|
|
||||||
<PostPurchaseOrder
|
|
||||||
onOk={() => {
|
|
||||||
setPostPurchaseOrderOpen(false)
|
|
||||||
objectFormRef?.current.handleFetchObject()
|
|
||||||
}}
|
|
||||||
objectData={objectFormState.objectData}
|
|
||||||
/>
|
|
||||||
</Modal>
|
|
||||||
<Modal
|
|
||||||
open={acknowledgePurchaseOrderOpen}
|
|
||||||
onCancel={() => {
|
|
||||||
setAcknowledgePurchaseOrderOpen(false)
|
|
||||||
}}
|
|
||||||
width={515}
|
|
||||||
footer={null}
|
|
||||||
destroyOnHidden={true}
|
|
||||||
centered={true}
|
|
||||||
>
|
|
||||||
<AcknowledgePurchaseOrder
|
|
||||||
onOk={() => {
|
|
||||||
setAcknowledgePurchaseOrderOpen(false)
|
|
||||||
objectFormRef?.current.handleFetchObject()
|
|
||||||
}}
|
|
||||||
objectData={objectFormState.objectData}
|
|
||||||
/>
|
|
||||||
</Modal>
|
|
||||||
<Modal
|
|
||||||
open={cancelPurchaseOrderOpen}
|
|
||||||
onCancel={() => {
|
|
||||||
setCancelPurchaseOrderOpen(false)
|
|
||||||
}}
|
|
||||||
width={515}
|
|
||||||
footer={null}
|
|
||||||
destroyOnHidden={true}
|
|
||||||
centered={true}
|
|
||||||
>
|
|
||||||
<CancelPurchaseOrder
|
|
||||||
onOk={() => {
|
|
||||||
setCancelPurchaseOrderOpen(false)
|
|
||||||
objectFormRef?.current.handleFetchObject()
|
|
||||||
}}
|
|
||||||
objectData={objectFormState.objectData}
|
|
||||||
/>
|
|
||||||
</Modal>
|
|
||||||
</>
|
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -184,6 +184,7 @@ const PurchaseOrderInfo = () => {
|
|||||||
type='purchaseOrder'
|
type='purchaseOrder'
|
||||||
style={{ height: '100%' }}
|
style={{ height: '100%' }}
|
||||||
ref={objectFormRef}
|
ref={objectFormRef}
|
||||||
|
setCurrentObject={true}
|
||||||
onStateChange={(state) => {
|
onStateChange={(state) => {
|
||||||
setEditFormState((prev) => ({ ...prev, ...state }))
|
setEditFormState((prev) => ({ ...prev, ...state }))
|
||||||
}}
|
}}
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
import { useRef, useState } from 'react'
|
import { useRef, useState, useEffect } from 'react'
|
||||||
import { useLocation } from 'react-router-dom'
|
import { useLocation } from 'react-router-dom'
|
||||||
import { Card, Flex, Modal, Space } from 'antd'
|
import { Card, Flex, Space } from 'antd'
|
||||||
import { LoadingOutlined } from '@ant-design/icons'
|
import { LoadingOutlined } from '@ant-design/icons'
|
||||||
import loglevel from 'loglevel'
|
import loglevel from 'loglevel'
|
||||||
import config from '../../../../config.js'
|
import config from '../../../../config.js'
|
||||||
@ -17,6 +17,7 @@ import EditButtons from '../../common/EditButtons.jsx'
|
|||||||
import ObjectTableNavigationButtons from '../../common/ObjectTableNavigationButtons.jsx'
|
import ObjectTableNavigationButtons from '../../common/ObjectTableNavigationButtons.jsx'
|
||||||
import ActivityIndicator from '../../common/ActivityIndicator.jsx'
|
import ActivityIndicator from '../../common/ActivityIndicator.jsx'
|
||||||
import ActionHandler from '../../common/ActionHandler.jsx'
|
import ActionHandler from '../../common/ActionHandler.jsx'
|
||||||
|
import { useActions } from '../../context/ActionsContext'
|
||||||
import ObjectActions from '../../common/ObjectActions.jsx'
|
import ObjectActions from '../../common/ObjectActions.jsx'
|
||||||
import ObjectTable from '../../common/ObjectTable.jsx'
|
import ObjectTable from '../../common/ObjectTable.jsx'
|
||||||
import InfoCollapsePlaceholder from '../../common/InfoCollapsePlaceholder.jsx'
|
import InfoCollapsePlaceholder from '../../common/InfoCollapsePlaceholder.jsx'
|
||||||
@ -24,9 +25,6 @@ import DocumentPrintButton from '../../common/DocumentPrintButton.jsx'
|
|||||||
import UserNotifierToggle from '../../common/UserNotifierToggle.jsx'
|
import UserNotifierToggle from '../../common/UserNotifierToggle.jsx'
|
||||||
import ScrollBox from '../../common/ScrollBox.jsx'
|
import ScrollBox from '../../common/ScrollBox.jsx'
|
||||||
import OrderItemIcon from '../../../Icons/OrderItemIcon.jsx'
|
import OrderItemIcon from '../../../Icons/OrderItemIcon.jsx'
|
||||||
import ShipShipment from './ShipShipment.jsx'
|
|
||||||
import ReceiveShipment from './ReceiveShipment.jsx'
|
|
||||||
import CancelShipment from './CancelShipment.jsx'
|
|
||||||
|
|
||||||
const log = loglevel.getLogger('ShipmentInfo')
|
const log = loglevel.getLogger('ShipmentInfo')
|
||||||
log.setLevel(config.logLevel)
|
log.setLevel(config.logLevel)
|
||||||
@ -35,6 +33,15 @@ const ShipmentInfo = () => {
|
|||||||
const location = useLocation()
|
const location = useLocation()
|
||||||
const objectFormRef = useRef(null)
|
const objectFormRef = useRef(null)
|
||||||
const actionHandlerRef = useRef(null)
|
const actionHandlerRef = useRef(null)
|
||||||
|
|
||||||
|
|
||||||
|
const { setOnModalOk } = useActions()
|
||||||
|
useEffect(() => {
|
||||||
|
setOnModalOk(() => () => {
|
||||||
|
objectFormRef.current?.handleFetchObject?.()
|
||||||
|
})
|
||||||
|
return () => setOnModalOk(null)
|
||||||
|
}, [setOnModalOk])
|
||||||
const shipmentId = new URLSearchParams(location.search).get('shipmentId')
|
const shipmentId = new URLSearchParams(location.search).get('shipmentId')
|
||||||
const [collapseState, updateCollapseState] = useCollapseState(
|
const [collapseState, updateCollapseState] = useCollapseState(
|
||||||
'ShipmentInfo',
|
'ShipmentInfo',
|
||||||
@ -53,10 +60,6 @@ const ShipmentInfo = () => {
|
|||||||
loading: false,
|
loading: false,
|
||||||
objectData: {}
|
objectData: {}
|
||||||
})
|
})
|
||||||
|
|
||||||
const [shipShipmentOpen, setShipShipmentOpen] = useState(false)
|
|
||||||
const [receiveShipmentOpen, setReceiveShipmentOpen] = useState(false)
|
|
||||||
const [cancelShipmentOpen, setCancelShipmentOpen] = useState(false)
|
|
||||||
const actions = {
|
const actions = {
|
||||||
edit: () => {
|
edit: () => {
|
||||||
objectFormRef?.current?.startEditing?.()
|
objectFormRef?.current?.startEditing?.()
|
||||||
@ -74,22 +77,9 @@ const ShipmentInfo = () => {
|
|||||||
objectFormRef?.current?.handleDelete?.()
|
objectFormRef?.current?.handleDelete?.()
|
||||||
return true
|
return true
|
||||||
},
|
},
|
||||||
ship: () => {
|
|
||||||
setShipShipmentOpen(true)
|
|
||||||
return true
|
|
||||||
},
|
|
||||||
receive: () => {
|
|
||||||
setReceiveShipmentOpen(true)
|
|
||||||
return true
|
|
||||||
},
|
|
||||||
cancel: () => {
|
|
||||||
setCancelShipmentOpen(true)
|
|
||||||
return true
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
|
||||||
<Flex
|
<Flex
|
||||||
gap='large'
|
gap='large'
|
||||||
vertical='true'
|
vertical='true'
|
||||||
@ -173,6 +163,7 @@ const ShipmentInfo = () => {
|
|||||||
type='shipment'
|
type='shipment'
|
||||||
style={{ height: '100%' }}
|
style={{ height: '100%' }}
|
||||||
ref={objectFormRef}
|
ref={objectFormRef}
|
||||||
|
setCurrentObject={true}
|
||||||
onStateChange={(state) => {
|
onStateChange={(state) => {
|
||||||
setEditFormState((prev) => ({ ...prev, ...state }))
|
setEditFormState((prev) => ({ ...prev, ...state }))
|
||||||
}}
|
}}
|
||||||
@ -256,61 +247,6 @@ const ShipmentInfo = () => {
|
|||||||
</Flex>
|
</Flex>
|
||||||
</ScrollBox>
|
</ScrollBox>
|
||||||
</Flex>
|
</Flex>
|
||||||
<Modal
|
|
||||||
open={shipShipmentOpen}
|
|
||||||
onCancel={() => {
|
|
||||||
setShipShipmentOpen(false)
|
|
||||||
}}
|
|
||||||
width={515}
|
|
||||||
footer={null}
|
|
||||||
destroyOnHidden={true}
|
|
||||||
centered={true}
|
|
||||||
>
|
|
||||||
<ShipShipment
|
|
||||||
onOk={() => {
|
|
||||||
setShipShipmentOpen(false)
|
|
||||||
objectFormRef?.current.handleFetchObject()
|
|
||||||
}}
|
|
||||||
objectData={objectFormState.objectData}
|
|
||||||
/>
|
|
||||||
</Modal>
|
|
||||||
<Modal
|
|
||||||
open={receiveShipmentOpen}
|
|
||||||
onCancel={() => {
|
|
||||||
setReceiveShipmentOpen(false)
|
|
||||||
}}
|
|
||||||
width={515}
|
|
||||||
footer={null}
|
|
||||||
destroyOnHidden={true}
|
|
||||||
centered={true}
|
|
||||||
>
|
|
||||||
<ReceiveShipment
|
|
||||||
onOk={() => {
|
|
||||||
setReceiveShipmentOpen(false)
|
|
||||||
objectFormRef?.current.handleFetchObject()
|
|
||||||
}}
|
|
||||||
objectData={objectFormState.objectData}
|
|
||||||
/>
|
|
||||||
</Modal>
|
|
||||||
<Modal
|
|
||||||
open={cancelShipmentOpen}
|
|
||||||
onCancel={() => {
|
|
||||||
setCancelShipmentOpen(false)
|
|
||||||
}}
|
|
||||||
width={515}
|
|
||||||
footer={null}
|
|
||||||
destroyOnHidden={true}
|
|
||||||
centered={true}
|
|
||||||
>
|
|
||||||
<CancelShipment
|
|
||||||
onOk={() => {
|
|
||||||
setCancelShipmentOpen(false)
|
|
||||||
objectFormRef?.current.handleFetchObject()
|
|
||||||
}}
|
|
||||||
objectData={objectFormState.objectData}
|
|
||||||
/>
|
|
||||||
</Modal>
|
|
||||||
</>
|
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -158,6 +158,7 @@ const StockAuditInfo = () => {
|
|||||||
type='stockAudit'
|
type='stockAudit'
|
||||||
style={{ height: '100%' }}
|
style={{ height: '100%' }}
|
||||||
ref={objectFormRef}
|
ref={objectFormRef}
|
||||||
|
setCurrentObject={true}
|
||||||
onStateChange={(state) => {
|
onStateChange={(state) => {
|
||||||
setEditFormState((prev) => ({ ...prev, ...state }))
|
setEditFormState((prev) => ({ ...prev, ...state }))
|
||||||
}}
|
}}
|
||||||
|
|||||||
@ -159,6 +159,7 @@ const StockLocationInfo = () => {
|
|||||||
type='stockLocation'
|
type='stockLocation'
|
||||||
style={{ height: '100%' }}
|
style={{ height: '100%' }}
|
||||||
ref={objectFormRef}
|
ref={objectFormRef}
|
||||||
|
setCurrentObject={true}
|
||||||
onStateChange={(state) => {
|
onStateChange={(state) => {
|
||||||
setEditFormState((prev) => ({ ...prev, ...state }))
|
setEditFormState((prev) => ({ ...prev, ...state }))
|
||||||
}}
|
}}
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
import { useRef, useState } from 'react'
|
import { useRef, useState, useEffect } from 'react'
|
||||||
import { useLocation } from 'react-router-dom'
|
import { useLocation } from 'react-router-dom'
|
||||||
import { Card, Flex, Modal, Space } from 'antd'
|
import { Card, Flex, Space } from 'antd'
|
||||||
import { LoadingOutlined } from '@ant-design/icons'
|
import { LoadingOutlined } from '@ant-design/icons'
|
||||||
import useCollapseState from '../../hooks/useCollapseState.jsx'
|
import useCollapseState from '../../hooks/useCollapseState.jsx'
|
||||||
import NotesPanel from '../../common/NotesPanel.jsx'
|
import NotesPanel from '../../common/NotesPanel.jsx'
|
||||||
@ -12,7 +12,6 @@ import {
|
|||||||
getModelProperty,
|
getModelProperty,
|
||||||
getModelByName
|
getModelByName
|
||||||
} from '../../../../database/ObjectModels.js'
|
} from '../../../../database/ObjectModels.js'
|
||||||
import PostStockTransfer from './PostStockTransfer.jsx'
|
|
||||||
import InfoCircleIcon from '../../../Icons/InfoCircleIcon.jsx'
|
import InfoCircleIcon from '../../../Icons/InfoCircleIcon.jsx'
|
||||||
import NoteIcon from '../../../Icons/NoteIcon.jsx'
|
import NoteIcon from '../../../Icons/NoteIcon.jsx'
|
||||||
import AuditLogIcon from '../../../Icons/AuditLogIcon.jsx'
|
import AuditLogIcon from '../../../Icons/AuditLogIcon.jsx'
|
||||||
@ -22,6 +21,7 @@ import EditButtons from '../../common/EditButtons.jsx'
|
|||||||
import ObjectTableNavigationButtons from '../../common/ObjectTableNavigationButtons.jsx'
|
import ObjectTableNavigationButtons from '../../common/ObjectTableNavigationButtons.jsx'
|
||||||
import ActivityIndicator from '../../common/ActivityIndicator.jsx'
|
import ActivityIndicator from '../../common/ActivityIndicator.jsx'
|
||||||
import ActionHandler from '../../common/ActionHandler.jsx'
|
import ActionHandler from '../../common/ActionHandler.jsx'
|
||||||
|
import { useActions } from '../../context/ActionsContext'
|
||||||
import ObjectActions from '../../common/ObjectActions.jsx'
|
import ObjectActions from '../../common/ObjectActions.jsx'
|
||||||
import ObjectTable from '../../common/ObjectTable.jsx'
|
import ObjectTable from '../../common/ObjectTable.jsx'
|
||||||
import InfoCollapsePlaceholder from '../../common/InfoCollapsePlaceholder.jsx'
|
import InfoCollapsePlaceholder from '../../common/InfoCollapsePlaceholder.jsx'
|
||||||
@ -33,10 +33,18 @@ const StockTransferInfo = () => {
|
|||||||
const location = useLocation()
|
const location = useLocation()
|
||||||
const objectFormRef = useRef(null)
|
const objectFormRef = useRef(null)
|
||||||
const actionHandlerRef = useRef(null)
|
const actionHandlerRef = useRef(null)
|
||||||
|
|
||||||
|
|
||||||
|
const { setOnModalOk } = useActions()
|
||||||
|
useEffect(() => {
|
||||||
|
setOnModalOk(() => () => {
|
||||||
|
objectFormRef.current?.handleFetchObject?.()
|
||||||
|
})
|
||||||
|
return () => setOnModalOk(null)
|
||||||
|
}, [setOnModalOk])
|
||||||
const stockTransferId = new URLSearchParams(location.search).get(
|
const stockTransferId = new URLSearchParams(location.search).get(
|
||||||
'stockTransferId'
|
'stockTransferId'
|
||||||
)
|
)
|
||||||
const [postOpen, setPostOpen] = useState(false)
|
|
||||||
const [collapseState, updateCollapseState] = useCollapseState(
|
const [collapseState, updateCollapseState] = useCollapseState(
|
||||||
'StockTransferInfo',
|
'StockTransferInfo',
|
||||||
{
|
{
|
||||||
@ -73,10 +81,6 @@ const StockTransferInfo = () => {
|
|||||||
objectFormRef?.current.handleDelete?.()
|
objectFormRef?.current.handleDelete?.()
|
||||||
return true
|
return true
|
||||||
},
|
},
|
||||||
post: () => {
|
|
||||||
setPostOpen(true)
|
|
||||||
return true
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
const editDisabled =
|
const editDisabled =
|
||||||
@ -85,7 +89,6 @@ const StockTransferInfo = () => {
|
|||||||
?.disabled(objectFormState.objectData) ?? false
|
?.disabled(objectFormState.objectData) ?? false
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
|
||||||
<Flex
|
<Flex
|
||||||
gap='large'
|
gap='large'
|
||||||
vertical='true'
|
vertical='true'
|
||||||
@ -172,6 +175,7 @@ const StockTransferInfo = () => {
|
|||||||
type='stockTransfer'
|
type='stockTransfer'
|
||||||
style={{ height: '100%' }}
|
style={{ height: '100%' }}
|
||||||
ref={objectFormRef}
|
ref={objectFormRef}
|
||||||
|
setCurrentObject={true}
|
||||||
onStateChange={(state) => {
|
onStateChange={(state) => {
|
||||||
setEditFormState((prev) => ({ ...prev, ...state }))
|
setEditFormState((prev) => ({ ...prev, ...state }))
|
||||||
}}
|
}}
|
||||||
@ -253,25 +257,6 @@ const StockTransferInfo = () => {
|
|||||||
</Flex>
|
</Flex>
|
||||||
</ScrollBox>
|
</ScrollBox>
|
||||||
</Flex>
|
</Flex>
|
||||||
<Modal
|
|
||||||
open={postOpen}
|
|
||||||
onCancel={() => {
|
|
||||||
setPostOpen(false)
|
|
||||||
}}
|
|
||||||
width={520}
|
|
||||||
footer={null}
|
|
||||||
destroyOnHidden={true}
|
|
||||||
centered={true}
|
|
||||||
>
|
|
||||||
<PostStockTransfer
|
|
||||||
onOk={() => {
|
|
||||||
setPostOpen(false)
|
|
||||||
objectFormRef?.current.handleFetchObject()
|
|
||||||
}}
|
|
||||||
objectData={objectFormState.objectData}
|
|
||||||
/>
|
|
||||||
</Modal>
|
|
||||||
</>
|
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
import { useRef, useState, useContext } from 'react'
|
import { useRef, useState, useEffect, useContext } from 'react'
|
||||||
import { useLocation } from 'react-router-dom'
|
import { useLocation } from 'react-router-dom'
|
||||||
import { Flex, Modal, Space } from 'antd'
|
import { Flex, Space } from 'antd'
|
||||||
import { LoadingOutlined } from '@ant-design/icons'
|
import { LoadingOutlined } from '@ant-design/icons'
|
||||||
import useCollapseState from '../../hooks/useCollapseState'
|
import useCollapseState from '../../hooks/useCollapseState'
|
||||||
import InfoCollapse from '../../common/InfoCollapse'
|
import InfoCollapse from '../../common/InfoCollapse'
|
||||||
@ -13,13 +13,13 @@ import EditButtons from '../../common/EditButtons'
|
|||||||
import ObjectTableNavigationButtons from '../../common/ObjectTableNavigationButtons.jsx'
|
import ObjectTableNavigationButtons from '../../common/ObjectTableNavigationButtons.jsx'
|
||||||
import ActivityIndicator from '../../common/ActivityIndicator.jsx'
|
import ActivityIndicator from '../../common/ActivityIndicator.jsx'
|
||||||
import ActionHandler from '../../common/ActionHandler.jsx'
|
import ActionHandler from '../../common/ActionHandler.jsx'
|
||||||
|
import { useActions } from '../../context/ActionsContext'
|
||||||
import ObjectActions from '../../common/ObjectActions.jsx'
|
import ObjectActions from '../../common/ObjectActions.jsx'
|
||||||
import ObjectTable from '../../common/ObjectTable.jsx'
|
import ObjectTable from '../../common/ObjectTable.jsx'
|
||||||
import InfoCollapsePlaceholder from '../../common/InfoCollapsePlaceholder.jsx'
|
import InfoCollapsePlaceholder from '../../common/InfoCollapsePlaceholder.jsx'
|
||||||
import DocumentPrintButton from '../../common/DocumentPrintButton.jsx'
|
import DocumentPrintButton from '../../common/DocumentPrintButton.jsx'
|
||||||
import UserNotifierToggle from '../../common/UserNotifierToggle.jsx'
|
import UserNotifierToggle from '../../common/UserNotifierToggle.jsx'
|
||||||
import ScrollBox from '../../common/ScrollBox.jsx'
|
import ScrollBox from '../../common/ScrollBox.jsx'
|
||||||
import RegenerateAppPasswordSecret from './RegenerateAppPasswordSecret.jsx'
|
|
||||||
import { getModelByName } from '../../../../database/ObjectModels.js'
|
import { getModelByName } from '../../../../database/ObjectModels.js'
|
||||||
import { AuthContext } from '../../context/AuthContext.jsx'
|
import { AuthContext } from '../../context/AuthContext.jsx'
|
||||||
|
|
||||||
@ -27,11 +27,19 @@ const AppPasswordInfo = () => {
|
|||||||
const location = useLocation()
|
const location = useLocation()
|
||||||
const objectFormRef = useRef(null)
|
const objectFormRef = useRef(null)
|
||||||
const actionHandlerRef = useRef(null)
|
const actionHandlerRef = useRef(null)
|
||||||
|
|
||||||
|
|
||||||
|
const { setOnModalOk } = useActions()
|
||||||
|
useEffect(() => {
|
||||||
|
setOnModalOk(() => () => {
|
||||||
|
objectFormRef.current?.handleFetchObject?.()
|
||||||
|
})
|
||||||
|
return () => setOnModalOk(null)
|
||||||
|
}, [setOnModalOk])
|
||||||
const { userProfile } = useContext(AuthContext)
|
const { userProfile } = useContext(AuthContext)
|
||||||
const appPasswordId = new URLSearchParams(location.search).get(
|
const appPasswordId = new URLSearchParams(location.search).get(
|
||||||
'appPasswordId'
|
'appPasswordId'
|
||||||
)
|
)
|
||||||
const [regenerateSecretOpen, setRegenerateSecretOpen] = useState(false)
|
|
||||||
const [collapseState, updateCollapseState] = useCollapseState(
|
const [collapseState, updateCollapseState] = useCollapseState(
|
||||||
'AppPasswordInfo',
|
'AppPasswordInfo',
|
||||||
{
|
{
|
||||||
@ -49,10 +57,6 @@ const AppPasswordInfo = () => {
|
|||||||
})
|
})
|
||||||
|
|
||||||
const actions = {
|
const actions = {
|
||||||
regenerateSecret: () => {
|
|
||||||
setRegenerateSecretOpen(true)
|
|
||||||
return false
|
|
||||||
},
|
|
||||||
edit: () => {
|
edit: () => {
|
||||||
objectFormRef?.current?.startEditing?.()
|
objectFormRef?.current?.startEditing?.()
|
||||||
return false
|
return false
|
||||||
@ -72,7 +76,6 @@ const AppPasswordInfo = () => {
|
|||||||
.disabled({ ...objectFormState.objectData, _user: userProfile })
|
.disabled({ ...objectFormState.objectData, _user: userProfile })
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
|
||||||
<Flex
|
<Flex
|
||||||
gap='large'
|
gap='large'
|
||||||
vertical='true'
|
vertical='true'
|
||||||
@ -160,6 +163,7 @@ const AppPasswordInfo = () => {
|
|||||||
type='appPassword'
|
type='appPassword'
|
||||||
style={{ height: '100%' }}
|
style={{ height: '100%' }}
|
||||||
ref={objectFormRef}
|
ref={objectFormRef}
|
||||||
|
setCurrentObject={true}
|
||||||
onStateChange={(state) => {
|
onStateChange={(state) => {
|
||||||
setEditFormState((prev) => ({ ...prev, ...state }))
|
setEditFormState((prev) => ({ ...prev, ...state }))
|
||||||
}}
|
}}
|
||||||
@ -198,20 +202,6 @@ const AppPasswordInfo = () => {
|
|||||||
</Flex>
|
</Flex>
|
||||||
</ScrollBox>
|
</ScrollBox>
|
||||||
</Flex>
|
</Flex>
|
||||||
|
|
||||||
<Modal
|
|
||||||
open={regenerateSecretOpen}
|
|
||||||
destroyOnHidden={true}
|
|
||||||
width={650}
|
|
||||||
onCancel={() => {
|
|
||||||
actionHandlerRef.current?.clearAction?.()
|
|
||||||
setRegenerateSecretOpen(false)
|
|
||||||
}}
|
|
||||||
footer={null}
|
|
||||||
>
|
|
||||||
<RegenerateAppPasswordSecret id={appPasswordId} />
|
|
||||||
</Modal>
|
|
||||||
</>
|
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -157,6 +157,7 @@ const CourierServiceInfo = () => {
|
|||||||
type='courierService'
|
type='courierService'
|
||||||
style={{ height: '100%' }}
|
style={{ height: '100%' }}
|
||||||
ref={objectFormRef}
|
ref={objectFormRef}
|
||||||
|
setCurrentObject={true}
|
||||||
onStateChange={(state) => {
|
onStateChange={(state) => {
|
||||||
setEditFormState((prev) => ({ ...prev, ...state }))
|
setEditFormState((prev) => ({ ...prev, ...state }))
|
||||||
}}
|
}}
|
||||||
|
|||||||
@ -153,6 +153,7 @@ const CourierInfo = () => {
|
|||||||
type='courier'
|
type='courier'
|
||||||
style={{ height: '100%' }}
|
style={{ height: '100%' }}
|
||||||
ref={objectFormRef}
|
ref={objectFormRef}
|
||||||
|
setCurrentObject={true}
|
||||||
onStateChange={(state) => {
|
onStateChange={(state) => {
|
||||||
setEditFormState((prev) => ({ ...prev, ...state }))
|
setEditFormState((prev) => ({ ...prev, ...state }))
|
||||||
}}
|
}}
|
||||||
|
|||||||
@ -154,6 +154,7 @@ const DocumentJobInfo = () => {
|
|||||||
type='documentJob'
|
type='documentJob'
|
||||||
style={{ height: '100%' }}
|
style={{ height: '100%' }}
|
||||||
ref={objectFormRef}
|
ref={objectFormRef}
|
||||||
|
setCurrentObject={true}
|
||||||
onStateChange={(state) => {
|
onStateChange={(state) => {
|
||||||
setEditFormState((prev) => ({ ...prev, ...state }))
|
setEditFormState((prev) => ({ ...prev, ...state }))
|
||||||
}}
|
}}
|
||||||
|
|||||||
@ -163,6 +163,7 @@ const DocumentPrinterInfo = () => {
|
|||||||
type='documentPrinter'
|
type='documentPrinter'
|
||||||
style={{ height: '100%' }}
|
style={{ height: '100%' }}
|
||||||
ref={objectFormRef}
|
ref={objectFormRef}
|
||||||
|
setCurrentObject={true}
|
||||||
onStateChange={(state) => {
|
onStateChange={(state) => {
|
||||||
setEditFormState((prev) => ({ ...prev, ...state }))
|
setEditFormState((prev) => ({ ...prev, ...state }))
|
||||||
}}
|
}}
|
||||||
|
|||||||
@ -154,6 +154,7 @@ const DocumentSizeInfo = () => {
|
|||||||
type='documentSize'
|
type='documentSize'
|
||||||
style={{ height: '100%' }}
|
style={{ height: '100%' }}
|
||||||
ref={objectFormRef}
|
ref={objectFormRef}
|
||||||
|
setCurrentObject={true}
|
||||||
onStateChange={(state) => {
|
onStateChange={(state) => {
|
||||||
setEditFormState((prev) => ({ ...prev, ...state }))
|
setEditFormState((prev) => ({ ...prev, ...state }))
|
||||||
}}
|
}}
|
||||||
|
|||||||
@ -160,6 +160,7 @@ const DocumentTemplateInfo = () => {
|
|||||||
type='documentTemplate'
|
type='documentTemplate'
|
||||||
style={{ height: '100%' }}
|
style={{ height: '100%' }}
|
||||||
ref={objectFormRef}
|
ref={objectFormRef}
|
||||||
|
setCurrentObject={true}
|
||||||
onStateChange={(state) => {
|
onStateChange={(state) => {
|
||||||
setEditFormState((prev) => ({ ...prev, ...state }))
|
setEditFormState((prev) => ({ ...prev, ...state }))
|
||||||
}}
|
}}
|
||||||
|
|||||||
@ -152,6 +152,7 @@ const FilamentSkuInfo = () => {
|
|||||||
type='filamentSku'
|
type='filamentSku'
|
||||||
style={{ height: '100%' }}
|
style={{ height: '100%' }}
|
||||||
ref={objectFormRef}
|
ref={objectFormRef}
|
||||||
|
setCurrentObject={true}
|
||||||
onStateChange={(state) => {
|
onStateChange={(state) => {
|
||||||
setEditFormState((prev) => ({ ...prev, ...state }))
|
setEditFormState((prev) => ({ ...prev, ...state }))
|
||||||
}}
|
}}
|
||||||
|
|||||||
@ -15,6 +15,7 @@ const NewFilamentSku = ({ onOk, reset, defaultValues }) => {
|
|||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
{({ handleSubmit, submitLoading, objectData, formValid }) => {
|
{({ handleSubmit, submitLoading, objectData, formValid }) => {
|
||||||
|
console.log('objectData', objectData)
|
||||||
const steps = [
|
const steps = [
|
||||||
{
|
{
|
||||||
title: 'Required',
|
title: 'Required',
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
import { useRef, useState } from 'react'
|
import { useRef, useState, useEffect } from 'react'
|
||||||
import { useLocation } from 'react-router-dom'
|
import { useLocation } from 'react-router-dom'
|
||||||
import { Card, Flex, Modal, Space } from 'antd'
|
import { Card, Flex, Space } from 'antd'
|
||||||
import { LoadingOutlined } from '@ant-design/icons'
|
import { LoadingOutlined } from '@ant-design/icons'
|
||||||
import loglevel from 'loglevel'
|
import loglevel from 'loglevel'
|
||||||
import config from '../../../../config'
|
import config from '../../../../config'
|
||||||
@ -17,6 +17,7 @@ import EditButtons from '../../common/EditButtons'
|
|||||||
import ObjectTableNavigationButtons from '../../common/ObjectTableNavigationButtons.jsx'
|
import ObjectTableNavigationButtons from '../../common/ObjectTableNavigationButtons.jsx'
|
||||||
import ActivityIndicator from '../../common/ActivityIndicator.jsx'
|
import ActivityIndicator from '../../common/ActivityIndicator.jsx'
|
||||||
import ActionHandler from '../../common/ActionHandler'
|
import ActionHandler from '../../common/ActionHandler'
|
||||||
|
import { useActions } from '../../context/ActionsContext'
|
||||||
import ObjectActions from '../../common/ObjectActions.jsx'
|
import ObjectActions from '../../common/ObjectActions.jsx'
|
||||||
import ObjectTable from '../../common/ObjectTable.jsx'
|
import ObjectTable from '../../common/ObjectTable.jsx'
|
||||||
import InfoCollapsePlaceholder from '../../common/InfoCollapsePlaceholder.jsx'
|
import InfoCollapsePlaceholder from '../../common/InfoCollapsePlaceholder.jsx'
|
||||||
@ -25,7 +26,6 @@ import FilamentSkuIcon from '../../../Icons/FilamentSkuIcon.jsx'
|
|||||||
import DocumentPrintButton from '../../common/DocumentPrintButton.jsx'
|
import DocumentPrintButton from '../../common/DocumentPrintButton.jsx'
|
||||||
import ScrollBox from '../../common/ScrollBox.jsx'
|
import ScrollBox from '../../common/ScrollBox.jsx'
|
||||||
import UserNotifierToggle from '../../common/UserNotifierToggle.jsx'
|
import UserNotifierToggle from '../../common/UserNotifierToggle.jsx'
|
||||||
import NewFilamentSku from '../FilamentSkus/NewFilamentSku'
|
|
||||||
|
|
||||||
const log = loglevel.getLogger('FilamentInfo')
|
const log = loglevel.getLogger('FilamentInfo')
|
||||||
log.setLevel(config.logLevel)
|
log.setLevel(config.logLevel)
|
||||||
@ -35,8 +35,15 @@ const FilamentInfo = () => {
|
|||||||
const objectFormRef = useRef(null)
|
const objectFormRef = useRef(null)
|
||||||
const actionHandlerRef = useRef(null)
|
const actionHandlerRef = useRef(null)
|
||||||
const filamentId = new URLSearchParams(location.search).get('filamentId')
|
const filamentId = new URLSearchParams(location.search).get('filamentId')
|
||||||
const [newFilamentSkuOpen, setNewFilamentSkuOpen] = useState(false)
|
|
||||||
const filamentSkusTableRef = useRef()
|
const filamentSkusTableRef = useRef()
|
||||||
|
|
||||||
|
const { setOnModalOk } = useActions()
|
||||||
|
useEffect(() => {
|
||||||
|
setOnModalOk(() => () => {
|
||||||
|
filamentSkusTableRef.current?.reload?.()
|
||||||
|
})
|
||||||
|
return () => setOnModalOk(null)
|
||||||
|
}, [setOnModalOk])
|
||||||
const [collapseState, updateCollapseState] = useCollapseState(
|
const [collapseState, updateCollapseState] = useCollapseState(
|
||||||
'FilamentInfo',
|
'FilamentInfo',
|
||||||
{
|
{
|
||||||
@ -58,10 +65,6 @@ const FilamentInfo = () => {
|
|||||||
})
|
})
|
||||||
|
|
||||||
const actions = {
|
const actions = {
|
||||||
newFilamentSku: () => {
|
|
||||||
setNewFilamentSkuOpen(true)
|
|
||||||
return true
|
|
||||||
},
|
|
||||||
edit: () => {
|
edit: () => {
|
||||||
objectFormRef?.current?.startEditing?.()
|
objectFormRef?.current?.startEditing?.()
|
||||||
return false
|
return false
|
||||||
@ -81,215 +84,192 @@ const FilamentInfo = () => {
|
|||||||
}
|
}
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<Flex
|
||||||
<Flex
|
gap='large'
|
||||||
gap='large'
|
vertical='true'
|
||||||
vertical='true'
|
style={{
|
||||||
style={{
|
maxHeight: '100%',
|
||||||
maxHeight: '100%',
|
minHeight: 0
|
||||||
minHeight: 0
|
}}
|
||||||
}}
|
>
|
||||||
>
|
<Flex justify={'space-between'}>
|
||||||
<Flex justify={'space-between'}>
|
<Space size='small'>
|
||||||
<Space size='small'>
|
<Space size='small'>
|
||||||
<Space size='small'>
|
<ObjectActions
|
||||||
<ObjectActions
|
type='filament'
|
||||||
type='filament'
|
id={filamentId}
|
||||||
id={filamentId}
|
disabled={objectFormState.loading}
|
||||||
disabled={objectFormState.loading}
|
objectData={objectFormState.objectData}
|
||||||
objectData={objectFormState.objectData}
|
/>
|
||||||
/>
|
<ViewButton
|
||||||
<ViewButton
|
disabled={objectFormState.loading}
|
||||||
disabled={objectFormState.loading}
|
items={[
|
||||||
items={[
|
{ key: 'info', label: 'Filament Information' },
|
||||||
{ key: 'info', label: 'Filament Information' },
|
{ key: 'filamentSkus', label: 'Filament SKUs' },
|
||||||
{ key: 'filamentSkus', label: 'Filament SKUs' },
|
{ key: 'stocks', label: 'Filament Stocks' },
|
||||||
{ key: 'stocks', label: 'Filament Stocks' },
|
{ key: 'notes', label: 'Notes' },
|
||||||
{ key: 'notes', label: 'Notes' },
|
{ key: 'auditLogs', label: 'Audit Logs' }
|
||||||
{ key: 'auditLogs', label: 'Audit Logs' }
|
]}
|
||||||
]}
|
visibleState={collapseState}
|
||||||
visibleState={collapseState}
|
updateVisibleState={updateCollapseState}
|
||||||
updateVisibleState={updateCollapseState}
|
/>
|
||||||
/>
|
<UserNotifierToggle
|
||||||
<UserNotifierToggle
|
type='filament'
|
||||||
type='filament'
|
objectData={objectFormState.objectData}
|
||||||
objectData={objectFormState.objectData}
|
disabled={objectFormState.loading}
|
||||||
disabled={objectFormState.loading}
|
/>
|
||||||
/>
|
<DocumentPrintButton
|
||||||
<DocumentPrintButton
|
type='filament'
|
||||||
type='filament'
|
objectData={objectFormState.objectData}
|
||||||
objectData={objectFormState.objectData}
|
disabled={objectFormState.loading}
|
||||||
disabled={objectFormState.loading}
|
|
||||||
/>
|
|
||||||
</Space>
|
|
||||||
<ActivityIndicator
|
|
||||||
activities={objectFormState.activities}
|
|
||||||
showStartingDivider={true}
|
|
||||||
/>
|
/>
|
||||||
</Space>
|
</Space>
|
||||||
<Space>
|
<ActivityIndicator
|
||||||
<EditButtons
|
activities={objectFormState.activities}
|
||||||
isEditing={objectFormState.isEditing}
|
showStartingDivider={true}
|
||||||
handleUpdate={() => {
|
/>
|
||||||
actionHandlerRef.current.callAction('finishEdit')
|
</Space>
|
||||||
}}
|
<Space>
|
||||||
cancelEditing={() => {
|
<EditButtons
|
||||||
actionHandlerRef.current.callAction('cancelEdit')
|
isEditing={objectFormState.isEditing}
|
||||||
}}
|
handleUpdate={() => {
|
||||||
startEditing={() => {
|
actionHandlerRef.current.callAction('finishEdit')
|
||||||
actionHandlerRef.current.callAction('edit')
|
}}
|
||||||
}}
|
cancelEditing={() => {
|
||||||
editLoading={objectFormState.editLoading}
|
actionHandlerRef.current.callAction('cancelEdit')
|
||||||
formValid={objectFormState.formValid}
|
}}
|
||||||
disabled={
|
startEditing={() => {
|
||||||
objectFormState.beingEditedByOther || objectFormState.loading
|
actionHandlerRef.current.callAction('edit')
|
||||||
}
|
}}
|
||||||
loading={objectFormState.editLoading}
|
editLoading={objectFormState.editLoading}
|
||||||
/>
|
formValid={objectFormState.formValid}
|
||||||
<ObjectTableNavigationButtons
|
disabled={
|
||||||
disabled={objectFormState.loading || objectFormState.isEditing}
|
objectFormState.beingEditedByOther || objectFormState.loading
|
||||||
_id={filamentId}
|
}
|
||||||
objectType='filament'
|
loading={objectFormState.editLoading}
|
||||||
showEndingDivider={true}
|
/>
|
||||||
/>
|
<ObjectTableNavigationButtons
|
||||||
</Space>
|
disabled={objectFormState.loading || objectFormState.isEditing}
|
||||||
</Flex>
|
_id={filamentId}
|
||||||
|
objectType='filament'
|
||||||
<ScrollBox>
|
showEndingDivider={true}
|
||||||
<Flex vertical gap={'large'}>
|
/>
|
||||||
<ActionHandler
|
</Space>
|
||||||
actions={actions}
|
|
||||||
loading={objectFormState.loading}
|
|
||||||
ref={actionHandlerRef}
|
|
||||||
>
|
|
||||||
<InfoCollapse
|
|
||||||
title='Filament Information'
|
|
||||||
icon={<InfoCircleIcon />}
|
|
||||||
active={collapseState.info}
|
|
||||||
onToggle={(expanded) => updateCollapseState('info', expanded)}
|
|
||||||
collapseKey='info'
|
|
||||||
>
|
|
||||||
<ObjectForm
|
|
||||||
id={filamentId}
|
|
||||||
type='filament'
|
|
||||||
style={{ height: '100%' }}
|
|
||||||
ref={objectFormRef}
|
|
||||||
onStateChange={(state) => {
|
|
||||||
setEditFormState((prev) => ({ ...prev, ...state }))
|
|
||||||
}}
|
|
||||||
>
|
|
||||||
{({ loading, isEditing, objectData }) => {
|
|
||||||
return (
|
|
||||||
<ObjectInfo
|
|
||||||
loading={loading}
|
|
||||||
indicator={<LoadingOutlined />}
|
|
||||||
isEditing={isEditing}
|
|
||||||
type='filament'
|
|
||||||
objectData={objectData}
|
|
||||||
/>
|
|
||||||
)
|
|
||||||
}}
|
|
||||||
</ObjectForm>
|
|
||||||
</InfoCollapse>
|
|
||||||
</ActionHandler>
|
|
||||||
|
|
||||||
<InfoCollapse
|
|
||||||
title='Filament SKUs'
|
|
||||||
icon={<FilamentSkuIcon />}
|
|
||||||
active={collapseState.filamentSkus}
|
|
||||||
onToggle={(expanded) =>
|
|
||||||
updateCollapseState('filamentSkus', expanded)
|
|
||||||
}
|
|
||||||
collapseKey='filamentSkus'
|
|
||||||
>
|
|
||||||
{objectFormState.loading ? (
|
|
||||||
<InfoCollapsePlaceholder />
|
|
||||||
) : (
|
|
||||||
<ObjectTable
|
|
||||||
ref={filamentSkusTableRef}
|
|
||||||
type='filamentSku'
|
|
||||||
masterFilter={{ filament: filamentId }}
|
|
||||||
visibleColumns={{ filament: false }}
|
|
||||||
/>
|
|
||||||
)}
|
|
||||||
</InfoCollapse>
|
|
||||||
|
|
||||||
<InfoCollapse
|
|
||||||
title='Filament Stocks'
|
|
||||||
icon={<FilamentIcon />}
|
|
||||||
active={collapseState.stocks}
|
|
||||||
onToggle={(expanded) => updateCollapseState('stocks', expanded)}
|
|
||||||
collapseKey='stocks'
|
|
||||||
>
|
|
||||||
{objectFormState.loading ? (
|
|
||||||
<InfoCollapsePlaceholder />
|
|
||||||
) : (
|
|
||||||
<ObjectTable
|
|
||||||
type='filamentStock'
|
|
||||||
masterFilter={{ filament: filamentId }}
|
|
||||||
visibleColumns={{
|
|
||||||
filament: false,
|
|
||||||
startingWeight: false
|
|
||||||
}}
|
|
||||||
/>
|
|
||||||
)}
|
|
||||||
</InfoCollapse>
|
|
||||||
|
|
||||||
<Modal
|
|
||||||
open={newFilamentSkuOpen}
|
|
||||||
styles={{ content: { paddingBottom: '24px' } }}
|
|
||||||
footer={null}
|
|
||||||
width={700}
|
|
||||||
onCancel={() => setNewFilamentSkuOpen(false)}
|
|
||||||
destroyOnHidden={true}
|
|
||||||
>
|
|
||||||
<NewFilamentSku
|
|
||||||
onOk={() => {
|
|
||||||
setNewFilamentSkuOpen(false)
|
|
||||||
filamentSkusTableRef.current?.reload?.()
|
|
||||||
}}
|
|
||||||
reset={newFilamentSkuOpen}
|
|
||||||
defaultValues={{
|
|
||||||
filament: objectFormState?.objectData || undefined
|
|
||||||
}}
|
|
||||||
/>
|
|
||||||
</Modal>
|
|
||||||
|
|
||||||
<InfoCollapse
|
|
||||||
title='Notes'
|
|
||||||
icon={<NoteIcon />}
|
|
||||||
active={collapseState.notes}
|
|
||||||
onToggle={(expanded) => updateCollapseState('notes', expanded)}
|
|
||||||
collapseKey='notes'
|
|
||||||
>
|
|
||||||
<Card>
|
|
||||||
<NotesPanel _id={filamentId} type='filament' />
|
|
||||||
</Card>
|
|
||||||
</InfoCollapse>
|
|
||||||
|
|
||||||
<InfoCollapse
|
|
||||||
title='Audit Logs'
|
|
||||||
icon={<AuditLogIcon />}
|
|
||||||
active={collapseState.auditLogs}
|
|
||||||
onToggle={(expanded) =>
|
|
||||||
updateCollapseState('auditLogs', expanded)
|
|
||||||
}
|
|
||||||
collapseKey='auditLogs'
|
|
||||||
>
|
|
||||||
{objectFormState.loading ? (
|
|
||||||
<InfoCollapsePlaceholder />
|
|
||||||
) : (
|
|
||||||
<ObjectTable
|
|
||||||
type='auditLog'
|
|
||||||
masterFilter={{ 'parent._id': filamentId }}
|
|
||||||
visibleColumns={{ _id: false, 'parent._id': false }}
|
|
||||||
/>
|
|
||||||
)}
|
|
||||||
</InfoCollapse>
|
|
||||||
</Flex>
|
|
||||||
</ScrollBox>
|
|
||||||
</Flex>
|
</Flex>
|
||||||
</>
|
|
||||||
|
<ScrollBox>
|
||||||
|
<Flex vertical gap={'large'}>
|
||||||
|
<ActionHandler
|
||||||
|
actions={actions}
|
||||||
|
loading={objectFormState.loading}
|
||||||
|
ref={actionHandlerRef}
|
||||||
|
>
|
||||||
|
<InfoCollapse
|
||||||
|
title='Filament Information'
|
||||||
|
icon={<InfoCircleIcon />}
|
||||||
|
active={collapseState.info}
|
||||||
|
onToggle={(expanded) => updateCollapseState('info', expanded)}
|
||||||
|
collapseKey='info'
|
||||||
|
>
|
||||||
|
<ObjectForm
|
||||||
|
id={filamentId}
|
||||||
|
type='filament'
|
||||||
|
style={{ height: '100%' }}
|
||||||
|
ref={objectFormRef}
|
||||||
|
setCurrentObject={true}
|
||||||
|
onStateChange={(state) => {
|
||||||
|
setEditFormState((prev) => ({ ...prev, ...state }))
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
{({ loading, isEditing, objectData }) => {
|
||||||
|
return (
|
||||||
|
<ObjectInfo
|
||||||
|
loading={loading}
|
||||||
|
indicator={<LoadingOutlined />}
|
||||||
|
isEditing={isEditing}
|
||||||
|
type='filament'
|
||||||
|
objectData={objectData}
|
||||||
|
/>
|
||||||
|
)
|
||||||
|
}}
|
||||||
|
</ObjectForm>
|
||||||
|
</InfoCollapse>
|
||||||
|
</ActionHandler>
|
||||||
|
|
||||||
|
<InfoCollapse
|
||||||
|
title='Filament SKUs'
|
||||||
|
icon={<FilamentSkuIcon />}
|
||||||
|
active={collapseState.filamentSkus}
|
||||||
|
onToggle={(expanded) =>
|
||||||
|
updateCollapseState('filamentSkus', expanded)
|
||||||
|
}
|
||||||
|
collapseKey='filamentSkus'
|
||||||
|
>
|
||||||
|
{objectFormState.loading ? (
|
||||||
|
<InfoCollapsePlaceholder />
|
||||||
|
) : (
|
||||||
|
<ObjectTable
|
||||||
|
ref={filamentSkusTableRef}
|
||||||
|
type='filamentSku'
|
||||||
|
masterFilter={{ filament: filamentId }}
|
||||||
|
visibleColumns={{ filament: false }}
|
||||||
|
/>
|
||||||
|
)}
|
||||||
|
</InfoCollapse>
|
||||||
|
|
||||||
|
<InfoCollapse
|
||||||
|
title='Filament Stocks'
|
||||||
|
icon={<FilamentIcon />}
|
||||||
|
active={collapseState.stocks}
|
||||||
|
onToggle={(expanded) => updateCollapseState('stocks', expanded)}
|
||||||
|
collapseKey='stocks'
|
||||||
|
>
|
||||||
|
{objectFormState.loading ? (
|
||||||
|
<InfoCollapsePlaceholder />
|
||||||
|
) : (
|
||||||
|
<ObjectTable
|
||||||
|
type='filamentStock'
|
||||||
|
masterFilter={{ filament: filamentId }}
|
||||||
|
visibleColumns={{
|
||||||
|
filament: false,
|
||||||
|
startingWeight: false
|
||||||
|
}}
|
||||||
|
/>
|
||||||
|
)}
|
||||||
|
</InfoCollapse>
|
||||||
|
|
||||||
|
<InfoCollapse
|
||||||
|
title='Notes'
|
||||||
|
icon={<NoteIcon />}
|
||||||
|
active={collapseState.notes}
|
||||||
|
onToggle={(expanded) => updateCollapseState('notes', expanded)}
|
||||||
|
collapseKey='notes'
|
||||||
|
>
|
||||||
|
<Card>
|
||||||
|
<NotesPanel _id={filamentId} type='filament' />
|
||||||
|
</Card>
|
||||||
|
</InfoCollapse>
|
||||||
|
|
||||||
|
<InfoCollapse
|
||||||
|
title='Audit Logs'
|
||||||
|
icon={<AuditLogIcon />}
|
||||||
|
active={collapseState.auditLogs}
|
||||||
|
onToggle={(expanded) => updateCollapseState('auditLogs', expanded)}
|
||||||
|
collapseKey='auditLogs'
|
||||||
|
>
|
||||||
|
{objectFormState.loading ? (
|
||||||
|
<InfoCollapsePlaceholder />
|
||||||
|
) : (
|
||||||
|
<ObjectTable
|
||||||
|
type='auditLog'
|
||||||
|
masterFilter={{ 'parent._id': filamentId }}
|
||||||
|
visibleColumns={{ _id: false, 'parent._id': false }}
|
||||||
|
/>
|
||||||
|
)}
|
||||||
|
</InfoCollapse>
|
||||||
|
</Flex>
|
||||||
|
</ScrollBox>
|
||||||
|
</Flex>
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -168,6 +168,7 @@ const FileInfo = () => {
|
|||||||
type='file'
|
type='file'
|
||||||
style={{ height: '100%' }}
|
style={{ height: '100%' }}
|
||||||
ref={objectFormRef}
|
ref={objectFormRef}
|
||||||
|
setCurrentObject={true}
|
||||||
onStateChange={(state) => {
|
onStateChange={(state) => {
|
||||||
setEditFormState((prev) => ({ ...prev, ...state }))
|
setEditFormState((prev) => ({ ...prev, ...state }))
|
||||||
}}
|
}}
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
import { useRef, useState } from 'react'
|
import { useRef, useState, useEffect } from 'react'
|
||||||
import { useLocation } from 'react-router-dom'
|
import { useLocation } from 'react-router-dom'
|
||||||
import { Card, Flex, Modal, Space } from 'antd'
|
import { Card, Flex, Space } from 'antd'
|
||||||
import { LoadingOutlined } from '@ant-design/icons'
|
import { LoadingOutlined } from '@ant-design/icons'
|
||||||
import loglevel from 'loglevel'
|
import loglevel from 'loglevel'
|
||||||
import config from '../../../../config.js'
|
import config from '../../../../config.js'
|
||||||
@ -17,10 +17,10 @@ import EditButtons from '../../common/EditButtons.jsx'
|
|||||||
import ObjectTableNavigationButtons from '../../common/ObjectTableNavigationButtons.jsx'
|
import ObjectTableNavigationButtons from '../../common/ObjectTableNavigationButtons.jsx'
|
||||||
import ActivityIndicator from '../../common/ActivityIndicator.jsx'
|
import ActivityIndicator from '../../common/ActivityIndicator.jsx'
|
||||||
import ActionHandler from '../../common/ActionHandler.jsx'
|
import ActionHandler from '../../common/ActionHandler.jsx'
|
||||||
|
import { useActions } from '../../context/ActionsContext'
|
||||||
import ObjectActions from '../../common/ObjectActions.jsx'
|
import ObjectActions from '../../common/ObjectActions.jsx'
|
||||||
import ObjectTable from '../../common/ObjectTable.jsx'
|
import ObjectTable from '../../common/ObjectTable.jsx'
|
||||||
import InfoCollapsePlaceholder from '../../common/InfoCollapsePlaceholder.jsx'
|
import InfoCollapsePlaceholder from '../../common/InfoCollapsePlaceholder.jsx'
|
||||||
import HostOTP from './HostOtp.jsx'
|
|
||||||
import DocumentPrintButton from '../../common/DocumentPrintButton.jsx'
|
import DocumentPrintButton from '../../common/DocumentPrintButton.jsx'
|
||||||
import UserNotifierToggle from '../../common/UserNotifierToggle.jsx'
|
import UserNotifierToggle from '../../common/UserNotifierToggle.jsx'
|
||||||
import PrinterIcon from '../../../Icons/PrinterIcon.jsx'
|
import PrinterIcon from '../../../Icons/PrinterIcon.jsx'
|
||||||
@ -34,6 +34,15 @@ const HostInfo = () => {
|
|||||||
const location = useLocation()
|
const location = useLocation()
|
||||||
const objectFormRef = useRef(null)
|
const objectFormRef = useRef(null)
|
||||||
const actionHandlerRef = useRef(null)
|
const actionHandlerRef = useRef(null)
|
||||||
|
|
||||||
|
|
||||||
|
const { setOnModalOk } = useActions()
|
||||||
|
useEffect(() => {
|
||||||
|
setOnModalOk(() => () => {
|
||||||
|
objectFormRef.current?.handleFetchObject?.()
|
||||||
|
})
|
||||||
|
return () => setOnModalOk(null)
|
||||||
|
}, [setOnModalOk])
|
||||||
const hostId = new URLSearchParams(location.search).get('hostId')
|
const hostId = new URLSearchParams(location.search).get('hostId')
|
||||||
const [collapseState, updateCollapseState] = useCollapseState('HostInfo', {
|
const [collapseState, updateCollapseState] = useCollapseState('HostInfo', {
|
||||||
info: true,
|
info: true,
|
||||||
@ -42,8 +51,6 @@ const HostInfo = () => {
|
|||||||
notes: true,
|
notes: true,
|
||||||
auditLogs: false
|
auditLogs: false
|
||||||
})
|
})
|
||||||
|
|
||||||
const [hostOTPOpen, setHostOTPOpen] = useState(false)
|
|
||||||
const [objectFormState, setEditFormState] = useState({
|
const [objectFormState, setEditFormState] = useState({
|
||||||
isEditing: false,
|
isEditing: false,
|
||||||
editLoading: false,
|
editLoading: false,
|
||||||
@ -54,10 +61,6 @@ const HostInfo = () => {
|
|||||||
})
|
})
|
||||||
|
|
||||||
const actions = {
|
const actions = {
|
||||||
hostOTP: () => {
|
|
||||||
setHostOTPOpen(true)
|
|
||||||
return false
|
|
||||||
},
|
|
||||||
edit: () => {
|
edit: () => {
|
||||||
objectFormRef?.current.startEditing()
|
objectFormRef?.current.startEditing()
|
||||||
return false
|
return false
|
||||||
@ -77,7 +80,6 @@ const HostInfo = () => {
|
|||||||
}
|
}
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
|
||||||
<Flex
|
<Flex
|
||||||
gap='large'
|
gap='large'
|
||||||
vertical='true'
|
vertical='true'
|
||||||
@ -170,6 +172,7 @@ const HostInfo = () => {
|
|||||||
type='host'
|
type='host'
|
||||||
style={{ height: '100%' }}
|
style={{ height: '100%' }}
|
||||||
ref={objectFormRef}
|
ref={objectFormRef}
|
||||||
|
setCurrentObject={true}
|
||||||
onStateChange={(state) => {
|
onStateChange={(state) => {
|
||||||
setEditFormState((prev) => ({ ...prev, ...state }))
|
setEditFormState((prev) => ({ ...prev, ...state }))
|
||||||
}}
|
}}
|
||||||
@ -267,20 +270,6 @@ const HostInfo = () => {
|
|||||||
</Flex>
|
</Flex>
|
||||||
</ScrollBox>
|
</ScrollBox>
|
||||||
</Flex>
|
</Flex>
|
||||||
|
|
||||||
<Modal
|
|
||||||
open={hostOTPOpen}
|
|
||||||
destroyOnHidden={true}
|
|
||||||
width={650}
|
|
||||||
onCancel={() => {
|
|
||||||
actionHandlerRef.current.clearAction()
|
|
||||||
setHostOTPOpen(false)
|
|
||||||
}}
|
|
||||||
footer={false}
|
|
||||||
>
|
|
||||||
<HostOTP id={hostId} />
|
|
||||||
</Modal>
|
|
||||||
</>
|
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -155,6 +155,7 @@ const MaterialInfo = () => {
|
|||||||
type='material'
|
type='material'
|
||||||
style={{ height: '100%' }}
|
style={{ height: '100%' }}
|
||||||
ref={objectFormRef}
|
ref={objectFormRef}
|
||||||
|
setCurrentObject={true}
|
||||||
onStateChange={(state) => {
|
onStateChange={(state) => {
|
||||||
setEditFormState((prev) => ({ ...prev, ...state }))
|
setEditFormState((prev) => ({ ...prev, ...state }))
|
||||||
}}
|
}}
|
||||||
|
|||||||
@ -143,6 +143,7 @@ const NoteTypeInfo = () => {
|
|||||||
type='noteType'
|
type='noteType'
|
||||||
style={{ height: '100%' }}
|
style={{ height: '100%' }}
|
||||||
ref={objectFormRef}
|
ref={objectFormRef}
|
||||||
|
setCurrentObject={true}
|
||||||
onStateChange={(state) => {
|
onStateChange={(state) => {
|
||||||
setEditFormState((prev) => ({ ...prev, ...state }))
|
setEditFormState((prev) => ({ ...prev, ...state }))
|
||||||
}}
|
}}
|
||||||
|
|||||||
@ -151,6 +151,7 @@ const NoteInfo = () => {
|
|||||||
type='note'
|
type='note'
|
||||||
style={{ height: '100%' }}
|
style={{ height: '100%' }}
|
||||||
ref={objectFormRef}
|
ref={objectFormRef}
|
||||||
|
setCurrentObject={true}
|
||||||
onStateChange={(state) => {
|
onStateChange={(state) => {
|
||||||
setEditFormState((prev) => ({ ...prev, ...state }))
|
setEditFormState((prev) => ({ ...prev, ...state }))
|
||||||
}}
|
}}
|
||||||
|
|||||||
@ -147,6 +147,7 @@ const PartSkuInfo = () => {
|
|||||||
type='partSku'
|
type='partSku'
|
||||||
style={{ height: '100%' }}
|
style={{ height: '100%' }}
|
||||||
ref={objectFormRef}
|
ref={objectFormRef}
|
||||||
|
setCurrentObject={true}
|
||||||
onStateChange={(state) => {
|
onStateChange={(state) => {
|
||||||
setEditFormState((prev) => ({ ...prev, ...state }))
|
setEditFormState((prev) => ({ ...prev, ...state }))
|
||||||
}}
|
}}
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
import { useRef, useState } from 'react'
|
import { useRef, useState, useEffect } from 'react'
|
||||||
import { useLocation } from 'react-router-dom'
|
import { useLocation } from 'react-router-dom'
|
||||||
import { Card, Flex, Modal, Space } from 'antd'
|
import { Card, Flex, Space } from 'antd'
|
||||||
import useCollapseState from '../../hooks/useCollapseState'
|
import useCollapseState from '../../hooks/useCollapseState'
|
||||||
import NotesPanel from '../../common/NotesPanel'
|
import NotesPanel from '../../common/NotesPanel'
|
||||||
import InfoCollapse from '../../common/InfoCollapse'
|
import InfoCollapse from '../../common/InfoCollapse'
|
||||||
@ -14,6 +14,7 @@ import InfoCircleIcon from '../../../Icons/InfoCircleIcon.jsx'
|
|||||||
import NoteIcon from '../../../Icons/NoteIcon.jsx'
|
import NoteIcon from '../../../Icons/NoteIcon.jsx'
|
||||||
import AuditLogIcon from '../../../Icons/AuditLogIcon.jsx'
|
import AuditLogIcon from '../../../Icons/AuditLogIcon.jsx'
|
||||||
import ActionHandler from '../../common/ActionHandler.jsx'
|
import ActionHandler from '../../common/ActionHandler.jsx'
|
||||||
|
import { useActions } from '../../context/ActionsContext'
|
||||||
import ObjectActions from '../../common/ObjectActions.jsx'
|
import ObjectActions from '../../common/ObjectActions.jsx'
|
||||||
import ObjectTable from '../../common/ObjectTable.jsx'
|
import ObjectTable from '../../common/ObjectTable.jsx'
|
||||||
import InfoCollapsePlaceholder from '../../common/InfoCollapsePlaceholder.jsx'
|
import InfoCollapsePlaceholder from '../../common/InfoCollapsePlaceholder.jsx'
|
||||||
@ -21,15 +22,22 @@ import DocumentPrintButton from '../../common/DocumentPrintButton.jsx'
|
|||||||
import UserNotifierToggle from '../../common/UserNotifierToggle.jsx'
|
import UserNotifierToggle from '../../common/UserNotifierToggle.jsx'
|
||||||
import ScrollBox from '../../common/ScrollBox.jsx'
|
import ScrollBox from '../../common/ScrollBox.jsx'
|
||||||
import PartSkuIcon from '../../../Icons/PartSkuIcon.jsx'
|
import PartSkuIcon from '../../../Icons/PartSkuIcon.jsx'
|
||||||
import NewPartSku from '../PartSkus/NewPartSku'
|
|
||||||
|
|
||||||
const PartInfo = () => {
|
const PartInfo = () => {
|
||||||
const location = useLocation()
|
const location = useLocation()
|
||||||
const objectFormRef = useRef(null)
|
const objectFormRef = useRef(null)
|
||||||
const actionHandlerRef = useRef(null)
|
const actionHandlerRef = useRef(null)
|
||||||
const partId = new URLSearchParams(location.search).get('partId')
|
const partId = new URLSearchParams(location.search).get('partId')
|
||||||
const [newPartSkuOpen, setNewPartSkuOpen] = useState(false)
|
|
||||||
const partSkusTableRef = useRef()
|
const partSkusTableRef = useRef()
|
||||||
|
|
||||||
|
|
||||||
|
const { setOnModalOk } = useActions()
|
||||||
|
useEffect(() => {
|
||||||
|
setOnModalOk(() => () => {
|
||||||
|
partSkusTableRef.current?.reload?.()
|
||||||
|
})
|
||||||
|
return () => setOnModalOk(null)
|
||||||
|
}, [setOnModalOk])
|
||||||
const [collapseState, updateCollapseState] = useCollapseState('PartInfo', {
|
const [collapseState, updateCollapseState] = useCollapseState('PartInfo', {
|
||||||
info: true,
|
info: true,
|
||||||
partSkus: true,
|
partSkus: true,
|
||||||
@ -46,10 +54,6 @@ const PartInfo = () => {
|
|||||||
})
|
})
|
||||||
|
|
||||||
const actions = {
|
const actions = {
|
||||||
newPartSku: () => {
|
|
||||||
setNewPartSkuOpen(true)
|
|
||||||
return true
|
|
||||||
},
|
|
||||||
edit: () => {
|
edit: () => {
|
||||||
objectFormRef?.current?.startEditing?.()
|
objectFormRef?.current?.startEditing?.()
|
||||||
return false
|
return false
|
||||||
@ -65,7 +69,6 @@ const PartInfo = () => {
|
|||||||
}
|
}
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
|
||||||
<Flex
|
<Flex
|
||||||
gap='large'
|
gap='large'
|
||||||
vertical='true'
|
vertical='true'
|
||||||
@ -146,6 +149,7 @@ const PartInfo = () => {
|
|||||||
type='part'
|
type='part'
|
||||||
style={{ height: '100%' }}
|
style={{ height: '100%' }}
|
||||||
ref={objectFormRef}
|
ref={objectFormRef}
|
||||||
|
setCurrentObject={true}
|
||||||
onStateChange={(state) => {
|
onStateChange={(state) => {
|
||||||
setEditFormState((prev) => ({ ...prev, ...state }))
|
setEditFormState((prev) => ({ ...prev, ...state }))
|
||||||
}}
|
}}
|
||||||
@ -190,25 +194,6 @@ const PartInfo = () => {
|
|||||||
)}
|
)}
|
||||||
</InfoCollapse>
|
</InfoCollapse>
|
||||||
</ActionHandler>
|
</ActionHandler>
|
||||||
<Modal
|
|
||||||
open={newPartSkuOpen}
|
|
||||||
styles={{ content: { paddingBottom: '24px' } }}
|
|
||||||
footer={null}
|
|
||||||
width={700}
|
|
||||||
onCancel={() => setNewPartSkuOpen(false)}
|
|
||||||
destroyOnHidden={true}
|
|
||||||
>
|
|
||||||
<NewPartSku
|
|
||||||
onOk={() => {
|
|
||||||
setNewPartSkuOpen(false)
|
|
||||||
partSkusTableRef.current?.reload?.()
|
|
||||||
}}
|
|
||||||
reset={newPartSkuOpen}
|
|
||||||
defaultValues={{
|
|
||||||
part: objectFormState?.objectData || undefined
|
|
||||||
}}
|
|
||||||
/>
|
|
||||||
</Modal>
|
|
||||||
<InfoCollapse
|
<InfoCollapse
|
||||||
title='Notes'
|
title='Notes'
|
||||||
icon={<NoteIcon />}
|
icon={<NoteIcon />}
|
||||||
@ -242,7 +227,6 @@ const PartInfo = () => {
|
|||||||
</Flex>
|
</Flex>
|
||||||
</ScrollBox>
|
</ScrollBox>
|
||||||
</Flex>
|
</Flex>
|
||||||
</>
|
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -152,6 +152,7 @@ const ProductCategoryInfo = () => {
|
|||||||
type='productCategory'
|
type='productCategory'
|
||||||
style={{ height: '100%' }}
|
style={{ height: '100%' }}
|
||||||
ref={objectFormRef}
|
ref={objectFormRef}
|
||||||
|
setCurrentObject={true}
|
||||||
onStateChange={(state) => {
|
onStateChange={(state) => {
|
||||||
setEditFormState((prev) => ({ ...prev, ...state }))
|
setEditFormState((prev) => ({ ...prev, ...state }))
|
||||||
}}
|
}}
|
||||||
|
|||||||
@ -148,6 +148,7 @@ const ProductSkuInfo = () => {
|
|||||||
type='productSku'
|
type='productSku'
|
||||||
style={{ height: '100%' }}
|
style={{ height: '100%' }}
|
||||||
ref={objectFormRef}
|
ref={objectFormRef}
|
||||||
|
setCurrentObject={true}
|
||||||
onStateChange={(state) => {
|
onStateChange={(state) => {
|
||||||
setEditFormState((prev) => ({ ...prev, ...state }))
|
setEditFormState((prev) => ({ ...prev, ...state }))
|
||||||
}}
|
}}
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
import { useRef, useState } from 'react'
|
import { useRef, useState, useEffect } from 'react'
|
||||||
import { useLocation } from 'react-router-dom'
|
import { useLocation } from 'react-router-dom'
|
||||||
import { Card, Flex, Modal, Space } from 'antd'
|
import { Card, Flex, Space } from 'antd'
|
||||||
import useCollapseState from '../../hooks/useCollapseState'
|
import useCollapseState from '../../hooks/useCollapseState'
|
||||||
import NotesPanel from '../../common/NotesPanel'
|
import NotesPanel from '../../common/NotesPanel'
|
||||||
import InfoCollapse from '../../common/InfoCollapse'
|
import InfoCollapse from '../../common/InfoCollapse'
|
||||||
@ -15,13 +15,13 @@ import NoteIcon from '../../../Icons/NoteIcon.jsx'
|
|||||||
import AuditLogIcon from '../../../Icons/AuditLogIcon.jsx'
|
import AuditLogIcon from '../../../Icons/AuditLogIcon.jsx'
|
||||||
import ObjectTable from '../../common/ObjectTable.jsx'
|
import ObjectTable from '../../common/ObjectTable.jsx'
|
||||||
import ActionHandler from '../../common/ActionHandler.jsx'
|
import ActionHandler from '../../common/ActionHandler.jsx'
|
||||||
|
import { useActions } from '../../context/ActionsContext'
|
||||||
import ObjectActions from '../../common/ObjectActions.jsx'
|
import ObjectActions from '../../common/ObjectActions.jsx'
|
||||||
import InfoCollapsePlaceholder from '../../common/InfoCollapsePlaceholder.jsx'
|
import InfoCollapsePlaceholder from '../../common/InfoCollapsePlaceholder.jsx'
|
||||||
import DocumentPrintButton from '../../common/DocumentPrintButton.jsx'
|
import DocumentPrintButton from '../../common/DocumentPrintButton.jsx'
|
||||||
import UserNotifierToggle from '../../common/UserNotifierToggle.jsx'
|
import UserNotifierToggle from '../../common/UserNotifierToggle.jsx'
|
||||||
import ScrollBox from '../../common/ScrollBox.jsx'
|
import ScrollBox from '../../common/ScrollBox.jsx'
|
||||||
import ProductSkuIcon from '../../../Icons/ProductSkuIcon.jsx'
|
import ProductSkuIcon from '../../../Icons/ProductSkuIcon.jsx'
|
||||||
import NewProductSku from '../ProductSkus/NewProductSku'
|
|
||||||
|
|
||||||
const ProductInfo = () => {
|
const ProductInfo = () => {
|
||||||
const location = useLocation()
|
const location = useLocation()
|
||||||
@ -34,8 +34,16 @@ const ProductInfo = () => {
|
|||||||
notes: true,
|
notes: true,
|
||||||
auditLogs: false
|
auditLogs: false
|
||||||
})
|
})
|
||||||
const [newProductSkuOpen, setNewProductSkuOpen] = useState(false)
|
|
||||||
const productSkusTableRef = useRef()
|
const productSkusTableRef = useRef()
|
||||||
|
|
||||||
|
|
||||||
|
const { setOnModalOk } = useActions()
|
||||||
|
useEffect(() => {
|
||||||
|
setOnModalOk(() => () => {
|
||||||
|
productSkusTableRef.current?.reload?.()
|
||||||
|
})
|
||||||
|
return () => setOnModalOk(null)
|
||||||
|
}, [setOnModalOk])
|
||||||
const [objectFormState, setEditFormState] = useState({
|
const [objectFormState, setEditFormState] = useState({
|
||||||
isEditing: false,
|
isEditing: false,
|
||||||
editLoading: false,
|
editLoading: false,
|
||||||
@ -46,10 +54,6 @@ const ProductInfo = () => {
|
|||||||
})
|
})
|
||||||
|
|
||||||
const actions = {
|
const actions = {
|
||||||
newProductSku: () => {
|
|
||||||
setNewProductSkuOpen(true)
|
|
||||||
return true
|
|
||||||
},
|
|
||||||
edit: () => {
|
edit: () => {
|
||||||
objectFormRef?.current?.startEditing?.()
|
objectFormRef?.current?.startEditing?.()
|
||||||
return false
|
return false
|
||||||
@ -65,7 +69,6 @@ const ProductInfo = () => {
|
|||||||
}
|
}
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
|
||||||
<Flex
|
<Flex
|
||||||
gap='large'
|
gap='large'
|
||||||
vertical='true'
|
vertical='true'
|
||||||
@ -146,6 +149,7 @@ const ProductInfo = () => {
|
|||||||
type='product'
|
type='product'
|
||||||
style={{ height: '100%' }}
|
style={{ height: '100%' }}
|
||||||
ref={objectFormRef}
|
ref={objectFormRef}
|
||||||
|
setCurrentObject={true}
|
||||||
onStateChange={(state) => {
|
onStateChange={(state) => {
|
||||||
setEditFormState((prev) => ({ ...prev, ...state }))
|
setEditFormState((prev) => ({ ...prev, ...state }))
|
||||||
}}
|
}}
|
||||||
@ -193,26 +197,6 @@ const ProductInfo = () => {
|
|||||||
</ObjectForm>
|
</ObjectForm>
|
||||||
</ActionHandler>
|
</ActionHandler>
|
||||||
|
|
||||||
<Modal
|
|
||||||
open={newProductSkuOpen}
|
|
||||||
styles={{ content: { paddingBottom: '24px' } }}
|
|
||||||
footer={null}
|
|
||||||
width={700}
|
|
||||||
onCancel={() => setNewProductSkuOpen(false)}
|
|
||||||
destroyOnHidden={true}
|
|
||||||
>
|
|
||||||
<NewProductSku
|
|
||||||
onOk={() => {
|
|
||||||
setNewProductSkuOpen(false)
|
|
||||||
productSkusTableRef.current?.reload?.()
|
|
||||||
}}
|
|
||||||
reset={newProductSkuOpen}
|
|
||||||
defaultValues={{
|
|
||||||
product: objectFormState?.objectData || undefined
|
|
||||||
}}
|
|
||||||
/>
|
|
||||||
</Modal>
|
|
||||||
|
|
||||||
<InfoCollapse
|
<InfoCollapse
|
||||||
title='Notes'
|
title='Notes'
|
||||||
icon={<NoteIcon />}
|
icon={<NoteIcon />}
|
||||||
@ -246,7 +230,6 @@ const ProductInfo = () => {
|
|||||||
</Flex>
|
</Flex>
|
||||||
</ScrollBox>
|
</ScrollBox>
|
||||||
</Flex>
|
</Flex>
|
||||||
</>
|
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -152,6 +152,7 @@ const TaxRateInfo = () => {
|
|||||||
type='taxRate'
|
type='taxRate'
|
||||||
style={{ height: '100%' }}
|
style={{ height: '100%' }}
|
||||||
ref={objectFormRef}
|
ref={objectFormRef}
|
||||||
|
setCurrentObject={true}
|
||||||
onStateChange={(state) => {
|
onStateChange={(state) => {
|
||||||
setEditFormState((prev) => ({ ...prev, ...state }))
|
setEditFormState((prev) => ({ ...prev, ...state }))
|
||||||
}}
|
}}
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
import { useRef, useState } from 'react'
|
import { useRef, useState } from 'react'
|
||||||
import { useLocation } from 'react-router-dom'
|
import { useLocation } from 'react-router-dom'
|
||||||
import { Card, Flex, Modal, Space } from 'antd'
|
import { Card, Flex, Space } from 'antd'
|
||||||
import { LoadingOutlined } from '@ant-design/icons'
|
import { LoadingOutlined } from '@ant-design/icons'
|
||||||
import useCollapseState from '../../hooks/useCollapseState'
|
import useCollapseState from '../../hooks/useCollapseState'
|
||||||
import NotesPanel from '../../common/NotesPanel'
|
import NotesPanel from '../../common/NotesPanel'
|
||||||
@ -22,7 +22,6 @@ import InfoCollapsePlaceholder from '../../common/InfoCollapsePlaceholder.jsx'
|
|||||||
import DocumentPrintButton from '../../common/DocumentPrintButton.jsx'
|
import DocumentPrintButton from '../../common/DocumentPrintButton.jsx'
|
||||||
import UserNotifierToggle from '../../common/UserNotifierToggle.jsx'
|
import UserNotifierToggle from '../../common/UserNotifierToggle.jsx'
|
||||||
import ScrollBox from '../../common/ScrollBox.jsx'
|
import ScrollBox from '../../common/ScrollBox.jsx'
|
||||||
import NewAppPassword from '../AppPasswords/NewAppPassword.jsx'
|
|
||||||
import ObjectProperty from '../../common/ObjectProperty.jsx'
|
import ObjectProperty from '../../common/ObjectProperty.jsx'
|
||||||
import { getModelProperty } from '../../../../database/ObjectModels.js'
|
import { getModelProperty } from '../../../../database/ObjectModels.js'
|
||||||
import { useMediaQuery } from 'react-responsive'
|
import { useMediaQuery } from 'react-responsive'
|
||||||
@ -33,7 +32,6 @@ const UserInfo = () => {
|
|||||||
const appPasswordsTableRef = useRef(null)
|
const appPasswordsTableRef = useRef(null)
|
||||||
const actionHandlerRef = useRef(null)
|
const actionHandlerRef = useRef(null)
|
||||||
const userId = new URLSearchParams(location.search).get('userId')
|
const userId = new URLSearchParams(location.search).get('userId')
|
||||||
const [newAppPasswordOpen, setNewAppPasswordOpen] = useState(false)
|
|
||||||
const [collapseState, updateCollapseState] = useCollapseState('UserInfo', {
|
const [collapseState, updateCollapseState] = useCollapseState('UserInfo', {
|
||||||
info: true,
|
info: true,
|
||||||
appPasswords: true,
|
appPasswords: true,
|
||||||
@ -51,10 +49,6 @@ const UserInfo = () => {
|
|||||||
const isMobile = useMediaQuery({ maxWidth: 768 })
|
const isMobile = useMediaQuery({ maxWidth: 768 })
|
||||||
|
|
||||||
const actions = {
|
const actions = {
|
||||||
newAppPassword: () => {
|
|
||||||
setNewAppPasswordOpen(true)
|
|
||||||
return false
|
|
||||||
},
|
|
||||||
edit: () => {
|
edit: () => {
|
||||||
objectFormRef?.current?.startEditing?.()
|
objectFormRef?.current?.startEditing?.()
|
||||||
return false
|
return false
|
||||||
@ -70,205 +64,184 @@ const UserInfo = () => {
|
|||||||
}
|
}
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<Flex
|
||||||
<Flex
|
gap='large'
|
||||||
gap='large'
|
vertical='true'
|
||||||
vertical='true'
|
style={{ maxHeight: '100%', minHeight: 0 }}
|
||||||
style={{ maxHeight: '100%', minHeight: 0 }}
|
>
|
||||||
>
|
<Flex justify={'space-between'}>
|
||||||
<Flex justify={'space-between'}>
|
<Space size='small'>
|
||||||
<Space size='small'>
|
<Space size='small'>
|
||||||
<Space size='small'>
|
<ObjectActions
|
||||||
<ObjectActions
|
type='user'
|
||||||
type='user'
|
id={userId}
|
||||||
id={userId}
|
disabled={objectFormState.loading}
|
||||||
disabled={objectFormState.loading}
|
objectData={objectFormState.objectData}
|
||||||
objectData={objectFormState.objectData}
|
/>
|
||||||
/>
|
<ViewButton
|
||||||
<ViewButton
|
disabled={objectFormState.loading}
|
||||||
disabled={objectFormState.loading}
|
items={[
|
||||||
items={[
|
{ key: 'info', label: 'User Information' },
|
||||||
{ key: 'info', label: 'User Information' },
|
{ key: 'appPasswords', label: 'App Passwords' },
|
||||||
{ key: 'appPasswords', label: 'App Passwords' },
|
{ key: 'notes', label: 'Notes' },
|
||||||
{ key: 'notes', label: 'Notes' },
|
{ key: 'auditLogs', label: 'Audit Logs' }
|
||||||
{ key: 'auditLogs', label: 'Audit Logs' }
|
]}
|
||||||
]}
|
visibleState={collapseState}
|
||||||
visibleState={collapseState}
|
updateVisibleState={updateCollapseState}
|
||||||
updateVisibleState={updateCollapseState}
|
/>
|
||||||
/>
|
<UserNotifierToggle
|
||||||
<UserNotifierToggle
|
type='user'
|
||||||
type='user'
|
objectData={objectFormState.objectData}
|
||||||
objectData={objectFormState.objectData}
|
disabled={objectFormState.loading}
|
||||||
disabled={objectFormState.loading}
|
/>
|
||||||
/>
|
<DocumentPrintButton
|
||||||
<DocumentPrintButton
|
type='user'
|
||||||
type='user'
|
objectData={objectFormState.objectData}
|
||||||
objectData={objectFormState.objectData}
|
disabled={objectFormState.loading}
|
||||||
disabled={objectFormState.loading}
|
|
||||||
/>
|
|
||||||
</Space>
|
|
||||||
<ActivityIndicator
|
|
||||||
activities={objectFormState.activities}
|
|
||||||
showStartingDivider={true}
|
|
||||||
/>
|
/>
|
||||||
</Space>
|
</Space>
|
||||||
<Space>
|
<ActivityIndicator
|
||||||
<EditButtons
|
activities={objectFormState.activities}
|
||||||
isEditing={objectFormState.isEditing}
|
showStartingDivider={true}
|
||||||
handleUpdate={() => {
|
/>
|
||||||
actionHandlerRef.current.callAction('finishEdit')
|
</Space>
|
||||||
}}
|
<Space>
|
||||||
cancelEditing={() => {
|
<EditButtons
|
||||||
actionHandlerRef.current.callAction('cancelEdit')
|
isEditing={objectFormState.isEditing}
|
||||||
}}
|
handleUpdate={() => {
|
||||||
startEditing={() => {
|
actionHandlerRef.current.callAction('finishEdit')
|
||||||
actionHandlerRef.current.callAction('edit')
|
}}
|
||||||
}}
|
cancelEditing={() => {
|
||||||
editLoading={objectFormState.editLoading}
|
actionHandlerRef.current.callAction('cancelEdit')
|
||||||
formValid={objectFormState.formValid}
|
}}
|
||||||
disabled={
|
startEditing={() => {
|
||||||
objectFormState.beingEditedByOther || objectFormState.loading
|
actionHandlerRef.current.callAction('edit')
|
||||||
}
|
}}
|
||||||
loading={objectFormState.editLoading}
|
editLoading={objectFormState.editLoading}
|
||||||
/>
|
formValid={objectFormState.formValid}
|
||||||
<ObjectTableNavigationButtons
|
disabled={
|
||||||
disabled={objectFormState.loading || objectFormState.isEditing}
|
objectFormState.beingEditedByOther || objectFormState.loading
|
||||||
_id={userId}
|
}
|
||||||
objectType='user'
|
loading={objectFormState.editLoading}
|
||||||
showEndingDivider={true}
|
/>
|
||||||
/>
|
<ObjectTableNavigationButtons
|
||||||
</Space>
|
disabled={objectFormState.loading || objectFormState.isEditing}
|
||||||
</Flex>
|
_id={userId}
|
||||||
<ScrollBox>
|
objectType='user'
|
||||||
<Flex vertical gap={'large'}>
|
showEndingDivider={true}
|
||||||
<ActionHandler
|
/>
|
||||||
actions={actions}
|
</Space>
|
||||||
loading={objectFormState.loading}
|
|
||||||
ref={actionHandlerRef}
|
|
||||||
>
|
|
||||||
<InfoCollapse
|
|
||||||
title='User Information'
|
|
||||||
icon={<InfoCircleIcon />}
|
|
||||||
active={collapseState.info}
|
|
||||||
onToggle={(expanded) => updateCollapseState('info', expanded)}
|
|
||||||
collapseKey='info'
|
|
||||||
>
|
|
||||||
<ObjectForm
|
|
||||||
id={userId}
|
|
||||||
type='user'
|
|
||||||
style={{ height: '100%' }}
|
|
||||||
ref={objectFormRef}
|
|
||||||
onStateChange={(state) => {
|
|
||||||
setEditFormState((prev) => ({ ...prev, ...state }))
|
|
||||||
}}
|
|
||||||
>
|
|
||||||
{({ loading, isEditing, objectData }) => (
|
|
||||||
<Flex gap='large' vertical={isMobile}>
|
|
||||||
<div
|
|
||||||
style={
|
|
||||||
isMobile
|
|
||||||
? { width: '100%' }
|
|
||||||
: { width: '20%', maxWidth: '238px' }
|
|
||||||
}
|
|
||||||
>
|
|
||||||
<Card styles={{ body: { padding: 18 } }}>
|
|
||||||
<ObjectProperty
|
|
||||||
{...getModelProperty('user', 'profileImage')}
|
|
||||||
isEditing={isEditing}
|
|
||||||
objectData={objectData}
|
|
||||||
loading={loading}
|
|
||||||
/>
|
|
||||||
</Card>
|
|
||||||
</div>
|
|
||||||
<ObjectInfo
|
|
||||||
loading={loading}
|
|
||||||
indicator={<LoadingOutlined />}
|
|
||||||
isEditing={isEditing}
|
|
||||||
type='user'
|
|
||||||
objectData={objectData}
|
|
||||||
visibleProperties={{
|
|
||||||
profileImage: false
|
|
||||||
}}
|
|
||||||
/>
|
|
||||||
</Flex>
|
|
||||||
)}
|
|
||||||
</ObjectForm>
|
|
||||||
</InfoCollapse>
|
|
||||||
</ActionHandler>
|
|
||||||
<InfoCollapse
|
|
||||||
title='App Passwords'
|
|
||||||
icon={<AppPasswordIcon />}
|
|
||||||
active={collapseState.appPasswords}
|
|
||||||
onToggle={(expanded) =>
|
|
||||||
updateCollapseState('appPasswords', expanded)
|
|
||||||
}
|
|
||||||
collapseKey='appPasswords'
|
|
||||||
>
|
|
||||||
{!userId ? (
|
|
||||||
<InfoCollapsePlaceholder />
|
|
||||||
) : (
|
|
||||||
<ObjectTable
|
|
||||||
type='appPassword'
|
|
||||||
masterFilter={{ user: userId }}
|
|
||||||
visibleColumns={{ user: false }}
|
|
||||||
ref={appPasswordsTableRef}
|
|
||||||
/>
|
|
||||||
)}
|
|
||||||
</InfoCollapse>
|
|
||||||
<InfoCollapse
|
|
||||||
title='Notes'
|
|
||||||
icon={<NoteIcon />}
|
|
||||||
active={collapseState.notes}
|
|
||||||
onToggle={(expanded) => updateCollapseState('notes', expanded)}
|
|
||||||
collapseKey='notes'
|
|
||||||
>
|
|
||||||
<Card>
|
|
||||||
<NotesPanel _id={userId} type='user' />
|
|
||||||
</Card>
|
|
||||||
</InfoCollapse>
|
|
||||||
<InfoCollapse
|
|
||||||
title='Audit Logs'
|
|
||||||
icon={<AuditLogIcon />}
|
|
||||||
active={collapseState.auditLogs}
|
|
||||||
onToggle={(expanded) =>
|
|
||||||
updateCollapseState('auditLogs', expanded)
|
|
||||||
}
|
|
||||||
collapseKey='auditLogs'
|
|
||||||
>
|
|
||||||
{objectFormState.loading ? (
|
|
||||||
<InfoCollapsePlaceholder />
|
|
||||||
) : (
|
|
||||||
<ObjectTable
|
|
||||||
type='auditLog'
|
|
||||||
masterFilter={{ 'parent._id': userId }}
|
|
||||||
visibleColumns={{ _id: false, 'parent._id': false }}
|
|
||||||
/>
|
|
||||||
)}
|
|
||||||
</InfoCollapse>
|
|
||||||
</Flex>
|
|
||||||
</ScrollBox>
|
|
||||||
</Flex>
|
</Flex>
|
||||||
|
<ScrollBox>
|
||||||
<Modal
|
<Flex vertical gap={'large'}>
|
||||||
open={newAppPasswordOpen}
|
<ActionHandler
|
||||||
destroyOnHidden={true}
|
actions={actions}
|
||||||
width={700}
|
loading={objectFormState.loading}
|
||||||
onCancel={() => {
|
ref={actionHandlerRef}
|
||||||
actionHandlerRef.current?.clearAction?.()
|
>
|
||||||
setNewAppPasswordOpen(false)
|
<InfoCollapse
|
||||||
}}
|
title='User Information'
|
||||||
footer={null}
|
icon={<InfoCircleIcon />}
|
||||||
>
|
active={collapseState.info}
|
||||||
<NewAppPassword
|
onToggle={(expanded) => updateCollapseState('info', expanded)}
|
||||||
onOk={() => {
|
collapseKey='info'
|
||||||
setNewAppPasswordOpen(false)
|
>
|
||||||
appPasswordsTableRef.current?.reload?.()
|
<ObjectForm
|
||||||
}}
|
id={userId}
|
||||||
reset={newAppPasswordOpen}
|
type='user'
|
||||||
defaultValues={{ user: { ...objectFormState.objectData } }}
|
style={{ height: '100%' }}
|
||||||
/>
|
ref={objectFormRef}
|
||||||
</Modal>
|
setCurrentObject={true}
|
||||||
</>
|
onStateChange={(state) => {
|
||||||
|
setEditFormState((prev) => ({ ...prev, ...state }))
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
{({ loading, isEditing, objectData }) => (
|
||||||
|
<Flex gap='large' vertical={isMobile}>
|
||||||
|
<div
|
||||||
|
style={
|
||||||
|
isMobile
|
||||||
|
? { width: '100%' }
|
||||||
|
: { width: '20%', maxWidth: '238px' }
|
||||||
|
}
|
||||||
|
>
|
||||||
|
<Card styles={{ body: { padding: 18 } }}>
|
||||||
|
<ObjectProperty
|
||||||
|
{...getModelProperty('user', 'profileImage')}
|
||||||
|
isEditing={isEditing}
|
||||||
|
objectData={objectData}
|
||||||
|
loading={loading}
|
||||||
|
/>
|
||||||
|
</Card>
|
||||||
|
</div>
|
||||||
|
<ObjectInfo
|
||||||
|
loading={loading}
|
||||||
|
indicator={<LoadingOutlined />}
|
||||||
|
isEditing={isEditing}
|
||||||
|
type='user'
|
||||||
|
objectData={objectData}
|
||||||
|
visibleProperties={{
|
||||||
|
profileImage: false
|
||||||
|
}}
|
||||||
|
/>
|
||||||
|
</Flex>
|
||||||
|
)}
|
||||||
|
</ObjectForm>
|
||||||
|
</InfoCollapse>
|
||||||
|
</ActionHandler>
|
||||||
|
<InfoCollapse
|
||||||
|
title='App Passwords'
|
||||||
|
icon={<AppPasswordIcon />}
|
||||||
|
active={collapseState.appPasswords}
|
||||||
|
onToggle={(expanded) =>
|
||||||
|
updateCollapseState('appPasswords', expanded)
|
||||||
|
}
|
||||||
|
collapseKey='appPasswords'
|
||||||
|
>
|
||||||
|
{!userId ? (
|
||||||
|
<InfoCollapsePlaceholder />
|
||||||
|
) : (
|
||||||
|
<ObjectTable
|
||||||
|
type='appPassword'
|
||||||
|
masterFilter={{ user: userId }}
|
||||||
|
visibleColumns={{ user: false }}
|
||||||
|
ref={appPasswordsTableRef}
|
||||||
|
/>
|
||||||
|
)}
|
||||||
|
</InfoCollapse>
|
||||||
|
<InfoCollapse
|
||||||
|
title='Notes'
|
||||||
|
icon={<NoteIcon />}
|
||||||
|
active={collapseState.notes}
|
||||||
|
onToggle={(expanded) => updateCollapseState('notes', expanded)}
|
||||||
|
collapseKey='notes'
|
||||||
|
>
|
||||||
|
<Card>
|
||||||
|
<NotesPanel _id={userId} type='user' />
|
||||||
|
</Card>
|
||||||
|
</InfoCollapse>
|
||||||
|
<InfoCollapse
|
||||||
|
title='Audit Logs'
|
||||||
|
icon={<AuditLogIcon />}
|
||||||
|
active={collapseState.auditLogs}
|
||||||
|
onToggle={(expanded) =>
|
||||||
|
updateCollapseState('auditLogs', expanded)
|
||||||
|
}
|
||||||
|
collapseKey='auditLogs'
|
||||||
|
>
|
||||||
|
{objectFormState.loading ? (
|
||||||
|
<InfoCollapsePlaceholder />
|
||||||
|
) : (
|
||||||
|
<ObjectTable
|
||||||
|
type='auditLog'
|
||||||
|
masterFilter={{ 'parent._id': userId }}
|
||||||
|
visibleColumns={{ _id: false, 'parent._id': false }}
|
||||||
|
/>
|
||||||
|
)}
|
||||||
|
</InfoCollapse>
|
||||||
|
</Flex>
|
||||||
|
</ScrollBox>
|
||||||
|
</Flex>
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -152,6 +152,7 @@ const VendorInfo = () => {
|
|||||||
type='vendor'
|
type='vendor'
|
||||||
style={{ height: '100%' }}
|
style={{ height: '100%' }}
|
||||||
ref={objectFormRef}
|
ref={objectFormRef}
|
||||||
|
setCurrentObject={true}
|
||||||
onStateChange={(state) => {
|
onStateChange={(state) => {
|
||||||
setEditFormState((prev) => ({ ...prev, ...state }))
|
setEditFormState((prev) => ({ ...prev, ...state }))
|
||||||
}}
|
}}
|
||||||
|
|||||||
@ -189,6 +189,7 @@ const FilamentProfileInfo = () => {
|
|||||||
id={filamentProfileId}
|
id={filamentProfileId}
|
||||||
type='filamentProfile'
|
type='filamentProfile'
|
||||||
ref={objectFormRef}
|
ref={objectFormRef}
|
||||||
|
setCurrentObject={true}
|
||||||
onStateChange={(state) =>
|
onStateChange={(state) =>
|
||||||
setObjectFormState((current) => ({ ...current, ...state }))
|
setObjectFormState((current) => ({ ...current, ...state }))
|
||||||
}
|
}
|
||||||
|
|||||||
@ -155,6 +155,7 @@ const GCodeFileInfo = () => {
|
|||||||
type='gcodeFile'
|
type='gcodeFile'
|
||||||
style={{ height: '100%' }}
|
style={{ height: '100%' }}
|
||||||
ref={objectFormRef}
|
ref={objectFormRef}
|
||||||
|
setCurrentObject={true}
|
||||||
onStateChange={(state) => {
|
onStateChange={(state) => {
|
||||||
setEditFormState((prev) => ({ ...prev, ...state }))
|
setEditFormState((prev) => ({ ...prev, ...state }))
|
||||||
}}
|
}}
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
import { useRef, useState } from 'react'
|
import { useRef, useState, useEffect } from 'react'
|
||||||
import { useLocation } from 'react-router-dom'
|
import { useLocation } from 'react-router-dom'
|
||||||
import { Card, Flex, Modal, Space } from 'antd'
|
import { Card, Flex, Space } from 'antd'
|
||||||
import { LoadingOutlined } from '@ant-design/icons'
|
import { LoadingOutlined } from '@ant-design/icons'
|
||||||
import loglevel from 'loglevel'
|
import loglevel from 'loglevel'
|
||||||
import config from '../../../../config.js'
|
import config from '../../../../config.js'
|
||||||
@ -17,13 +17,13 @@ import EditButtons from '../../common/EditButtons.jsx'
|
|||||||
import ObjectTableNavigationButtons from '../../common/ObjectTableNavigationButtons.jsx'
|
import ObjectTableNavigationButtons from '../../common/ObjectTableNavigationButtons.jsx'
|
||||||
import ActivityIndicator from '../../common/ActivityIndicator.jsx'
|
import ActivityIndicator from '../../common/ActivityIndicator.jsx'
|
||||||
import ActionHandler from '../../common/ActionHandler.jsx'
|
import ActionHandler from '../../common/ActionHandler.jsx'
|
||||||
|
import { useActions } from '../../context/ActionsContext'
|
||||||
import ObjectActions from '../../common/ObjectActions.jsx'
|
import ObjectActions from '../../common/ObjectActions.jsx'
|
||||||
import ObjectTable from '../../common/ObjectTable.jsx'
|
import ObjectTable from '../../common/ObjectTable.jsx'
|
||||||
import InfoCollapsePlaceholder from '../../common/InfoCollapsePlaceholder.jsx'
|
import InfoCollapsePlaceholder from '../../common/InfoCollapsePlaceholder.jsx'
|
||||||
import JobIcon from '../../../Icons/JobIcon.jsx'
|
import JobIcon from '../../../Icons/JobIcon.jsx'
|
||||||
import DocumentPrintButton from '../../common/DocumentPrintButton.jsx'
|
import DocumentPrintButton from '../../common/DocumentPrintButton.jsx'
|
||||||
import UserNotifierToggle from '../../common/UserNotifierToggle.jsx'
|
import UserNotifierToggle from '../../common/UserNotifierToggle.jsx'
|
||||||
import DeployJob from './DeployJob.jsx'
|
|
||||||
import ScrollBox from '../../common/ScrollBox.jsx'
|
import ScrollBox from '../../common/ScrollBox.jsx'
|
||||||
import { getModelByName } from '../../../../database/ObjectModels.js'
|
import { getModelByName } from '../../../../database/ObjectModels.js'
|
||||||
|
|
||||||
@ -34,9 +34,16 @@ const JobInfo = () => {
|
|||||||
const location = useLocation()
|
const location = useLocation()
|
||||||
const objectFormRef = useRef(null)
|
const objectFormRef = useRef(null)
|
||||||
const actionHandlerRef = useRef(null)
|
const actionHandlerRef = useRef(null)
|
||||||
const jobId = new URLSearchParams(location.search).get('jobId')
|
|
||||||
|
|
||||||
const [deployJobOpen, setDeployJobOpen] = useState(false)
|
|
||||||
|
const { setOnModalOk } = useActions()
|
||||||
|
useEffect(() => {
|
||||||
|
setOnModalOk(() => () => {
|
||||||
|
objectFormRef.current?.handleFetchObject?.()
|
||||||
|
})
|
||||||
|
return () => setOnModalOk(null)
|
||||||
|
}, [setOnModalOk])
|
||||||
|
const jobId = new URLSearchParams(location.search).get('jobId')
|
||||||
const [collapseState, updateCollapseState] = useCollapseState('JobInfo', {
|
const [collapseState, updateCollapseState] = useCollapseState('JobInfo', {
|
||||||
info: true,
|
info: true,
|
||||||
subJobs: true,
|
subJobs: true,
|
||||||
@ -73,14 +80,9 @@ const JobInfo = () => {
|
|||||||
objectFormRef?.current.handleUpdate()
|
objectFormRef?.current.handleUpdate()
|
||||||
return true
|
return true
|
||||||
},
|
},
|
||||||
deploy: () => {
|
|
||||||
setDeployJobOpen(true)
|
|
||||||
return false
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
|
||||||
<Flex
|
<Flex
|
||||||
gap='large'
|
gap='large'
|
||||||
vertical='true'
|
vertical='true'
|
||||||
@ -174,6 +176,7 @@ const JobInfo = () => {
|
|||||||
type='job'
|
type='job'
|
||||||
style={{ height: '100%' }}
|
style={{ height: '100%' }}
|
||||||
ref={objectFormRef}
|
ref={objectFormRef}
|
||||||
|
setCurrentObject={true}
|
||||||
onStateChange={(state) => {
|
onStateChange={(state) => {
|
||||||
setEditFormState((prev) => ({ ...prev, ...state }))
|
setEditFormState((prev) => ({ ...prev, ...state }))
|
||||||
}}
|
}}
|
||||||
@ -239,25 +242,6 @@ const JobInfo = () => {
|
|||||||
</Flex>
|
</Flex>
|
||||||
</ScrollBox>
|
</ScrollBox>
|
||||||
</Flex>
|
</Flex>
|
||||||
<Modal
|
|
||||||
destroyOnHidden
|
|
||||||
footer={null}
|
|
||||||
open={deployJobOpen}
|
|
||||||
width={700}
|
|
||||||
onCancel={() => {
|
|
||||||
actionHandlerRef.current.clearAction()
|
|
||||||
setDeployJobOpen(false)
|
|
||||||
}}
|
|
||||||
>
|
|
||||||
<DeployJob
|
|
||||||
objectData={{ ...objectFormState.objectData }}
|
|
||||||
onOk={() => {
|
|
||||||
actionHandlerRef.current.clearAction()
|
|
||||||
setDeployJobOpen(false)
|
|
||||||
}}
|
|
||||||
/>
|
|
||||||
</Modal>
|
|
||||||
</>
|
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -162,6 +162,7 @@ const PrinterProfileInfo = () => {
|
|||||||
id={printerProfileId}
|
id={printerProfileId}
|
||||||
type='printerProfile'
|
type='printerProfile'
|
||||||
ref={objectFormRef}
|
ref={objectFormRef}
|
||||||
|
setCurrentObject={true}
|
||||||
onStateChange={(state) =>
|
onStateChange={(state) =>
|
||||||
setObjectFormState((current) => ({ ...current, ...state }))
|
setObjectFormState((current) => ({ ...current, ...state }))
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
import { useState, useRef, useEffect, useContext } from 'react'
|
import { useState, useRef, useEffect, useContext } from 'react'
|
||||||
import { useLocation } from 'react-router-dom'
|
import { useLocation } from 'react-router-dom'
|
||||||
import { Space, Flex, Card, Splitter, Divider, Modal } from 'antd'
|
import { Space, Flex, Card, Splitter, Divider } from 'antd'
|
||||||
import loglevel from 'loglevel'
|
import loglevel from 'loglevel'
|
||||||
import config from '../../../../config.js'
|
import config from '../../../../config.js'
|
||||||
import useCollapseState from '../../hooks/useCollapseState.jsx'
|
import useCollapseState from '../../hooks/useCollapseState.jsx'
|
||||||
@ -11,6 +11,7 @@ import NoteIcon from '../../../Icons/NoteIcon.jsx'
|
|||||||
import ObjectForm from '../../common/ObjectForm.jsx'
|
import ObjectForm from '../../common/ObjectForm.jsx'
|
||||||
import ActionHandler from '../../common/ActionHandler.jsx'
|
import ActionHandler from '../../common/ActionHandler.jsx'
|
||||||
import ObjectActions from '../../common/ObjectActions.jsx'
|
import ObjectActions from '../../common/ObjectActions.jsx'
|
||||||
|
import { useActions } from '../../context/ActionsContext'
|
||||||
import PropTypes from 'prop-types'
|
import PropTypes from 'prop-types'
|
||||||
|
|
||||||
import ObjectInfo from '../../common/ObjectInfo.jsx'
|
import ObjectInfo from '../../common/ObjectInfo.jsx'
|
||||||
@ -29,8 +30,6 @@ import MissingPlaceholder from '../../common/MissingPlaceholder.jsx'
|
|||||||
import { useMediaQuery } from 'react-responsive'
|
import { useMediaQuery } from 'react-responsive'
|
||||||
import AlertsDisplay from '../../common/AlertsDisplay.jsx'
|
import AlertsDisplay from '../../common/AlertsDisplay.jsx'
|
||||||
import { ApiServerContext } from '../../context/ApiServerContext.jsx'
|
import { ApiServerContext } from '../../context/ApiServerContext.jsx'
|
||||||
import LoadFilamentStock from '../../Inventory/FilamentStocks/LoadFilamentStock.jsx'
|
|
||||||
import UnloadFilamentStock from '../../Inventory/FilamentStocks/UnloadFilamentStock.jsx'
|
|
||||||
import ScrollBox from '../../common/ScrollBox.jsx'
|
import ScrollBox from '../../common/ScrollBox.jsx'
|
||||||
import ObjectTableNavigationButtons from '../../common/ObjectTableNavigationButtons.jsx'
|
import ObjectTableNavigationButtons from '../../common/ObjectTableNavigationButtons.jsx'
|
||||||
import PrinterControlButtons from '../../common/PrinterControlButtons.jsx'
|
import PrinterControlButtons from '../../common/PrinterControlButtons.jsx'
|
||||||
@ -59,6 +58,7 @@ const ControlPrinter = ({ slicerIntegration = false }) => {
|
|||||||
)
|
)
|
||||||
|
|
||||||
const { connected, sendObjectAction } = useContext(ApiServerContext)
|
const { connected, sendObjectAction } = useContext(ApiServerContext)
|
||||||
|
const { setCurrentObject, setCurrentObjectType, setOnModalOk } = useActions()
|
||||||
const [sideBarVisible, setSideBarVisible] = useState(
|
const [sideBarVisible, setSideBarVisible] = useState(
|
||||||
collapseState.temperature ||
|
collapseState.temperature ||
|
||||||
collapseState.position ||
|
collapseState.position ||
|
||||||
@ -66,8 +66,14 @@ const ControlPrinter = ({ slicerIntegration = false }) => {
|
|||||||
collapseState.misc
|
collapseState.misc
|
||||||
)
|
)
|
||||||
|
|
||||||
const [loadFilamentStockOpen, setLoadFilamentStockOpen] = useState(false)
|
const [objectFormState, setEditFormState] = useState({
|
||||||
const [unloadFilamentStockOpen, setUnloadFilamentStockOpen] = useState(false)
|
isEditing: false,
|
||||||
|
editLoading: false,
|
||||||
|
formValid: false,
|
||||||
|
activities: [],
|
||||||
|
loading: false,
|
||||||
|
objectData: {}
|
||||||
|
})
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
setSideBarVisible(
|
setSideBarVisible(
|
||||||
@ -78,14 +84,26 @@ const ControlPrinter = ({ slicerIntegration = false }) => {
|
|||||||
)
|
)
|
||||||
}, [collapseState])
|
}, [collapseState])
|
||||||
|
|
||||||
const [objectFormState, setEditFormState] = useState({
|
useEffect(() => {
|
||||||
isEditing: false,
|
setCurrentObjectType('printer')
|
||||||
editLoading: false,
|
return () => {
|
||||||
formValid: false,
|
setCurrentObject(null)
|
||||||
activities: [],
|
setCurrentObjectType(null)
|
||||||
loading: false,
|
}
|
||||||
objectData: {}
|
}, [setCurrentObject, setCurrentObjectType])
|
||||||
})
|
|
||||||
|
useEffect(() => {
|
||||||
|
if (objectFormState.objectData?._id) {
|
||||||
|
setCurrentObject(objectFormState.objectData)
|
||||||
|
}
|
||||||
|
}, [objectFormState.objectData, setCurrentObject])
|
||||||
|
|
||||||
|
useEffect(() => {
|
||||||
|
setOnModalOk(() => () => {
|
||||||
|
objectFormRef.current?.handleFetchObject?.()
|
||||||
|
})
|
||||||
|
return () => setOnModalOk(null)
|
||||||
|
}, [setOnModalOk])
|
||||||
|
|
||||||
const actions = {
|
const actions = {
|
||||||
edit: () => {
|
edit: () => {
|
||||||
@ -156,14 +174,6 @@ const ControlPrinter = ({ slicerIntegration = false }) => {
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
return true
|
return true
|
||||||
},
|
|
||||||
loadFilamentStock: () => {
|
|
||||||
setLoadFilamentStockOpen(true)
|
|
||||||
return true
|
|
||||||
},
|
|
||||||
unloadFilamentStock: () => {
|
|
||||||
setUnloadFilamentStockOpen(true)
|
|
||||||
return true
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -373,6 +383,7 @@ const ControlPrinter = ({ slicerIntegration = false }) => {
|
|||||||
id={printerId}
|
id={printerId}
|
||||||
type='printer'
|
type='printer'
|
||||||
ref={objectFormRef}
|
ref={objectFormRef}
|
||||||
|
setCurrentObject={true}
|
||||||
onStateChange={(state) => {
|
onStateChange={(state) => {
|
||||||
setEditFormState((prev) => ({ ...prev, ...state }))
|
setEditFormState((prev) => ({ ...prev, ...state }))
|
||||||
}}
|
}}
|
||||||
@ -595,34 +606,6 @@ const ControlPrinter = ({ slicerIntegration = false }) => {
|
|||||||
</Flex>
|
</Flex>
|
||||||
</ScrollBox>
|
</ScrollBox>
|
||||||
</Flex>
|
</Flex>
|
||||||
<Modal
|
|
||||||
open={loadFilamentStockOpen}
|
|
||||||
onCancel={() => setLoadFilamentStockOpen(false)}
|
|
||||||
footer={null}
|
|
||||||
width='700px'
|
|
||||||
destroyOnHidden={true}
|
|
||||||
>
|
|
||||||
<LoadFilamentStock
|
|
||||||
printer={objectFormState.objectData}
|
|
||||||
onOk={() => setLoadFilamentStockOpen(false)}
|
|
||||||
reset={false}
|
|
||||||
filamentStockLoaded={false}
|
|
||||||
/>
|
|
||||||
</Modal>
|
|
||||||
<Modal
|
|
||||||
open={unloadFilamentStockOpen}
|
|
||||||
onCancel={() => setUnloadFilamentStockOpen(false)}
|
|
||||||
footer={null}
|
|
||||||
width='700px'
|
|
||||||
destroyOnHidden={true}
|
|
||||||
>
|
|
||||||
<UnloadFilamentStock
|
|
||||||
printer={objectFormState.objectData}
|
|
||||||
onOk={() => setUnloadFilamentStockOpen(false)}
|
|
||||||
reset={false}
|
|
||||||
filamentStockLoaded={false}
|
|
||||||
/>
|
|
||||||
</Modal>
|
|
||||||
</>
|
</>
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,7 +1,6 @@
|
|||||||
import { useRef, useState } from 'react'
|
import { useRef, useState, useEffect } from 'react'
|
||||||
import { useLocation } from 'react-router-dom'
|
import { useLocation } from 'react-router-dom'
|
||||||
import { Card, Flex, Modal, Space } from 'antd'
|
import { Card, Flex, Space } from 'antd'
|
||||||
import NewPrinterProfile from '../PrinterProfiles/NewPrinterProfile'
|
|
||||||
import { LoadingOutlined } from '@ant-design/icons'
|
import { LoadingOutlined } from '@ant-design/icons'
|
||||||
import loglevel from 'loglevel'
|
import loglevel from 'loglevel'
|
||||||
import config from '../../../../config.js'
|
import config from '../../../../config.js'
|
||||||
@ -17,6 +16,7 @@ import ObjectForm from '../../common/ObjectForm.jsx'
|
|||||||
import EditButtons from '../../common/EditButtons.jsx'
|
import EditButtons from '../../common/EditButtons.jsx'
|
||||||
import ActivityIndicator from '../../common/ActivityIndicator.jsx'
|
import ActivityIndicator from '../../common/ActivityIndicator.jsx'
|
||||||
import ActionHandler from '../../common/ActionHandler.jsx'
|
import ActionHandler from '../../common/ActionHandler.jsx'
|
||||||
|
import { useActions } from '../../context/ActionsContext'
|
||||||
import ObjectActions from '../../common/ObjectActions.jsx'
|
import ObjectActions from '../../common/ObjectActions.jsx'
|
||||||
import ObjectTable from '../../common/ObjectTable.jsx'
|
import ObjectTable from '../../common/ObjectTable.jsx'
|
||||||
import InfoCollapsePlaceholder from '../../common/InfoCollapsePlaceholder.jsx'
|
import InfoCollapsePlaceholder from '../../common/InfoCollapsePlaceholder.jsx'
|
||||||
@ -33,6 +33,9 @@ const PrinterInfo = () => {
|
|||||||
const objectFormRef = useRef(null)
|
const objectFormRef = useRef(null)
|
||||||
const profilesTableRef = useRef(null)
|
const profilesTableRef = useRef(null)
|
||||||
const actionHandlerRef = useRef(null)
|
const actionHandlerRef = useRef(null)
|
||||||
|
|
||||||
|
|
||||||
|
const { setOnModalOk } = useActions()
|
||||||
const printerId = new URLSearchParams(location.search).get('printerId')
|
const printerId = new URLSearchParams(location.search).get('printerId')
|
||||||
const [collapseState, updateCollapseState] = useCollapseState('PrinterInfo', {
|
const [collapseState, updateCollapseState] = useCollapseState('PrinterInfo', {
|
||||||
info: true,
|
info: true,
|
||||||
@ -50,7 +53,14 @@ const PrinterInfo = () => {
|
|||||||
loading: false,
|
loading: false,
|
||||||
objectData: {}
|
objectData: {}
|
||||||
})
|
})
|
||||||
const [newPrinterProfileOpen, setNewPrinterProfileOpen] = useState(false)
|
|
||||||
|
useEffect(() => {
|
||||||
|
setOnModalOk(() => () => {
|
||||||
|
profilesTableRef.current?.reload?.()
|
||||||
|
objectFormRef.current?.handleFetchObject?.()
|
||||||
|
})
|
||||||
|
return () => setOnModalOk(null)
|
||||||
|
}, [setOnModalOk])
|
||||||
|
|
||||||
const actions = {
|
const actions = {
|
||||||
edit: () => {
|
edit: () => {
|
||||||
@ -65,14 +75,9 @@ const PrinterInfo = () => {
|
|||||||
objectFormRef?.current.handleUpdate()
|
objectFormRef?.current.handleUpdate()
|
||||||
return true
|
return true
|
||||||
},
|
},
|
||||||
newPrinterProfile: () => {
|
|
||||||
setNewPrinterProfileOpen(true)
|
|
||||||
return true
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
|
||||||
<Flex
|
<Flex
|
||||||
gap='large'
|
gap='large'
|
||||||
vertical='true'
|
vertical='true'
|
||||||
@ -164,6 +169,7 @@ const PrinterInfo = () => {
|
|||||||
type='printer'
|
type='printer'
|
||||||
style={{ height: '100%' }}
|
style={{ height: '100%' }}
|
||||||
ref={objectFormRef}
|
ref={objectFormRef}
|
||||||
|
setCurrentObject={true}
|
||||||
onStateChange={(state) => {
|
onStateChange={(state) => {
|
||||||
setEditFormState((prev) => ({ ...prev, ...state }))
|
setEditFormState((prev) => ({ ...prev, ...state }))
|
||||||
}}
|
}}
|
||||||
@ -248,28 +254,6 @@ const PrinterInfo = () => {
|
|||||||
</Flex>
|
</Flex>
|
||||||
</ScrollBox>
|
</ScrollBox>
|
||||||
</Flex>
|
</Flex>
|
||||||
<Modal
|
|
||||||
open={newPrinterProfileOpen}
|
|
||||||
styles={{ content: { paddingBottom: '24px' } }}
|
|
||||||
footer={null}
|
|
||||||
width={800}
|
|
||||||
onCancel={() => {
|
|
||||||
setNewPrinterProfileOpen(false)
|
|
||||||
}}
|
|
||||||
destroyOnHidden={true}
|
|
||||||
>
|
|
||||||
<NewPrinterProfile
|
|
||||||
onOk={() => {
|
|
||||||
setNewPrinterProfileOpen(false)
|
|
||||||
profilesTableRef.current?.reload()
|
|
||||||
}}
|
|
||||||
reset={newPrinterProfileOpen}
|
|
||||||
defaultValues={{
|
|
||||||
printer: { ...objectFormState.objectData }
|
|
||||||
}}
|
|
||||||
/>
|
|
||||||
</Modal>
|
|
||||||
</>
|
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -143,6 +143,7 @@ const SubJobInfo = () => {
|
|||||||
type='subJob'
|
type='subJob'
|
||||||
style={{ height: '100%' }}
|
style={{ height: '100%' }}
|
||||||
ref={objectFormRef}
|
ref={objectFormRef}
|
||||||
|
setCurrentObject={true}
|
||||||
onStateChange={(state) => {
|
onStateChange={(state) => {
|
||||||
setEditFormState((prev) => ({ ...prev, ...state }))
|
setEditFormState((prev) => ({ ...prev, ...state }))
|
||||||
}}
|
}}
|
||||||
|
|||||||
@ -152,6 +152,7 @@ const ClientInfo = () => {
|
|||||||
type='client'
|
type='client'
|
||||||
style={{ height: '100%' }}
|
style={{ height: '100%' }}
|
||||||
ref={objectFormRef}
|
ref={objectFormRef}
|
||||||
|
setCurrentObject={true}
|
||||||
onStateChange={(state) => {
|
onStateChange={(state) => {
|
||||||
setEditFormState((prev) => ({ ...prev, ...state }))
|
setEditFormState((prev) => ({ ...prev, ...state }))
|
||||||
}}
|
}}
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
import { useRef, useState } from 'react'
|
import { useRef, useState, useEffect } from 'react'
|
||||||
import { useLocation } from 'react-router-dom'
|
import { useLocation } from 'react-router-dom'
|
||||||
import { Card, Flex, Modal, Space } from 'antd'
|
import { Card, Flex, Space } from 'antd'
|
||||||
import loglevel from 'loglevel'
|
import loglevel from 'loglevel'
|
||||||
import config from '../../../../config'
|
import config from '../../../../config'
|
||||||
import useCollapseState from '../../hooks/useCollapseState'
|
import useCollapseState from '../../hooks/useCollapseState'
|
||||||
@ -16,14 +16,13 @@ import EditButtons from '../../common/EditButtons'
|
|||||||
import ObjectTableNavigationButtons from '../../common/ObjectTableNavigationButtons.jsx'
|
import ObjectTableNavigationButtons from '../../common/ObjectTableNavigationButtons.jsx'
|
||||||
import ActivityIndicator from '../../common/ActivityIndicator.jsx'
|
import ActivityIndicator from '../../common/ActivityIndicator.jsx'
|
||||||
import ActionHandler from '../../common/ActionHandler.jsx'
|
import ActionHandler from '../../common/ActionHandler.jsx'
|
||||||
|
import { useActions } from '../../context/ActionsContext'
|
||||||
import ObjectActions from '../../common/ObjectActions.jsx'
|
import ObjectActions from '../../common/ObjectActions.jsx'
|
||||||
import ObjectTable from '../../common/ObjectTable.jsx'
|
import ObjectTable from '../../common/ObjectTable.jsx'
|
||||||
import InfoCollapsePlaceholder from '../../common/InfoCollapsePlaceholder.jsx'
|
import InfoCollapsePlaceholder from '../../common/InfoCollapsePlaceholder.jsx'
|
||||||
import DocumentPrintButton from '../../common/DocumentPrintButton.jsx'
|
import DocumentPrintButton from '../../common/DocumentPrintButton.jsx'
|
||||||
import UserNotifierToggle from '../../common/UserNotifierToggle.jsx'
|
import UserNotifierToggle from '../../common/UserNotifierToggle.jsx'
|
||||||
import ScrollBox from '../../common/ScrollBox.jsx'
|
import ScrollBox from '../../common/ScrollBox.jsx'
|
||||||
import PublishListingVarient from './PublishListingVarient.jsx'
|
|
||||||
import UnpublishListingVarient from './UnpublishListingVarient.jsx'
|
|
||||||
|
|
||||||
const log = loglevel.getLogger('ListingVarientInfo')
|
const log = loglevel.getLogger('ListingVarientInfo')
|
||||||
log.setLevel(config.logLevel)
|
log.setLevel(config.logLevel)
|
||||||
@ -32,11 +31,18 @@ const ListingVarientInfo = () => {
|
|||||||
const location = useLocation()
|
const location = useLocation()
|
||||||
const objectFormRef = useRef(null)
|
const objectFormRef = useRef(null)
|
||||||
const actionHandlerRef = useRef(null)
|
const actionHandlerRef = useRef(null)
|
||||||
|
|
||||||
|
|
||||||
|
const { setOnModalOk } = useActions()
|
||||||
|
useEffect(() => {
|
||||||
|
setOnModalOk(() => () => {
|
||||||
|
objectFormRef.current?.handleFetchObject?.()
|
||||||
|
})
|
||||||
|
return () => setOnModalOk(null)
|
||||||
|
}, [setOnModalOk])
|
||||||
const listingVarientId = new URLSearchParams(location.search).get(
|
const listingVarientId = new URLSearchParams(location.search).get(
|
||||||
'listingVarientId'
|
'listingVarientId'
|
||||||
)
|
)
|
||||||
const [publishOpen, setPublishOpen] = useState(false)
|
|
||||||
const [unpublishOpen, setUnpublishOpen] = useState(false)
|
|
||||||
const [collapseState, updateCollapseState] = useCollapseState(
|
const [collapseState, updateCollapseState] = useCollapseState(
|
||||||
'ListingVarientInfo',
|
'ListingVarientInfo',
|
||||||
{
|
{
|
||||||
@ -71,18 +77,9 @@ const ListingVarientInfo = () => {
|
|||||||
objectFormRef?.current?.handleDelete?.()
|
objectFormRef?.current?.handleDelete?.()
|
||||||
return true
|
return true
|
||||||
},
|
},
|
||||||
publish: () => {
|
|
||||||
setPublishOpen(true)
|
|
||||||
return true
|
|
||||||
},
|
|
||||||
unpublish: () => {
|
|
||||||
setUnpublishOpen(true)
|
|
||||||
return true
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
|
||||||
<Flex
|
<Flex
|
||||||
gap='large'
|
gap='large'
|
||||||
vertical='true'
|
vertical='true'
|
||||||
@ -162,6 +159,7 @@ const ListingVarientInfo = () => {
|
|||||||
type='listingVarient'
|
type='listingVarient'
|
||||||
style={{ height: '100%' }}
|
style={{ height: '100%' }}
|
||||||
ref={objectFormRef}
|
ref={objectFormRef}
|
||||||
|
setCurrentObject={true}
|
||||||
onStateChange={(state) => {
|
onStateChange={(state) => {
|
||||||
setEditFormState((prev) => ({ ...prev, ...state }))
|
setEditFormState((prev) => ({ ...prev, ...state }))
|
||||||
}}
|
}}
|
||||||
@ -221,39 +219,6 @@ const ListingVarientInfo = () => {
|
|||||||
</Flex>
|
</Flex>
|
||||||
</ScrollBox>
|
</ScrollBox>
|
||||||
</Flex>
|
</Flex>
|
||||||
<Modal
|
|
||||||
open={publishOpen}
|
|
||||||
onCancel={() => setPublishOpen(false)}
|
|
||||||
width={515}
|
|
||||||
footer={null}
|
|
||||||
destroyOnHidden={true}
|
|
||||||
centered={true}
|
|
||||||
>
|
|
||||||
<PublishListingVarient
|
|
||||||
objectData={objectFormState.objectData}
|
|
||||||
onOk={() => {
|
|
||||||
setPublishOpen(false)
|
|
||||||
objectFormRef?.current.handleFetchObject()
|
|
||||||
}}
|
|
||||||
/>
|
|
||||||
</Modal>
|
|
||||||
<Modal
|
|
||||||
open={unpublishOpen}
|
|
||||||
onCancel={() => setUnpublishOpen(false)}
|
|
||||||
width={515}
|
|
||||||
footer={null}
|
|
||||||
destroyOnHidden={true}
|
|
||||||
centered={true}
|
|
||||||
>
|
|
||||||
<UnpublishListingVarient
|
|
||||||
objectData={objectFormState.objectData}
|
|
||||||
onOk={() => {
|
|
||||||
setUnpublishOpen(false)
|
|
||||||
objectFormRef?.current.handleFetchObject()
|
|
||||||
}}
|
|
||||||
/>
|
|
||||||
</Modal>
|
|
||||||
</>
|
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
import { useRef, useState } from 'react'
|
import { useRef, useState, useEffect } from 'react'
|
||||||
import { useLocation } from 'react-router-dom'
|
import { useLocation } from 'react-router-dom'
|
||||||
import { Card, Flex, Modal, Space } from 'antd'
|
import { Card, Flex, Space } from 'antd'
|
||||||
import loglevel from 'loglevel'
|
import loglevel from 'loglevel'
|
||||||
import config from '../../../../config'
|
import config from '../../../../config'
|
||||||
import useCollapseState from '../../hooks/useCollapseState'
|
import useCollapseState from '../../hooks/useCollapseState'
|
||||||
@ -17,15 +17,13 @@ import EditButtons from '../../common/EditButtons'
|
|||||||
import ObjectTableNavigationButtons from '../../common/ObjectTableNavigationButtons.jsx'
|
import ObjectTableNavigationButtons from '../../common/ObjectTableNavigationButtons.jsx'
|
||||||
import ActivityIndicator from '../../common/ActivityIndicator.jsx'
|
import ActivityIndicator from '../../common/ActivityIndicator.jsx'
|
||||||
import ActionHandler from '../../common/ActionHandler.jsx'
|
import ActionHandler from '../../common/ActionHandler.jsx'
|
||||||
|
import { useActions } from '../../context/ActionsContext'
|
||||||
import ObjectActions from '../../common/ObjectActions.jsx'
|
import ObjectActions from '../../common/ObjectActions.jsx'
|
||||||
import ObjectTable from '../../common/ObjectTable.jsx'
|
import ObjectTable from '../../common/ObjectTable.jsx'
|
||||||
import InfoCollapsePlaceholder from '../../common/InfoCollapsePlaceholder.jsx'
|
import InfoCollapsePlaceholder from '../../common/InfoCollapsePlaceholder.jsx'
|
||||||
import DocumentPrintButton from '../../common/DocumentPrintButton.jsx'
|
import DocumentPrintButton from '../../common/DocumentPrintButton.jsx'
|
||||||
import UserNotifierToggle from '../../common/UserNotifierToggle.jsx'
|
import UserNotifierToggle from '../../common/UserNotifierToggle.jsx'
|
||||||
import ScrollBox from '../../common/ScrollBox.jsx'
|
import ScrollBox from '../../common/ScrollBox.jsx'
|
||||||
import NewListingVarient from '../ListingVarients/NewListingVarient.jsx'
|
|
||||||
import PublishListing from './PublishListing.jsx'
|
|
||||||
import UnpublishListing from './UnpublishListing.jsx'
|
|
||||||
|
|
||||||
const log = loglevel.getLogger('ListingInfo')
|
const log = loglevel.getLogger('ListingInfo')
|
||||||
log.setLevel(config.logLevel)
|
log.setLevel(config.logLevel)
|
||||||
@ -35,10 +33,16 @@ const ListingInfo = () => {
|
|||||||
const objectFormRef = useRef(null)
|
const objectFormRef = useRef(null)
|
||||||
const listingVarientsTableRef = useRef(null)
|
const listingVarientsTableRef = useRef(null)
|
||||||
const actionHandlerRef = useRef(null)
|
const actionHandlerRef = useRef(null)
|
||||||
|
|
||||||
|
|
||||||
|
const { setOnModalOk } = useActions()
|
||||||
|
useEffect(() => {
|
||||||
|
setOnModalOk(() => () => {
|
||||||
|
listingVarientsTableRef.current?.reload?.()
|
||||||
|
})
|
||||||
|
return () => setOnModalOk(null)
|
||||||
|
}, [setOnModalOk])
|
||||||
const listingId = new URLSearchParams(location.search).get('listingId')
|
const listingId = new URLSearchParams(location.search).get('listingId')
|
||||||
const [newListingVarientOpen, setNewListingVarientOpen] = useState(false)
|
|
||||||
const [publishListingOpen, setPublishListingOpen] = useState(false)
|
|
||||||
const [unpublishListingOpen, setUnpublishListingOpen] = useState(false)
|
|
||||||
const [collapseState, updateCollapseState] = useCollapseState('ListingInfo', {
|
const [collapseState, updateCollapseState] = useCollapseState('ListingInfo', {
|
||||||
info: true,
|
info: true,
|
||||||
listingVarients: true,
|
listingVarients: true,
|
||||||
@ -71,22 +75,9 @@ const ListingInfo = () => {
|
|||||||
objectFormRef?.current?.handleDelete?.()
|
objectFormRef?.current?.handleDelete?.()
|
||||||
return true
|
return true
|
||||||
},
|
},
|
||||||
newListingVarient: () => {
|
|
||||||
setNewListingVarientOpen(true)
|
|
||||||
return true
|
|
||||||
},
|
|
||||||
publish: () => {
|
|
||||||
setPublishListingOpen(true)
|
|
||||||
return true
|
|
||||||
},
|
|
||||||
unpublish: () => {
|
|
||||||
setUnpublishListingOpen(true)
|
|
||||||
return true
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
|
||||||
<Flex
|
<Flex
|
||||||
gap='large'
|
gap='large'
|
||||||
vertical='true'
|
vertical='true'
|
||||||
@ -167,6 +158,7 @@ const ListingInfo = () => {
|
|||||||
type='listing'
|
type='listing'
|
||||||
style={{ height: '100%' }}
|
style={{ height: '100%' }}
|
||||||
ref={objectFormRef}
|
ref={objectFormRef}
|
||||||
|
setCurrentObject={true}
|
||||||
onStateChange={(state) => {
|
onStateChange={(state) => {
|
||||||
setEditFormState((prev) => ({ ...prev, ...state }))
|
setEditFormState((prev) => ({ ...prev, ...state }))
|
||||||
}}
|
}}
|
||||||
@ -245,61 +237,6 @@ const ListingInfo = () => {
|
|||||||
</Flex>
|
</Flex>
|
||||||
</ScrollBox>
|
</ScrollBox>
|
||||||
</Flex>
|
</Flex>
|
||||||
<Modal
|
|
||||||
open={newListingVarientOpen}
|
|
||||||
onCancel={() => {
|
|
||||||
setNewListingVarientOpen(false)
|
|
||||||
}}
|
|
||||||
width={800}
|
|
||||||
footer={null}
|
|
||||||
destroyOnHidden={true}
|
|
||||||
>
|
|
||||||
<NewListingVarient
|
|
||||||
onOk={() => {
|
|
||||||
setNewListingVarientOpen(false)
|
|
||||||
listingVarientsTableRef.current?.reload()
|
|
||||||
}}
|
|
||||||
reset={newListingVarientOpen}
|
|
||||||
defaultValues={{
|
|
||||||
listing: objectFormState.objectData
|
|
||||||
}}
|
|
||||||
/>
|
|
||||||
</Modal>
|
|
||||||
<Modal
|
|
||||||
open={publishListingOpen}
|
|
||||||
onCancel={() => setPublishListingOpen(false)}
|
|
||||||
width={515}
|
|
||||||
footer={null}
|
|
||||||
destroyOnHidden={true}
|
|
||||||
centered={true}
|
|
||||||
>
|
|
||||||
<PublishListing
|
|
||||||
objectData={objectFormState.objectData}
|
|
||||||
onOk={() => {
|
|
||||||
setPublishListingOpen(false)
|
|
||||||
objectFormRef?.current.handleFetchObject()
|
|
||||||
listingVarientsTableRef.current?.reload?.()
|
|
||||||
}}
|
|
||||||
/>
|
|
||||||
</Modal>
|
|
||||||
<Modal
|
|
||||||
open={unpublishListingOpen}
|
|
||||||
onCancel={() => setUnpublishListingOpen(false)}
|
|
||||||
width={515}
|
|
||||||
footer={null}
|
|
||||||
destroyOnHidden={true}
|
|
||||||
centered={true}
|
|
||||||
>
|
|
||||||
<UnpublishListing
|
|
||||||
objectData={objectFormState.objectData}
|
|
||||||
onOk={() => {
|
|
||||||
setUnpublishListingOpen(false)
|
|
||||||
objectFormRef?.current.handleFetchObject()
|
|
||||||
listingVarientsTableRef.current?.reload?.()
|
|
||||||
}}
|
|
||||||
/>
|
|
||||||
</Modal>
|
|
||||||
</>
|
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
import { useContext, useRef, useState } from 'react'
|
import { useContext, useRef, useState , useEffect} from 'react'
|
||||||
import { useLocation } from 'react-router-dom'
|
import { useLocation } from 'react-router-dom'
|
||||||
import { Card, Flex, message, Modal, Space } from 'antd'
|
import { Card, Flex, message, Space } from 'antd'
|
||||||
import loglevel from 'loglevel'
|
import loglevel from 'loglevel'
|
||||||
import config from '../../../../config'
|
import config from '../../../../config'
|
||||||
import useCollapseState from '../../hooks/useCollapseState'
|
import useCollapseState from '../../hooks/useCollapseState'
|
||||||
@ -16,15 +16,13 @@ import EditButtons from '../../common/EditButtons'
|
|||||||
import ObjectTableNavigationButtons from '../../common/ObjectTableNavigationButtons.jsx'
|
import ObjectTableNavigationButtons from '../../common/ObjectTableNavigationButtons.jsx'
|
||||||
import ActivityIndicator from '../../common/ActivityIndicator.jsx'
|
import ActivityIndicator from '../../common/ActivityIndicator.jsx'
|
||||||
import ActionHandler from '../../common/ActionHandler.jsx'
|
import ActionHandler from '../../common/ActionHandler.jsx'
|
||||||
|
import { useActions } from '../../context/ActionsContext'
|
||||||
import ObjectActions from '../../common/ObjectActions.jsx'
|
import ObjectActions from '../../common/ObjectActions.jsx'
|
||||||
import ObjectTable from '../../common/ObjectTable.jsx'
|
import ObjectTable from '../../common/ObjectTable.jsx'
|
||||||
import InfoCollapsePlaceholder from '../../common/InfoCollapsePlaceholder.jsx'
|
import InfoCollapsePlaceholder from '../../common/InfoCollapsePlaceholder.jsx'
|
||||||
import DocumentPrintButton from '../../common/DocumentPrintButton.jsx'
|
import DocumentPrintButton from '../../common/DocumentPrintButton.jsx'
|
||||||
import UserNotifierToggle from '../../common/UserNotifierToggle.jsx'
|
import UserNotifierToggle from '../../common/UserNotifierToggle.jsx'
|
||||||
import ScrollBox from '../../common/ScrollBox.jsx'
|
import ScrollBox from '../../common/ScrollBox.jsx'
|
||||||
import SyncListings from './SyncListings.jsx'
|
|
||||||
import SyncOrders from './SyncOrders.jsx'
|
|
||||||
import ConfigureMarketplace from './ConfigureMarketplace.jsx'
|
|
||||||
import { ApiServerContext } from '../../context/ApiServerContext.jsx'
|
import { ApiServerContext } from '../../context/ApiServerContext.jsx'
|
||||||
import { ElectronContext } from '../../context/ElectronContext.jsx'
|
import { ElectronContext } from '../../context/ElectronContext.jsx'
|
||||||
import {
|
import {
|
||||||
@ -39,6 +37,15 @@ const MarketplaceInfo = () => {
|
|||||||
const location = useLocation()
|
const location = useLocation()
|
||||||
const objectFormRef = useRef(null)
|
const objectFormRef = useRef(null)
|
||||||
const actionHandlerRef = useRef(null)
|
const actionHandlerRef = useRef(null)
|
||||||
|
|
||||||
|
|
||||||
|
const { setOnModalOk } = useActions()
|
||||||
|
useEffect(() => {
|
||||||
|
setOnModalOk(() => () => {
|
||||||
|
objectFormRef.current?.handleFetchObject?.()
|
||||||
|
})
|
||||||
|
return () => setOnModalOk(null)
|
||||||
|
}, [setOnModalOk])
|
||||||
const { getMarketplaceAuthUrl, refreshMarketplaceAuth } =
|
const { getMarketplaceAuthUrl, refreshMarketplaceAuth } =
|
||||||
useContext(ApiServerContext)
|
useContext(ApiServerContext)
|
||||||
const { openExternalUrl } = useContext(ElectronContext)
|
const { openExternalUrl } = useContext(ElectronContext)
|
||||||
@ -61,9 +68,6 @@ const MarketplaceInfo = () => {
|
|||||||
loading: false,
|
loading: false,
|
||||||
objectData: {}
|
objectData: {}
|
||||||
})
|
})
|
||||||
const [syncListingsOpen, setSyncListingsOpen] = useState(false)
|
|
||||||
const [syncOrdersOpen, setSyncOrdersOpen] = useState(false)
|
|
||||||
const [configureModalOpen, setConfigureModalOpen] = useState(false)
|
|
||||||
|
|
||||||
const startAuthorization = async () => {
|
const startAuthorization = async () => {
|
||||||
const objectData = objectFormState.objectData
|
const objectData = objectFormState.objectData
|
||||||
@ -128,18 +132,6 @@ const MarketplaceInfo = () => {
|
|||||||
objectFormRef?.current?.handleDelete?.()
|
objectFormRef?.current?.handleDelete?.()
|
||||||
return true
|
return true
|
||||||
},
|
},
|
||||||
syncListings: () => {
|
|
||||||
setSyncListingsOpen(true)
|
|
||||||
return true
|
|
||||||
},
|
|
||||||
syncOrders: () => {
|
|
||||||
setSyncOrdersOpen(true)
|
|
||||||
return true
|
|
||||||
},
|
|
||||||
configure: () => {
|
|
||||||
setConfigureModalOpen(true)
|
|
||||||
return true
|
|
||||||
},
|
|
||||||
connect: () => {
|
connect: () => {
|
||||||
startAuthorization()
|
startAuthorization()
|
||||||
return true
|
return true
|
||||||
@ -155,7 +147,6 @@ const MarketplaceInfo = () => {
|
|||||||
}
|
}
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
|
||||||
<Flex
|
<Flex
|
||||||
gap='large'
|
gap='large'
|
||||||
vertical='true'
|
vertical='true'
|
||||||
@ -242,6 +233,7 @@ const MarketplaceInfo = () => {
|
|||||||
type='marketplace'
|
type='marketplace'
|
||||||
style={{ height: '100%' }}
|
style={{ height: '100%' }}
|
||||||
ref={objectFormRef}
|
ref={objectFormRef}
|
||||||
|
setCurrentObject={true}
|
||||||
onStateChange={(state) => {
|
onStateChange={(state) => {
|
||||||
setEditFormState((prev) => ({ ...prev, ...state }))
|
setEditFormState((prev) => ({ ...prev, ...state }))
|
||||||
}}
|
}}
|
||||||
@ -291,63 +283,6 @@ const MarketplaceInfo = () => {
|
|||||||
</Flex>
|
</Flex>
|
||||||
</ScrollBox>
|
</ScrollBox>
|
||||||
</Flex>
|
</Flex>
|
||||||
<Modal
|
|
||||||
open={syncListingsOpen}
|
|
||||||
onCancel={() => setSyncListingsOpen(false)}
|
|
||||||
width={500}
|
|
||||||
footer={null}
|
|
||||||
destroyOnHidden={true}
|
|
||||||
centered
|
|
||||||
>
|
|
||||||
<SyncListings
|
|
||||||
onOk={() => {
|
|
||||||
setSyncListingsOpen(false)
|
|
||||||
objectFormRef?.current.handleFetchObject()
|
|
||||||
}}
|
|
||||||
objectData={objectFormState.objectData}
|
|
||||||
/>
|
|
||||||
</Modal>
|
|
||||||
<Modal
|
|
||||||
open={syncOrdersOpen}
|
|
||||||
onCancel={() => setSyncOrdersOpen(false)}
|
|
||||||
width={500}
|
|
||||||
footer={null}
|
|
||||||
destroyOnHidden={true}
|
|
||||||
centered
|
|
||||||
>
|
|
||||||
<SyncOrders
|
|
||||||
onOk={() => {
|
|
||||||
setSyncOrdersOpen(false)
|
|
||||||
objectFormRef?.current.handleFetchObject()
|
|
||||||
}}
|
|
||||||
objectData={objectFormState.objectData}
|
|
||||||
/>
|
|
||||||
</Modal>
|
|
||||||
<Modal
|
|
||||||
open={configureModalOpen}
|
|
||||||
onCancel={() => setConfigureModalOpen(false)}
|
|
||||||
width={650}
|
|
||||||
footer={null}
|
|
||||||
destroyOnHidden={true}
|
|
||||||
centered
|
|
||||||
>
|
|
||||||
<ConfigureMarketplace
|
|
||||||
onConnect={() => {
|
|
||||||
startAuthorization()
|
|
||||||
setConfigureModalOpen(false)
|
|
||||||
}}
|
|
||||||
isConnected={
|
|
||||||
!!(
|
|
||||||
objectFormState.objectData?.config?.refreshToken ||
|
|
||||||
objectFormState.objectData?.config?.accessToken ||
|
|
||||||
objectFormState.objectData?.config?.shopCipher
|
|
||||||
)
|
|
||||||
}
|
|
||||||
loading={objectFormState.loading}
|
|
||||||
disabled={objectFormState.isEditing}
|
|
||||||
/>
|
|
||||||
</Modal>
|
|
||||||
</>
|
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
import { useRef, useState } from 'react'
|
import { useRef, useState, useEffect } from 'react'
|
||||||
import { useLocation } from 'react-router-dom'
|
import { useLocation } from 'react-router-dom'
|
||||||
import { Space, Flex, Card, Modal } from 'antd'
|
import { Space, Flex, Card } from 'antd'
|
||||||
import { LoadingOutlined } from '@ant-design/icons'
|
import { LoadingOutlined } from '@ant-design/icons'
|
||||||
import loglevel from 'loglevel'
|
import loglevel from 'loglevel'
|
||||||
import config from '../../../../config.js'
|
import config from '../../../../config.js'
|
||||||
@ -17,6 +17,7 @@ import EditButtons from '../../common/EditButtons.jsx'
|
|||||||
import ObjectTableNavigationButtons from '../../common/ObjectTableNavigationButtons.jsx'
|
import ObjectTableNavigationButtons from '../../common/ObjectTableNavigationButtons.jsx'
|
||||||
import ActivityIndicator from '../../common/ActivityIndicator.jsx'
|
import ActivityIndicator from '../../common/ActivityIndicator.jsx'
|
||||||
import ActionHandler from '../../common/ActionHandler.jsx'
|
import ActionHandler from '../../common/ActionHandler.jsx'
|
||||||
|
import { useActions } from '../../context/ActionsContext'
|
||||||
import ObjectActions from '../../common/ObjectActions.jsx'
|
import ObjectActions from '../../common/ObjectActions.jsx'
|
||||||
import ObjectTable from '../../common/ObjectTable.jsx'
|
import ObjectTable from '../../common/ObjectTable.jsx'
|
||||||
import InfoCollapsePlaceholder from '../../common/InfoCollapsePlaceholder.jsx'
|
import InfoCollapsePlaceholder from '../../common/InfoCollapsePlaceholder.jsx'
|
||||||
@ -24,16 +25,10 @@ import DocumentPrintButton from '../../common/DocumentPrintButton.jsx'
|
|||||||
import UserNotifierToggle from '../../common/UserNotifierToggle.jsx'
|
import UserNotifierToggle from '../../common/UserNotifierToggle.jsx'
|
||||||
import ScrollBox from '../../common/ScrollBox.jsx'
|
import ScrollBox from '../../common/ScrollBox.jsx'
|
||||||
import OrderItemsIcon from '../../../Icons/OrderItemIcon.jsx'
|
import OrderItemsIcon from '../../../Icons/OrderItemIcon.jsx'
|
||||||
import NewOrderItem from '../../Inventory/OrderItems/NewOrderItem.jsx'
|
|
||||||
import NewShipment from '../../Inventory/Shipments/NewShipment.jsx'
|
|
||||||
import PostSalesOrder from './PostSalesOrder.jsx'
|
|
||||||
import ConfirmSalesOrder from './ConfirmSalesOrder.jsx'
|
|
||||||
import CancelSalesOrder from './CancelSalesOrder.jsx'
|
|
||||||
import ShipmentIcon from '../../../Icons/ShipmentIcon.jsx'
|
import ShipmentIcon from '../../../Icons/ShipmentIcon.jsx'
|
||||||
import InvoiceIcon from '../../../Icons/InvoiceIcon.jsx'
|
import InvoiceIcon from '../../../Icons/InvoiceIcon.jsx'
|
||||||
import StockEventIcon from '../../../Icons/StockEventIcon.jsx'
|
import StockEventIcon from '../../../Icons/StockEventIcon.jsx'
|
||||||
import { getModelByName } from '../../../../database/ObjectModels.js'
|
import { getModelByName } from '../../../../database/ObjectModels.js'
|
||||||
import NewInvoice from '../../Finance/Invoices/NewInvoice.jsx'
|
|
||||||
|
|
||||||
const log = loglevel.getLogger('SalesOrderInfo')
|
const log = loglevel.getLogger('SalesOrderInfo')
|
||||||
log.setLevel(config.logLevel)
|
log.setLevel(config.logLevel)
|
||||||
@ -44,12 +39,15 @@ const SalesOrderInfo = () => {
|
|||||||
const orderItemsTableRef = useRef(null)
|
const orderItemsTableRef = useRef(null)
|
||||||
const shipmentsTableRef = useRef(null)
|
const shipmentsTableRef = useRef(null)
|
||||||
const actionHandlerRef = useRef(null)
|
const actionHandlerRef = useRef(null)
|
||||||
const [newOrderItemOpen, setNewOrderItemOpen] = useState(false)
|
|
||||||
const [newShipmentOpen, setNewShipmentOpen] = useState(false)
|
|
||||||
const [postSalesOrderOpen, setPostSalesOrderOpen] = useState(false)
|
const { setOnModalOk } = useActions()
|
||||||
const [confirmSalesOrderOpen, setConfirmSalesOrderOpen] = useState(false)
|
useEffect(() => {
|
||||||
const [cancelSalesOrderOpen, setCancelSalesOrderOpen] = useState(false)
|
setOnModalOk(() => () => {
|
||||||
const [newInvoiceOpen, setNewInvoiceOpen] = useState(false)
|
objectFormRef.current?.handleFetchObject?.()
|
||||||
|
})
|
||||||
|
return () => setOnModalOk(null)
|
||||||
|
}, [setOnModalOk])
|
||||||
const salesOrderId = new URLSearchParams(location.search).get('salesOrderId')
|
const salesOrderId = new URLSearchParams(location.search).get('salesOrderId')
|
||||||
const [collapseState, updateCollapseState] = useCollapseState(
|
const [collapseState, updateCollapseState] = useCollapseState(
|
||||||
'SalesOrderInfo',
|
'SalesOrderInfo',
|
||||||
@ -93,30 +91,6 @@ const SalesOrderInfo = () => {
|
|||||||
objectFormRef?.current?.handleDelete?.()
|
objectFormRef?.current?.handleDelete?.()
|
||||||
return true
|
return true
|
||||||
},
|
},
|
||||||
newOrderItem: () => {
|
|
||||||
setNewOrderItemOpen(true)
|
|
||||||
return true
|
|
||||||
},
|
|
||||||
newShipment: () => {
|
|
||||||
setNewShipmentOpen(true)
|
|
||||||
return true
|
|
||||||
},
|
|
||||||
newInvoice: () => {
|
|
||||||
setNewInvoiceOpen(true)
|
|
||||||
return true
|
|
||||||
},
|
|
||||||
post: () => {
|
|
||||||
setPostSalesOrderOpen(true)
|
|
||||||
return true
|
|
||||||
},
|
|
||||||
confirm: () => {
|
|
||||||
setConfirmSalesOrderOpen(true)
|
|
||||||
return true
|
|
||||||
},
|
|
||||||
cancel: () => {
|
|
||||||
setCancelSalesOrderOpen(true)
|
|
||||||
return true
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
const editDisabled = getModelByName('salesOrder')
|
const editDisabled = getModelByName('salesOrder')
|
||||||
@ -124,7 +98,6 @@ const SalesOrderInfo = () => {
|
|||||||
.disabled(objectFormState.objectData)
|
.disabled(objectFormState.objectData)
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
|
||||||
<Flex
|
<Flex
|
||||||
gap='large'
|
gap='large'
|
||||||
vertical='true'
|
vertical='true'
|
||||||
@ -214,6 +187,7 @@ const SalesOrderInfo = () => {
|
|||||||
type='salesOrder'
|
type='salesOrder'
|
||||||
style={{ height: '100%' }}
|
style={{ height: '100%' }}
|
||||||
ref={objectFormRef}
|
ref={objectFormRef}
|
||||||
|
setCurrentObject={true}
|
||||||
onStateChange={(state) => {
|
onStateChange={(state) => {
|
||||||
setEditFormState((prev) => ({ ...prev, ...state }))
|
setEditFormState((prev) => ({ ...prev, ...state }))
|
||||||
}}
|
}}
|
||||||
@ -358,122 +332,6 @@ const SalesOrderInfo = () => {
|
|||||||
</Flex>
|
</Flex>
|
||||||
</ScrollBox>
|
</ScrollBox>
|
||||||
</Flex>
|
</Flex>
|
||||||
<Modal
|
|
||||||
open={newOrderItemOpen}
|
|
||||||
onCancel={() => {
|
|
||||||
setNewOrderItemOpen(false)
|
|
||||||
}}
|
|
||||||
width={800}
|
|
||||||
footer={null}
|
|
||||||
destroyOnHidden={true}
|
|
||||||
>
|
|
||||||
<NewOrderItem
|
|
||||||
onOk={() => {
|
|
||||||
setNewOrderItemOpen(false)
|
|
||||||
}}
|
|
||||||
reset={newOrderItemOpen}
|
|
||||||
defaultValues={{
|
|
||||||
order: { _id: salesOrderId },
|
|
||||||
orderType: 'salesOrder',
|
|
||||||
syncAmount: 'itemPrice'
|
|
||||||
}}
|
|
||||||
/>
|
|
||||||
</Modal>
|
|
||||||
<Modal
|
|
||||||
open={newShipmentOpen}
|
|
||||||
onCancel={() => {
|
|
||||||
setNewShipmentOpen(false)
|
|
||||||
}}
|
|
||||||
width={800}
|
|
||||||
footer={null}
|
|
||||||
destroyOnHidden={true}
|
|
||||||
>
|
|
||||||
<NewShipment
|
|
||||||
onOk={() => {
|
|
||||||
setNewShipmentOpen(false)
|
|
||||||
}}
|
|
||||||
reset={newShipmentOpen}
|
|
||||||
defaultValues={{
|
|
||||||
orderType: 'salesOrder',
|
|
||||||
order: { _id: salesOrderId }
|
|
||||||
}}
|
|
||||||
/>
|
|
||||||
</Modal>
|
|
||||||
<Modal
|
|
||||||
open={newInvoiceOpen}
|
|
||||||
onCancel={() => {
|
|
||||||
setNewInvoiceOpen(false)
|
|
||||||
}}
|
|
||||||
width={800}
|
|
||||||
footer={null}
|
|
||||||
destroyOnHidden={true}
|
|
||||||
>
|
|
||||||
<NewInvoice
|
|
||||||
onOk={() => {
|
|
||||||
setNewInvoiceOpen(false)
|
|
||||||
}}
|
|
||||||
reset={newInvoiceOpen}
|
|
||||||
defaultValues={{
|
|
||||||
orderType: 'salesOrder',
|
|
||||||
order: { ...objectFormState.objectData }
|
|
||||||
}}
|
|
||||||
/>
|
|
||||||
</Modal>
|
|
||||||
<Modal
|
|
||||||
open={postSalesOrderOpen}
|
|
||||||
onCancel={() => {
|
|
||||||
setPostSalesOrderOpen(false)
|
|
||||||
}}
|
|
||||||
width={500}
|
|
||||||
footer={null}
|
|
||||||
destroyOnHidden={true}
|
|
||||||
centered={true}
|
|
||||||
>
|
|
||||||
<PostSalesOrder
|
|
||||||
onOk={() => {
|
|
||||||
setPostSalesOrderOpen(false)
|
|
||||||
objectFormRef?.current.handleFetchObject()
|
|
||||||
}}
|
|
||||||
objectData={objectFormState.objectData}
|
|
||||||
/>
|
|
||||||
</Modal>
|
|
||||||
<Modal
|
|
||||||
open={confirmSalesOrderOpen}
|
|
||||||
onCancel={() => {
|
|
||||||
setConfirmSalesOrderOpen(false)
|
|
||||||
}}
|
|
||||||
width={515}
|
|
||||||
footer={null}
|
|
||||||
destroyOnHidden={true}
|
|
||||||
centered={true}
|
|
||||||
>
|
|
||||||
<ConfirmSalesOrder
|
|
||||||
onOk={() => {
|
|
||||||
setConfirmSalesOrderOpen(false)
|
|
||||||
objectFormRef?.current.handleFetchObject()
|
|
||||||
}}
|
|
||||||
objectData={objectFormState.objectData}
|
|
||||||
/>
|
|
||||||
</Modal>
|
|
||||||
<Modal
|
|
||||||
open={cancelSalesOrderOpen}
|
|
||||||
onCancel={() => {
|
|
||||||
setCancelSalesOrderOpen(false)
|
|
||||||
}}
|
|
||||||
width={515}
|
|
||||||
footer={null}
|
|
||||||
destroyOnHidden={true}
|
|
||||||
centered={true}
|
|
||||||
>
|
|
||||||
<CancelSalesOrder
|
|
||||||
onOk={() => {
|
|
||||||
setCancelSalesOrderOpen(false)
|
|
||||||
objectFormRef?.current.handleFetchObject()
|
|
||||||
}}
|
|
||||||
objectData={objectFormState.objectData}
|
|
||||||
/>
|
|
||||||
</Modal>
|
|
||||||
</>
|
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -1,3 +1,11 @@
|
|||||||
|
import { createElement, lazy } from 'react'
|
||||||
|
|
||||||
|
const AppPasswordInfo = lazy(
|
||||||
|
() => import('../../components/Dashboard/Management/AppPasswords/AppPasswordInfo')
|
||||||
|
)
|
||||||
|
const RegenerateAppPasswordSecret = lazy(
|
||||||
|
() => import('../../components/Dashboard/Management/AppPasswords/RegenerateAppPasswordSecret')
|
||||||
|
)
|
||||||
import AppPasswordIcon from '../../components/Icons/AppPasswordIcon'
|
import AppPasswordIcon from '../../components/Icons/AppPasswordIcon'
|
||||||
import InfoCircleIcon from '../../components/Icons/InfoCircleIcon'
|
import InfoCircleIcon from '../../components/Icons/InfoCircleIcon'
|
||||||
import EditIcon from '../../components/Icons/EditIcon'
|
import EditIcon from '../../components/Icons/EditIcon'
|
||||||
@ -15,21 +23,20 @@ export const AppPassword = {
|
|||||||
actions: [
|
actions: [
|
||||||
{
|
{
|
||||||
name: 'info',
|
name: 'info',
|
||||||
|
type: 'page',
|
||||||
|
pageName: 'info',
|
||||||
label: 'Info',
|
label: 'Info',
|
||||||
default: true,
|
default: true,
|
||||||
row: true,
|
row: true,
|
||||||
icon: InfoCircleIcon,
|
icon: InfoCircleIcon
|
||||||
url: (_id) =>
|
|
||||||
`/dashboard/management/apppasswords/info?appPasswordId=${_id}`
|
|
||||||
},
|
},
|
||||||
|
|
||||||
{
|
{
|
||||||
name: 'edit',
|
name: 'edit',
|
||||||
|
type: 'page',
|
||||||
|
pageName: 'info',
|
||||||
label: 'Edit',
|
label: 'Edit',
|
||||||
row: true,
|
row: true,
|
||||||
icon: EditIcon,
|
icon: EditIcon,
|
||||||
url: (_id) =>
|
|
||||||
`/dashboard/management/apppasswords/info?appPasswordId=${_id}&action=edit`,
|
|
||||||
visible: (objectData) => {
|
visible: (objectData) => {
|
||||||
return !(objectData?._isEditing && objectData?._isEditing == true)
|
return !(objectData?._isEditing && objectData?._isEditing == true)
|
||||||
},
|
},
|
||||||
@ -38,21 +45,21 @@ export const AppPassword = {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: 'finishEdit',
|
name: 'cancelEdit',
|
||||||
label: 'Save Edits',
|
label: 'Cancel Edits',
|
||||||
icon: CheckIcon,
|
type: 'page',
|
||||||
url: (_id) =>
|
pageName: 'info',
|
||||||
`/dashboard/management/apppasswords/info?appPasswordId=${_id}&action=finishEdit`,
|
icon: XMarkIcon,
|
||||||
visible: (objectData) => {
|
visible: (objectData) => {
|
||||||
return objectData?._isEditing && objectData?._isEditing == true
|
return objectData?._isEditing && objectData?._isEditing == true
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: 'cancelEdit',
|
name: 'finishEdit',
|
||||||
label: 'Cancel Edits',
|
label: 'Save Edits',
|
||||||
icon: XMarkIcon,
|
type: 'page',
|
||||||
url: (_id) =>
|
pageName: 'info',
|
||||||
`/dashboard/management/apppasswords/info?appPasswordId=${_id}&action=cancelEdit`,
|
icon: CheckIcon,
|
||||||
visible: (objectData) => {
|
visible: (objectData) => {
|
||||||
return objectData?._isEditing && objectData?._isEditing == true
|
return objectData?._isEditing && objectData?._isEditing == true
|
||||||
}
|
}
|
||||||
@ -60,17 +67,25 @@ export const AppPassword = {
|
|||||||
{ type: 'divider' },
|
{ type: 'divider' },
|
||||||
{
|
{
|
||||||
name: 'regenerateSecret',
|
name: 'regenerateSecret',
|
||||||
|
type: 'modal',
|
||||||
|
modalWidth: 520,
|
||||||
label: 'Regenerate Secret',
|
label: 'Regenerate Secret',
|
||||||
type: 'button',
|
|
||||||
row: true,
|
row: true,
|
||||||
icon: LockIcon,
|
icon: LockIcon,
|
||||||
url: (_id) =>
|
|
||||||
`/dashboard/management/apppasswords/info?appPasswordId=${_id}&action=regenerateSecret`,
|
|
||||||
disabled: (objectData) => {
|
disabled: (objectData) => {
|
||||||
return objectData?._user?._id != objectData?.user?._id
|
return objectData?._user?._id != objectData?.user?._id
|
||||||
|
},
|
||||||
|
content: (objectData, { onOk } = {}) => {
|
||||||
|
return createElement(RegenerateAppPasswordSecret, { id: objectData._id, onOk })
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
|
pages: [
|
||||||
|
{
|
||||||
|
name: 'info',
|
||||||
|
content: () => createElement(AppPasswordInfo)
|
||||||
|
}
|
||||||
|
],
|
||||||
columns: ['_reference', 'name', 'user', 'active', 'createdAt', 'updatedAt'],
|
columns: ['_reference', 'name', 'user', 'active', 'createdAt', 'updatedAt'],
|
||||||
filters: [
|
filters: [
|
||||||
'_id',
|
'_id',
|
||||||
|
|||||||
@ -1,3 +1,8 @@
|
|||||||
|
import { createElement, lazy } from 'react'
|
||||||
|
|
||||||
|
const ClientInfo = lazy(
|
||||||
|
() => import('../../components/Dashboard/Sales/Clients/ClientInfo')
|
||||||
|
)
|
||||||
import ClientIcon from '../../components/Icons/ClientIcon'
|
import ClientIcon from '../../components/Icons/ClientIcon'
|
||||||
import InfoCircleIcon from '../../components/Icons/InfoCircleIcon'
|
import InfoCircleIcon from '../../components/Icons/InfoCircleIcon'
|
||||||
import EditIcon from '../../components/Icons/EditIcon'
|
import EditIcon from '../../components/Icons/EditIcon'
|
||||||
@ -15,38 +20,40 @@ export const Client = {
|
|||||||
actions: [
|
actions: [
|
||||||
{
|
{
|
||||||
name: 'info',
|
name: 'info',
|
||||||
|
type: 'page',
|
||||||
|
pageName: 'info',
|
||||||
label: 'Info',
|
label: 'Info',
|
||||||
default: true,
|
default: true,
|
||||||
row: true,
|
row: true,
|
||||||
icon: InfoCircleIcon,
|
icon: InfoCircleIcon
|
||||||
url: (_id) => `/dashboard/sales/clients/info?clientId=${_id}`
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: 'edit',
|
name: 'edit',
|
||||||
|
type: 'page',
|
||||||
|
pageName: 'info',
|
||||||
label: 'Edit',
|
label: 'Edit',
|
||||||
row: true,
|
row: true,
|
||||||
icon: EditIcon,
|
icon: EditIcon,
|
||||||
url: (_id) => `/dashboard/sales/clients/info?clientId=${_id}&action=edit`,
|
|
||||||
visible: (objectData) => {
|
visible: (objectData) => {
|
||||||
return !(objectData?._isEditing && objectData?._isEditing == true)
|
return !(objectData?._isEditing && objectData?._isEditing == true)
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: 'finishEdit',
|
name: 'cancelEdit',
|
||||||
label: 'Save Edits',
|
label: 'Cancel Edits',
|
||||||
icon: CheckIcon,
|
type: 'page',
|
||||||
url: (_id) =>
|
pageName: 'info',
|
||||||
`/dashboard/sales/clients/info?clientId=${_id}&action=finishEdit`,
|
icon: XMarkIcon,
|
||||||
visible: (objectData) => {
|
visible: (objectData) => {
|
||||||
return objectData?._isEditing && objectData?._isEditing == true
|
return objectData?._isEditing && objectData?._isEditing == true
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: 'cancelEdit',
|
name: 'finishEdit',
|
||||||
label: 'Cancel Edits',
|
label: 'Save Edits',
|
||||||
icon: XMarkIcon,
|
type: 'page',
|
||||||
url: (_id) =>
|
pageName: 'info',
|
||||||
`/dashboard/sales/clients/info?clientId=${_id}&action=cancelEdit`,
|
icon: CheckIcon,
|
||||||
visible: (objectData) => {
|
visible: (objectData) => {
|
||||||
return objectData?._isEditing && objectData?._isEditing == true
|
return objectData?._isEditing && objectData?._isEditing == true
|
||||||
}
|
}
|
||||||
@ -54,11 +61,17 @@ export const Client = {
|
|||||||
{ type: 'divider' },
|
{ type: 'divider' },
|
||||||
{
|
{
|
||||||
name: 'delete',
|
name: 'delete',
|
||||||
|
type: 'page',
|
||||||
|
pageName: 'info',
|
||||||
label: 'Delete',
|
label: 'Delete',
|
||||||
icon: BinIcon,
|
icon: BinIcon,
|
||||||
danger: true,
|
danger: true
|
||||||
url: (_id) =>
|
}
|
||||||
`/dashboard/sales/clients/info?clientId=${_id}&action=delete`
|
],
|
||||||
|
pages: [
|
||||||
|
{
|
||||||
|
name: 'info',
|
||||||
|
content: () => createElement(ClientInfo)
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
columns: [
|
columns: [
|
||||||
|
|||||||
@ -1,3 +1,8 @@
|
|||||||
|
import { createElement, lazy } from 'react'
|
||||||
|
|
||||||
|
const CourierInfo = lazy(
|
||||||
|
() => import('../../components/Dashboard/Management/Couriers/CourierInfo')
|
||||||
|
)
|
||||||
import CourierIcon from '../../components/Icons/CourierIcon'
|
import CourierIcon from '../../components/Icons/CourierIcon'
|
||||||
import InfoCircleIcon from '../../components/Icons/InfoCircleIcon'
|
import InfoCircleIcon from '../../components/Icons/InfoCircleIcon'
|
||||||
import EditIcon from '../../components/Icons/EditIcon'
|
import EditIcon from '../../components/Icons/EditIcon'
|
||||||
@ -15,39 +20,40 @@ export const Courier = {
|
|||||||
actions: [
|
actions: [
|
||||||
{
|
{
|
||||||
name: 'info',
|
name: 'info',
|
||||||
|
type: 'page',
|
||||||
|
pageName: 'info',
|
||||||
label: 'Info',
|
label: 'Info',
|
||||||
default: true,
|
default: true,
|
||||||
row: true,
|
row: true,
|
||||||
icon: InfoCircleIcon,
|
icon: InfoCircleIcon
|
||||||
url: (_id) => `/dashboard/management/couriers/info?courierId=${_id}`
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: 'edit',
|
name: 'edit',
|
||||||
|
type: 'page',
|
||||||
|
pageName: 'info',
|
||||||
label: 'Edit',
|
label: 'Edit',
|
||||||
row: true,
|
row: true,
|
||||||
icon: EditIcon,
|
icon: EditIcon,
|
||||||
url: (_id) =>
|
|
||||||
`/dashboard/management/couriers/info?courierId=${_id}&action=edit`,
|
|
||||||
visible: (objectData) => {
|
visible: (objectData) => {
|
||||||
return !(objectData?._isEditing && objectData?._isEditing == true)
|
return !(objectData?._isEditing && objectData?._isEditing == true)
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: 'finishEdit',
|
name: 'cancelEdit',
|
||||||
label: 'Save Edits',
|
label: 'Cancel Edits',
|
||||||
icon: CheckIcon,
|
type: 'page',
|
||||||
url: (_id) =>
|
pageName: 'info',
|
||||||
`/dashboard/management/couriers/info?courierId=${_id}&action=finishEdit`,
|
icon: XMarkIcon,
|
||||||
visible: (objectData) => {
|
visible: (objectData) => {
|
||||||
return objectData?._isEditing && objectData?._isEditing == true
|
return objectData?._isEditing && objectData?._isEditing == true
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: 'cancelEdit',
|
name: 'finishEdit',
|
||||||
label: 'Cancel Edits',
|
label: 'Save Edits',
|
||||||
icon: XMarkIcon,
|
type: 'page',
|
||||||
url: (_id) =>
|
pageName: 'info',
|
||||||
`/dashboard/management/couriers/info?courierId=${_id}&action=cancelEdit`,
|
icon: CheckIcon,
|
||||||
visible: (objectData) => {
|
visible: (objectData) => {
|
||||||
return objectData?._isEditing && objectData?._isEditing == true
|
return objectData?._isEditing && objectData?._isEditing == true
|
||||||
}
|
}
|
||||||
@ -55,11 +61,17 @@ export const Courier = {
|
|||||||
{ type: 'divider' },
|
{ type: 'divider' },
|
||||||
{
|
{
|
||||||
name: 'delete',
|
name: 'delete',
|
||||||
|
type: 'page',
|
||||||
|
pageName: 'info',
|
||||||
label: 'Delete',
|
label: 'Delete',
|
||||||
icon: BinIcon,
|
icon: BinIcon,
|
||||||
danger: true,
|
danger: true
|
||||||
url: (_id) =>
|
}
|
||||||
`/dashboard/management/couriers/info?courierId=${_id}&action=delete`
|
],
|
||||||
|
pages: [
|
||||||
|
{
|
||||||
|
name: 'info',
|
||||||
|
content: () => createElement(CourierInfo)
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
columns: ['_reference', 'name', 'country', 'email', 'website', 'createdAt'],
|
columns: ['_reference', 'name', 'country', 'email', 'website', 'createdAt'],
|
||||||
|
|||||||
@ -1,3 +1,8 @@
|
|||||||
|
import { createElement, lazy } from 'react'
|
||||||
|
|
||||||
|
const CourierServiceInfo = lazy(
|
||||||
|
() => import('../../components/Dashboard/Management/CourierServices/CourierServiceInfo')
|
||||||
|
)
|
||||||
import CourierServiceIcon from '../../components/Icons/CourierServiceIcon'
|
import CourierServiceIcon from '../../components/Icons/CourierServiceIcon'
|
||||||
import InfoCircleIcon from '../../components/Icons/InfoCircleIcon'
|
import InfoCircleIcon from '../../components/Icons/InfoCircleIcon'
|
||||||
import EditIcon from '../../components/Icons/EditIcon'
|
import EditIcon from '../../components/Icons/EditIcon'
|
||||||
@ -15,40 +20,40 @@ export const CourierService = {
|
|||||||
actions: [
|
actions: [
|
||||||
{
|
{
|
||||||
name: 'info',
|
name: 'info',
|
||||||
|
type: 'page',
|
||||||
|
pageName: 'info',
|
||||||
label: 'Info',
|
label: 'Info',
|
||||||
default: true,
|
default: true,
|
||||||
row: true,
|
row: true,
|
||||||
icon: InfoCircleIcon,
|
icon: InfoCircleIcon
|
||||||
url: (_id) =>
|
|
||||||
`/dashboard/management/courierservices/info?courierServiceId=${_id}`
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: 'edit',
|
name: 'edit',
|
||||||
|
type: 'page',
|
||||||
|
pageName: 'info',
|
||||||
label: 'Edit',
|
label: 'Edit',
|
||||||
row: true,
|
row: true,
|
||||||
icon: EditIcon,
|
icon: EditIcon,
|
||||||
url: (_id) =>
|
|
||||||
`/dashboard/management/courierservices/info?courierServiceId=${_id}&action=edit`,
|
|
||||||
visible: (objectData) => {
|
visible: (objectData) => {
|
||||||
return !(objectData?._isEditing && objectData?._isEditing == true)
|
return !(objectData?._isEditing && objectData?._isEditing == true)
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: 'finishEdit',
|
name: 'cancelEdit',
|
||||||
label: 'Save Edits',
|
label: 'Cancel Edits',
|
||||||
icon: CheckIcon,
|
type: 'page',
|
||||||
url: (_id) =>
|
pageName: 'info',
|
||||||
`/dashboard/management/courierservices/info?courierServiceId=${_id}&action=finishEdit`,
|
icon: XMarkIcon,
|
||||||
visible: (objectData) => {
|
visible: (objectData) => {
|
||||||
return objectData?._isEditing && objectData?._isEditing == true
|
return objectData?._isEditing && objectData?._isEditing == true
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: 'cancelEdit',
|
name: 'finishEdit',
|
||||||
label: 'Cancel Edits',
|
label: 'Save Edits',
|
||||||
icon: XMarkIcon,
|
type: 'page',
|
||||||
url: (_id) =>
|
pageName: 'info',
|
||||||
`/dashboard/management/courierservices/info?courierServiceId=${_id}&action=cancelEdit`,
|
icon: CheckIcon,
|
||||||
visible: (objectData) => {
|
visible: (objectData) => {
|
||||||
return objectData?._isEditing && objectData?._isEditing == true
|
return objectData?._isEditing && objectData?._isEditing == true
|
||||||
}
|
}
|
||||||
@ -56,11 +61,17 @@ export const CourierService = {
|
|||||||
{ type: 'divider' },
|
{ type: 'divider' },
|
||||||
{
|
{
|
||||||
name: 'delete',
|
name: 'delete',
|
||||||
|
type: 'page',
|
||||||
|
pageName: 'info',
|
||||||
label: 'Delete',
|
label: 'Delete',
|
||||||
icon: BinIcon,
|
icon: BinIcon,
|
||||||
danger: true,
|
danger: true
|
||||||
url: (_id) =>
|
}
|
||||||
`/dashboard/management/courierservices/info?courierServiceId=${_id}&action=delete`
|
],
|
||||||
|
pages: [
|
||||||
|
{
|
||||||
|
name: 'info',
|
||||||
|
content: () => createElement(CourierServiceInfo)
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
columns: [
|
columns: [
|
||||||
|
|||||||
@ -1,3 +1,8 @@
|
|||||||
|
import { createElement, lazy } from 'react'
|
||||||
|
|
||||||
|
const DocumentJobInfo = lazy(
|
||||||
|
() => import('../../components/Dashboard/Management/DocumentJobs/DocumentJobInfo')
|
||||||
|
)
|
||||||
import InfoCircleIcon from '../../components/Icons/InfoCircleIcon'
|
import InfoCircleIcon from '../../components/Icons/InfoCircleIcon'
|
||||||
import EditIcon from '../../components/Icons/EditIcon'
|
import EditIcon from '../../components/Icons/EditIcon'
|
||||||
import CheckIcon from '../../components/Icons/CheckIcon'
|
import CheckIcon from '../../components/Icons/CheckIcon'
|
||||||
@ -15,44 +20,49 @@ export const DocumentJob = {
|
|||||||
actions: [
|
actions: [
|
||||||
{
|
{
|
||||||
name: 'info',
|
name: 'info',
|
||||||
|
type: 'page',
|
||||||
|
pageName: 'info',
|
||||||
label: 'Info',
|
label: 'Info',
|
||||||
default: true,
|
default: true,
|
||||||
row: true,
|
row: true,
|
||||||
icon: InfoCircleIcon,
|
icon: InfoCircleIcon
|
||||||
url: (_id) =>
|
|
||||||
`/dashboard/management/documentjobs/info?documentJobId=${_id}`
|
|
||||||
},
|
},
|
||||||
|
|
||||||
{
|
{
|
||||||
name: 'edit',
|
name: 'edit',
|
||||||
|
type: 'page',
|
||||||
|
pageName: 'info',
|
||||||
label: 'Edit',
|
label: 'Edit',
|
||||||
row: true,
|
row: true,
|
||||||
icon: EditIcon,
|
icon: EditIcon,
|
||||||
url: (_id) =>
|
|
||||||
`/dashboard/management/documentjobs/info?documentJobId=${_id}&action=edit`,
|
|
||||||
visible: (objectData) => {
|
visible: (objectData) => {
|
||||||
return !(objectData?._isEditing && objectData?._isEditing == true)
|
return !(objectData?._isEditing && objectData?._isEditing == true)
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
, {
|
||||||
|
name: 'cancelEdit',
|
||||||
|
label: 'Cancel Edits',
|
||||||
|
type: 'page',
|
||||||
|
pageName: 'info',
|
||||||
|
icon: XMarkIcon,
|
||||||
|
visible: (objectData) => {
|
||||||
|
return objectData?._isEditing && objectData?._isEditing == true
|
||||||
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: 'finishEdit',
|
name: 'finishEdit',
|
||||||
label: 'Save Edits',
|
label: 'Save Edits',
|
||||||
|
type: 'page',
|
||||||
|
pageName: 'info',
|
||||||
icon: CheckIcon,
|
icon: CheckIcon,
|
||||||
url: (_id) =>
|
|
||||||
`/dashboard/management/documentjobs/info?documentJobId=${_id}&action=finishEdit`,
|
|
||||||
visible: (objectData) => {
|
visible: (objectData) => {
|
||||||
return objectData?._isEditing && objectData?._isEditing == true
|
return objectData?._isEditing && objectData?._isEditing == true
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
],
|
||||||
|
pages: [
|
||||||
{
|
{
|
||||||
name: 'cancelEdit',
|
name: 'info',
|
||||||
label: 'Cancel Edits',
|
content: () => createElement(DocumentJobInfo)
|
||||||
icon: XMarkIcon,
|
|
||||||
url: (_id) =>
|
|
||||||
`/dashboard/management/documentjobs/info?documentJobId=${_id}&action=cancelEdit`,
|
|
||||||
visible: (objectData) => {
|
|
||||||
return objectData?._isEditing && objectData?._isEditing == true
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
columns: ['_reference', 'name', 'state', 'createdAt', 'updatedAt'],
|
columns: ['_reference', 'name', 'state', 'createdAt', 'updatedAt'],
|
||||||
|
|||||||
@ -1,8 +1,13 @@
|
|||||||
|
import { createElement, lazy } from 'react'
|
||||||
|
|
||||||
|
const DocumentPrinterInfo = lazy(
|
||||||
|
() => import('../../components/Dashboard/Management/DocumentPrinters/DocumentPrinterInfo')
|
||||||
|
)
|
||||||
import InfoCircleIcon from '../../components/Icons/InfoCircleIcon'
|
import InfoCircleIcon from '../../components/Icons/InfoCircleIcon'
|
||||||
import EditIcon from '../../components/Icons/EditIcon'
|
import EditIcon from '../../components/Icons/EditIcon'
|
||||||
import DocumentPrinterIcon from '../../components/Icons/DocumentPrinterIcon'
|
|
||||||
import CheckIcon from '../../components/Icons/CheckIcon'
|
import CheckIcon from '../../components/Icons/CheckIcon'
|
||||||
import XMarkIcon from '../../components/Icons/XMarkIcon'
|
import XMarkIcon from '../../components/Icons/XMarkIcon'
|
||||||
|
import DocumentPrinterIcon from '../../components/Icons/DocumentPrinterIcon'
|
||||||
|
|
||||||
export const DocumentPrinter = {
|
export const DocumentPrinter = {
|
||||||
name: 'documentPrinter',
|
name: 'documentPrinter',
|
||||||
@ -14,44 +19,49 @@ export const DocumentPrinter = {
|
|||||||
actions: [
|
actions: [
|
||||||
{
|
{
|
||||||
name: 'info',
|
name: 'info',
|
||||||
|
type: 'page',
|
||||||
|
pageName: 'info',
|
||||||
label: 'Info',
|
label: 'Info',
|
||||||
default: true,
|
default: true,
|
||||||
row: true,
|
row: true,
|
||||||
icon: InfoCircleIcon,
|
icon: InfoCircleIcon
|
||||||
url: (_id) =>
|
|
||||||
`/dashboard/management/documentprinters/info?documentPrinterId=${_id}`
|
|
||||||
},
|
},
|
||||||
|
|
||||||
{
|
{
|
||||||
name: 'edit',
|
name: 'edit',
|
||||||
|
type: 'page',
|
||||||
|
pageName: 'info',
|
||||||
label: 'Edit',
|
label: 'Edit',
|
||||||
row: true,
|
row: true,
|
||||||
icon: EditIcon,
|
icon: EditIcon,
|
||||||
url: (_id) =>
|
|
||||||
`/dashboard/management/documentprinters/info?documentPrinterId=${_id}&action=edit`,
|
|
||||||
visible: (objectData) => {
|
visible: (objectData) => {
|
||||||
return !(objectData?._isEditing && objectData?._isEditing == true)
|
return !(objectData?._isEditing && objectData?._isEditing == true)
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
, {
|
||||||
|
name: 'cancelEdit',
|
||||||
|
label: 'Cancel Edits',
|
||||||
|
type: 'page',
|
||||||
|
pageName: 'info',
|
||||||
|
icon: XMarkIcon,
|
||||||
|
visible: (objectData) => {
|
||||||
|
return objectData?._isEditing && objectData?._isEditing == true
|
||||||
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: 'finishEdit',
|
name: 'finishEdit',
|
||||||
label: 'Save Edits',
|
label: 'Save Edits',
|
||||||
|
type: 'page',
|
||||||
|
pageName: 'info',
|
||||||
icon: CheckIcon,
|
icon: CheckIcon,
|
||||||
url: (_id) =>
|
|
||||||
`/dashboard/management/documentprinters/info?documentPrinterId=${_id}&action=finishEdit`,
|
|
||||||
visible: (objectData) => {
|
visible: (objectData) => {
|
||||||
return objectData?._isEditing && objectData?._isEditing == true
|
return objectData?._isEditing && objectData?._isEditing == true
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
],
|
||||||
|
pages: [
|
||||||
{
|
{
|
||||||
name: 'cancelEdit',
|
name: 'info',
|
||||||
label: 'Cancel Edits',
|
content: () => createElement(DocumentPrinterInfo)
|
||||||
icon: XMarkIcon,
|
|
||||||
url: (_id) =>
|
|
||||||
`/dashboard/management/documentprinters/info?documentPrinterId=${_id}&action=cancelEdit`,
|
|
||||||
visible: (objectData) => {
|
|
||||||
return objectData?._isEditing && objectData?._isEditing == true
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
columns: [
|
columns: [
|
||||||
|
|||||||
@ -1,3 +1,8 @@
|
|||||||
|
import { createElement, lazy } from 'react'
|
||||||
|
|
||||||
|
const DocumentSizeInfo = lazy(
|
||||||
|
() => import('../../components/Dashboard/Management/DocumentSizes/DocumentSizeInfo')
|
||||||
|
)
|
||||||
import InfoCircleIcon from '../../components/Icons/InfoCircleIcon'
|
import InfoCircleIcon from '../../components/Icons/InfoCircleIcon'
|
||||||
import EditIcon from '../../components/Icons/EditIcon'
|
import EditIcon from '../../components/Icons/EditIcon'
|
||||||
import CheckIcon from '../../components/Icons/CheckIcon'
|
import CheckIcon from '../../components/Icons/CheckIcon'
|
||||||
@ -14,44 +19,49 @@ export const DocumentSize = {
|
|||||||
actions: [
|
actions: [
|
||||||
{
|
{
|
||||||
name: 'info',
|
name: 'info',
|
||||||
|
type: 'page',
|
||||||
|
pageName: 'info',
|
||||||
label: 'Info',
|
label: 'Info',
|
||||||
default: true,
|
default: true,
|
||||||
row: true,
|
row: true,
|
||||||
icon: InfoCircleIcon,
|
icon: InfoCircleIcon
|
||||||
url: (_id) =>
|
|
||||||
`/dashboard/management/documentsizes/info?documentSizeId=${_id}`
|
|
||||||
},
|
},
|
||||||
|
|
||||||
{
|
{
|
||||||
name: 'edit',
|
name: 'edit',
|
||||||
|
type: 'page',
|
||||||
|
pageName: 'info',
|
||||||
label: 'Edit',
|
label: 'Edit',
|
||||||
row: true,
|
row: true,
|
||||||
icon: EditIcon,
|
icon: EditIcon,
|
||||||
url: (_id) =>
|
|
||||||
`/dashboard/management/documentsizes/info?documentSizeId=${_id}&action=edit`,
|
|
||||||
visible: (objectData) => {
|
visible: (objectData) => {
|
||||||
return !(objectData?._isEditing && objectData?._isEditing == true)
|
return !(objectData?._isEditing && objectData?._isEditing == true)
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
, {
|
||||||
|
name: 'cancelEdit',
|
||||||
|
label: 'Cancel Edits',
|
||||||
|
type: 'page',
|
||||||
|
pageName: 'info',
|
||||||
|
icon: XMarkIcon,
|
||||||
|
visible: (objectData) => {
|
||||||
|
return objectData?._isEditing && objectData?._isEditing == true
|
||||||
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: 'finishEdit',
|
name: 'finishEdit',
|
||||||
label: 'Save Edits',
|
label: 'Save Edits',
|
||||||
|
type: 'page',
|
||||||
|
pageName: 'info',
|
||||||
icon: CheckIcon,
|
icon: CheckIcon,
|
||||||
url: (_id) =>
|
|
||||||
`/dashboard/management/documentsizes/info?documentSizeId=${_id}&action=finishEdit`,
|
|
||||||
visible: (objectData) => {
|
visible: (objectData) => {
|
||||||
return objectData?._isEditing && objectData?._isEditing == true
|
return objectData?._isEditing && objectData?._isEditing == true
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
],
|
||||||
|
pages: [
|
||||||
{
|
{
|
||||||
name: 'cancelEdit',
|
name: 'info',
|
||||||
label: 'Cancel Edits',
|
content: () => createElement(DocumentSizeInfo)
|
||||||
icon: XMarkIcon,
|
|
||||||
url: (_id) =>
|
|
||||||
`/dashboard/management/documentsizes/info?documentSizeId=${_id}&action=cancelEdit`,
|
|
||||||
visible: (objectData) => {
|
|
||||||
return objectData?._isEditing && objectData?._isEditing == true
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
columns: [
|
columns: [
|
||||||
|
|||||||
@ -1,3 +1,8 @@
|
|||||||
|
import { createElement, lazy } from 'react'
|
||||||
|
|
||||||
|
const DocumentTemplateInfo = lazy(
|
||||||
|
() => import('../../components/Dashboard/Management/DocumentTemplates/DocumentTemplateInfo')
|
||||||
|
)
|
||||||
import InfoCircleIcon from '../../components/Icons/InfoCircleIcon'
|
import InfoCircleIcon from '../../components/Icons/InfoCircleIcon'
|
||||||
import EditIcon from '../../components/Icons/EditIcon'
|
import EditIcon from '../../components/Icons/EditIcon'
|
||||||
import CheckIcon from '../../components/Icons/CheckIcon'
|
import CheckIcon from '../../components/Icons/CheckIcon'
|
||||||
@ -23,44 +28,49 @@ export const DocumentTemplate = {
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: 'info',
|
name: 'info',
|
||||||
|
type: 'page',
|
||||||
|
pageName: 'info',
|
||||||
label: 'Info',
|
label: 'Info',
|
||||||
default: true,
|
default: true,
|
||||||
row: true,
|
row: true,
|
||||||
icon: InfoCircleIcon,
|
icon: InfoCircleIcon
|
||||||
url: (_id) =>
|
|
||||||
`/dashboard/management/documenttemplates/info?documentTemplateId=${_id}`
|
|
||||||
},
|
},
|
||||||
|
|
||||||
{
|
{
|
||||||
name: 'edit',
|
name: 'edit',
|
||||||
|
type: 'page',
|
||||||
|
pageName: 'info',
|
||||||
label: 'Edit',
|
label: 'Edit',
|
||||||
row: true,
|
row: true,
|
||||||
icon: EditIcon,
|
icon: EditIcon,
|
||||||
url: (_id) =>
|
|
||||||
`/dashboard/management/documenttemplates/info?documentTemplateId=${_id}&action=edit`,
|
|
||||||
visible: (objectData) => {
|
visible: (objectData) => {
|
||||||
return !(objectData?._isEditing && objectData?._isEditing == true)
|
return !(objectData?._isEditing && objectData?._isEditing == true)
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
, {
|
||||||
|
name: 'cancelEdit',
|
||||||
|
label: 'Cancel Edits',
|
||||||
|
type: 'page',
|
||||||
|
pageName: 'info',
|
||||||
|
icon: XMarkIcon,
|
||||||
|
visible: (objectData) => {
|
||||||
|
return objectData?._isEditing && objectData?._isEditing == true
|
||||||
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: 'finishEdit',
|
name: 'finishEdit',
|
||||||
label: 'Save Edits',
|
label: 'Save Edits',
|
||||||
|
type: 'page',
|
||||||
|
pageName: 'info',
|
||||||
icon: CheckIcon,
|
icon: CheckIcon,
|
||||||
url: (_id) =>
|
|
||||||
`/dashboard/management/documenttemplates/info?documentTemplateId=${_id}&action=finishEdit`,
|
|
||||||
visible: (objectData) => {
|
visible: (objectData) => {
|
||||||
return objectData?._isEditing && objectData?._isEditing == true
|
return objectData?._isEditing && objectData?._isEditing == true
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
],
|
||||||
|
pages: [
|
||||||
{
|
{
|
||||||
name: 'cancelEdit',
|
name: 'info',
|
||||||
label: 'Cancel Edits',
|
content: () => createElement(DocumentTemplateInfo)
|
||||||
icon: XMarkIcon,
|
|
||||||
url: (_id) =>
|
|
||||||
`/dashboard/management/documenttemplates/info?documentTemplateId=${_id}&action=cancelEdit`,
|
|
||||||
visible: (objectData) => {
|
|
||||||
return objectData?._isEditing && objectData?._isEditing == true
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
columns: [
|
columns: [
|
||||||
|
|||||||
@ -1,8 +1,16 @@
|
|||||||
|
import { createElement, lazy } from 'react'
|
||||||
|
|
||||||
|
const FilamentInfo = lazy(
|
||||||
|
() => import('../../components/Dashboard/Management/Filaments/FilamentInfo')
|
||||||
|
)
|
||||||
|
const NewFilamentSku = lazy(
|
||||||
|
() => import('../../components/Dashboard/Management/FilamentSkus/NewFilamentSku')
|
||||||
|
)
|
||||||
import EditIcon from '../../components/Icons/EditIcon'
|
import EditIcon from '../../components/Icons/EditIcon'
|
||||||
import FilamentIcon from '../../components/Icons/FilamentIcon'
|
|
||||||
import InfoCircleIcon from '../../components/Icons/InfoCircleIcon'
|
|
||||||
import CheckIcon from '../../components/Icons/CheckIcon'
|
import CheckIcon from '../../components/Icons/CheckIcon'
|
||||||
import XMarkIcon from '../../components/Icons/XMarkIcon'
|
import XMarkIcon from '../../components/Icons/XMarkIcon'
|
||||||
|
import FilamentIcon from '../../components/Icons/FilamentIcon'
|
||||||
|
import InfoCircleIcon from '../../components/Icons/InfoCircleIcon'
|
||||||
import PlusIcon from '../../components/Icons/PlusIcon'
|
import PlusIcon from '../../components/Icons/PlusIcon'
|
||||||
import BinIcon from '../../components/Icons/BinIcon'
|
import BinIcon from '../../components/Icons/BinIcon'
|
||||||
|
|
||||||
@ -16,39 +24,40 @@ export const Filament = {
|
|||||||
actions: [
|
actions: [
|
||||||
{
|
{
|
||||||
name: 'info',
|
name: 'info',
|
||||||
|
type: 'page',
|
||||||
|
pageName: 'info',
|
||||||
label: 'Info',
|
label: 'Info',
|
||||||
default: true,
|
default: true,
|
||||||
row: true,
|
row: true,
|
||||||
icon: InfoCircleIcon,
|
icon: InfoCircleIcon
|
||||||
url: (_id) => `/dashboard/management/filaments/info?filamentId=${_id}`
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: 'edit',
|
name: 'edit',
|
||||||
|
type: 'page',
|
||||||
|
pageName: 'info',
|
||||||
label: 'Edit',
|
label: 'Edit',
|
||||||
row: true,
|
row: true,
|
||||||
icon: EditIcon,
|
icon: EditIcon,
|
||||||
url: (_id) =>
|
|
||||||
`/dashboard/management/filaments/info?filamentId=${_id}&action=edit`,
|
|
||||||
visible: (objectData) => {
|
visible: (objectData) => {
|
||||||
return !(objectData?._isEditing && objectData?._isEditing == true)
|
return !(objectData?._isEditing && objectData?._isEditing == true)
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: 'finishEdit',
|
name: 'cancelEdit',
|
||||||
label: 'Save Edits',
|
label: 'Cancel Edits',
|
||||||
icon: CheckIcon,
|
type: 'page',
|
||||||
url: (_id) =>
|
pageName: 'info',
|
||||||
`/dashboard/management/filaments/info?filamentId=${_id}&action=finishEdit`,
|
icon: XMarkIcon,
|
||||||
visible: (objectData) => {
|
visible: (objectData) => {
|
||||||
return objectData?._isEditing && objectData?._isEditing == true
|
return objectData?._isEditing && objectData?._isEditing == true
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: 'cancelEdit',
|
name: 'finishEdit',
|
||||||
label: 'Cancel Edits',
|
label: 'Save Edits',
|
||||||
icon: XMarkIcon,
|
type: 'page',
|
||||||
url: (_id) =>
|
pageName: 'info',
|
||||||
`/dashboard/management/filaments/info?filamentId=${_id}&action=cancelEdit`,
|
icon: CheckIcon,
|
||||||
visible: (objectData) => {
|
visible: (objectData) => {
|
||||||
return objectData?._isEditing && objectData?._isEditing == true
|
return objectData?._isEditing && objectData?._isEditing == true
|
||||||
}
|
}
|
||||||
@ -56,28 +65,36 @@ export const Filament = {
|
|||||||
{ type: 'divider' },
|
{ type: 'divider' },
|
||||||
{
|
{
|
||||||
name: 'newFilamentSku',
|
name: 'newFilamentSku',
|
||||||
|
type: 'modal',
|
||||||
|
modalWidth: 700,
|
||||||
label: 'New Filament SKU',
|
label: 'New Filament SKU',
|
||||||
type: 'button',
|
|
||||||
icon: PlusIcon,
|
icon: PlusIcon,
|
||||||
url: (_id) =>
|
|
||||||
`/dashboard/management/filaments/info?filamentId=${_id}&action=newFilamentSku`,
|
|
||||||
visible: (objectData) => {
|
visible: (objectData) => {
|
||||||
return !(objectData?._isEditing && objectData?._isEditing == true)
|
return !(objectData?._isEditing && objectData?._isEditing == true)
|
||||||
|
},
|
||||||
|
content: (objectData, { onOk } = {}) => {
|
||||||
|
return createElement(NewFilamentSku, { defaultValues: { filament: objectData }, onOk, reset: true })
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{ type: 'divider' },
|
{ type: 'divider' },
|
||||||
{
|
{
|
||||||
name: 'delete',
|
name: 'delete',
|
||||||
|
type: 'page',
|
||||||
|
pageName: 'info',
|
||||||
label: 'Delete',
|
label: 'Delete',
|
||||||
icon: BinIcon,
|
icon: BinIcon,
|
||||||
danger: true,
|
danger: true,
|
||||||
url: (_id) =>
|
|
||||||
`/dashboard/management/filaments/info?filamentId=${_id}&action=delete`,
|
|
||||||
visible: (objectData) => {
|
visible: (objectData) => {
|
||||||
return !(objectData?._isEditing && objectData?._isEditing == true)
|
return !(objectData?._isEditing && objectData?._isEditing == true)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
|
pages: [
|
||||||
|
{
|
||||||
|
name: 'info',
|
||||||
|
content: () => createElement(FilamentInfo)
|
||||||
|
}
|
||||||
|
],
|
||||||
columns: [
|
columns: [
|
||||||
'_reference',
|
'_reference',
|
||||||
'name',
|
'name',
|
||||||
|
|||||||
@ -1,3 +1,8 @@
|
|||||||
|
import { createElement, lazy } from 'react'
|
||||||
|
|
||||||
|
const FilamentProfileInfo = lazy(
|
||||||
|
() => import('../../components/Dashboard/Production/FilamentProfiles/FilamentProfileInfo')
|
||||||
|
)
|
||||||
import FilamentProfileIcon from '../../components/Icons/FilamentProfileIcon'
|
import FilamentProfileIcon from '../../components/Icons/FilamentProfileIcon'
|
||||||
import InfoCircleIcon from '../../components/Icons/InfoCircleIcon'
|
import InfoCircleIcon from '../../components/Icons/InfoCircleIcon'
|
||||||
import EditIcon from '../../components/Icons/EditIcon'
|
import EditIcon from '../../components/Icons/EditIcon'
|
||||||
@ -15,47 +20,57 @@ export const FilamentProfile = {
|
|||||||
actions: [
|
actions: [
|
||||||
{
|
{
|
||||||
name: 'info',
|
name: 'info',
|
||||||
|
type: 'page',
|
||||||
|
pageName: 'info',
|
||||||
label: 'Info',
|
label: 'Info',
|
||||||
default: true,
|
default: true,
|
||||||
row: true,
|
row: true,
|
||||||
icon: InfoCircleIcon,
|
icon: InfoCircleIcon
|
||||||
url: (_id) =>
|
|
||||||
`/dashboard/production/filamentprofiles/info?filamentProfileId=${_id}`
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: 'edit',
|
name: 'edit',
|
||||||
|
type: 'page',
|
||||||
|
pageName: 'info',
|
||||||
label: 'Edit',
|
label: 'Edit',
|
||||||
row: true,
|
row: true,
|
||||||
icon: EditIcon,
|
icon: EditIcon,
|
||||||
url: (_id) =>
|
|
||||||
`/dashboard/production/filamentprofiles/info?filamentProfileId=${_id}&action=edit`,
|
|
||||||
visible: (objectData) => !objectData?._isEditing
|
visible: (objectData) => !objectData?._isEditing
|
||||||
},
|
},
|
||||||
{
|
|
||||||
name: 'finishEdit',
|
|
||||||
label: 'Save Edits',
|
|
||||||
icon: CheckIcon,
|
|
||||||
url: (_id) =>
|
|
||||||
`/dashboard/production/filamentprofiles/info?filamentProfileId=${_id}&action=finishEdit`,
|
|
||||||
visible: (objectData) => objectData?._isEditing === true
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
name: 'cancelEdit',
|
name: 'cancelEdit',
|
||||||
label: 'Cancel Edits',
|
label: 'Cancel Edits',
|
||||||
|
type: 'page',
|
||||||
|
pageName: 'info',
|
||||||
icon: XMarkIcon,
|
icon: XMarkIcon,
|
||||||
url: (_id) =>
|
visible: (objectData) => {
|
||||||
`/dashboard/production/filamentprofiles/info?filamentProfileId=${_id}&action=cancelEdit`,
|
return objectData?._isEditing && objectData?._isEditing == true
|
||||||
visible: (objectData) => objectData?._isEditing === true
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: 'finishEdit',
|
||||||
|
label: 'Save Edits',
|
||||||
|
type: 'page',
|
||||||
|
pageName: 'info',
|
||||||
|
icon: CheckIcon,
|
||||||
|
visible: (objectData) => {
|
||||||
|
return objectData?._isEditing && objectData?._isEditing == true
|
||||||
|
}
|
||||||
},
|
},
|
||||||
{ type: 'divider' },
|
{ type: 'divider' },
|
||||||
{
|
{
|
||||||
name: 'delete',
|
name: 'delete',
|
||||||
|
type: 'page',
|
||||||
|
pageName: 'info',
|
||||||
label: 'Delete',
|
label: 'Delete',
|
||||||
row: true,
|
row: true,
|
||||||
icon: BinIcon,
|
icon: BinIcon,
|
||||||
danger: true,
|
danger: true
|
||||||
url: (_id) =>
|
}
|
||||||
`/dashboard/production/filamentprofiles/info?filamentProfileId=${_id}&action=delete`
|
],
|
||||||
|
pages: [
|
||||||
|
{
|
||||||
|
name: 'info',
|
||||||
|
content: () => createElement(FilamentProfileInfo)
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
columns: ['_reference', 'name', 'filamentType', 'filament', 'updatedAt'],
|
columns: ['_reference', 'name', 'filamentType', 'filament', 'updatedAt'],
|
||||||
|
|||||||
@ -1,3 +1,8 @@
|
|||||||
|
import { createElement, lazy } from 'react'
|
||||||
|
|
||||||
|
const FilamentSkuInfo = lazy(
|
||||||
|
() => import('../../components/Dashboard/Management/FilamentSkus/FilamentSkuInfo')
|
||||||
|
)
|
||||||
import FilamentSkuIcon from '../../components/Icons/FilamentSkuIcon'
|
import FilamentSkuIcon from '../../components/Icons/FilamentSkuIcon'
|
||||||
import InfoCircleIcon from '../../components/Icons/InfoCircleIcon'
|
import InfoCircleIcon from '../../components/Icons/InfoCircleIcon'
|
||||||
import EditIcon from '../../components/Icons/EditIcon'
|
import EditIcon from '../../components/Icons/EditIcon'
|
||||||
@ -15,40 +20,40 @@ export const FilamentSku = {
|
|||||||
actions: [
|
actions: [
|
||||||
{
|
{
|
||||||
name: 'info',
|
name: 'info',
|
||||||
|
type: 'page',
|
||||||
|
pageName: 'info',
|
||||||
label: 'Info',
|
label: 'Info',
|
||||||
default: true,
|
default: true,
|
||||||
row: true,
|
row: true,
|
||||||
icon: InfoCircleIcon,
|
icon: InfoCircleIcon
|
||||||
url: (_id) =>
|
|
||||||
`/dashboard/management/filamentskus/info?filamentSkuId=${_id}`
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: 'edit',
|
name: 'edit',
|
||||||
|
type: 'page',
|
||||||
|
pageName: 'info',
|
||||||
label: 'Edit',
|
label: 'Edit',
|
||||||
row: true,
|
row: true,
|
||||||
icon: EditIcon,
|
icon: EditIcon,
|
||||||
url: (_id) =>
|
|
||||||
`/dashboard/management/filamentskus/info?filamentSkuId=${_id}&action=edit`,
|
|
||||||
visible: (objectData) => {
|
visible: (objectData) => {
|
||||||
return !(objectData?._isEditing && objectData?._isEditing == true)
|
return !(objectData?._isEditing && objectData?._isEditing == true)
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: 'finishEdit',
|
name: 'cancelEdit',
|
||||||
label: 'Save Edits',
|
label: 'Cancel Edits',
|
||||||
icon: CheckIcon,
|
type: 'page',
|
||||||
url: (_id) =>
|
pageName: 'info',
|
||||||
`/dashboard/management/filamentskus/info?filamentSkuId=${_id}&action=finishEdit`,
|
icon: XMarkIcon,
|
||||||
visible: (objectData) => {
|
visible: (objectData) => {
|
||||||
return objectData?._isEditing && objectData?._isEditing == true
|
return objectData?._isEditing && objectData?._isEditing == true
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: 'cancelEdit',
|
name: 'finishEdit',
|
||||||
label: 'Cancel Edits',
|
label: 'Save Edits',
|
||||||
icon: XMarkIcon,
|
type: 'page',
|
||||||
url: (_id) =>
|
pageName: 'info',
|
||||||
`/dashboard/management/filamentskus/info?filamentSkuId=${_id}&action=cancelEdit`,
|
icon: CheckIcon,
|
||||||
visible: (objectData) => {
|
visible: (objectData) => {
|
||||||
return objectData?._isEditing && objectData?._isEditing == true
|
return objectData?._isEditing && objectData?._isEditing == true
|
||||||
}
|
}
|
||||||
@ -56,11 +61,17 @@ export const FilamentSku = {
|
|||||||
{ type: 'divider' },
|
{ type: 'divider' },
|
||||||
{
|
{
|
||||||
name: 'delete',
|
name: 'delete',
|
||||||
|
type: 'page',
|
||||||
|
pageName: 'info',
|
||||||
label: 'Delete',
|
label: 'Delete',
|
||||||
icon: BinIcon,
|
icon: BinIcon,
|
||||||
danger: true,
|
danger: true
|
||||||
url: (_id) =>
|
}
|
||||||
`/dashboard/management/filamentskus/info?filamentSkuId=${_id}&action=delete`
|
],
|
||||||
|
pages: [
|
||||||
|
{
|
||||||
|
name: 'info',
|
||||||
|
content: () => createElement(FilamentSkuInfo)
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
columns: [
|
columns: [
|
||||||
|
|||||||
@ -1,3 +1,8 @@
|
|||||||
|
import { createElement, lazy } from 'react'
|
||||||
|
|
||||||
|
const FilamentStockInfo = lazy(
|
||||||
|
() => import('../../components/Dashboard/Inventory/FilamentStocks/FilamentStockInfo')
|
||||||
|
)
|
||||||
import FilamentStockIcon from '../../components/Icons/FilamentStockIcon'
|
import FilamentStockIcon from '../../components/Icons/FilamentStockIcon'
|
||||||
import InfoCircleIcon from '../../components/Icons/InfoCircleIcon'
|
import InfoCircleIcon from '../../components/Icons/InfoCircleIcon'
|
||||||
|
|
||||||
@ -11,12 +16,18 @@ export const FilamentStock = {
|
|||||||
actions: [
|
actions: [
|
||||||
{
|
{
|
||||||
name: 'info',
|
name: 'info',
|
||||||
|
type: 'page',
|
||||||
|
pageName: 'info',
|
||||||
label: 'Info',
|
label: 'Info',
|
||||||
default: true,
|
default: true,
|
||||||
row: true,
|
row: true,
|
||||||
icon: InfoCircleIcon,
|
icon: InfoCircleIcon
|
||||||
url: (_id) =>
|
}
|
||||||
`/dashboard/inventory/filamentstocks/info?filamentStockId=${_id}`
|
],
|
||||||
|
pages: [
|
||||||
|
{
|
||||||
|
name: 'info',
|
||||||
|
content: () => createElement(FilamentStockInfo)
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
columns: [
|
columns: [
|
||||||
|
|||||||
@ -1,3 +1,8 @@
|
|||||||
|
import { createElement, lazy } from 'react'
|
||||||
|
|
||||||
|
const FileInfo = lazy(
|
||||||
|
() => import('../../components/Dashboard/Management/Files/FileInfo')
|
||||||
|
)
|
||||||
import DownloadIcon from '../../components/Icons/DownloadIcon'
|
import DownloadIcon from '../../components/Icons/DownloadIcon'
|
||||||
import FileIcon from '../../components/Icons/FileIcon'
|
import FileIcon from '../../components/Icons/FileIcon'
|
||||||
import InfoCircleIcon from '../../components/Icons/InfoCircleIcon'
|
import InfoCircleIcon from '../../components/Icons/InfoCircleIcon'
|
||||||
@ -16,59 +21,66 @@ export const File = {
|
|||||||
actions: [
|
actions: [
|
||||||
{
|
{
|
||||||
name: 'info',
|
name: 'info',
|
||||||
|
type: 'page',
|
||||||
|
pageName: 'info',
|
||||||
label: 'Info',
|
label: 'Info',
|
||||||
default: true,
|
default: true,
|
||||||
row: true,
|
row: true,
|
||||||
icon: InfoCircleIcon,
|
icon: InfoCircleIcon
|
||||||
url: (_id) => `/dashboard/management/files/info?fileId=${_id}`
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: 'edit',
|
name: 'edit',
|
||||||
|
type: 'page',
|
||||||
|
pageName: 'info',
|
||||||
label: 'Edit',
|
label: 'Edit',
|
||||||
row: true,
|
row: true,
|
||||||
icon: EditIcon,
|
icon: EditIcon,
|
||||||
url: (_id) =>
|
|
||||||
`/dashboard/management/files/info?fileId=${_id}&action=edit`,
|
|
||||||
visible: (objectData) => {
|
visible: (objectData) => {
|
||||||
return !(objectData?._isEditing && objectData?._isEditing == true)
|
return !(objectData?._isEditing && objectData?._isEditing == true)
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: 'finishEdit',
|
name: 'cancelEdit',
|
||||||
label: 'Save Edits',
|
label: 'Cancel Edits',
|
||||||
icon: CheckIcon,
|
type: 'page',
|
||||||
url: (_id) =>
|
pageName: 'info',
|
||||||
`/dashboard/management/files/info?fileId=${_id}&action=finishEdit`,
|
icon: XMarkIcon,
|
||||||
visible: (objectData) => {
|
visible: (objectData) => {
|
||||||
return objectData?._isEditing && objectData?._isEditing == true
|
return objectData?._isEditing && objectData?._isEditing == true
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: 'cancelEdit',
|
name: 'finishEdit',
|
||||||
label: 'Cancel Edits',
|
label: 'Save Edits',
|
||||||
icon: XMarkIcon,
|
type: 'page',
|
||||||
url: (_id) =>
|
pageName: 'info',
|
||||||
`/dashboard/management/files/info?fileId=${_id}&action=cancelEdit`,
|
icon: CheckIcon,
|
||||||
visible: (objectData) => {
|
visible: (objectData) => {
|
||||||
return objectData?._isEditing && objectData?._isEditing == true
|
return objectData?._isEditing && objectData?._isEditing == true
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: 'download',
|
name: 'download',
|
||||||
|
type: 'page',
|
||||||
|
pageName: 'info',
|
||||||
label: 'Download',
|
label: 'Download',
|
||||||
row: true,
|
row: true,
|
||||||
icon: DownloadIcon,
|
icon: DownloadIcon
|
||||||
url: (_id) =>
|
|
||||||
`/dashboard/management/files/info?fileId=${_id}&action=download`
|
|
||||||
},
|
},
|
||||||
{ type: 'divider' },
|
{ type: 'divider' },
|
||||||
{
|
{
|
||||||
name: 'delete',
|
name: 'delete',
|
||||||
|
type: 'page',
|
||||||
|
pageName: 'info',
|
||||||
label: 'Delete',
|
label: 'Delete',
|
||||||
icon: BinIcon,
|
icon: BinIcon,
|
||||||
danger: true,
|
danger: true
|
||||||
url: (_id) =>
|
}
|
||||||
`/dashboard/management/files/info?fileId=${_id}&action=delete`
|
],
|
||||||
|
pages: [
|
||||||
|
{
|
||||||
|
name: 'info',
|
||||||
|
content: () => createElement(FileInfo)
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
columns: [
|
columns: [
|
||||||
|
|||||||
@ -1,3 +1,8 @@
|
|||||||
|
import { createElement, lazy } from 'react'
|
||||||
|
|
||||||
|
const GCodeFileInfo = lazy(
|
||||||
|
() => import('../../components/Dashboard/Production/GCodeFiles/GCodeFileInfo')
|
||||||
|
)
|
||||||
import DownloadIcon from '../../components/Icons/DownloadIcon'
|
import DownloadIcon from '../../components/Icons/DownloadIcon'
|
||||||
import EditIcon from '../../components/Icons/EditIcon'
|
import EditIcon from '../../components/Icons/EditIcon'
|
||||||
import CheckIcon from '../../components/Icons/CheckIcon'
|
import CheckIcon from '../../components/Icons/CheckIcon'
|
||||||
@ -24,50 +29,57 @@ export const GCodeFile = {
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: 'info',
|
name: 'info',
|
||||||
|
type: 'page',
|
||||||
|
pageName: 'info',
|
||||||
label: 'Info',
|
label: 'Info',
|
||||||
default: true,
|
default: true,
|
||||||
row: true,
|
row: true,
|
||||||
icon: InfoCircleIcon,
|
icon: InfoCircleIcon
|
||||||
url: (_id) => `/dashboard/production/gcodefiles/info?gcodeFileId=${_id}`
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: 'download',
|
name: 'download',
|
||||||
|
type: 'page',
|
||||||
|
pageName: 'info',
|
||||||
label: 'Download',
|
label: 'Download',
|
||||||
row: true,
|
row: true,
|
||||||
icon: DownloadIcon,
|
icon: DownloadIcon
|
||||||
url: (_id) =>
|
|
||||||
`/dashboard/production/gcodefiles/info?gcodeFileId=${_id}&action=download`
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: 'edit',
|
name: 'edit',
|
||||||
|
type: 'page',
|
||||||
|
pageName: 'info',
|
||||||
label: 'Edit',
|
label: 'Edit',
|
||||||
row: true,
|
row: true,
|
||||||
icon: EditIcon,
|
icon: EditIcon,
|
||||||
url: (_id) =>
|
|
||||||
`/dashboard/production/gcodefiles/info?gcodeFileId=${_id}&action=edit`,
|
|
||||||
visible: (objectData) => {
|
visible: (objectData) => {
|
||||||
return !(objectData?._isEditing && objectData?._isEditing == true)
|
return !(objectData?._isEditing && objectData?._isEditing == true)
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
, {
|
||||||
|
name: 'cancelEdit',
|
||||||
|
label: 'Cancel Edits',
|
||||||
|
type: 'page',
|
||||||
|
pageName: 'info',
|
||||||
|
icon: XMarkIcon,
|
||||||
|
visible: (objectData) => {
|
||||||
|
return objectData?._isEditing && objectData?._isEditing == true
|
||||||
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: 'finishEdit',
|
name: 'finishEdit',
|
||||||
label: 'Save Edits',
|
label: 'Save Edits',
|
||||||
|
type: 'page',
|
||||||
|
pageName: 'info',
|
||||||
icon: CheckIcon,
|
icon: CheckIcon,
|
||||||
url: (_id) =>
|
|
||||||
`/dashboard/production/gcodefiles/info?gcodeFileId=${_id}&action=finishEdit`,
|
|
||||||
visible: (objectData) => {
|
visible: (objectData) => {
|
||||||
return objectData?._isEditing && objectData?._isEditing == true
|
return objectData?._isEditing && objectData?._isEditing == true
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
],
|
||||||
|
pages: [
|
||||||
{
|
{
|
||||||
name: 'cancelEdit',
|
name: 'info',
|
||||||
label: 'Cancel Edits',
|
content: () => createElement(GCodeFileInfo)
|
||||||
icon: XMarkIcon,
|
|
||||||
url: (_id) =>
|
|
||||||
`/dashboard/production/gcodefiles/info?gcodeFileId=${_id}&action=cancelEdit`,
|
|
||||||
visible: (objectData) => {
|
|
||||||
return objectData?._isEditing && objectData?._isEditing == true
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
|
|
||||||
|
|||||||
@ -1,3 +1,11 @@
|
|||||||
|
import { createElement, lazy } from 'react'
|
||||||
|
|
||||||
|
const HostInfo = lazy(
|
||||||
|
() => import('../../components/Dashboard/Management/Hosts/HostInfo')
|
||||||
|
)
|
||||||
|
const HostOTP = lazy(
|
||||||
|
() => import('../../components/Dashboard/Management/Hosts/HostOtp')
|
||||||
|
)
|
||||||
import HostIcon from '../../components/Icons/HostIcon'
|
import HostIcon from '../../components/Icons/HostIcon'
|
||||||
import InfoCircleIcon from '../../components/Icons/InfoCircleIcon'
|
import InfoCircleIcon from '../../components/Icons/InfoCircleIcon'
|
||||||
import EditIcon from '../../components/Icons/EditIcon'
|
import EditIcon from '../../components/Icons/EditIcon'
|
||||||
@ -16,40 +24,40 @@ export const Host = {
|
|||||||
actions: [
|
actions: [
|
||||||
{
|
{
|
||||||
name: 'info',
|
name: 'info',
|
||||||
|
type: 'page',
|
||||||
|
pageName: 'info',
|
||||||
label: 'Info',
|
label: 'Info',
|
||||||
default: true,
|
default: true,
|
||||||
row: true,
|
row: true,
|
||||||
icon: InfoCircleIcon,
|
icon: InfoCircleIcon
|
||||||
url: (_id) => `/dashboard/management/hosts/info?hostId=${_id}`
|
|
||||||
},
|
},
|
||||||
|
|
||||||
{
|
{
|
||||||
name: 'edit',
|
name: 'edit',
|
||||||
|
type: 'page',
|
||||||
|
pageName: 'info',
|
||||||
label: 'Edit',
|
label: 'Edit',
|
||||||
row: true,
|
row: true,
|
||||||
icon: EditIcon,
|
icon: EditIcon,
|
||||||
url: (_id) =>
|
|
||||||
`/dashboard/management/hosts/info?hostId=${_id}&action=edit`,
|
|
||||||
visible: (objectData) => {
|
visible: (objectData) => {
|
||||||
return !(objectData?._isEditing && objectData?._isEditing == true)
|
return !(objectData?._isEditing && objectData?._isEditing == true)
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: 'finishEdit',
|
name: 'cancelEdit',
|
||||||
label: 'Save Edits',
|
label: 'Cancel Edits',
|
||||||
icon: CheckIcon,
|
type: 'page',
|
||||||
url: (_id) =>
|
pageName: 'info',
|
||||||
`/dashboard/management/hosts/info?hostId=${_id}&action=finishEdit`,
|
icon: XMarkIcon,
|
||||||
visible: (objectData) => {
|
visible: (objectData) => {
|
||||||
return objectData?._isEditing && objectData?._isEditing == true
|
return objectData?._isEditing && objectData?._isEditing == true
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: 'cancelEdit',
|
name: 'finishEdit',
|
||||||
label: 'Cancel Edits',
|
label: 'Save Edits',
|
||||||
icon: XMarkIcon,
|
type: 'page',
|
||||||
url: (_id) =>
|
pageName: 'info',
|
||||||
`/dashboard/management/hosts/info?hostId=${_id}&action=cancelEdit`,
|
icon: CheckIcon,
|
||||||
visible: (objectData) => {
|
visible: (objectData) => {
|
||||||
return objectData?._isEditing && objectData?._isEditing == true
|
return objectData?._isEditing && objectData?._isEditing == true
|
||||||
}
|
}
|
||||||
@ -59,18 +67,27 @@ export const Host = {
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: 'connect',
|
name: 'connect',
|
||||||
|
type: 'modal',
|
||||||
|
modalWidth: 520,
|
||||||
label: 'Connect',
|
label: 'Connect',
|
||||||
icon: OTPIcon,
|
icon: OTPIcon,
|
||||||
url: (_id) =>
|
content: (objectData, { onOk } = {}) => {
|
||||||
`/dashboard/management/hosts/info?hostId=${_id}&action=hostOTP`
|
return createElement(HostOTP, { id: objectData._id, onOk })
|
||||||
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: 'delete',
|
name: 'delete',
|
||||||
|
type: 'page',
|
||||||
|
pageName: 'info',
|
||||||
label: 'Delete',
|
label: 'Delete',
|
||||||
icon: BinIcon,
|
icon: BinIcon,
|
||||||
danger: true,
|
danger: true
|
||||||
url: (_id) =>
|
}
|
||||||
`/dashboard/management/hosts/info?hostId=${_id}&action=delete`
|
],
|
||||||
|
pages: [
|
||||||
|
{
|
||||||
|
name: 'info',
|
||||||
|
content: () => createElement(HostInfo)
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
columns: ['_reference', 'name', 'state', 'tags', 'connectedAt'],
|
columns: ['_reference', 'name', 'state', 'tags', 'connectedAt'],
|
||||||
|
|||||||
@ -1,3 +1,17 @@
|
|||||||
|
import { createElement, lazy } from 'react'
|
||||||
|
|
||||||
|
const InvoiceInfo = lazy(
|
||||||
|
() => import('../../components/Dashboard/Finance/Invoices/InvoiceInfo')
|
||||||
|
)
|
||||||
|
const PostInvoice = lazy(
|
||||||
|
() => import('../../components/Dashboard/Finance/Invoices/PostInvoice')
|
||||||
|
)
|
||||||
|
const AcknowledgeInvoice = lazy(
|
||||||
|
() => import('../../components/Dashboard/Finance/Invoices/AcknowledgeInvoice')
|
||||||
|
)
|
||||||
|
const NewPayment = lazy(
|
||||||
|
() => import('../../components/Dashboard/Finance/Payments/NewPayment')
|
||||||
|
)
|
||||||
import InvoiceIcon from '../../components/Icons/InvoiceIcon'
|
import InvoiceIcon from '../../components/Icons/InvoiceIcon'
|
||||||
import InfoCircleIcon from '../../components/Icons/InfoCircleIcon'
|
import InfoCircleIcon from '../../components/Icons/InfoCircleIcon'
|
||||||
import CheckIcon from '../../components/Icons/CheckIcon'
|
import CheckIcon from '../../components/Icons/CheckIcon'
|
||||||
@ -16,19 +30,19 @@ export const Invoice = {
|
|||||||
actions: [
|
actions: [
|
||||||
{
|
{
|
||||||
name: 'info',
|
name: 'info',
|
||||||
|
type: 'page',
|
||||||
|
pageName: 'info',
|
||||||
label: 'Info',
|
label: 'Info',
|
||||||
default: true,
|
default: true,
|
||||||
row: true,
|
row: true,
|
||||||
icon: InfoCircleIcon,
|
icon: InfoCircleIcon
|
||||||
url: (_id) => `/dashboard/finance/invoices/info?invoiceId=${_id}`
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: 'edit',
|
name: 'edit',
|
||||||
|
type: 'page',
|
||||||
|
pageName: 'info',
|
||||||
label: 'Edit',
|
label: 'Edit',
|
||||||
type: 'button',
|
|
||||||
icon: EditIcon,
|
icon: EditIcon,
|
||||||
url: (_id) =>
|
|
||||||
`/dashboard/finance/invoices/info?invoiceId=${_id}&action=edit`,
|
|
||||||
visible: (objectData) => {
|
visible: (objectData) => {
|
||||||
return !(objectData?._isEditing && objectData?._isEditing == true)
|
return !(objectData?._isEditing && objectData?._isEditing == true)
|
||||||
},
|
},
|
||||||
@ -38,34 +52,31 @@ export const Invoice = {
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: 'cancelEdit',
|
name: 'cancelEdit',
|
||||||
label: 'Cancel Edit',
|
label: 'Cancel Edits',
|
||||||
type: 'button',
|
type: 'page',
|
||||||
|
pageName: 'info',
|
||||||
icon: XMarkIcon,
|
icon: XMarkIcon,
|
||||||
url: (_id) =>
|
|
||||||
`/dashboard/finance/invoices/info?invoiceId=${_id}&action=cancelEdit`,
|
|
||||||
visible: (objectData) => {
|
visible: (objectData) => {
|
||||||
return objectData?._isEditing && objectData?._isEditing == true
|
return objectData?._isEditing && objectData?._isEditing == true
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: 'finishEdit',
|
name: 'finishEdit',
|
||||||
label: 'Finish Edit',
|
label: 'Save Edits',
|
||||||
type: 'button',
|
type: 'page',
|
||||||
|
pageName: 'info',
|
||||||
icon: CheckIcon,
|
icon: CheckIcon,
|
||||||
url: (_id) =>
|
|
||||||
`/dashboard/finance/invoices/info?invoiceId=${_id}&action=finishEdit`,
|
|
||||||
visible: (objectData) => {
|
visible: (objectData) => {
|
||||||
return objectData?._isEditing && objectData?._isEditing == true
|
return objectData?._isEditing && objectData?._isEditing == true
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: 'delete',
|
name: 'delete',
|
||||||
|
type: 'page',
|
||||||
|
pageName: 'info',
|
||||||
label: 'Delete',
|
label: 'Delete',
|
||||||
type: 'button',
|
|
||||||
icon: BinIcon,
|
icon: BinIcon,
|
||||||
danger: true,
|
danger: true,
|
||||||
url: (_id) =>
|
|
||||||
`/dashboard/finance/invoices/info?invoiceId=${_id}&action=delete`,
|
|
||||||
visible: (objectData) => {
|
visible: (objectData) => {
|
||||||
return !(objectData?._isEditing && objectData?._isEditing == true)
|
return !(objectData?._isEditing && objectData?._isEditing == true)
|
||||||
},
|
},
|
||||||
@ -76,47 +87,59 @@ export const Invoice = {
|
|||||||
{ type: 'divider' },
|
{ type: 'divider' },
|
||||||
{
|
{
|
||||||
name: 'newPayment',
|
name: 'newPayment',
|
||||||
|
type: 'modal',
|
||||||
|
modalWidth: 700,
|
||||||
label: 'New Payment',
|
label: 'New Payment',
|
||||||
type: 'button',
|
|
||||||
icon: PlusIcon,
|
icon: PlusIcon,
|
||||||
url: (_id) =>
|
|
||||||
`/dashboard/finance/invoices/info?invoiceId=${_id}&action=newPayment`,
|
|
||||||
disabled: (objectData) => {
|
disabled: (objectData) => {
|
||||||
const allowedStates = ['acknowledged', 'partiallyPaid', 'overdue']
|
const allowedStates = ['acknowledged', 'partiallyPaid', 'overdue']
|
||||||
return !allowedStates.includes(objectData?.state?.type)
|
return !allowedStates.includes(objectData?.state?.type)
|
||||||
|
},
|
||||||
|
content: (objectData, { onOk } = {}) => {
|
||||||
|
return createElement(NewPayment, {
|
||||||
|
defaultValues: {
|
||||||
|
invoice: objectData,
|
||||||
|
amount: objectData?.grandTotalAmount
|
||||||
|
},
|
||||||
|
onOk,
|
||||||
|
reset: true
|
||||||
|
})
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{ type: 'divider' },
|
{ type: 'divider' },
|
||||||
{
|
{
|
||||||
name: 'post',
|
name: 'post',
|
||||||
|
type: 'modal',
|
||||||
|
modalWidth: 520,
|
||||||
label: 'Post',
|
label: 'Post',
|
||||||
type: 'button',
|
|
||||||
icon: CheckIcon,
|
icon: CheckIcon,
|
||||||
url: (_id) =>
|
|
||||||
`/dashboard/finance/invoices/info?invoiceId=${_id}&action=post`,
|
|
||||||
visible: (objectData) => {
|
visible: (objectData) => {
|
||||||
return objectData?.state?.type == 'draft'
|
return objectData?.state?.type == 'draft'
|
||||||
|
},
|
||||||
|
content: (objectData, { onOk } = {}) => {
|
||||||
|
return createElement(PostInvoice, { objectData, onOk })
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: 'acknowledge',
|
name: 'acknowledge',
|
||||||
|
type: 'modal',
|
||||||
|
modalWidth: 520,
|
||||||
label: 'Acknowledge',
|
label: 'Acknowledge',
|
||||||
type: 'button',
|
|
||||||
icon: CheckIcon,
|
icon: CheckIcon,
|
||||||
url: (_id) =>
|
|
||||||
`/dashboard/finance/invoices/info?invoiceId=${_id}&action=acknowledge`,
|
|
||||||
visible: (objectData) => {
|
visible: (objectData) => {
|
||||||
return objectData?.state?.type == 'sent'
|
return objectData?.state?.type == 'sent'
|
||||||
|
},
|
||||||
|
content: (objectData, { onOk } = {}) => {
|
||||||
|
return createElement(AcknowledgeInvoice, { objectData, onOk })
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: 'cancel',
|
name: 'cancel',
|
||||||
|
type: 'page',
|
||||||
|
pageName: 'info',
|
||||||
label: 'Cancel',
|
label: 'Cancel',
|
||||||
type: 'button',
|
|
||||||
icon: XMarkIcon,
|
icon: XMarkIcon,
|
||||||
danger: true,
|
danger: true,
|
||||||
url: (_id) =>
|
|
||||||
`/dashboard/finance/invoices/info?invoiceId=${_id}&action=cancel`,
|
|
||||||
disabled: (objectData) => {
|
disabled: (objectData) => {
|
||||||
const allowedStates = [
|
const allowedStates = [
|
||||||
'acknowledged',
|
'acknowledged',
|
||||||
@ -131,6 +154,12 @@ export const Invoice = {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
|
pages: [
|
||||||
|
{
|
||||||
|
name: 'info',
|
||||||
|
content: () => createElement(InvoiceInfo)
|
||||||
|
}
|
||||||
|
],
|
||||||
group: ['orderType'],
|
group: ['orderType'],
|
||||||
filters: [
|
filters: [
|
||||||
'vendor',
|
'vendor',
|
||||||
|
|||||||
@ -1,3 +1,11 @@
|
|||||||
|
import { createElement, lazy } from 'react'
|
||||||
|
|
||||||
|
const JobInfo = lazy(
|
||||||
|
() => import('../../components/Dashboard/Production/Jobs/JobInfo')
|
||||||
|
)
|
||||||
|
const DeployJob = lazy(
|
||||||
|
() => import('../../components/Dashboard/Production/Jobs/DeployJob')
|
||||||
|
)
|
||||||
import JobIcon from '../../components/Icons/JobIcon'
|
import JobIcon from '../../components/Icons/JobIcon'
|
||||||
import InfoCircleIcon from '../../components/Icons/InfoCircleIcon'
|
import InfoCircleIcon from '../../components/Icons/InfoCircleIcon'
|
||||||
import CheckIcon from '../../components/Icons/CheckIcon'
|
import CheckIcon from '../../components/Icons/CheckIcon'
|
||||||
@ -16,18 +24,19 @@ export const Job = {
|
|||||||
actions: [
|
actions: [
|
||||||
{
|
{
|
||||||
name: 'info',
|
name: 'info',
|
||||||
|
type: 'page',
|
||||||
|
pageName: 'info',
|
||||||
label: 'Info',
|
label: 'Info',
|
||||||
default: true,
|
default: true,
|
||||||
row: true,
|
row: true,
|
||||||
icon: InfoCircleIcon,
|
icon: InfoCircleIcon
|
||||||
url: (_id) => `/dashboard/production/jobs/info?jobId=${_id}`
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: 'edit',
|
name: 'edit',
|
||||||
|
type: 'page',
|
||||||
|
pageName: 'info',
|
||||||
label: 'Edit',
|
label: 'Edit',
|
||||||
type: 'button',
|
|
||||||
icon: EditIcon,
|
icon: EditIcon,
|
||||||
url: (_id) => `/dashboard/production/jobs/info?jobId=${_id}&action=edit`,
|
|
||||||
visible: (objectData) => {
|
visible: (objectData) => {
|
||||||
return !(objectData?._isEditing && objectData?._isEditing == true)
|
return !(objectData?._isEditing && objectData?._isEditing == true)
|
||||||
},
|
},
|
||||||
@ -37,34 +46,31 @@ export const Job = {
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: 'cancelEdit',
|
name: 'cancelEdit',
|
||||||
label: 'Cancel Edit',
|
label: 'Cancel Edits',
|
||||||
type: 'button',
|
type: 'page',
|
||||||
|
pageName: 'info',
|
||||||
icon: XMarkIcon,
|
icon: XMarkIcon,
|
||||||
url: (_id) =>
|
|
||||||
`/dashboard/production/jobs/info?jobId=${_id}&action=cancelEdit`,
|
|
||||||
visible: (objectData) => {
|
visible: (objectData) => {
|
||||||
return objectData?._isEditing && objectData?._isEditing == true
|
return objectData?._isEditing && objectData?._isEditing == true
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: 'finishEdit',
|
name: 'finishEdit',
|
||||||
label: 'Finish Edit',
|
label: 'Save Edits',
|
||||||
type: 'button',
|
type: 'page',
|
||||||
|
pageName: 'info',
|
||||||
icon: CheckIcon,
|
icon: CheckIcon,
|
||||||
url: (_id) =>
|
|
||||||
`/dashboard/production/jobs/info?jobId=${_id}&action=finishEdit`,
|
|
||||||
visible: (objectData) => {
|
visible: (objectData) => {
|
||||||
return objectData?._isEditing && objectData?._isEditing == true
|
return objectData?._isEditing && objectData?._isEditing == true
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: 'delete',
|
name: 'delete',
|
||||||
|
type: 'page',
|
||||||
|
pageName: 'info',
|
||||||
label: 'Delete',
|
label: 'Delete',
|
||||||
type: 'button',
|
|
||||||
icon: BinIcon,
|
icon: BinIcon,
|
||||||
danger: true,
|
danger: true,
|
||||||
url: (_id) =>
|
|
||||||
`/dashboard/production/jobs/info?jobId=${_id}&action=delete`,
|
|
||||||
visible: (objectData) => {
|
visible: (objectData) => {
|
||||||
return !(objectData?._isEditing && objectData?._isEditing == true)
|
return !(objectData?._isEditing && objectData?._isEditing == true)
|
||||||
},
|
},
|
||||||
@ -75,17 +81,26 @@ export const Job = {
|
|||||||
{ type: 'divider' },
|
{ type: 'divider' },
|
||||||
{
|
{
|
||||||
name: 'deploy',
|
name: 'deploy',
|
||||||
|
type: 'modal',
|
||||||
|
modalWidth: 680,
|
||||||
label: 'Deploy',
|
label: 'Deploy',
|
||||||
default: true,
|
default: true,
|
||||||
row: true,
|
row: true,
|
||||||
icon: CheckIcon,
|
icon: CheckIcon,
|
||||||
url: (_id) =>
|
|
||||||
`/dashboard/production/jobs/info?jobId=${_id}&action=deploy`,
|
|
||||||
disabled: (objectData) => {
|
disabled: (objectData) => {
|
||||||
return objectData?.state?.type != 'draft'
|
return objectData?.state?.type != 'draft'
|
||||||
|
},
|
||||||
|
content: (objectData, { onOk } = {}) => {
|
||||||
|
return createElement(DeployJob, { objectData, onOk })
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
|
pages: [
|
||||||
|
{
|
||||||
|
name: 'info',
|
||||||
|
content: () => createElement(JobInfo)
|
||||||
|
}
|
||||||
|
],
|
||||||
columns: ['_reference', 'quantity', 'state', 'gcodeFile', 'createdAt'],
|
columns: ['_reference', 'quantity', 'state', 'gcodeFile', 'createdAt'],
|
||||||
filters: [
|
filters: [
|
||||||
'state',
|
'state',
|
||||||
@ -96,13 +111,7 @@ export const Job = {
|
|||||||
'createdAt',
|
'createdAt',
|
||||||
'updatedAt'
|
'updatedAt'
|
||||||
],
|
],
|
||||||
sorters: [
|
sorters: ['createdAt', 'state', 'quantity', 'gcodeFile', 'updatedAt'],
|
||||||
'createdAt',
|
|
||||||
'state',
|
|
||||||
'quantity',
|
|
||||||
'gcodeFile',
|
|
||||||
'updatedAt'
|
|
||||||
],
|
|
||||||
properties: [
|
properties: [
|
||||||
{
|
{
|
||||||
name: '_id',
|
name: '_id',
|
||||||
|
|||||||
@ -1,3 +1,17 @@
|
|||||||
|
import { createElement, lazy } from 'react'
|
||||||
|
|
||||||
|
const ListingInfo = lazy(
|
||||||
|
() => import('../../components/Dashboard/Sales/Listings/ListingInfo')
|
||||||
|
)
|
||||||
|
const NewListingVarient = lazy(
|
||||||
|
() => import('../../components/Dashboard/Sales/ListingVarients/NewListingVarient')
|
||||||
|
)
|
||||||
|
const PublishListing = lazy(
|
||||||
|
() => import('../../components/Dashboard/Sales/Listings/PublishListing')
|
||||||
|
)
|
||||||
|
const UnpublishListing = lazy(
|
||||||
|
() => import('../../components/Dashboard/Sales/Listings/UnpublishListing')
|
||||||
|
)
|
||||||
import ListingIcon from '../../components/Icons/ListingIcon'
|
import ListingIcon from '../../components/Icons/ListingIcon'
|
||||||
import InfoCircleIcon from '../../components/Icons/InfoCircleIcon'
|
import InfoCircleIcon from '../../components/Icons/InfoCircleIcon'
|
||||||
import EditIcon from '../../components/Icons/EditIcon'
|
import EditIcon from '../../components/Icons/EditIcon'
|
||||||
@ -16,39 +30,40 @@ export const Listing = {
|
|||||||
actions: [
|
actions: [
|
||||||
{
|
{
|
||||||
name: 'info',
|
name: 'info',
|
||||||
|
type: 'page',
|
||||||
|
pageName: 'info',
|
||||||
label: 'Info',
|
label: 'Info',
|
||||||
default: true,
|
default: true,
|
||||||
row: true,
|
row: true,
|
||||||
icon: InfoCircleIcon,
|
icon: InfoCircleIcon
|
||||||
url: (_id) => `/dashboard/sales/listings/info?listingId=${_id}`
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: 'edit',
|
name: 'edit',
|
||||||
|
type: 'page',
|
||||||
|
pageName: 'info',
|
||||||
label: 'Edit',
|
label: 'Edit',
|
||||||
row: true,
|
row: true,
|
||||||
icon: EditIcon,
|
icon: EditIcon,
|
||||||
url: (_id) =>
|
|
||||||
`/dashboard/sales/listings/info?listingId=${_id}&action=edit`,
|
|
||||||
visible: (objectData) => {
|
visible: (objectData) => {
|
||||||
return !(objectData?._isEditing && objectData?._isEditing == true)
|
return !(objectData?._isEditing && objectData?._isEditing == true)
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: 'finishEdit',
|
name: 'cancelEdit',
|
||||||
label: 'Save Edits',
|
label: 'Cancel Edits',
|
||||||
icon: CheckIcon,
|
type: 'page',
|
||||||
url: (_id) =>
|
pageName: 'info',
|
||||||
`/dashboard/sales/listings/info?listingId=${_id}&action=finishEdit`,
|
icon: XMarkIcon,
|
||||||
visible: (objectData) => {
|
visible: (objectData) => {
|
||||||
return objectData?._isEditing && objectData?._isEditing == true
|
return objectData?._isEditing && objectData?._isEditing == true
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: 'cancelEdit',
|
name: 'finishEdit',
|
||||||
label: 'Cancel Edits',
|
label: 'Save Edits',
|
||||||
icon: XMarkIcon,
|
type: 'page',
|
||||||
url: (_id) =>
|
pageName: 'info',
|
||||||
`/dashboard/sales/listings/info?listingId=${_id}&action=cancelEdit`,
|
icon: CheckIcon,
|
||||||
visible: (objectData) => {
|
visible: (objectData) => {
|
||||||
return objectData?._isEditing && objectData?._isEditing == true
|
return objectData?._isEditing && objectData?._isEditing == true
|
||||||
}
|
}
|
||||||
@ -56,44 +71,56 @@ export const Listing = {
|
|||||||
{ type: 'divider' },
|
{ type: 'divider' },
|
||||||
{
|
{
|
||||||
name: 'newListingVarient',
|
name: 'newListingVarient',
|
||||||
|
type: 'modal',
|
||||||
|
modalWidth: 700,
|
||||||
label: 'New Listing Varient',
|
label: 'New Listing Varient',
|
||||||
type: 'button',
|
|
||||||
icon: PlusIcon,
|
icon: PlusIcon,
|
||||||
url: (_id) =>
|
content: (objectData, { onOk } = {}) => {
|
||||||
`/dashboard/sales/listings/info?listingId=${_id}&action=newListingVarient`
|
return createElement(NewListingVarient, { defaultValues: { listing: objectData }, onOk, reset: true })
|
||||||
|
}
|
||||||
},
|
},
|
||||||
{ type: 'divider' },
|
{ type: 'divider' },
|
||||||
{
|
{
|
||||||
name: 'publish',
|
name: 'publish',
|
||||||
|
type: 'modal',
|
||||||
|
modalWidth: 520,
|
||||||
label: 'Publish',
|
label: 'Publish',
|
||||||
type: 'button',
|
|
||||||
icon: CheckIcon,
|
icon: CheckIcon,
|
||||||
url: (_id) =>
|
|
||||||
`/dashboard/sales/listings/info?listingId=${_id}&action=publish`,
|
|
||||||
visible: (objectData) =>
|
visible: (objectData) =>
|
||||||
objectData?.state?.type === 'draft' ||
|
objectData?.state?.type === 'draft' ||
|
||||||
objectData?.state?.type === 'inactive',
|
objectData?.state?.type === 'inactive',
|
||||||
disabled: (objectData) => objectData?.state?.type === 'syncing'
|
disabled: (objectData) => objectData?.state?.type === 'syncing',
|
||||||
|
content: (objectData, { onOk } = {}) => {
|
||||||
|
return createElement(PublishListing, { objectData, onOk })
|
||||||
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: 'unpublish',
|
name: 'unpublish',
|
||||||
|
type: 'modal',
|
||||||
|
modalWidth: 520,
|
||||||
label: 'Unpublish',
|
label: 'Unpublish',
|
||||||
type: 'button',
|
|
||||||
icon: XMarkIcon,
|
icon: XMarkIcon,
|
||||||
danger: true,
|
danger: true,
|
||||||
url: (_id) =>
|
|
||||||
`/dashboard/sales/listings/info?listingId=${_id}&action=unpublish`,
|
|
||||||
visible: (objectData) => objectData?.state?.type === 'active',
|
visible: (objectData) => objectData?.state?.type === 'active',
|
||||||
disabled: (objectData) => objectData?.state?.type === 'syncing'
|
disabled: (objectData) => objectData?.state?.type === 'syncing',
|
||||||
|
content: (objectData, { onOk } = {}) => {
|
||||||
|
return createElement(UnpublishListing, { objectData, onOk })
|
||||||
|
}
|
||||||
},
|
},
|
||||||
{ type: 'divider' },
|
{ type: 'divider' },
|
||||||
{
|
{
|
||||||
name: 'delete',
|
name: 'delete',
|
||||||
|
type: 'page',
|
||||||
|
pageName: 'info',
|
||||||
label: 'Delete',
|
label: 'Delete',
|
||||||
icon: BinIcon,
|
icon: BinIcon,
|
||||||
danger: true,
|
danger: true
|
||||||
url: (_id) =>
|
}
|
||||||
`/dashboard/sales/listings/info?listingId=${_id}&action=delete`
|
],
|
||||||
|
pages: [
|
||||||
|
{
|
||||||
|
name: 'info',
|
||||||
|
content: () => createElement(ListingInfo)
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
columns: [
|
columns: [
|
||||||
|
|||||||
@ -1,3 +1,14 @@
|
|||||||
|
import { createElement, lazy } from 'react'
|
||||||
|
|
||||||
|
const ListingVarientInfo = lazy(
|
||||||
|
() => import('../../components/Dashboard/Sales/ListingVarients/ListingVarientInfo')
|
||||||
|
)
|
||||||
|
const PublishListingVarient = lazy(
|
||||||
|
() => import('../../components/Dashboard/Sales/ListingVarients/PublishListingVarient')
|
||||||
|
)
|
||||||
|
const UnpublishListingVarient = lazy(
|
||||||
|
() => import('../../components/Dashboard/Sales/ListingVarients/UnpublishListingVarient')
|
||||||
|
)
|
||||||
import ListingVarientIcon from '../../components/Icons/ListingVarientIcon'
|
import ListingVarientIcon from '../../components/Icons/ListingVarientIcon'
|
||||||
import InfoCircleIcon from '../../components/Icons/InfoCircleIcon'
|
import InfoCircleIcon from '../../components/Icons/InfoCircleIcon'
|
||||||
import EditIcon from '../../components/Icons/EditIcon'
|
import EditIcon from '../../components/Icons/EditIcon'
|
||||||
@ -7,6 +18,7 @@ import BinIcon from '../../components/Icons/BinIcon'
|
|||||||
|
|
||||||
export const ListingVarient = {
|
export const ListingVarient = {
|
||||||
name: 'listingVarient',
|
name: 'listingVarient',
|
||||||
|
url: '/dashboard/sales/listingvarients',
|
||||||
label: 'Listing Varient',
|
label: 'Listing Varient',
|
||||||
labelPlural: 'Listing Varients',
|
labelPlural: 'Listing Varients',
|
||||||
prefix: 'LVR',
|
prefix: 'LVR',
|
||||||
@ -14,40 +26,40 @@ export const ListingVarient = {
|
|||||||
actions: [
|
actions: [
|
||||||
{
|
{
|
||||||
name: 'info',
|
name: 'info',
|
||||||
|
type: 'page',
|
||||||
|
pageName: 'info',
|
||||||
label: 'Info',
|
label: 'Info',
|
||||||
default: true,
|
default: true,
|
||||||
row: true,
|
row: true,
|
||||||
icon: InfoCircleIcon,
|
icon: InfoCircleIcon
|
||||||
url: (_id) =>
|
|
||||||
`/dashboard/sales/listingvarients/info?listingVarientId=${_id}`
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: 'edit',
|
name: 'edit',
|
||||||
|
type: 'page',
|
||||||
|
pageName: 'info',
|
||||||
label: 'Edit',
|
label: 'Edit',
|
||||||
row: true,
|
row: true,
|
||||||
icon: EditIcon,
|
icon: EditIcon,
|
||||||
url: (_id) =>
|
|
||||||
`/dashboard/sales/listingvarients/info?listingVarientId=${_id}&action=edit`,
|
|
||||||
visible: (objectData) => {
|
visible: (objectData) => {
|
||||||
return !(objectData?._isEditing && objectData?._isEditing == true)
|
return !(objectData?._isEditing && objectData?._isEditing == true)
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: 'finishEdit',
|
name: 'cancelEdit',
|
||||||
label: 'Save Edits',
|
label: 'Cancel Edits',
|
||||||
icon: CheckIcon,
|
type: 'page',
|
||||||
url: (_id) =>
|
pageName: 'info',
|
||||||
`/dashboard/sales/listingvarients/info?listingVarientId=${_id}&action=finishEdit`,
|
icon: XMarkIcon,
|
||||||
visible: (objectData) => {
|
visible: (objectData) => {
|
||||||
return objectData?._isEditing && objectData?._isEditing == true
|
return objectData?._isEditing && objectData?._isEditing == true
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: 'cancelEdit',
|
name: 'finishEdit',
|
||||||
label: 'Cancel Edits',
|
label: 'Save Edits',
|
||||||
icon: XMarkIcon,
|
type: 'page',
|
||||||
url: (_id) =>
|
pageName: 'info',
|
||||||
`/dashboard/sales/listingvarients/info?listingVarientId=${_id}&action=cancelEdit`,
|
icon: CheckIcon,
|
||||||
visible: (objectData) => {
|
visible: (objectData) => {
|
||||||
return objectData?._isEditing && objectData?._isEditing == true
|
return objectData?._isEditing && objectData?._isEditing == true
|
||||||
}
|
}
|
||||||
@ -55,35 +67,45 @@ export const ListingVarient = {
|
|||||||
{ type: 'divider' },
|
{ type: 'divider' },
|
||||||
{
|
{
|
||||||
name: 'publish',
|
name: 'publish',
|
||||||
|
type: 'modal',
|
||||||
|
modalWidth: 520,
|
||||||
label: 'Publish',
|
label: 'Publish',
|
||||||
type: 'button',
|
|
||||||
icon: CheckIcon,
|
icon: CheckIcon,
|
||||||
url: (_id) =>
|
|
||||||
`/dashboard/sales/listingvarients/info?listingVarientId=${_id}&action=publish`,
|
|
||||||
visible: (objectData) =>
|
visible: (objectData) =>
|
||||||
objectData?.state?.type === 'draft' ||
|
objectData?.state?.type === 'draft' ||
|
||||||
objectData?.state?.type === 'inactive',
|
objectData?.state?.type === 'inactive',
|
||||||
disabled: (objectData) => objectData?.state?.type === 'syncing'
|
disabled: (objectData) => objectData?.state?.type === 'syncing',
|
||||||
|
content: (objectData, { onOk } = {}) => {
|
||||||
|
return createElement(PublishListingVarient, { objectData, onOk })
|
||||||
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: 'unpublish',
|
name: 'unpublish',
|
||||||
|
type: 'modal',
|
||||||
|
modalWidth: 520,
|
||||||
label: 'Unpublish',
|
label: 'Unpublish',
|
||||||
type: 'button',
|
|
||||||
icon: XMarkIcon,
|
icon: XMarkIcon,
|
||||||
danger: true,
|
danger: true,
|
||||||
url: (_id) =>
|
|
||||||
`/dashboard/sales/listingvarients/info?listingVarientId=${_id}&action=unpublish`,
|
|
||||||
visible: (objectData) => objectData?.state?.type === 'active',
|
visible: (objectData) => objectData?.state?.type === 'active',
|
||||||
disabled: (objectData) => objectData?.state?.type === 'syncing'
|
disabled: (objectData) => objectData?.state?.type === 'syncing',
|
||||||
|
content: (objectData, { onOk } = {}) => {
|
||||||
|
return createElement(UnpublishListingVarient, { objectData, onOk })
|
||||||
|
}
|
||||||
},
|
},
|
||||||
{ type: 'divider' },
|
{ type: 'divider' },
|
||||||
{
|
{
|
||||||
name: 'delete',
|
name: 'delete',
|
||||||
|
type: 'page',
|
||||||
|
pageName: 'info',
|
||||||
label: 'Delete',
|
label: 'Delete',
|
||||||
icon: BinIcon,
|
icon: BinIcon,
|
||||||
danger: true,
|
danger: true
|
||||||
url: (_id) =>
|
}
|
||||||
`/dashboard/sales/listingvarients/info?listingVarientId=${_id}&action=delete`
|
],
|
||||||
|
pages: [
|
||||||
|
{
|
||||||
|
name: 'info',
|
||||||
|
content: () => createElement(ListingVarientInfo)
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
columns: [
|
columns: [
|
||||||
|
|||||||
@ -1,3 +1,14 @@
|
|||||||
|
import { createElement, lazy } from 'react'
|
||||||
|
|
||||||
|
const MarketplaceInfo = lazy(
|
||||||
|
() => import('../../components/Dashboard/Sales/Marketplaces/MarketplaceInfo')
|
||||||
|
)
|
||||||
|
const SyncListings = lazy(
|
||||||
|
() => import('../../components/Dashboard/Sales/Marketplaces/SyncListings')
|
||||||
|
)
|
||||||
|
const SyncOrders = lazy(
|
||||||
|
() => import('../../components/Dashboard/Sales/Marketplaces/SyncOrders')
|
||||||
|
)
|
||||||
import MarketplaceIcon from '../../components/Icons/MarketplaceIcon'
|
import MarketplaceIcon from '../../components/Icons/MarketplaceIcon'
|
||||||
import InfoCircleIcon from '../../components/Icons/InfoCircleIcon'
|
import InfoCircleIcon from '../../components/Icons/InfoCircleIcon'
|
||||||
import EditIcon from '../../components/Icons/EditIcon'
|
import EditIcon from '../../components/Icons/EditIcon'
|
||||||
@ -17,39 +28,40 @@ export const Marketplace = {
|
|||||||
actions: [
|
actions: [
|
||||||
{
|
{
|
||||||
name: 'info',
|
name: 'info',
|
||||||
|
type: 'page',
|
||||||
|
pageName: 'info',
|
||||||
label: 'Info',
|
label: 'Info',
|
||||||
default: true,
|
default: true,
|
||||||
row: true,
|
row: true,
|
||||||
icon: InfoCircleIcon,
|
icon: InfoCircleIcon
|
||||||
url: (_id) => `/dashboard/sales/marketplaces/info?marketplaceId=${_id}`
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: 'edit',
|
name: 'edit',
|
||||||
|
type: 'page',
|
||||||
|
pageName: 'info',
|
||||||
label: 'Edit',
|
label: 'Edit',
|
||||||
row: true,
|
row: true,
|
||||||
icon: EditIcon,
|
icon: EditIcon,
|
||||||
url: (_id) =>
|
|
||||||
`/dashboard/sales/marketplaces/info?marketplaceId=${_id}&action=edit`,
|
|
||||||
visible: (objectData) => {
|
visible: (objectData) => {
|
||||||
return !(objectData?._isEditing && objectData?._isEditing == true)
|
return !(objectData?._isEditing && objectData?._isEditing == true)
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: 'finishEdit',
|
name: 'cancelEdit',
|
||||||
label: 'Save Edits',
|
label: 'Cancel Edits',
|
||||||
icon: CheckIcon,
|
type: 'page',
|
||||||
url: (_id) =>
|
pageName: 'info',
|
||||||
`/dashboard/sales/marketplaces/info?marketplaceId=${_id}&action=finishEdit`,
|
icon: XMarkIcon,
|
||||||
visible: (objectData) => {
|
visible: (objectData) => {
|
||||||
return objectData?._isEditing && objectData?._isEditing == true
|
return objectData?._isEditing && objectData?._isEditing == true
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: 'cancelEdit',
|
name: 'finishEdit',
|
||||||
label: 'Cancel Edits',
|
label: 'Save Edits',
|
||||||
icon: XMarkIcon,
|
type: 'page',
|
||||||
url: (_id) =>
|
pageName: 'info',
|
||||||
`/dashboard/sales/marketplaces/info?marketplaceId=${_id}&action=cancelEdit`,
|
icon: CheckIcon,
|
||||||
visible: (objectData) => {
|
visible: (objectData) => {
|
||||||
return objectData?._isEditing && objectData?._isEditing == true
|
return objectData?._isEditing && objectData?._isEditing == true
|
||||||
}
|
}
|
||||||
@ -57,34 +69,37 @@ export const Marketplace = {
|
|||||||
{ type: 'divider' },
|
{ type: 'divider' },
|
||||||
{
|
{
|
||||||
name: 'syncListings',
|
name: 'syncListings',
|
||||||
|
type: 'modal',
|
||||||
|
modalWidth: 520,
|
||||||
label: 'Sync Listings',
|
label: 'Sync Listings',
|
||||||
type: 'button',
|
|
||||||
icon: ReloadIcon,
|
icon: ReloadIcon,
|
||||||
url: (_id) =>
|
|
||||||
`/dashboard/sales/marketplaces/info?marketplaceId=${_id}&action=syncListings`,
|
|
||||||
disabled: (objectData) => {
|
disabled: (objectData) => {
|
||||||
return objectData?.state?.type != 'ready'
|
return objectData?.state?.type != 'ready'
|
||||||
|
},
|
||||||
|
content: (objectData, { onOk } = {}) => {
|
||||||
|
return createElement(SyncListings, { objectData, onOk })
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: 'syncOrders',
|
name: 'syncOrders',
|
||||||
|
type: 'modal',
|
||||||
|
modalWidth: 520,
|
||||||
label: 'Sync Orders',
|
label: 'Sync Orders',
|
||||||
type: 'button',
|
|
||||||
icon: ReloadIcon,
|
icon: ReloadIcon,
|
||||||
url: (_id) =>
|
|
||||||
`/dashboard/sales/marketplaces/info?marketplaceId=${_id}&action=syncOrders`,
|
|
||||||
disabled: (objectData) => {
|
disabled: (objectData) => {
|
||||||
return objectData?.state?.type != 'ready'
|
return objectData?.state?.type != 'ready'
|
||||||
|
},
|
||||||
|
content: (objectData, { onOk } = {}) => {
|
||||||
|
return createElement(SyncOrders, { objectData, onOk })
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{ type: 'divider' },
|
{ type: 'divider' },
|
||||||
{
|
{
|
||||||
name: 'connect',
|
name: 'connect',
|
||||||
|
type: 'page',
|
||||||
|
pageName: 'info',
|
||||||
label: 'Connect',
|
label: 'Connect',
|
||||||
type: 'button',
|
|
||||||
icon: LinkIcon,
|
icon: LinkIcon,
|
||||||
url: (_id) =>
|
|
||||||
`/dashboard/sales/marketplaces/info?marketplaceId=${_id}&action=connect`,
|
|
||||||
disabled: (objectData) => {
|
disabled: (objectData) => {
|
||||||
return (
|
return (
|
||||||
objectData?.state?.type == 'ready' ||
|
objectData?.state?.type == 'ready' ||
|
||||||
@ -95,22 +110,20 @@ export const Marketplace = {
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: 'reconnect',
|
name: 'reconnect',
|
||||||
|
type: 'page',
|
||||||
|
pageName: 'info',
|
||||||
label: 'Reconnect',
|
label: 'Reconnect',
|
||||||
type: 'button',
|
|
||||||
icon: LinkIcon,
|
icon: LinkIcon,
|
||||||
url: (_id) =>
|
|
||||||
`/dashboard/sales/marketplaces/info?marketplaceId=${_id}&action=reconnect`,
|
|
||||||
disabled: (objectData) => {
|
disabled: (objectData) => {
|
||||||
return objectData?.state?.type != 'ready'
|
return objectData?.state?.type != 'ready'
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: 'refreshToken',
|
name: 'refreshToken',
|
||||||
|
type: 'page',
|
||||||
|
pageName: 'info',
|
||||||
label: 'Refresh Token',
|
label: 'Refresh Token',
|
||||||
type: 'button',
|
|
||||||
icon: ReloadIcon,
|
icon: ReloadIcon,
|
||||||
url: (_id) =>
|
|
||||||
`/dashboard/sales/marketplaces/info?marketplaceId=${_id}&action=refreshToken`,
|
|
||||||
disabled: (objectData) => {
|
disabled: (objectData) => {
|
||||||
return objectData?.state?.type != 'ready'
|
return objectData?.state?.type != 'ready'
|
||||||
}
|
}
|
||||||
@ -118,11 +131,17 @@ export const Marketplace = {
|
|||||||
{ type: 'divider' },
|
{ type: 'divider' },
|
||||||
{
|
{
|
||||||
name: 'delete',
|
name: 'delete',
|
||||||
|
type: 'page',
|
||||||
|
pageName: 'info',
|
||||||
label: 'Delete',
|
label: 'Delete',
|
||||||
icon: BinIcon,
|
icon: BinIcon,
|
||||||
danger: true,
|
danger: true
|
||||||
url: (_id) =>
|
}
|
||||||
`/dashboard/sales/marketplaces/info?marketplaceId=${_id}&action=delete`
|
],
|
||||||
|
pages: [
|
||||||
|
{
|
||||||
|
name: 'info',
|
||||||
|
content: () => createElement(MarketplaceInfo)
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
columns: [
|
columns: [
|
||||||
|
|||||||
@ -1,3 +1,8 @@
|
|||||||
|
import { createElement, lazy } from 'react'
|
||||||
|
|
||||||
|
const MaterialInfo = lazy(
|
||||||
|
() => import('../../components/Dashboard/Management/Materials/MaterialInfo')
|
||||||
|
)
|
||||||
import MaterialIcon from '../../components/Icons/MaterialIcon'
|
import MaterialIcon from '../../components/Icons/MaterialIcon'
|
||||||
import InfoCircleIcon from '../../components/Icons/InfoCircleIcon'
|
import InfoCircleIcon from '../../components/Icons/InfoCircleIcon'
|
||||||
import EditIcon from '../../components/Icons/EditIcon'
|
import EditIcon from '../../components/Icons/EditIcon'
|
||||||
@ -15,39 +20,40 @@ export const Material = {
|
|||||||
actions: [
|
actions: [
|
||||||
{
|
{
|
||||||
name: 'info',
|
name: 'info',
|
||||||
|
type: 'page',
|
||||||
|
pageName: 'info',
|
||||||
label: 'Info',
|
label: 'Info',
|
||||||
default: true,
|
default: true,
|
||||||
row: true,
|
row: true,
|
||||||
icon: InfoCircleIcon,
|
icon: InfoCircleIcon
|
||||||
url: (_id) => `/dashboard/management/materials/info?materialId=${_id}`
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: 'edit',
|
name: 'edit',
|
||||||
|
type: 'page',
|
||||||
|
pageName: 'info',
|
||||||
label: 'Edit',
|
label: 'Edit',
|
||||||
row: true,
|
row: true,
|
||||||
icon: EditIcon,
|
icon: EditIcon,
|
||||||
url: (_id) =>
|
|
||||||
`/dashboard/management/materials/info?materialId=${_id}&action=edit`,
|
|
||||||
visible: (objectData) => {
|
visible: (objectData) => {
|
||||||
return !(objectData?._isEditing && objectData?._isEditing == true)
|
return !(objectData?._isEditing && objectData?._isEditing == true)
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: 'finishEdit',
|
name: 'cancelEdit',
|
||||||
label: 'Save Edits',
|
label: 'Cancel Edits',
|
||||||
icon: CheckIcon,
|
type: 'page',
|
||||||
url: (_id) =>
|
pageName: 'info',
|
||||||
`/dashboard/management/materials/info?materialId=${_id}&action=finishEdit`,
|
icon: XMarkIcon,
|
||||||
visible: (objectData) => {
|
visible: (objectData) => {
|
||||||
return objectData?._isEditing && objectData?._isEditing == true
|
return objectData?._isEditing && objectData?._isEditing == true
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: 'cancelEdit',
|
name: 'finishEdit',
|
||||||
label: 'Cancel Edits',
|
label: 'Save Edits',
|
||||||
icon: XMarkIcon,
|
type: 'page',
|
||||||
url: (_id) =>
|
pageName: 'info',
|
||||||
`/dashboard/management/materials/info?materialId=${_id}&action=cancelEdit`,
|
icon: CheckIcon,
|
||||||
visible: (objectData) => {
|
visible: (objectData) => {
|
||||||
return objectData?._isEditing && objectData?._isEditing == true
|
return objectData?._isEditing && objectData?._isEditing == true
|
||||||
}
|
}
|
||||||
@ -55,11 +61,17 @@ export const Material = {
|
|||||||
{ type: 'divider' },
|
{ type: 'divider' },
|
||||||
{
|
{
|
||||||
name: 'delete',
|
name: 'delete',
|
||||||
|
type: 'page',
|
||||||
|
pageName: 'info',
|
||||||
label: 'Delete',
|
label: 'Delete',
|
||||||
icon: BinIcon,
|
icon: BinIcon,
|
||||||
danger: true,
|
danger: true
|
||||||
url: (_id) =>
|
}
|
||||||
`/dashboard/management/materials/info?materialId=${_id}&action=delete`
|
],
|
||||||
|
pages: [
|
||||||
|
{
|
||||||
|
name: 'info',
|
||||||
|
content: () => createElement(MaterialInfo)
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
columns: ['_reference', 'name', 'tags', 'createdAt', 'updatedAt'],
|
columns: ['_reference', 'name', 'tags', 'createdAt', 'updatedAt'],
|
||||||
|
|||||||
@ -1,3 +1,8 @@
|
|||||||
|
import { createElement, lazy } from 'react'
|
||||||
|
|
||||||
|
const NoteTypeInfo = lazy(
|
||||||
|
() => import('../../components/Dashboard/Management/NoteTypes/NoteTypeInfo')
|
||||||
|
)
|
||||||
import NoteTypeIcon from '../../components/Icons/NoteTypeIcon'
|
import NoteTypeIcon from '../../components/Icons/NoteTypeIcon'
|
||||||
import InfoCircleIcon from '../../components/Icons/InfoCircleIcon'
|
import InfoCircleIcon from '../../components/Icons/InfoCircleIcon'
|
||||||
import EditIcon from '../../components/Icons/EditIcon'
|
import EditIcon from '../../components/Icons/EditIcon'
|
||||||
@ -14,42 +19,49 @@ export const NoteType = {
|
|||||||
actions: [
|
actions: [
|
||||||
{
|
{
|
||||||
name: 'info',
|
name: 'info',
|
||||||
|
type: 'page',
|
||||||
|
pageName: 'info',
|
||||||
label: 'Info',
|
label: 'Info',
|
||||||
default: true,
|
default: true,
|
||||||
row: true,
|
row: true,
|
||||||
icon: InfoCircleIcon,
|
icon: InfoCircleIcon
|
||||||
url: (_id) => `/dashboard/management/notetypes/info?noteTypeId=${_id}`
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: 'edit',
|
name: 'edit',
|
||||||
|
type: 'page',
|
||||||
|
pageName: 'info',
|
||||||
label: 'Edit',
|
label: 'Edit',
|
||||||
row: true,
|
row: true,
|
||||||
icon: EditIcon,
|
icon: EditIcon,
|
||||||
url: (_id) =>
|
|
||||||
`/dashboard/management/notetypes/info?noteTypeId=${_id}&action=edit`,
|
|
||||||
visible: (objectData) => {
|
visible: (objectData) => {
|
||||||
return !(objectData?._isEditing && objectData?._isEditing == true)
|
return !(objectData?._isEditing && objectData?._isEditing == true)
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
, {
|
||||||
|
name: 'cancelEdit',
|
||||||
|
label: 'Cancel Edits',
|
||||||
|
type: 'page',
|
||||||
|
pageName: 'info',
|
||||||
|
icon: XMarkIcon,
|
||||||
|
visible: (objectData) => {
|
||||||
|
return objectData?._isEditing && objectData?._isEditing == true
|
||||||
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: 'finishEdit',
|
name: 'finishEdit',
|
||||||
label: 'Save Edits',
|
label: 'Save Edits',
|
||||||
|
type: 'page',
|
||||||
|
pageName: 'info',
|
||||||
icon: CheckIcon,
|
icon: CheckIcon,
|
||||||
url: (_id) =>
|
|
||||||
`/dashboard/management/notetypes/info?noteTypeId=${_id}&action=finishEdit`,
|
|
||||||
visible: (objectData) => {
|
visible: (objectData) => {
|
||||||
return objectData?._isEditing && objectData?._isEditing == true
|
return objectData?._isEditing && objectData?._isEditing == true
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
],
|
||||||
|
pages: [
|
||||||
{
|
{
|
||||||
name: 'cancelEdit',
|
name: 'info',
|
||||||
label: 'Cancel Edits',
|
content: () => createElement(NoteTypeInfo)
|
||||||
icon: XMarkIcon,
|
|
||||||
url: (_id) =>
|
|
||||||
`/dashboard/management/notetypes/info?noteTypeId=${_id}&action=cancelEdit`,
|
|
||||||
visible: (objectData) => {
|
|
||||||
return objectData?._isEditing && objectData?._isEditing == true
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
columns: ['_reference', 'name', 'color', 'active', 'createdAt', 'updatedAt'],
|
columns: ['_reference', 'name', 'color', 'active', 'createdAt', 'updatedAt'],
|
||||||
|
|||||||
@ -1,9 +1,14 @@
|
|||||||
|
import { createElement, lazy } from 'react'
|
||||||
|
|
||||||
|
const OrderItemInfo = lazy(
|
||||||
|
() => import('../../components/Dashboard/Inventory/OrderItems/OrderItemInfo')
|
||||||
|
)
|
||||||
import OrderItemIcon from '../../components/Icons/OrderItemIcon'
|
import OrderItemIcon from '../../components/Icons/OrderItemIcon'
|
||||||
import InfoCircleIcon from '../../components/Icons/InfoCircleIcon'
|
import InfoCircleIcon from '../../components/Icons/InfoCircleIcon'
|
||||||
import EditIcon from '../../components/Icons/EditIcon'
|
import EditIcon from '../../components/Icons/EditIcon'
|
||||||
import BinIcon from '../../components/Icons/BinIcon'
|
|
||||||
import CheckIcon from '../../components/Icons/CheckIcon'
|
import CheckIcon from '../../components/Icons/CheckIcon'
|
||||||
import XMarkIcon from '../../components/Icons/XMarkIcon'
|
import XMarkIcon from '../../components/Icons/XMarkIcon'
|
||||||
|
import BinIcon from '../../components/Icons/BinIcon'
|
||||||
|
|
||||||
export const OrderItem = {
|
export const OrderItem = {
|
||||||
name: 'orderItem',
|
name: 'orderItem',
|
||||||
@ -15,19 +20,19 @@ export const OrderItem = {
|
|||||||
actions: [
|
actions: [
|
||||||
{
|
{
|
||||||
name: 'info',
|
name: 'info',
|
||||||
|
type: 'page',
|
||||||
|
pageName: 'info',
|
||||||
label: 'Info',
|
label: 'Info',
|
||||||
default: true,
|
default: true,
|
||||||
row: true,
|
row: true,
|
||||||
icon: InfoCircleIcon,
|
icon: InfoCircleIcon
|
||||||
url: (_id) => `/dashboard/inventory/orderitems/info?orderItemId=${_id}`
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: 'edit',
|
name: 'edit',
|
||||||
|
type: 'page',
|
||||||
|
pageName: 'info',
|
||||||
label: 'Edit',
|
label: 'Edit',
|
||||||
type: 'button',
|
|
||||||
icon: EditIcon,
|
icon: EditIcon,
|
||||||
url: (_id) =>
|
|
||||||
`/dashboard/inventory/orderitems/info?orderItemId=${_id}&action=edit`,
|
|
||||||
visible: (objectData) => {
|
visible: (objectData) => {
|
||||||
return !(objectData?._isEditing && objectData?._isEditing == true)
|
return !(objectData?._isEditing && objectData?._isEditing == true)
|
||||||
},
|
},
|
||||||
@ -37,40 +42,31 @@ export const OrderItem = {
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: 'cancelEdit',
|
name: 'cancelEdit',
|
||||||
label: 'Cancel Edit',
|
label: 'Cancel Edits',
|
||||||
type: 'button',
|
type: 'page',
|
||||||
|
pageName: 'info',
|
||||||
icon: XMarkIcon,
|
icon: XMarkIcon,
|
||||||
url: (_id) =>
|
|
||||||
`/dashboard/inventory/orderitems/info?orderItemId=${_id}&action=cancelEdit`,
|
|
||||||
visible: (objectData) => {
|
visible: (objectData) => {
|
||||||
return objectData?._isEditing && objectData?._isEditing == true
|
return objectData?._isEditing && objectData?._isEditing == true
|
||||||
},
|
|
||||||
disabled: (objectData) => {
|
|
||||||
return objectData?.state?.type != 'draft'
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: 'finishEdit',
|
name: 'finishEdit',
|
||||||
label: 'Finish Edit',
|
label: 'Save Edits',
|
||||||
type: 'button',
|
type: 'page',
|
||||||
|
pageName: 'info',
|
||||||
icon: CheckIcon,
|
icon: CheckIcon,
|
||||||
url: (_id) =>
|
|
||||||
`/dashboard/inventory/orderitems/info?orderItemId=${_id}&action=finishEdit`,
|
|
||||||
visible: (objectData) => {
|
visible: (objectData) => {
|
||||||
return objectData?._isEditing && objectData?._isEditing == true
|
return objectData?._isEditing && objectData?._isEditing == true
|
||||||
},
|
|
||||||
disabled: (objectData) => {
|
|
||||||
return objectData?.state?.type != 'draft'
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: 'delete',
|
name: 'delete',
|
||||||
|
type: 'page',
|
||||||
|
pageName: 'info',
|
||||||
label: 'Delete',
|
label: 'Delete',
|
||||||
type: 'button',
|
|
||||||
icon: BinIcon,
|
icon: BinIcon,
|
||||||
danger: true,
|
danger: true,
|
||||||
url: (_id) =>
|
|
||||||
`/dashboard/inventory/orderitems/info?orderItemId=${_id}&action=delete`,
|
|
||||||
visible: (objectData) => {
|
visible: (objectData) => {
|
||||||
return !(objectData?._isEditing && objectData?._isEditing == true)
|
return !(objectData?._isEditing && objectData?._isEditing == true)
|
||||||
},
|
},
|
||||||
@ -79,6 +75,12 @@ export const OrderItem = {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
|
pages: [
|
||||||
|
{
|
||||||
|
name: 'info',
|
||||||
|
content: () => createElement(OrderItemInfo)
|
||||||
|
}
|
||||||
|
],
|
||||||
group: [],
|
group: [],
|
||||||
filters: [
|
filters: [
|
||||||
'name',
|
'name',
|
||||||
|
|||||||
@ -1,8 +1,16 @@
|
|||||||
|
import { createElement, lazy } from 'react'
|
||||||
|
|
||||||
|
const PartInfo = lazy(
|
||||||
|
() => import('../../components/Dashboard/Management/Parts/PartInfo')
|
||||||
|
)
|
||||||
|
const NewPartSku = lazy(
|
||||||
|
() => import('../../components/Dashboard/Management/PartSkus/NewPartSku')
|
||||||
|
)
|
||||||
import EditIcon from '../../components/Icons/EditIcon'
|
import EditIcon from '../../components/Icons/EditIcon'
|
||||||
import InfoCircleIcon from '../../components/Icons/InfoCircleIcon'
|
|
||||||
import PartIcon from '../../components/Icons/PartIcon'
|
|
||||||
import CheckIcon from '../../components/Icons/CheckIcon'
|
import CheckIcon from '../../components/Icons/CheckIcon'
|
||||||
import XMarkIcon from '../../components/Icons/XMarkIcon'
|
import XMarkIcon from '../../components/Icons/XMarkIcon'
|
||||||
|
import InfoCircleIcon from '../../components/Icons/InfoCircleIcon'
|
||||||
|
import PartIcon from '../../components/Icons/PartIcon'
|
||||||
import PlusIcon from '../../components/Icons/PlusIcon'
|
import PlusIcon from '../../components/Icons/PlusIcon'
|
||||||
|
|
||||||
export const Part = {
|
export const Part = {
|
||||||
@ -15,39 +23,40 @@ export const Part = {
|
|||||||
actions: [
|
actions: [
|
||||||
{
|
{
|
||||||
name: 'info',
|
name: 'info',
|
||||||
|
type: 'page',
|
||||||
|
pageName: 'info',
|
||||||
label: 'Info',
|
label: 'Info',
|
||||||
default: true,
|
default: true,
|
||||||
row: true,
|
row: true,
|
||||||
icon: InfoCircleIcon,
|
icon: InfoCircleIcon
|
||||||
url: (_id) => `/dashboard/management/parts/info?partId=${_id}`
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: 'edit',
|
name: 'edit',
|
||||||
|
type: 'page',
|
||||||
|
pageName: 'info',
|
||||||
label: 'Edit',
|
label: 'Edit',
|
||||||
row: true,
|
row: true,
|
||||||
icon: EditIcon,
|
icon: EditIcon,
|
||||||
url: (_id) =>
|
|
||||||
`/dashboard/management/parts/info?partId=${_id}&action=edit`,
|
|
||||||
visible: (objectData) => {
|
visible: (objectData) => {
|
||||||
return !(objectData?._isEditing && objectData?._isEditing == true)
|
return !(objectData?._isEditing && objectData?._isEditing == true)
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: 'finishEdit',
|
name: 'cancelEdit',
|
||||||
label: 'Save Edits',
|
label: 'Cancel Edits',
|
||||||
icon: CheckIcon,
|
type: 'page',
|
||||||
url: (_id) =>
|
pageName: 'info',
|
||||||
`/dashboard/management/parts/info?partId=${_id}&action=finishEdit`,
|
icon: XMarkIcon,
|
||||||
visible: (objectData) => {
|
visible: (objectData) => {
|
||||||
return objectData?._isEditing && objectData?._isEditing == true
|
return objectData?._isEditing && objectData?._isEditing == true
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: 'cancelEdit',
|
name: 'finishEdit',
|
||||||
label: 'Cancel Edits',
|
label: 'Save Edits',
|
||||||
icon: XMarkIcon,
|
type: 'page',
|
||||||
url: (_id) =>
|
pageName: 'info',
|
||||||
`/dashboard/management/parts/info?partId=${_id}&action=cancelEdit`,
|
icon: CheckIcon,
|
||||||
visible: (objectData) => {
|
visible: (objectData) => {
|
||||||
return objectData?._isEditing && objectData?._isEditing == true
|
return objectData?._isEditing && objectData?._isEditing == true
|
||||||
}
|
}
|
||||||
@ -55,16 +64,24 @@ export const Part = {
|
|||||||
{ type: 'divider' },
|
{ type: 'divider' },
|
||||||
{
|
{
|
||||||
name: 'newPartSku',
|
name: 'newPartSku',
|
||||||
|
type: 'modal',
|
||||||
|
modalWidth: 700,
|
||||||
label: 'New Part SKU',
|
label: 'New Part SKU',
|
||||||
type: 'button',
|
|
||||||
icon: PlusIcon,
|
icon: PlusIcon,
|
||||||
url: (_id) =>
|
|
||||||
`/dashboard/management/parts/info?partId=${_id}&action=newPartSku`,
|
|
||||||
visible: (objectData) => {
|
visible: (objectData) => {
|
||||||
return !(objectData?._isEditing && objectData?._isEditing == true)
|
return !(objectData?._isEditing && objectData?._isEditing == true)
|
||||||
|
},
|
||||||
|
content: (objectData, { onOk } = {}) => {
|
||||||
|
return createElement(NewPartSku, { defaultValues: { part: objectData }, onOk, reset: true })
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
|
pages: [
|
||||||
|
{
|
||||||
|
name: 'info',
|
||||||
|
content: () => createElement(PartInfo)
|
||||||
|
}
|
||||||
|
],
|
||||||
columns: [
|
columns: [
|
||||||
'_reference',
|
'_reference',
|
||||||
'name',
|
'name',
|
||||||
|
|||||||
@ -1,3 +1,8 @@
|
|||||||
|
import { createElement, lazy } from 'react'
|
||||||
|
|
||||||
|
const PartSkuInfo = lazy(
|
||||||
|
() => import('../../components/Dashboard/Management/PartSkus/PartSkuInfo')
|
||||||
|
)
|
||||||
import PartSkuIcon from '../../components/Icons/PartSkuIcon'
|
import PartSkuIcon from '../../components/Icons/PartSkuIcon'
|
||||||
import InfoCircleIcon from '../../components/Icons/InfoCircleIcon'
|
import InfoCircleIcon from '../../components/Icons/InfoCircleIcon'
|
||||||
import EditIcon from '../../components/Icons/EditIcon'
|
import EditIcon from '../../components/Icons/EditIcon'
|
||||||
@ -15,39 +20,40 @@ export const PartSku = {
|
|||||||
actions: [
|
actions: [
|
||||||
{
|
{
|
||||||
name: 'info',
|
name: 'info',
|
||||||
|
type: 'page',
|
||||||
|
pageName: 'info',
|
||||||
label: 'Info',
|
label: 'Info',
|
||||||
default: true,
|
default: true,
|
||||||
row: true,
|
row: true,
|
||||||
icon: InfoCircleIcon,
|
icon: InfoCircleIcon
|
||||||
url: (_id) => `/dashboard/management/partskus/info?partSkuId=${_id}`
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: 'edit',
|
name: 'edit',
|
||||||
|
type: 'page',
|
||||||
|
pageName: 'info',
|
||||||
label: 'Edit',
|
label: 'Edit',
|
||||||
row: true,
|
row: true,
|
||||||
icon: EditIcon,
|
icon: EditIcon,
|
||||||
url: (_id) =>
|
|
||||||
`/dashboard/management/partskus/info?partSkuId=${_id}&action=edit`,
|
|
||||||
visible: (objectData) => {
|
visible: (objectData) => {
|
||||||
return !(objectData?._isEditing && objectData?._isEditing == true)
|
return !(objectData?._isEditing && objectData?._isEditing == true)
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: 'finishEdit',
|
name: 'cancelEdit',
|
||||||
label: 'Save Edits',
|
label: 'Cancel Edits',
|
||||||
icon: CheckIcon,
|
type: 'page',
|
||||||
url: (_id) =>
|
pageName: 'info',
|
||||||
`/dashboard/management/partskus/info?partSkuId=${_id}&action=finishEdit`,
|
icon: XMarkIcon,
|
||||||
visible: (objectData) => {
|
visible: (objectData) => {
|
||||||
return objectData?._isEditing && objectData?._isEditing == true
|
return objectData?._isEditing && objectData?._isEditing == true
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: 'cancelEdit',
|
name: 'finishEdit',
|
||||||
label: 'Cancel Edits',
|
label: 'Save Edits',
|
||||||
icon: XMarkIcon,
|
type: 'page',
|
||||||
url: (_id) =>
|
pageName: 'info',
|
||||||
`/dashboard/management/partskus/info?partSkuId=${_id}&action=cancelEdit`,
|
icon: CheckIcon,
|
||||||
visible: (objectData) => {
|
visible: (objectData) => {
|
||||||
return objectData?._isEditing && objectData?._isEditing == true
|
return objectData?._isEditing && objectData?._isEditing == true
|
||||||
}
|
}
|
||||||
@ -55,11 +61,17 @@ export const PartSku = {
|
|||||||
{ type: 'divider' },
|
{ type: 'divider' },
|
||||||
{
|
{
|
||||||
name: 'delete',
|
name: 'delete',
|
||||||
|
type: 'page',
|
||||||
|
pageName: 'info',
|
||||||
label: 'Delete',
|
label: 'Delete',
|
||||||
icon: BinIcon,
|
icon: BinIcon,
|
||||||
danger: true,
|
danger: true
|
||||||
url: (_id) =>
|
}
|
||||||
`/dashboard/management/partskus/info?partSkuId=${_id}&action=delete`
|
],
|
||||||
|
pages: [
|
||||||
|
{
|
||||||
|
name: 'info',
|
||||||
|
content: () => createElement(PartSkuInfo)
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
columns: [
|
columns: [
|
||||||
|
|||||||
@ -1,3 +1,8 @@
|
|||||||
|
import { createElement, lazy } from 'react'
|
||||||
|
|
||||||
|
const PartStockInfo = lazy(
|
||||||
|
() => import('../../components/Dashboard/Inventory/PartStocks/PartStockInfo')
|
||||||
|
)
|
||||||
import PartStockIcon from '../../components/Icons/PartStockIcon'
|
import PartStockIcon from '../../components/Icons/PartStockIcon'
|
||||||
import InfoCircleIcon from '../../components/Icons/InfoCircleIcon'
|
import InfoCircleIcon from '../../components/Icons/InfoCircleIcon'
|
||||||
|
|
||||||
@ -11,11 +16,18 @@ export const PartStock = {
|
|||||||
actions: [
|
actions: [
|
||||||
{
|
{
|
||||||
name: 'info',
|
name: 'info',
|
||||||
|
type: 'page',
|
||||||
|
pageName: 'info',
|
||||||
label: 'Info',
|
label: 'Info',
|
||||||
default: true,
|
default: true,
|
||||||
row: true,
|
row: true,
|
||||||
icon: InfoCircleIcon,
|
icon: InfoCircleIcon
|
||||||
url: (_id) => `/dashboard/inventory/partstocks/info?partStockId=${_id}`
|
}
|
||||||
|
],
|
||||||
|
pages: [
|
||||||
|
{
|
||||||
|
name: 'info',
|
||||||
|
content: () => createElement(PartStockInfo)
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
filters: [
|
filters: [
|
||||||
|
|||||||
@ -1,3 +1,20 @@
|
|||||||
|
import { createElement, lazy } from 'react'
|
||||||
|
|
||||||
|
const PaymentInfo = lazy(
|
||||||
|
() => import('../../components/Dashboard/Finance/Payments/PaymentInfo')
|
||||||
|
)
|
||||||
|
const PostPayment = lazy(
|
||||||
|
() => import('../../components/Dashboard/Finance/Payments/PostPayment')
|
||||||
|
)
|
||||||
|
const AuthorisePayment = lazy(
|
||||||
|
() => import('../../components/Dashboard/Finance/Payments/AuthorisePayment')
|
||||||
|
)
|
||||||
|
const DeclinePayment = lazy(
|
||||||
|
() => import('../../components/Dashboard/Finance/Payments/DeclinePayment')
|
||||||
|
)
|
||||||
|
const CancelPayment = lazy(
|
||||||
|
() => import('../../components/Dashboard/Finance/Payments/CancelPayment')
|
||||||
|
)
|
||||||
import PaymentIcon from '../../components/Icons/PaymentIcon'
|
import PaymentIcon from '../../components/Icons/PaymentIcon'
|
||||||
import InfoCircleIcon from '../../components/Icons/InfoCircleIcon'
|
import InfoCircleIcon from '../../components/Icons/InfoCircleIcon'
|
||||||
import CheckIcon from '../../components/Icons/CheckIcon'
|
import CheckIcon from '../../components/Icons/CheckIcon'
|
||||||
@ -15,19 +32,19 @@ export const Payment = {
|
|||||||
actions: [
|
actions: [
|
||||||
{
|
{
|
||||||
name: 'info',
|
name: 'info',
|
||||||
|
type: 'page',
|
||||||
|
pageName: 'info',
|
||||||
label: 'Info',
|
label: 'Info',
|
||||||
default: true,
|
default: true,
|
||||||
row: true,
|
row: true,
|
||||||
icon: InfoCircleIcon,
|
icon: InfoCircleIcon
|
||||||
url: (_id) => `/dashboard/finance/payments/info?paymentId=${_id}`
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: 'edit',
|
name: 'edit',
|
||||||
|
type: 'page',
|
||||||
|
pageName: 'info',
|
||||||
label: 'Edit',
|
label: 'Edit',
|
||||||
type: 'button',
|
|
||||||
icon: EditIcon,
|
icon: EditIcon,
|
||||||
url: (_id) =>
|
|
||||||
`/dashboard/finance/payments/info?paymentId=${_id}&action=edit`,
|
|
||||||
visible: (objectData) => {
|
visible: (objectData) => {
|
||||||
return !(objectData?._isEditing && objectData?._isEditing == true)
|
return !(objectData?._isEditing && objectData?._isEditing == true)
|
||||||
},
|
},
|
||||||
@ -37,34 +54,31 @@ export const Payment = {
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: 'cancelEdit',
|
name: 'cancelEdit',
|
||||||
label: 'Cancel Edit',
|
label: 'Cancel Edits',
|
||||||
type: 'button',
|
type: 'page',
|
||||||
|
pageName: 'info',
|
||||||
icon: XMarkIcon,
|
icon: XMarkIcon,
|
||||||
url: (_id) =>
|
|
||||||
`/dashboard/finance/payments/info?paymentId=${_id}&action=cancelEdit`,
|
|
||||||
visible: (objectData) => {
|
visible: (objectData) => {
|
||||||
return objectData?._isEditing && objectData?._isEditing == true
|
return objectData?._isEditing && objectData?._isEditing == true
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: 'finishEdit',
|
name: 'finishEdit',
|
||||||
label: 'Finish Edit',
|
label: 'Save Edits',
|
||||||
type: 'button',
|
type: 'page',
|
||||||
|
pageName: 'info',
|
||||||
icon: CheckIcon,
|
icon: CheckIcon,
|
||||||
url: (_id) =>
|
|
||||||
`/dashboard/finance/payments/info?paymentId=${_id}&action=finishEdit`,
|
|
||||||
visible: (objectData) => {
|
visible: (objectData) => {
|
||||||
return objectData?._isEditing && objectData?._isEditing == true
|
return objectData?._isEditing && objectData?._isEditing == true
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: 'delete',
|
name: 'delete',
|
||||||
|
type: 'page',
|
||||||
|
pageName: 'info',
|
||||||
label: 'Delete',
|
label: 'Delete',
|
||||||
type: 'button',
|
|
||||||
icon: BinIcon,
|
icon: BinIcon,
|
||||||
danger: true,
|
danger: true,
|
||||||
url: (_id) =>
|
|
||||||
`/dashboard/finance/payments/info?paymentId=${_id}&action=delete`,
|
|
||||||
visible: (objectData) => {
|
visible: (objectData) => {
|
||||||
return !(objectData?._isEditing && objectData?._isEditing == true)
|
return !(objectData?._isEditing && objectData?._isEditing == true)
|
||||||
},
|
},
|
||||||
@ -75,60 +89,74 @@ export const Payment = {
|
|||||||
{ type: 'divider' },
|
{ type: 'divider' },
|
||||||
{
|
{
|
||||||
name: 'post',
|
name: 'post',
|
||||||
|
type: 'modal',
|
||||||
|
modalWidth: 520,
|
||||||
label: 'Post',
|
label: 'Post',
|
||||||
type: 'button',
|
|
||||||
icon: CheckIcon,
|
icon: CheckIcon,
|
||||||
url: (_id) =>
|
|
||||||
`/dashboard/finance/payments/info?paymentId=${_id}&action=post`,
|
|
||||||
visible: (objectData) => {
|
visible: (objectData) => {
|
||||||
return objectData?.state?.type == 'draft'
|
return objectData?.state?.type == 'draft'
|
||||||
|
},
|
||||||
|
content: (objectData, { onOk } = {}) => {
|
||||||
|
return createElement(PostPayment, { objectData, onOk })
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: 'authorise',
|
name: 'authorise',
|
||||||
|
type: 'modal',
|
||||||
|
modalWidth: 520,
|
||||||
label: 'Authorise',
|
label: 'Authorise',
|
||||||
type: 'button',
|
|
||||||
icon: CheckIcon,
|
icon: CheckIcon,
|
||||||
url: (_id) =>
|
|
||||||
`/dashboard/finance/payments/info?paymentId=${_id}&action=authorise`,
|
|
||||||
disabled: (objectData) => {
|
disabled: (objectData) => {
|
||||||
return objectData?.state?.type != 'posted'
|
return objectData?.state?.type != 'posted'
|
||||||
},
|
},
|
||||||
visible: (objectData) => {
|
visible: (objectData) => {
|
||||||
return objectData?.state?.type == 'posted'
|
return objectData?.state?.type == 'posted'
|
||||||
|
},
|
||||||
|
content: (objectData, { onOk } = {}) => {
|
||||||
|
return createElement(AuthorisePayment, { objectData, onOk })
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: 'decline',
|
name: 'decline',
|
||||||
|
type: 'modal',
|
||||||
|
modalWidth: 520,
|
||||||
label: 'Decline',
|
label: 'Decline',
|
||||||
type: 'button',
|
|
||||||
icon: XMarkIcon,
|
icon: XMarkIcon,
|
||||||
danger: true,
|
danger: true,
|
||||||
url: (_id) =>
|
|
||||||
`/dashboard/finance/payments/info?paymentId=${_id}&action=decline`,
|
|
||||||
disabled: (objectData) => {
|
disabled: (objectData) => {
|
||||||
return objectData?.state?.type != 'posted'
|
return objectData?.state?.type != 'posted'
|
||||||
},
|
},
|
||||||
visible: (objectData) => {
|
visible: (objectData) => {
|
||||||
return objectData?.state?.type == 'posted'
|
return objectData?.state?.type == 'posted'
|
||||||
|
},
|
||||||
|
content: (objectData, { onOk } = {}) => {
|
||||||
|
return createElement(DeclinePayment, { objectData, onOk })
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: 'cancel',
|
name: 'cancel',
|
||||||
|
type: 'modal',
|
||||||
|
modalWidth: 520,
|
||||||
label: 'Cancel',
|
label: 'Cancel',
|
||||||
type: 'button',
|
|
||||||
icon: XMarkIcon,
|
icon: XMarkIcon,
|
||||||
danger: true,
|
danger: true,
|
||||||
url: (_id) =>
|
|
||||||
`/dashboard/finance/payments/info?paymentId=${_id}&action=cancel`,
|
|
||||||
disabled: (objectData) => {
|
disabled: (objectData) => {
|
||||||
return objectData?.state?.type != 'posted'
|
return objectData?.state?.type != 'posted'
|
||||||
},
|
},
|
||||||
visible: (objectData) => {
|
visible: (objectData) => {
|
||||||
return objectData?.state?.type == 'posted'
|
return objectData?.state?.type == 'posted'
|
||||||
|
},
|
||||||
|
content: (objectData, { onOk } = {}) => {
|
||||||
|
return createElement(CancelPayment, { objectData, onOk })
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
|
pages: [
|
||||||
|
{
|
||||||
|
name: 'info',
|
||||||
|
content: () => createElement(PaymentInfo)
|
||||||
|
}
|
||||||
|
],
|
||||||
group: ['vendor', 'client', 'invoice'],
|
group: ['vendor', 'client', 'invoice'],
|
||||||
filters: [
|
filters: [
|
||||||
'vendor',
|
'vendor',
|
||||||
|
|||||||
@ -1,3 +1,17 @@
|
|||||||
|
import { createElement, lazy } from 'react'
|
||||||
|
|
||||||
|
const PrinterInfo = lazy(
|
||||||
|
() => import('../../components/Dashboard/Production/Printers/PrinterInfo')
|
||||||
|
)
|
||||||
|
const NewPrinterProfile = lazy(
|
||||||
|
() => import('../../components/Dashboard/Production/PrinterProfiles/NewPrinterProfile')
|
||||||
|
)
|
||||||
|
const LoadFilamentStock = lazy(
|
||||||
|
() => import('../../components/Dashboard/Inventory/FilamentStocks/LoadFilamentStock')
|
||||||
|
)
|
||||||
|
const UnloadFilamentStock = lazy(
|
||||||
|
() => import('../../components/Dashboard/Inventory/FilamentStocks/UnloadFilamentStock')
|
||||||
|
)
|
||||||
import PrinterIcon from '../../components/Icons/PrinterIcon'
|
import PrinterIcon from '../../components/Icons/PrinterIcon'
|
||||||
import InfoCircleIcon from '../../components/Icons/InfoCircleIcon'
|
import InfoCircleIcon from '../../components/Icons/InfoCircleIcon'
|
||||||
import ReloadIcon from '../../components/Icons/ReloadIcon'
|
import ReloadIcon from '../../components/Icons/ReloadIcon'
|
||||||
@ -22,13 +36,13 @@ export const Printer = {
|
|||||||
actions: [
|
actions: [
|
||||||
{
|
{
|
||||||
name: 'info',
|
name: 'info',
|
||||||
|
type: 'page',
|
||||||
|
pageName: 'info',
|
||||||
label: 'Info',
|
label: 'Info',
|
||||||
default: true,
|
default: true,
|
||||||
row: true,
|
row: true,
|
||||||
icon: InfoCircleIcon,
|
icon: InfoCircleIcon
|
||||||
url: (_id) => `/dashboard/production/printers/info?printerId=${_id}`
|
|
||||||
},
|
},
|
||||||
|
|
||||||
{
|
{
|
||||||
name: 'control',
|
name: 'control',
|
||||||
label: 'Control',
|
label: 'Control',
|
||||||
@ -38,31 +52,31 @@ export const Printer = {
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: 'edit',
|
name: 'edit',
|
||||||
|
type: 'page',
|
||||||
|
pageName: 'info',
|
||||||
label: 'Edit',
|
label: 'Edit',
|
||||||
row: true,
|
row: true,
|
||||||
icon: EditIcon,
|
icon: EditIcon,
|
||||||
url: (_id) =>
|
|
||||||
`/dashboard/production/printers/info?printerId=${_id}&action=edit`,
|
|
||||||
visible: (objectData) => {
|
visible: (objectData) => {
|
||||||
return !(objectData?._isEditing && objectData?._isEditing == true)
|
return !(objectData?._isEditing && objectData?._isEditing == true)
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: 'finishEdit',
|
name: 'cancelEdit',
|
||||||
label: 'Save Edits',
|
label: 'Cancel Edits',
|
||||||
icon: CheckIcon,
|
type: 'page',
|
||||||
url: (_id) =>
|
pageName: 'info',
|
||||||
`/dashboard/production/printers/info?printerId=${_id}&action=finishEdit`,
|
icon: XMarkIcon,
|
||||||
visible: (objectData) => {
|
visible: (objectData) => {
|
||||||
return objectData?._isEditing && objectData?._isEditing == true
|
return objectData?._isEditing && objectData?._isEditing == true
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: 'cancelEdit',
|
name: 'finishEdit',
|
||||||
label: 'Cancel Edits',
|
label: 'Save Edits',
|
||||||
icon: XMarkIcon,
|
type: 'page',
|
||||||
url: (_id) =>
|
pageName: 'info',
|
||||||
`/dashboard/production/printers/info?printerId=${_id}&action=cancelEdit`,
|
icon: CheckIcon,
|
||||||
visible: (objectData) => {
|
visible: (objectData) => {
|
||||||
return objectData?._isEditing && objectData?._isEditing == true
|
return objectData?._isEditing && objectData?._isEditing == true
|
||||||
}
|
}
|
||||||
@ -70,11 +84,13 @@ export const Printer = {
|
|||||||
{ type: 'divider' },
|
{ type: 'divider' },
|
||||||
{
|
{
|
||||||
name: 'newPrinterProfile',
|
name: 'newPrinterProfile',
|
||||||
|
type: 'modal',
|
||||||
|
modalWidth: 700,
|
||||||
label: 'New Printer Profile',
|
label: 'New Printer Profile',
|
||||||
type: 'button',
|
|
||||||
icon: PlusIcon,
|
icon: PlusIcon,
|
||||||
url: (_id) =>
|
content: (objectData, { onOk } = {}) => {
|
||||||
`/dashboard/production/printers/info?printerId=${_id}&action=newPrinterProfile`
|
return createElement(NewPrinterProfile, { defaultValues: { printer: objectData }, onOk, reset: true })
|
||||||
|
}
|
||||||
},
|
},
|
||||||
{ type: 'divider' },
|
{ type: 'divider' },
|
||||||
{
|
{
|
||||||
@ -188,35 +204,57 @@ export const Printer = {
|
|||||||
children: [
|
children: [
|
||||||
{
|
{
|
||||||
name: 'loadFilamentStock',
|
name: 'loadFilamentStock',
|
||||||
|
type: 'modal',
|
||||||
|
modalWidth: 700,
|
||||||
label: 'Load Filament Stock',
|
label: 'Load Filament Stock',
|
||||||
icon: FilamentStockIcon,
|
icon: FilamentStockIcon,
|
||||||
url: (_id) =>
|
|
||||||
`/dashboard/production/printers/control?printerId=${_id}&action=loadFilamentStock`,
|
|
||||||
disabled: (objectData) => {
|
disabled: (objectData) => {
|
||||||
return (
|
return (
|
||||||
objectData?.state?.type == 'printing' ||
|
objectData?.state?.type == 'printing' ||
|
||||||
objectData?.state?.type == 'error' ||
|
objectData?.state?.type == 'error' ||
|
||||||
objectData?.currentFilamentStock != null
|
objectData?.currentFilamentStock != null
|
||||||
)
|
)
|
||||||
|
},
|
||||||
|
content: (objectData, { onOk } = {}) => {
|
||||||
|
return createElement(LoadFilamentStock, {
|
||||||
|
printer: objectData,
|
||||||
|
onOk,
|
||||||
|
reset: false,
|
||||||
|
filamentStockLoaded: false
|
||||||
|
})
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: 'unloadFilamentStock',
|
name: 'unloadFilamentStock',
|
||||||
|
type: 'modal',
|
||||||
|
modalWidth: 700,
|
||||||
label: 'Unload Filament Stock',
|
label: 'Unload Filament Stock',
|
||||||
icon: FilamentStockIcon,
|
icon: FilamentStockIcon,
|
||||||
url: (_id) =>
|
|
||||||
`/dashboard/production/printers/control?printerId=${_id}&action=unloadFilamentStock`,
|
|
||||||
disabled: (objectData) => {
|
disabled: (objectData) => {
|
||||||
return (
|
return (
|
||||||
objectData?.state?.type == 'printing' ||
|
objectData?.state?.type == 'printing' ||
|
||||||
objectData?.state?.type == 'error' ||
|
objectData?.state?.type == 'error' ||
|
||||||
objectData?.currentFilamentStock == null
|
objectData?.currentFilamentStock == null
|
||||||
)
|
)
|
||||||
|
},
|
||||||
|
content: (objectData, { onOk } = {}) => {
|
||||||
|
return createElement(UnloadFilamentStock, {
|
||||||
|
printer: objectData,
|
||||||
|
onOk,
|
||||||
|
reset: false,
|
||||||
|
filamentStockLoaded: false
|
||||||
|
})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
|
pages: [
|
||||||
|
{
|
||||||
|
name: 'info',
|
||||||
|
content: () => createElement(PrinterInfo)
|
||||||
|
}
|
||||||
|
],
|
||||||
columns: [
|
columns: [
|
||||||
'_reference',
|
'_reference',
|
||||||
'name',
|
'name',
|
||||||
|
|||||||
@ -1,3 +1,8 @@
|
|||||||
|
import { createElement, lazy } from 'react'
|
||||||
|
|
||||||
|
const PrinterProfileInfo = lazy(
|
||||||
|
() => import('../../components/Dashboard/Production/PrinterProfiles/PrinterProfileInfo')
|
||||||
|
)
|
||||||
import PrinterProfileIcon from '../../components/Icons/PrinterProfileIcon'
|
import PrinterProfileIcon from '../../components/Icons/PrinterProfileIcon'
|
||||||
import InfoCircleIcon from '../../components/Icons/InfoCircleIcon'
|
import InfoCircleIcon from '../../components/Icons/InfoCircleIcon'
|
||||||
import EditIcon from '../../components/Icons/EditIcon'
|
import EditIcon from '../../components/Icons/EditIcon'
|
||||||
@ -280,47 +285,57 @@ export const PrinterProfile = {
|
|||||||
actions: [
|
actions: [
|
||||||
{
|
{
|
||||||
name: 'info',
|
name: 'info',
|
||||||
|
type: 'page',
|
||||||
|
pageName: 'info',
|
||||||
label: 'Info',
|
label: 'Info',
|
||||||
default: true,
|
default: true,
|
||||||
row: true,
|
row: true,
|
||||||
icon: InfoCircleIcon,
|
icon: InfoCircleIcon
|
||||||
url: (_id) =>
|
|
||||||
`/dashboard/production/printerprofiles/info?printerProfileId=${_id}`
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: 'edit',
|
name: 'edit',
|
||||||
|
type: 'page',
|
||||||
|
pageName: 'info',
|
||||||
label: 'Edit',
|
label: 'Edit',
|
||||||
row: true,
|
row: true,
|
||||||
icon: EditIcon,
|
icon: EditIcon,
|
||||||
url: (_id) =>
|
|
||||||
`/dashboard/production/printerprofiles/info?printerProfileId=${_id}&action=edit`,
|
|
||||||
visible: (objectData) => !objectData?._isEditing
|
visible: (objectData) => !objectData?._isEditing
|
||||||
},
|
},
|
||||||
{
|
|
||||||
name: 'finishEdit',
|
|
||||||
label: 'Save Edits',
|
|
||||||
icon: CheckIcon,
|
|
||||||
url: (_id) =>
|
|
||||||
`/dashboard/production/printerprofiles/info?printerProfileId=${_id}&action=finishEdit`,
|
|
||||||
visible: (objectData) => objectData?._isEditing === true
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
name: 'cancelEdit',
|
name: 'cancelEdit',
|
||||||
label: 'Cancel Edits',
|
label: 'Cancel Edits',
|
||||||
|
type: 'page',
|
||||||
|
pageName: 'info',
|
||||||
icon: XMarkIcon,
|
icon: XMarkIcon,
|
||||||
url: (_id) =>
|
visible: (objectData) => {
|
||||||
`/dashboard/production/printerprofiles/info?printerProfileId=${_id}&action=cancelEdit`,
|
return objectData?._isEditing && objectData?._isEditing == true
|
||||||
visible: (objectData) => objectData?._isEditing === true
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: 'finishEdit',
|
||||||
|
label: 'Save Edits',
|
||||||
|
type: 'page',
|
||||||
|
pageName: 'info',
|
||||||
|
icon: CheckIcon,
|
||||||
|
visible: (objectData) => {
|
||||||
|
return objectData?._isEditing && objectData?._isEditing == true
|
||||||
|
}
|
||||||
},
|
},
|
||||||
{ type: 'divider' },
|
{ type: 'divider' },
|
||||||
{
|
{
|
||||||
name: 'delete',
|
name: 'delete',
|
||||||
|
type: 'page',
|
||||||
|
pageName: 'info',
|
||||||
label: 'Delete',
|
label: 'Delete',
|
||||||
row: true,
|
row: true,
|
||||||
icon: BinIcon,
|
icon: BinIcon,
|
||||||
danger: true,
|
danger: true
|
||||||
url: (_id) =>
|
}
|
||||||
`/dashboard/production/printerprofiles/info?printerProfileId=${_id}&action=delete`
|
],
|
||||||
|
pages: [
|
||||||
|
{
|
||||||
|
name: 'info',
|
||||||
|
content: () => createElement(PrinterProfileInfo)
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
columns: [
|
columns: [
|
||||||
|
|||||||
@ -1,3 +1,11 @@
|
|||||||
|
import { createElement, lazy } from 'react'
|
||||||
|
|
||||||
|
const ProductInfo = lazy(
|
||||||
|
() => import('../../components/Dashboard/Management/Products/ProductInfo')
|
||||||
|
)
|
||||||
|
const NewProductSku = lazy(
|
||||||
|
() => import('../../components/Dashboard/Management/ProductSkus/NewProductSku')
|
||||||
|
)
|
||||||
import ProductIcon from '../../components/Icons/ProductIcon'
|
import ProductIcon from '../../components/Icons/ProductIcon'
|
||||||
import InfoCircleIcon from '../../components/Icons/InfoCircleIcon'
|
import InfoCircleIcon from '../../components/Icons/InfoCircleIcon'
|
||||||
import EditIcon from '../../components/Icons/EditIcon'
|
import EditIcon from '../../components/Icons/EditIcon'
|
||||||
@ -15,39 +23,40 @@ export const Product = {
|
|||||||
actions: [
|
actions: [
|
||||||
{
|
{
|
||||||
name: 'info',
|
name: 'info',
|
||||||
|
type: 'page',
|
||||||
|
pageName: 'info',
|
||||||
label: 'Info',
|
label: 'Info',
|
||||||
default: true,
|
default: true,
|
||||||
row: true,
|
row: true,
|
||||||
icon: InfoCircleIcon,
|
icon: InfoCircleIcon
|
||||||
url: (_id) => `/dashboard/management/products/info?productId=${_id}`
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: 'edit',
|
name: 'edit',
|
||||||
|
type: 'page',
|
||||||
|
pageName: 'info',
|
||||||
label: 'Edit',
|
label: 'Edit',
|
||||||
row: true,
|
row: true,
|
||||||
icon: EditIcon,
|
icon: EditIcon,
|
||||||
url: (_id) =>
|
|
||||||
`/dashboard/management/products/info?productId=${_id}&action=edit`,
|
|
||||||
visible: (objectData) => {
|
visible: (objectData) => {
|
||||||
return !(objectData?._isEditing && objectData?._isEditing == true)
|
return !(objectData?._isEditing && objectData?._isEditing == true)
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: 'finishEdit',
|
name: 'cancelEdit',
|
||||||
label: 'Save Edits',
|
label: 'Cancel Edits',
|
||||||
icon: CheckIcon,
|
type: 'page',
|
||||||
url: (_id) =>
|
pageName: 'info',
|
||||||
`/dashboard/management/products/info?productId=${_id}&action=finishEdit`,
|
icon: XMarkIcon,
|
||||||
visible: (objectData) => {
|
visible: (objectData) => {
|
||||||
return objectData?._isEditing && objectData?._isEditing == true
|
return objectData?._isEditing && objectData?._isEditing == true
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: 'cancelEdit',
|
name: 'finishEdit',
|
||||||
label: 'Cancel Edits',
|
label: 'Save Edits',
|
||||||
icon: XMarkIcon,
|
type: 'page',
|
||||||
url: (_id) =>
|
pageName: 'info',
|
||||||
`/dashboard/management/products/info?productId=${_id}&action=cancelEdit`,
|
icon: CheckIcon,
|
||||||
visible: (objectData) => {
|
visible: (objectData) => {
|
||||||
return objectData?._isEditing && objectData?._isEditing == true
|
return objectData?._isEditing && objectData?._isEditing == true
|
||||||
}
|
}
|
||||||
@ -57,16 +66,24 @@ export const Product = {
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: 'newProductSku',
|
name: 'newProductSku',
|
||||||
|
type: 'modal',
|
||||||
|
modalWidth: 700,
|
||||||
label: 'New Product SKU',
|
label: 'New Product SKU',
|
||||||
type: 'button',
|
|
||||||
icon: PlusIcon,
|
icon: PlusIcon,
|
||||||
url: (_id) =>
|
|
||||||
`/dashboard/management/products/info?productId=${_id}&action=newProductSku`,
|
|
||||||
visible: (objectData) => {
|
visible: (objectData) => {
|
||||||
return !(objectData?._isEditing && objectData?._isEditing == true)
|
return !(objectData?._isEditing && objectData?._isEditing == true)
|
||||||
|
},
|
||||||
|
content: (objectData, { onOk } = {}) => {
|
||||||
|
return createElement(NewProductSku, { defaultValues: { product: objectData }, onOk, reset: true })
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
|
pages: [
|
||||||
|
{
|
||||||
|
name: 'info',
|
||||||
|
content: () => createElement(ProductInfo)
|
||||||
|
}
|
||||||
|
],
|
||||||
columns: [
|
columns: [
|
||||||
'_reference',
|
'_reference',
|
||||||
'name',
|
'name',
|
||||||
|
|||||||
@ -1,3 +1,8 @@
|
|||||||
|
import { createElement, lazy } from 'react'
|
||||||
|
|
||||||
|
const ProductCategoryInfo = lazy(
|
||||||
|
() => import('../../components/Dashboard/Management/ProductCategories/ProductCategoryInfo')
|
||||||
|
)
|
||||||
import ProductCategoryIcon from '../../components/Icons/ProductCategoryIcon'
|
import ProductCategoryIcon from '../../components/Icons/ProductCategoryIcon'
|
||||||
import InfoCircleIcon from '../../components/Icons/InfoCircleIcon'
|
import InfoCircleIcon from '../../components/Icons/InfoCircleIcon'
|
||||||
import EditIcon from '../../components/Icons/EditIcon'
|
import EditIcon from '../../components/Icons/EditIcon'
|
||||||
@ -16,40 +21,40 @@ export const ProductCategory = {
|
|||||||
actions: [
|
actions: [
|
||||||
{
|
{
|
||||||
name: 'info',
|
name: 'info',
|
||||||
|
type: 'page',
|
||||||
|
pageName: 'info',
|
||||||
label: 'Info',
|
label: 'Info',
|
||||||
default: true,
|
default: true,
|
||||||
row: true,
|
row: true,
|
||||||
icon: InfoCircleIcon,
|
icon: InfoCircleIcon
|
||||||
url: (_id) =>
|
|
||||||
`/dashboard/management/productcategories/info?productCategoryId=${_id}`
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: 'edit',
|
name: 'edit',
|
||||||
|
type: 'page',
|
||||||
|
pageName: 'info',
|
||||||
label: 'Edit',
|
label: 'Edit',
|
||||||
row: true,
|
row: true,
|
||||||
icon: EditIcon,
|
icon: EditIcon,
|
||||||
url: (_id) =>
|
|
||||||
`/dashboard/management/productcategories/info?productCategoryId=${_id}&action=edit`,
|
|
||||||
visible: (objectData) => {
|
visible: (objectData) => {
|
||||||
return !(objectData?._isEditing && objectData?._isEditing == true)
|
return !(objectData?._isEditing && objectData?._isEditing == true)
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: 'finishEdit',
|
name: 'cancelEdit',
|
||||||
label: 'Save Edits',
|
label: 'Cancel Edits',
|
||||||
icon: CheckIcon,
|
type: 'page',
|
||||||
url: (_id) =>
|
pageName: 'info',
|
||||||
`/dashboard/management/productcategories/info?productCategoryId=${_id}&action=finishEdit`,
|
icon: XMarkIcon,
|
||||||
visible: (objectData) => {
|
visible: (objectData) => {
|
||||||
return objectData?._isEditing && objectData?._isEditing == true
|
return objectData?._isEditing && objectData?._isEditing == true
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: 'cancelEdit',
|
name: 'finishEdit',
|
||||||
label: 'Cancel Edits',
|
label: 'Save Edits',
|
||||||
icon: XMarkIcon,
|
type: 'page',
|
||||||
url: (_id) =>
|
pageName: 'info',
|
||||||
`/dashboard/management/productcategories/info?productCategoryId=${_id}&action=cancelEdit`,
|
icon: CheckIcon,
|
||||||
visible: (objectData) => {
|
visible: (objectData) => {
|
||||||
return objectData?._isEditing && objectData?._isEditing == true
|
return objectData?._isEditing && objectData?._isEditing == true
|
||||||
}
|
}
|
||||||
@ -57,11 +62,17 @@ export const ProductCategory = {
|
|||||||
{ type: 'divider' },
|
{ type: 'divider' },
|
||||||
{
|
{
|
||||||
name: 'delete',
|
name: 'delete',
|
||||||
|
type: 'page',
|
||||||
|
pageName: 'info',
|
||||||
label: 'Delete',
|
label: 'Delete',
|
||||||
icon: BinIcon,
|
icon: BinIcon,
|
||||||
danger: true,
|
danger: true
|
||||||
url: (_id) =>
|
}
|
||||||
`/dashboard/management/productcategories/info?productCategoryId=${_id}&action=delete`
|
],
|
||||||
|
pages: [
|
||||||
|
{
|
||||||
|
name: 'info',
|
||||||
|
content: () => createElement(ProductCategoryInfo)
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
columns: ['_reference', 'name', 'createdAt', 'updatedAt'],
|
columns: ['_reference', 'name', 'createdAt', 'updatedAt'],
|
||||||
|
|||||||
@ -1,3 +1,8 @@
|
|||||||
|
import { createElement, lazy } from 'react'
|
||||||
|
|
||||||
|
const ProductSkuInfo = lazy(
|
||||||
|
() => import('../../components/Dashboard/Management/ProductSkus/ProductSkuInfo')
|
||||||
|
)
|
||||||
import ProductSkuIcon from '../../components/Icons/ProductSkuIcon'
|
import ProductSkuIcon from '../../components/Icons/ProductSkuIcon'
|
||||||
import InfoCircleIcon from '../../components/Icons/InfoCircleIcon'
|
import InfoCircleIcon from '../../components/Icons/InfoCircleIcon'
|
||||||
import EditIcon from '../../components/Icons/EditIcon'
|
import EditIcon from '../../components/Icons/EditIcon'
|
||||||
@ -15,39 +20,40 @@ export const ProductSku = {
|
|||||||
actions: [
|
actions: [
|
||||||
{
|
{
|
||||||
name: 'info',
|
name: 'info',
|
||||||
|
type: 'page',
|
||||||
|
pageName: 'info',
|
||||||
label: 'Info',
|
label: 'Info',
|
||||||
default: true,
|
default: true,
|
||||||
row: true,
|
row: true,
|
||||||
icon: InfoCircleIcon,
|
icon: InfoCircleIcon
|
||||||
url: (_id) => `/dashboard/management/productskus/info?productSkuId=${_id}`
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: 'edit',
|
name: 'edit',
|
||||||
|
type: 'page',
|
||||||
|
pageName: 'info',
|
||||||
label: 'Edit',
|
label: 'Edit',
|
||||||
row: true,
|
row: true,
|
||||||
icon: EditIcon,
|
icon: EditIcon,
|
||||||
url: (_id) =>
|
|
||||||
`/dashboard/management/productskus/info?productSkuId=${_id}&action=edit`,
|
|
||||||
visible: (objectData) => {
|
visible: (objectData) => {
|
||||||
return !(objectData?._isEditing && objectData?._isEditing == true)
|
return !(objectData?._isEditing && objectData?._isEditing == true)
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: 'finishEdit',
|
name: 'cancelEdit',
|
||||||
label: 'Save Edits',
|
label: 'Cancel Edits',
|
||||||
icon: CheckIcon,
|
type: 'page',
|
||||||
url: (_id) =>
|
pageName: 'info',
|
||||||
`/dashboard/management/productskus/info?productSkuId=${_id}&action=finishEdit`,
|
icon: XMarkIcon,
|
||||||
visible: (objectData) => {
|
visible: (objectData) => {
|
||||||
return objectData?._isEditing && objectData?._isEditing == true
|
return objectData?._isEditing && objectData?._isEditing == true
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: 'cancelEdit',
|
name: 'finishEdit',
|
||||||
label: 'Cancel Edits',
|
label: 'Save Edits',
|
||||||
icon: XMarkIcon,
|
type: 'page',
|
||||||
url: (_id) =>
|
pageName: 'info',
|
||||||
`/dashboard/management/productskus/info?productSkuId=${_id}&action=cancelEdit`,
|
icon: CheckIcon,
|
||||||
visible: (objectData) => {
|
visible: (objectData) => {
|
||||||
return objectData?._isEditing && objectData?._isEditing == true
|
return objectData?._isEditing && objectData?._isEditing == true
|
||||||
}
|
}
|
||||||
@ -55,11 +61,17 @@ export const ProductSku = {
|
|||||||
{ type: 'divider' },
|
{ type: 'divider' },
|
||||||
{
|
{
|
||||||
name: 'delete',
|
name: 'delete',
|
||||||
|
type: 'page',
|
||||||
|
pageName: 'info',
|
||||||
label: 'Delete',
|
label: 'Delete',
|
||||||
icon: BinIcon,
|
icon: BinIcon,
|
||||||
danger: true,
|
danger: true
|
||||||
url: (_id) =>
|
}
|
||||||
`/dashboard/management/productskus/info?productSkuId=${_id}&action=delete`
|
],
|
||||||
|
pages: [
|
||||||
|
{
|
||||||
|
name: 'info',
|
||||||
|
content: () => createElement(ProductSkuInfo)
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
columns: [
|
columns: [
|
||||||
|
|||||||
@ -1,3 +1,11 @@
|
|||||||
|
import { createElement, lazy } from 'react'
|
||||||
|
|
||||||
|
const ProductStockInfo = lazy(
|
||||||
|
() => import('../../components/Dashboard/Inventory/ProductStocks/ProductStockInfo')
|
||||||
|
)
|
||||||
|
const PostProductStock = lazy(
|
||||||
|
() => import('../../components/Dashboard/Inventory/ProductStocks/PostProductStock')
|
||||||
|
)
|
||||||
import ProductStockIcon from '../../components/Icons/ProductStockIcon'
|
import ProductStockIcon from '../../components/Icons/ProductStockIcon'
|
||||||
import InfoCircleIcon from '../../components/Icons/InfoCircleIcon'
|
import InfoCircleIcon from '../../components/Icons/InfoCircleIcon'
|
||||||
import EditIcon from '../../components/Icons/EditIcon'
|
import EditIcon from '../../components/Icons/EditIcon'
|
||||||
@ -15,20 +23,19 @@ export const ProductStock = {
|
|||||||
actions: [
|
actions: [
|
||||||
{
|
{
|
||||||
name: 'info',
|
name: 'info',
|
||||||
|
type: 'page',
|
||||||
|
pageName: 'info',
|
||||||
label: 'Info',
|
label: 'Info',
|
||||||
default: true,
|
default: true,
|
||||||
row: true,
|
row: true,
|
||||||
icon: InfoCircleIcon,
|
icon: InfoCircleIcon
|
||||||
url: (_id) =>
|
|
||||||
`/dashboard/inventory/productstocks/info?productStockId=${_id}`
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: 'edit',
|
name: 'edit',
|
||||||
|
type: 'page',
|
||||||
|
pageName: 'info',
|
||||||
label: 'Edit',
|
label: 'Edit',
|
||||||
type: 'button',
|
|
||||||
icon: EditIcon,
|
icon: EditIcon,
|
||||||
url: (_id) =>
|
|
||||||
`/dashboard/inventory/productstocks/info?productStockId=${_id}&action=edit`,
|
|
||||||
visible: (objectData) => {
|
visible: (objectData) => {
|
||||||
return !(objectData?._isEditing && objectData?._isEditing == true)
|
return !(objectData?._isEditing && objectData?._isEditing == true)
|
||||||
},
|
},
|
||||||
@ -38,34 +45,31 @@ export const ProductStock = {
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: 'cancelEdit',
|
name: 'cancelEdit',
|
||||||
label: 'Cancel Edit',
|
label: 'Cancel Edits',
|
||||||
type: 'button',
|
type: 'page',
|
||||||
|
pageName: 'info',
|
||||||
icon: XMarkIcon,
|
icon: XMarkIcon,
|
||||||
url: (_id) =>
|
|
||||||
`/dashboard/inventory/productstocks/info?productStockId=${_id}&action=cancelEdit`,
|
|
||||||
visible: (objectData) => {
|
visible: (objectData) => {
|
||||||
return objectData?._isEditing && objectData?._isEditing == true
|
return objectData?._isEditing && objectData?._isEditing == true
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: 'finishEdit',
|
name: 'finishEdit',
|
||||||
label: 'Finish Edit',
|
label: 'Save Edits',
|
||||||
type: 'button',
|
type: 'page',
|
||||||
|
pageName: 'info',
|
||||||
icon: CheckIcon,
|
icon: CheckIcon,
|
||||||
url: (_id) =>
|
|
||||||
`/dashboard/inventory/productstocks/info?productStockId=${_id}&action=finishEdit`,
|
|
||||||
visible: (objectData) => {
|
visible: (objectData) => {
|
||||||
return objectData?._isEditing && objectData?._isEditing == true
|
return objectData?._isEditing && objectData?._isEditing == true
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: 'delete',
|
name: 'delete',
|
||||||
|
type: 'page',
|
||||||
|
pageName: 'info',
|
||||||
label: 'Delete',
|
label: 'Delete',
|
||||||
type: 'button',
|
|
||||||
icon: BinIcon,
|
icon: BinIcon,
|
||||||
danger: true,
|
danger: true,
|
||||||
url: (_id) =>
|
|
||||||
`/dashboard/inventory/productstocks/info?productStockId=${_id}&action=delete`,
|
|
||||||
visible: (objectData) => {
|
visible: (objectData) => {
|
||||||
return !(objectData?._isEditing && objectData?._isEditing == true)
|
return !(objectData?._isEditing && objectData?._isEditing == true)
|
||||||
},
|
},
|
||||||
@ -76,16 +80,24 @@ export const ProductStock = {
|
|||||||
{ type: 'divider' },
|
{ type: 'divider' },
|
||||||
{
|
{
|
||||||
name: 'post',
|
name: 'post',
|
||||||
|
type: 'modal',
|
||||||
|
modalWidth: 520,
|
||||||
label: 'Post',
|
label: 'Post',
|
||||||
type: 'button',
|
|
||||||
icon: CheckIcon,
|
icon: CheckIcon,
|
||||||
url: (_id) =>
|
|
||||||
`/dashboard/inventory/productstocks/info?productStockId=${_id}&action=post`,
|
|
||||||
visible: (objectData) => {
|
visible: (objectData) => {
|
||||||
return objectData?.state?.type == 'draft'
|
return objectData?.state?.type == 'draft'
|
||||||
|
},
|
||||||
|
content: (objectData, { onOk } = {}) => {
|
||||||
|
return createElement(PostProductStock, { objectData, onOk })
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
|
pages: [
|
||||||
|
{
|
||||||
|
name: 'info',
|
||||||
|
content: () => createElement(ProductStockInfo)
|
||||||
|
}
|
||||||
|
],
|
||||||
filters: [
|
filters: [
|
||||||
'productSku',
|
'productSku',
|
||||||
'state',
|
'state',
|
||||||
|
|||||||
@ -1,3 +1,26 @@
|
|||||||
|
import { createElement, lazy } from 'react'
|
||||||
|
|
||||||
|
const PurchaseOrderInfo = lazy(
|
||||||
|
() => import('../../components/Dashboard/Inventory/PurchaseOrders/PurchaseOrderInfo')
|
||||||
|
)
|
||||||
|
const NewOrderItem = lazy(
|
||||||
|
() => import('../../components/Dashboard/Inventory/OrderItems/NewOrderItem')
|
||||||
|
)
|
||||||
|
const NewShipment = lazy(
|
||||||
|
() => import('../../components/Dashboard/Inventory/Shipments/NewShipment')
|
||||||
|
)
|
||||||
|
const NewInvoice = lazy(
|
||||||
|
() => import('../../components/Dashboard/Finance/Invoices/NewInvoice')
|
||||||
|
)
|
||||||
|
const PostPurchaseOrder = lazy(
|
||||||
|
() => import('../../components/Dashboard/Inventory/PurchaseOrders/PostPurchaseOrder')
|
||||||
|
)
|
||||||
|
const AcknowledgePurchaseOrder = lazy(
|
||||||
|
() => import('../../components/Dashboard/Inventory/PurchaseOrders/AcknowledgePurchaseOrder')
|
||||||
|
)
|
||||||
|
const CancelPurchaseOrder = lazy(
|
||||||
|
() => import('../../components/Dashboard/Inventory/PurchaseOrders/CancelPurchaseOrder')
|
||||||
|
)
|
||||||
import PurchaseOrderIcon from '../../components/Icons/PurchaseOrderIcon'
|
import PurchaseOrderIcon from '../../components/Icons/PurchaseOrderIcon'
|
||||||
import InfoCircleIcon from '../../components/Icons/InfoCircleIcon'
|
import InfoCircleIcon from '../../components/Icons/InfoCircleIcon'
|
||||||
import PlusIcon from '../../components/Icons/PlusIcon'
|
import PlusIcon from '../../components/Icons/PlusIcon'
|
||||||
@ -16,20 +39,19 @@ export const PurchaseOrder = {
|
|||||||
actions: [
|
actions: [
|
||||||
{
|
{
|
||||||
name: 'info',
|
name: 'info',
|
||||||
|
type: 'page',
|
||||||
|
pageName: 'info',
|
||||||
label: 'Info',
|
label: 'Info',
|
||||||
default: true,
|
default: true,
|
||||||
row: true,
|
row: true,
|
||||||
icon: InfoCircleIcon,
|
icon: InfoCircleIcon
|
||||||
url: (_id) =>
|
|
||||||
`/dashboard/inventory/purchaseorders/info?purchaseOrderId=${_id}`
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: 'edit',
|
name: 'edit',
|
||||||
|
type: 'page',
|
||||||
|
pageName: 'info',
|
||||||
label: 'Edit',
|
label: 'Edit',
|
||||||
type: 'button',
|
|
||||||
icon: EditIcon,
|
icon: EditIcon,
|
||||||
url: (_id) =>
|
|
||||||
`/dashboard/inventory/purchaseorders/info?purchaseOrderId=${_id}&action=edit`,
|
|
||||||
visible: (objectData) => {
|
visible: (objectData) => {
|
||||||
return !(objectData?._isEditing && objectData?._isEditing == true)
|
return !(objectData?._isEditing && objectData?._isEditing == true)
|
||||||
},
|
},
|
||||||
@ -39,34 +61,31 @@ export const PurchaseOrder = {
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: 'cancelEdit',
|
name: 'cancelEdit',
|
||||||
label: 'Cancel Edit',
|
label: 'Cancel Edits',
|
||||||
type: 'button',
|
type: 'page',
|
||||||
|
pageName: 'info',
|
||||||
icon: XMarkIcon,
|
icon: XMarkIcon,
|
||||||
url: (_id) =>
|
|
||||||
`/dashboard/inventory/purchaseorders/info?purchaseOrderId=${_id}&action=cancelEdit`,
|
|
||||||
visible: (objectData) => {
|
visible: (objectData) => {
|
||||||
return objectData?._isEditing && objectData?._isEditing == true
|
return objectData?._isEditing && objectData?._isEditing == true
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: 'finishEdit',
|
name: 'finishEdit',
|
||||||
label: 'Finish Edit',
|
label: 'Save Edits',
|
||||||
type: 'button',
|
type: 'page',
|
||||||
|
pageName: 'info',
|
||||||
icon: CheckIcon,
|
icon: CheckIcon,
|
||||||
url: (_id) =>
|
|
||||||
`/dashboard/inventory/purchaseorders/info?purchaseOrderId=${_id}&action=finishEdit`,
|
|
||||||
visible: (objectData) => {
|
visible: (objectData) => {
|
||||||
return objectData?._isEditing && objectData?._isEditing == true
|
return objectData?._isEditing && objectData?._isEditing == true
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: 'delete',
|
name: 'delete',
|
||||||
|
type: 'page',
|
||||||
|
pageName: 'info',
|
||||||
label: 'Delete',
|
label: 'Delete',
|
||||||
type: 'button',
|
|
||||||
icon: BinIcon,
|
icon: BinIcon,
|
||||||
danger: true,
|
danger: true,
|
||||||
url: (_id) =>
|
|
||||||
`/dashboard/inventory/purchaseorders/info?purchaseOrderId=${_id}&action=delete`,
|
|
||||||
visible: (objectData) => {
|
visible: (objectData) => {
|
||||||
return !(objectData?._isEditing && objectData?._isEditing == true)
|
return !(objectData?._isEditing && objectData?._isEditing == true)
|
||||||
},
|
},
|
||||||
@ -76,34 +95,49 @@ export const PurchaseOrder = {
|
|||||||
},
|
},
|
||||||
{ type: 'divider' },
|
{ type: 'divider' },
|
||||||
{
|
{
|
||||||
name: 'New Order Item',
|
name: 'newOrderItem',
|
||||||
|
type: 'modal',
|
||||||
|
modalWidth: 700,
|
||||||
label: 'New Order Item',
|
label: 'New Order Item',
|
||||||
type: 'button',
|
|
||||||
icon: PlusIcon,
|
icon: PlusIcon,
|
||||||
url: (_id) =>
|
|
||||||
`/dashboard/inventory/purchaseorders/info?purchaseOrderId=${_id}&action=newOrderItem`,
|
|
||||||
disabled: (objectData) => {
|
disabled: (objectData) => {
|
||||||
return objectData?.state?.type != 'draft'
|
return objectData?.state?.type != 'draft'
|
||||||
|
},
|
||||||
|
content: (objectData, { onOk } = {}) => {
|
||||||
|
return createElement(NewOrderItem, {
|
||||||
|
defaultValues: {
|
||||||
|
order: { _id: objectData._id },
|
||||||
|
orderType: 'purchaseOrder',
|
||||||
|
syncAmount: 'itemCost'
|
||||||
|
},
|
||||||
|
onOk,
|
||||||
|
reset: true
|
||||||
|
})
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: 'New Shipment',
|
name: 'newShipment',
|
||||||
|
type: 'modal',
|
||||||
|
modalWidth: 700,
|
||||||
label: 'New Shipment',
|
label: 'New Shipment',
|
||||||
type: 'button',
|
|
||||||
icon: PlusIcon,
|
icon: PlusIcon,
|
||||||
url: (_id) =>
|
|
||||||
`/dashboard/inventory/purchaseorders/info?purchaseOrderId=${_id}&action=newShipment`,
|
|
||||||
disabled: (objectData) => {
|
disabled: (objectData) => {
|
||||||
return objectData?.state?.type != 'draft'
|
return objectData?.state?.type != 'draft'
|
||||||
|
},
|
||||||
|
content: (objectData, { onOk } = {}) => {
|
||||||
|
return createElement(NewShipment, {
|
||||||
|
defaultValues: { orderType: 'purchaseOrder', order: { _id: objectData._id } },
|
||||||
|
onOk,
|
||||||
|
reset: true
|
||||||
|
})
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: 'New Invoice',
|
name: 'newInvoice',
|
||||||
|
type: 'modal',
|
||||||
|
modalWidth: 700,
|
||||||
label: 'New Invoice',
|
label: 'New Invoice',
|
||||||
type: 'button',
|
|
||||||
icon: PlusIcon,
|
icon: PlusIcon,
|
||||||
url: (_id) =>
|
|
||||||
`/dashboard/inventory/purchaseorders/info?purchaseOrderId=${_id}&action=newInvoice`,
|
|
||||||
disabled: (objectData) => {
|
disabled: (objectData) => {
|
||||||
const allowedStates = [
|
const allowedStates = [
|
||||||
'received',
|
'received',
|
||||||
@ -112,6 +146,13 @@ export const PurchaseOrder = {
|
|||||||
'partiallyShipped'
|
'partiallyShipped'
|
||||||
]
|
]
|
||||||
return !allowedStates.includes(objectData?.state?.type)
|
return !allowedStates.includes(objectData?.state?.type)
|
||||||
|
},
|
||||||
|
content: (objectData, { onOk } = {}) => {
|
||||||
|
return createElement(NewInvoice, {
|
||||||
|
defaultValues: { orderType: 'purchaseOrder', order: objectData },
|
||||||
|
onOk,
|
||||||
|
reset: true
|
||||||
|
})
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@ -119,30 +160,33 @@ export const PurchaseOrder = {
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: 'post',
|
name: 'post',
|
||||||
|
type: 'modal',
|
||||||
|
modalWidth: 520,
|
||||||
label: 'Post',
|
label: 'Post',
|
||||||
type: 'button',
|
|
||||||
icon: CheckIcon,
|
icon: CheckIcon,
|
||||||
url: (_id) =>
|
|
||||||
`/dashboard/inventory/purchaseorders/info?purchaseOrderId=${_id}&action=post`,
|
|
||||||
visible: (objectData) => {
|
visible: (objectData) => {
|
||||||
return objectData?.state?.type == 'draft'
|
return objectData?.state?.type == 'draft'
|
||||||
|
},
|
||||||
|
content: (objectData, { onOk } = {}) => {
|
||||||
|
return createElement(PostPurchaseOrder, { objectData, onOk })
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: 'acknowledge',
|
name: 'acknowledge',
|
||||||
|
type: 'modal',
|
||||||
|
modalWidth: 520,
|
||||||
label: 'Acknowledge',
|
label: 'Acknowledge',
|
||||||
type: 'button',
|
|
||||||
icon: CheckIcon,
|
icon: CheckIcon,
|
||||||
url: (_id) =>
|
|
||||||
`/dashboard/inventory/purchaseorders/info?purchaseOrderId=${_id}&action=acknowledge`,
|
|
||||||
visible: (objectData) => {
|
visible: (objectData) => {
|
||||||
return objectData?.state?.type == 'sent'
|
return objectData?.state?.type == 'sent'
|
||||||
|
},
|
||||||
|
content: (objectData, { onOk } = {}) => {
|
||||||
|
return createElement(AcknowledgePurchaseOrder, { objectData, onOk })
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: 'complete',
|
name: 'complete',
|
||||||
label: 'Complete',
|
label: 'Complete',
|
||||||
type: 'button',
|
|
||||||
icon: CheckIcon,
|
icon: CheckIcon,
|
||||||
url: (_id) =>
|
url: (_id) =>
|
||||||
`/dashboard/inventory/shipments/info?shipmentId=${_id}&action=complete`,
|
`/dashboard/inventory/shipments/info?shipmentId=${_id}&action=complete`,
|
||||||
@ -155,12 +199,11 @@ export const PurchaseOrder = {
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: 'cancel',
|
name: 'cancel',
|
||||||
|
type: 'modal',
|
||||||
|
modalWidth: 520,
|
||||||
label: 'Cancel',
|
label: 'Cancel',
|
||||||
type: 'button',
|
|
||||||
icon: XMarkIcon,
|
icon: XMarkIcon,
|
||||||
danger: true,
|
danger: true,
|
||||||
url: (_id) =>
|
|
||||||
`/dashboard/inventory/purchaseorders/info?purchaseOrderId=${_id}&action=cancel`,
|
|
||||||
disabled: (objectData) => {
|
disabled: (objectData) => {
|
||||||
return objectData?.state?.type == 'cancelled'
|
return objectData?.state?.type == 'cancelled'
|
||||||
},
|
},
|
||||||
@ -170,9 +213,18 @@ export const PurchaseOrder = {
|
|||||||
objectData?.state?.type != 'completed' &&
|
objectData?.state?.type != 'completed' &&
|
||||||
objectData?.state?.type != 'received'
|
objectData?.state?.type != 'received'
|
||||||
)
|
)
|
||||||
|
},
|
||||||
|
content: (objectData, { onOk } = {}) => {
|
||||||
|
return createElement(CancelPurchaseOrder, { objectData, onOk })
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
|
pages: [
|
||||||
|
{
|
||||||
|
name: 'info',
|
||||||
|
content: () => createElement(PurchaseOrderInfo)
|
||||||
|
}
|
||||||
|
],
|
||||||
group: ['vendor'],
|
group: ['vendor'],
|
||||||
filters: [
|
filters: [
|
||||||
'vendor',
|
'vendor',
|
||||||
|
|||||||
@ -1,3 +1,26 @@
|
|||||||
|
import { createElement, lazy } from 'react'
|
||||||
|
|
||||||
|
const SalesOrderInfo = lazy(
|
||||||
|
() => import('../../components/Dashboard/Sales/SalesOrders/SalesOrderInfo')
|
||||||
|
)
|
||||||
|
const NewOrderItem = lazy(
|
||||||
|
() => import('../../components/Dashboard/Inventory/OrderItems/NewOrderItem')
|
||||||
|
)
|
||||||
|
const NewShipment = lazy(
|
||||||
|
() => import('../../components/Dashboard/Inventory/Shipments/NewShipment')
|
||||||
|
)
|
||||||
|
const NewInvoice = lazy(
|
||||||
|
() => import('../../components/Dashboard/Finance/Invoices/NewInvoice')
|
||||||
|
)
|
||||||
|
const PostSalesOrder = lazy(
|
||||||
|
() => import('../../components/Dashboard/Sales/SalesOrders/PostSalesOrder')
|
||||||
|
)
|
||||||
|
const ConfirmSalesOrder = lazy(
|
||||||
|
() => import('../../components/Dashboard/Sales/SalesOrders/ConfirmSalesOrder')
|
||||||
|
)
|
||||||
|
const CancelSalesOrder = lazy(
|
||||||
|
() => import('../../components/Dashboard/Sales/SalesOrders/CancelSalesOrder')
|
||||||
|
)
|
||||||
import SalesOrderIcon from '../../components/Icons/SalesOrderIcon'
|
import SalesOrderIcon from '../../components/Icons/SalesOrderIcon'
|
||||||
import InfoCircleIcon from '../../components/Icons/InfoCircleIcon'
|
import InfoCircleIcon from '../../components/Icons/InfoCircleIcon'
|
||||||
import PlusIcon from '../../components/Icons/PlusIcon'
|
import PlusIcon from '../../components/Icons/PlusIcon'
|
||||||
@ -16,19 +39,19 @@ export const SalesOrder = {
|
|||||||
actions: [
|
actions: [
|
||||||
{
|
{
|
||||||
name: 'info',
|
name: 'info',
|
||||||
|
type: 'page',
|
||||||
|
pageName: 'info',
|
||||||
label: 'Info',
|
label: 'Info',
|
||||||
default: true,
|
default: true,
|
||||||
row: true,
|
row: true,
|
||||||
icon: InfoCircleIcon,
|
icon: InfoCircleIcon
|
||||||
url: (_id) => `/dashboard/sales/salesorders/info?salesOrderId=${_id}`
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: 'edit',
|
name: 'edit',
|
||||||
|
type: 'page',
|
||||||
|
pageName: 'info',
|
||||||
label: 'Edit',
|
label: 'Edit',
|
||||||
type: 'button',
|
|
||||||
icon: EditIcon,
|
icon: EditIcon,
|
||||||
url: (_id) =>
|
|
||||||
`/dashboard/sales/salesorders/info?salesOrderId=${_id}&action=edit`,
|
|
||||||
visible: (objectData) => {
|
visible: (objectData) => {
|
||||||
return !(objectData?._isEditing && objectData?._isEditing == true)
|
return !(objectData?._isEditing && objectData?._isEditing == true)
|
||||||
},
|
},
|
||||||
@ -38,34 +61,31 @@ export const SalesOrder = {
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: 'cancelEdit',
|
name: 'cancelEdit',
|
||||||
label: 'Cancel Edit',
|
label: 'Cancel Edits',
|
||||||
type: 'button',
|
type: 'page',
|
||||||
|
pageName: 'info',
|
||||||
icon: XMarkIcon,
|
icon: XMarkIcon,
|
||||||
url: (_id) =>
|
|
||||||
`/dashboard/sales/salesorders/info?salesOrderId=${_id}&action=cancelEdit`,
|
|
||||||
visible: (objectData) => {
|
visible: (objectData) => {
|
||||||
return objectData?._isEditing && objectData?._isEditing == true
|
return objectData?._isEditing && objectData?._isEditing == true
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: 'finishEdit',
|
name: 'finishEdit',
|
||||||
label: 'Finish Edit',
|
label: 'Save Edits',
|
||||||
type: 'button',
|
type: 'page',
|
||||||
|
pageName: 'info',
|
||||||
icon: CheckIcon,
|
icon: CheckIcon,
|
||||||
url: (_id) =>
|
|
||||||
`/dashboard/sales/salesorders/info?salesOrderId=${_id}&action=finishEdit`,
|
|
||||||
visible: (objectData) => {
|
visible: (objectData) => {
|
||||||
return objectData?._isEditing && objectData?._isEditing == true
|
return objectData?._isEditing && objectData?._isEditing == true
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: 'delete',
|
name: 'delete',
|
||||||
|
type: 'page',
|
||||||
|
pageName: 'info',
|
||||||
label: 'Delete',
|
label: 'Delete',
|
||||||
type: 'button',
|
|
||||||
icon: BinIcon,
|
icon: BinIcon,
|
||||||
danger: true,
|
danger: true,
|
||||||
url: (_id) =>
|
|
||||||
`/dashboard/sales/salesorders/info?salesOrderId=${_id}&action=delete`,
|
|
||||||
visible: (objectData) => {
|
visible: (objectData) => {
|
||||||
return !(objectData?._isEditing && objectData?._isEditing == true)
|
return !(objectData?._isEditing && objectData?._isEditing == true)
|
||||||
},
|
},
|
||||||
@ -75,34 +95,54 @@ export const SalesOrder = {
|
|||||||
},
|
},
|
||||||
{ type: 'divider' },
|
{ type: 'divider' },
|
||||||
{
|
{
|
||||||
name: 'New Order Item',
|
name: 'newOrderItem',
|
||||||
|
type: 'modal',
|
||||||
|
modalWidth: 700,
|
||||||
label: 'New Order Item',
|
label: 'New Order Item',
|
||||||
type: 'button',
|
|
||||||
icon: PlusIcon,
|
icon: PlusIcon,
|
||||||
url: (_id) =>
|
|
||||||
`/dashboard/sales/salesorders/info?salesOrderId=${_id}&action=newOrderItem`,
|
|
||||||
disabled: (objectData) => {
|
disabled: (objectData) => {
|
||||||
return objectData?.state?.type != 'draft'
|
return objectData?.state?.type != 'draft'
|
||||||
|
},
|
||||||
|
content: (objectData, { onOk } = {}) => {
|
||||||
|
return createElement(NewOrderItem, {
|
||||||
|
defaultValues: {
|
||||||
|
order: { _id: objectData._id },
|
||||||
|
orderType: 'salesOrder',
|
||||||
|
syncAmount: 'itemPrice'
|
||||||
|
},
|
||||||
|
onOk,
|
||||||
|
reset: true
|
||||||
|
})
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: 'New Shipment',
|
name: 'newShipment',
|
||||||
|
type: 'modal',
|
||||||
|
modalWidth: 700,
|
||||||
|
modalCentered: false,
|
||||||
label: 'New Shipment',
|
label: 'New Shipment',
|
||||||
type: 'button',
|
|
||||||
icon: PlusIcon,
|
icon: PlusIcon,
|
||||||
url: (_id) =>
|
|
||||||
`/dashboard/sales/salesorders/info?salesOrderId=${_id}&action=newShipment`,
|
|
||||||
disabled: (objectData) => {
|
disabled: (objectData) => {
|
||||||
return objectData?.state?.type != 'draft'
|
return objectData?.state?.type != 'draft'
|
||||||
|
},
|
||||||
|
content: (objectData, { onOk } = {}) => {
|
||||||
|
return createElement(NewShipment, {
|
||||||
|
defaultValues: {
|
||||||
|
orderType: 'salesOrder',
|
||||||
|
order: { _id: objectData._id }
|
||||||
|
},
|
||||||
|
onOk,
|
||||||
|
reset: true
|
||||||
|
})
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: 'New Invoice',
|
name: 'newInvoice',
|
||||||
|
type: 'modal',
|
||||||
|
modalWidth: 700,
|
||||||
|
modalCentered: false,
|
||||||
label: 'New Invoice',
|
label: 'New Invoice',
|
||||||
type: 'button',
|
|
||||||
icon: PlusIcon,
|
icon: PlusIcon,
|
||||||
url: (_id) =>
|
|
||||||
`/dashboard/sales/salesorders/info?salesOrderId=${_id}&action=newInvoice`,
|
|
||||||
disabled: (objectData) => {
|
disabled: (objectData) => {
|
||||||
const allowedStates = [
|
const allowedStates = [
|
||||||
'delivered',
|
'delivered',
|
||||||
@ -113,38 +153,50 @@ export const SalesOrder = {
|
|||||||
'partiallyShipped'
|
'partiallyShipped'
|
||||||
]
|
]
|
||||||
return !allowedStates.includes(objectData?.state?.type)
|
return !allowedStates.includes(objectData?.state?.type)
|
||||||
|
},
|
||||||
|
content: (objectData, { onOk } = {}) => {
|
||||||
|
return createElement(NewInvoice, {
|
||||||
|
defaultValues: { orderType: 'salesOrder', order: objectData },
|
||||||
|
onOk,
|
||||||
|
reset: true
|
||||||
|
})
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{ type: 'divider' },
|
{ type: 'divider' },
|
||||||
{
|
{
|
||||||
name: 'post',
|
name: 'post',
|
||||||
|
type: 'modal',
|
||||||
|
modalWidth: 520,
|
||||||
|
modalCentered: true,
|
||||||
label: 'Post',
|
label: 'Post',
|
||||||
type: 'button',
|
|
||||||
icon: CheckIcon,
|
icon: CheckIcon,
|
||||||
url: (_id) =>
|
|
||||||
`/dashboard/sales/salesorders/info?salesOrderId=${_id}&action=post`,
|
|
||||||
visible: (objectData) => {
|
visible: (objectData) => {
|
||||||
return objectData?.state?.type == 'draft'
|
return objectData?.state?.type == 'draft'
|
||||||
|
},
|
||||||
|
content: (objectData, { onOk } = {}) => {
|
||||||
|
return createElement(PostSalesOrder, { objectData, onOk })
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: 'confirm',
|
name: 'confirm',
|
||||||
|
type: 'modal',
|
||||||
|
modalWidth: 520,
|
||||||
label: 'Confirm',
|
label: 'Confirm',
|
||||||
type: 'button',
|
modalCentered: true,
|
||||||
icon: CheckIcon,
|
icon: CheckIcon,
|
||||||
url: (_id) =>
|
|
||||||
`/dashboard/sales/salesorders/info?salesOrderId=${_id}&action=confirm`,
|
|
||||||
visible: (objectData) => {
|
visible: (objectData) => {
|
||||||
return objectData?.state?.type == 'sent'
|
return objectData?.state?.type == 'sent'
|
||||||
|
},
|
||||||
|
content: (objectData, { onOk } = {}) => {
|
||||||
|
return createElement(ConfirmSalesOrder, { objectData, onOk })
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: 'complete',
|
name: 'complete',
|
||||||
|
type: 'page',
|
||||||
|
pageName: 'info',
|
||||||
label: 'Complete',
|
label: 'Complete',
|
||||||
type: 'button',
|
|
||||||
icon: CheckIcon,
|
icon: CheckIcon,
|
||||||
url: (_id) =>
|
|
||||||
`/dashboard/sales/salesorders/info?salesOrderId=${_id}&action=complete`,
|
|
||||||
disabled: (objectData) => {
|
disabled: (objectData) => {
|
||||||
return objectData?.state?.type != 'delivered'
|
return objectData?.state?.type != 'delivered'
|
||||||
},
|
},
|
||||||
@ -154,12 +206,11 @@ export const SalesOrder = {
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: 'cancel',
|
name: 'cancel',
|
||||||
|
type: 'modal',
|
||||||
|
modalWidth: 520,
|
||||||
label: 'Cancel',
|
label: 'Cancel',
|
||||||
type: 'button',
|
|
||||||
icon: XMarkIcon,
|
icon: XMarkIcon,
|
||||||
danger: true,
|
danger: true,
|
||||||
url: (_id) =>
|
|
||||||
`/dashboard/sales/salesorders/info?salesOrderId=${_id}&action=cancel`,
|
|
||||||
disabled: (objectData) => {
|
disabled: (objectData) => {
|
||||||
return objectData?.state?.type == 'cancelled'
|
return objectData?.state?.type == 'cancelled'
|
||||||
},
|
},
|
||||||
@ -169,9 +220,18 @@ export const SalesOrder = {
|
|||||||
objectData?.state?.type != 'completed' &&
|
objectData?.state?.type != 'completed' &&
|
||||||
objectData?.state?.type != 'delivered'
|
objectData?.state?.type != 'delivered'
|
||||||
)
|
)
|
||||||
|
},
|
||||||
|
content: (objectData, { onOk } = {}) => {
|
||||||
|
return createElement(CancelSalesOrder, { objectData, onOk })
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
|
pages: [
|
||||||
|
{
|
||||||
|
name: 'info',
|
||||||
|
content: () => createElement(SalesOrderInfo)
|
||||||
|
}
|
||||||
|
],
|
||||||
group: ['client'],
|
group: ['client'],
|
||||||
filters: [
|
filters: [
|
||||||
'client',
|
'client',
|
||||||
|
|||||||
@ -1,3 +1,17 @@
|
|||||||
|
import { createElement, lazy } from 'react'
|
||||||
|
|
||||||
|
const ShipmentInfo = lazy(
|
||||||
|
() => import('../../components/Dashboard/Inventory/Shipments/ShipmentInfo')
|
||||||
|
)
|
||||||
|
const ShipShipment = lazy(
|
||||||
|
() => import('../../components/Dashboard/Inventory/Shipments/ShipShipment')
|
||||||
|
)
|
||||||
|
const ReceiveShipment = lazy(
|
||||||
|
() => import('../../components/Dashboard/Inventory/Shipments/ReceiveShipment')
|
||||||
|
)
|
||||||
|
const CancelShipment = lazy(
|
||||||
|
() => import('../../components/Dashboard/Inventory/Shipments/CancelShipment')
|
||||||
|
)
|
||||||
import ShipmentIcon from '../../components/Icons/ShipmentIcon'
|
import ShipmentIcon from '../../components/Icons/ShipmentIcon'
|
||||||
import InfoCircleIcon from '../../components/Icons/InfoCircleIcon'
|
import InfoCircleIcon from '../../components/Icons/InfoCircleIcon'
|
||||||
import EditIcon from '../../components/Icons/EditIcon'
|
import EditIcon from '../../components/Icons/EditIcon'
|
||||||
@ -15,19 +29,19 @@ export const Shipment = {
|
|||||||
actions: [
|
actions: [
|
||||||
{
|
{
|
||||||
name: 'info',
|
name: 'info',
|
||||||
|
type: 'page',
|
||||||
|
pageName: 'info',
|
||||||
label: 'Info',
|
label: 'Info',
|
||||||
default: true,
|
default: true,
|
||||||
row: true,
|
row: true,
|
||||||
icon: InfoCircleIcon,
|
icon: InfoCircleIcon
|
||||||
url: (_id) => `/dashboard/inventory/shipments/info?shipmentId=${_id}`
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: 'edit',
|
name: 'edit',
|
||||||
|
type: 'page',
|
||||||
|
pageName: 'info',
|
||||||
label: 'Edit',
|
label: 'Edit',
|
||||||
type: 'button',
|
|
||||||
icon: EditIcon,
|
icon: EditIcon,
|
||||||
url: (_id) =>
|
|
||||||
`/dashboard/inventory/shipments/info?shipmentId=${_id}&action=edit`,
|
|
||||||
visible: (objectData) => {
|
visible: (objectData) => {
|
||||||
return !(objectData?._isEditing && objectData?._isEditing == true)
|
return !(objectData?._isEditing && objectData?._isEditing == true)
|
||||||
},
|
},
|
||||||
@ -37,40 +51,31 @@ export const Shipment = {
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: 'cancelEdit',
|
name: 'cancelEdit',
|
||||||
label: 'Cancel Edit',
|
label: 'Cancel Edits',
|
||||||
type: 'button',
|
type: 'page',
|
||||||
|
pageName: 'info',
|
||||||
icon: XMarkIcon,
|
icon: XMarkIcon,
|
||||||
url: (_id) =>
|
|
||||||
`/dashboard/inventory/shipments/info?shipmentId=${_id}&action=cancelEdit`,
|
|
||||||
visible: (objectData) => {
|
visible: (objectData) => {
|
||||||
return objectData?._isEditing && objectData?._isEditing == true
|
return objectData?._isEditing && objectData?._isEditing == true
|
||||||
},
|
|
||||||
disabled: (objectData) => {
|
|
||||||
return objectData?.state?.type != 'draft'
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: 'finishEdit',
|
name: 'finishEdit',
|
||||||
label: 'Finish Edit',
|
label: 'Save Edits',
|
||||||
type: 'button',
|
type: 'page',
|
||||||
|
pageName: 'info',
|
||||||
icon: CheckIcon,
|
icon: CheckIcon,
|
||||||
url: (_id) =>
|
|
||||||
`/dashboard/inventory/shipments/info?shipmentId=${_id}&action=finishEdit`,
|
|
||||||
visible: (objectData) => {
|
visible: (objectData) => {
|
||||||
return objectData?._isEditing && objectData?._isEditing == true
|
return objectData?._isEditing && objectData?._isEditing == true
|
||||||
},
|
|
||||||
disabled: (objectData) => {
|
|
||||||
return objectData?.state?.type != 'draft'
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: 'delete',
|
name: 'delete',
|
||||||
|
type: 'page',
|
||||||
|
pageName: 'info',
|
||||||
label: 'Delete',
|
label: 'Delete',
|
||||||
type: 'button',
|
|
||||||
icon: BinIcon,
|
icon: BinIcon,
|
||||||
danger: true,
|
danger: true,
|
||||||
url: (_id) =>
|
|
||||||
`/dashboard/inventory/shipments/info?shipmentId=${_id}&action=delete`,
|
|
||||||
visible: (objectData) => {
|
visible: (objectData) => {
|
||||||
return !(objectData?._isEditing && objectData?._isEditing == true)
|
return !(objectData?._isEditing && objectData?._isEditing == true)
|
||||||
},
|
},
|
||||||
@ -81,11 +86,10 @@ export const Shipment = {
|
|||||||
{ type: 'divider' },
|
{ type: 'divider' },
|
||||||
{
|
{
|
||||||
name: 'ship',
|
name: 'ship',
|
||||||
|
type: 'modal',
|
||||||
|
modalWidth: 520,
|
||||||
label: 'Ship',
|
label: 'Ship',
|
||||||
type: 'button',
|
|
||||||
icon: CheckIcon,
|
icon: CheckIcon,
|
||||||
url: (_id) =>
|
|
||||||
`/dashboard/inventory/shipments/info?shipmentId=${_id}&action=ship`,
|
|
||||||
disabled: (objectData) => {
|
disabled: (objectData) => {
|
||||||
return objectData?.state?.type != 'planned'
|
return objectData?.state?.type != 'planned'
|
||||||
},
|
},
|
||||||
@ -94,15 +98,17 @@ export const Shipment = {
|
|||||||
objectData?.state?.type == 'planned' ||
|
objectData?.state?.type == 'planned' ||
|
||||||
objectData?.state?.type == 'draft'
|
objectData?.state?.type == 'draft'
|
||||||
)
|
)
|
||||||
|
},
|
||||||
|
content: (objectData, { onOk } = {}) => {
|
||||||
|
return createElement(ShipShipment, { objectData, onOk })
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: 'receive',
|
name: 'receive',
|
||||||
|
type: 'modal',
|
||||||
|
modalWidth: 520,
|
||||||
label: 'Receive',
|
label: 'Receive',
|
||||||
type: 'button',
|
|
||||||
icon: CheckIcon,
|
icon: CheckIcon,
|
||||||
url: (_id) =>
|
|
||||||
`/dashboard/inventory/shipments/info?shipmentId=${_id}&action=receive`,
|
|
||||||
disabled: (objectData) => {
|
disabled: (objectData) => {
|
||||||
return objectData?.state?.type != 'shipped'
|
return objectData?.state?.type != 'shipped'
|
||||||
},
|
},
|
||||||
@ -111,7 +117,27 @@ export const Shipment = {
|
|||||||
objectData?.state?.type == 'shipped' ||
|
objectData?.state?.type == 'shipped' ||
|
||||||
objectData?.state?.type == 'delivered'
|
objectData?.state?.type == 'delivered'
|
||||||
)
|
)
|
||||||
|
},
|
||||||
|
content: (objectData, { onOk } = {}) => {
|
||||||
|
return createElement(ReceiveShipment, { objectData, onOk })
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: 'cancel',
|
||||||
|
type: 'modal',
|
||||||
|
modalWidth: 520,
|
||||||
|
label: 'Cancel',
|
||||||
|
icon: CheckIcon,
|
||||||
|
danger: true,
|
||||||
|
content: (objectData, { onOk } = {}) => {
|
||||||
|
return createElement(CancelShipment, { objectData, onOk })
|
||||||
|
}
|
||||||
|
}
|
||||||
|
],
|
||||||
|
pages: [
|
||||||
|
{
|
||||||
|
name: 'info',
|
||||||
|
content: () => createElement(ShipmentInfo)
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
group: [],
|
group: [],
|
||||||
|
|||||||
@ -1,3 +1,8 @@
|
|||||||
|
import { createElement, lazy } from 'react'
|
||||||
|
|
||||||
|
const StockAuditInfo = lazy(
|
||||||
|
() => import('../../components/Dashboard/Inventory/StockAudits/StockAuditInfo')
|
||||||
|
)
|
||||||
import StockAuditIcon from '../../components/Icons/StockAuditIcon'
|
import StockAuditIcon from '../../components/Icons/StockAuditIcon'
|
||||||
import InfoCircleIcon from '../../components/Icons/InfoCircleIcon'
|
import InfoCircleIcon from '../../components/Icons/InfoCircleIcon'
|
||||||
|
|
||||||
@ -11,11 +16,18 @@ export const StockAudit = {
|
|||||||
actions: [
|
actions: [
|
||||||
{
|
{
|
||||||
name: 'info',
|
name: 'info',
|
||||||
|
type: 'page',
|
||||||
|
pageName: 'info',
|
||||||
label: 'Info',
|
label: 'Info',
|
||||||
default: true,
|
default: true,
|
||||||
row: true,
|
row: true,
|
||||||
icon: InfoCircleIcon,
|
icon: InfoCircleIcon
|
||||||
url: (_id) => `/dashboard/inventory/stockaudits/info?stockAuditId=${_id}`
|
}
|
||||||
|
],
|
||||||
|
pages: [
|
||||||
|
{
|
||||||
|
name: 'info',
|
||||||
|
content: () => createElement(StockAuditInfo)
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
columns: ['_reference', 'state', 'createdAt', 'updatedAt'],
|
columns: ['_reference', 'state', 'createdAt', 'updatedAt'],
|
||||||
|
|||||||
@ -1,3 +1,8 @@
|
|||||||
|
import { createElement, lazy } from 'react'
|
||||||
|
|
||||||
|
const StockLocationInfo = lazy(
|
||||||
|
() => import('../../components/Dashboard/Inventory/StockLocations/StockLocationInfo')
|
||||||
|
)
|
||||||
import StockLocationIcon from '../../components/Icons/StockLocationIcon'
|
import StockLocationIcon from '../../components/Icons/StockLocationIcon'
|
||||||
import InfoCircleIcon from '../../components/Icons/InfoCircleIcon'
|
import InfoCircleIcon from '../../components/Icons/InfoCircleIcon'
|
||||||
|
|
||||||
@ -11,12 +16,18 @@ export const StockLocation = {
|
|||||||
actions: [
|
actions: [
|
||||||
{
|
{
|
||||||
name: 'info',
|
name: 'info',
|
||||||
|
type: 'page',
|
||||||
|
pageName: 'info',
|
||||||
label: 'Info',
|
label: 'Info',
|
||||||
default: true,
|
default: true,
|
||||||
row: true,
|
row: true,
|
||||||
icon: InfoCircleIcon,
|
icon: InfoCircleIcon
|
||||||
url: (_id) =>
|
}
|
||||||
`/dashboard/inventory/stocklocations/info?stockLocationId=${_id}`
|
],
|
||||||
|
pages: [
|
||||||
|
{
|
||||||
|
name: 'info',
|
||||||
|
content: () => createElement(StockLocationInfo)
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
filters: ['name','createdAt','updatedAt','_reference'],
|
filters: ['name','createdAt','updatedAt','_reference'],
|
||||||
|
|||||||
@ -1,3 +1,11 @@
|
|||||||
|
import { createElement, lazy } from 'react'
|
||||||
|
|
||||||
|
const StockTransferInfo = lazy(
|
||||||
|
() => import('../../components/Dashboard/Inventory/StockTransfers/StockTransferInfo')
|
||||||
|
)
|
||||||
|
const PostStockTransfer = lazy(
|
||||||
|
() => import('../../components/Dashboard/Inventory/StockTransfers/PostStockTransfer')
|
||||||
|
)
|
||||||
import StockTransferIcon from '../../components/Icons/StockTransferIcon'
|
import StockTransferIcon from '../../components/Icons/StockTransferIcon'
|
||||||
import InfoCircleIcon from '../../components/Icons/InfoCircleIcon'
|
import InfoCircleIcon from '../../components/Icons/InfoCircleIcon'
|
||||||
import EditIcon from '../../components/Icons/EditIcon'
|
import EditIcon from '../../components/Icons/EditIcon'
|
||||||
@ -15,20 +23,19 @@ export const StockTransfer = {
|
|||||||
actions: [
|
actions: [
|
||||||
{
|
{
|
||||||
name: 'info',
|
name: 'info',
|
||||||
|
type: 'page',
|
||||||
|
pageName: 'info',
|
||||||
label: 'Info',
|
label: 'Info',
|
||||||
default: true,
|
default: true,
|
||||||
row: true,
|
row: true,
|
||||||
icon: InfoCircleIcon,
|
icon: InfoCircleIcon
|
||||||
url: (_id) =>
|
|
||||||
`/dashboard/inventory/stocktransfers/info?stockTransferId=${_id}`
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: 'edit',
|
name: 'edit',
|
||||||
|
type: 'page',
|
||||||
|
pageName: 'info',
|
||||||
label: 'Edit',
|
label: 'Edit',
|
||||||
type: 'button',
|
|
||||||
icon: EditIcon,
|
icon: EditIcon,
|
||||||
url: (_id) =>
|
|
||||||
`/dashboard/inventory/stocktransfers/info?stockTransferId=${_id}&action=edit`,
|
|
||||||
visible: (objectData) => {
|
visible: (objectData) => {
|
||||||
return !(objectData?._isEditing && objectData?._isEditing == true)
|
return !(objectData?._isEditing && objectData?._isEditing == true)
|
||||||
},
|
},
|
||||||
@ -38,34 +45,31 @@ export const StockTransfer = {
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: 'cancelEdit',
|
name: 'cancelEdit',
|
||||||
label: 'Cancel Edit',
|
label: 'Cancel Edits',
|
||||||
type: 'button',
|
type: 'page',
|
||||||
|
pageName: 'info',
|
||||||
icon: XMarkIcon,
|
icon: XMarkIcon,
|
||||||
url: (_id) =>
|
|
||||||
`/dashboard/inventory/stocktransfers/info?stockTransferId=${_id}&action=cancelEdit`,
|
|
||||||
visible: (objectData) => {
|
visible: (objectData) => {
|
||||||
return objectData?._isEditing && objectData?._isEditing == true
|
return objectData?._isEditing && objectData?._isEditing == true
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: 'finishEdit',
|
name: 'finishEdit',
|
||||||
label: 'Finish Edit',
|
label: 'Save Edits',
|
||||||
type: 'button',
|
type: 'page',
|
||||||
|
pageName: 'info',
|
||||||
icon: CheckIcon,
|
icon: CheckIcon,
|
||||||
url: (_id) =>
|
|
||||||
`/dashboard/inventory/stocktransfers/info?stockTransferId=${_id}&action=finishEdit`,
|
|
||||||
visible: (objectData) => {
|
visible: (objectData) => {
|
||||||
return objectData?._isEditing && objectData?._isEditing == true
|
return objectData?._isEditing && objectData?._isEditing == true
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: 'delete',
|
name: 'delete',
|
||||||
|
type: 'page',
|
||||||
|
pageName: 'info',
|
||||||
label: 'Delete',
|
label: 'Delete',
|
||||||
type: 'button',
|
|
||||||
icon: BinIcon,
|
icon: BinIcon,
|
||||||
danger: true,
|
danger: true,
|
||||||
url: (_id) =>
|
|
||||||
`/dashboard/inventory/stocktransfers/info?stockTransferId=${_id}&action=delete`,
|
|
||||||
visible: (objectData) => {
|
visible: (objectData) => {
|
||||||
return !(objectData?._isEditing && objectData?._isEditing == true)
|
return !(objectData?._isEditing && objectData?._isEditing == true)
|
||||||
},
|
},
|
||||||
@ -76,16 +80,24 @@ export const StockTransfer = {
|
|||||||
{ type: 'divider' },
|
{ type: 'divider' },
|
||||||
{
|
{
|
||||||
name: 'post',
|
name: 'post',
|
||||||
|
type: 'modal',
|
||||||
|
modalWidth: 520,
|
||||||
label: 'Post',
|
label: 'Post',
|
||||||
type: 'button',
|
|
||||||
icon: CheckIcon,
|
icon: CheckIcon,
|
||||||
url: (_id) =>
|
|
||||||
`/dashboard/inventory/stocktransfers/info?stockTransferId=${_id}&action=post`,
|
|
||||||
visible: (objectData) => {
|
visible: (objectData) => {
|
||||||
return objectData?.state?.type == 'draft'
|
return objectData?.state?.type == 'draft'
|
||||||
|
},
|
||||||
|
content: (objectData, { onOk } = {}) => {
|
||||||
|
return createElement(PostStockTransfer, { objectData, onOk })
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
|
pages: [
|
||||||
|
{
|
||||||
|
name: 'info',
|
||||||
|
content: () => createElement(StockTransferInfo)
|
||||||
|
}
|
||||||
|
],
|
||||||
filters: [
|
filters: [
|
||||||
'state',
|
'state',
|
||||||
'state.type',
|
'state.type',
|
||||||
|
|||||||
@ -1,3 +1,8 @@
|
|||||||
|
import { createElement, lazy } from 'react'
|
||||||
|
|
||||||
|
const SubJobInfo = lazy(
|
||||||
|
() => import('../../components/Dashboard/Production/SubJobs/SubJobInfo')
|
||||||
|
)
|
||||||
import SubJobIcon from '../../components/Icons/SubJobIcon'
|
import SubJobIcon from '../../components/Icons/SubJobIcon'
|
||||||
import InfoCircleIcon from '../../components/Icons/InfoCircleIcon'
|
import InfoCircleIcon from '../../components/Icons/InfoCircleIcon'
|
||||||
import XMarkIcon from '../../components/Icons/XMarkIcon'
|
import XMarkIcon from '../../components/Icons/XMarkIcon'
|
||||||
@ -13,24 +18,31 @@ export const SubJob = {
|
|||||||
actions: [
|
actions: [
|
||||||
{
|
{
|
||||||
name: 'info',
|
name: 'info',
|
||||||
|
type: 'page',
|
||||||
|
pageName: 'info',
|
||||||
label: 'Info',
|
label: 'Info',
|
||||||
default: true,
|
default: true,
|
||||||
row: true,
|
row: true,
|
||||||
icon: InfoCircleIcon,
|
icon: InfoCircleIcon
|
||||||
url: (_id) => `/dashboard/production/subjobs/info?subJobId=${_id}`
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: 'cancel',
|
name: 'cancel',
|
||||||
|
type: 'page',
|
||||||
|
pageName: 'info',
|
||||||
label: 'Cancel Sub Job',
|
label: 'Cancel Sub Job',
|
||||||
row: true,
|
row: true,
|
||||||
icon: XMarkIcon,
|
icon: XMarkIcon,
|
||||||
url: (_id) =>
|
|
||||||
`/dashboard/production/subjobs/info?subJobId=${_id}&action=cancel`,
|
|
||||||
disabled: (objectData) => {
|
disabled: (objectData) => {
|
||||||
return objectData?.state?.type !== 'queued'
|
return objectData?.state?.type !== 'queued'
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
|
pages: [
|
||||||
|
{
|
||||||
|
name: 'info',
|
||||||
|
content: () => createElement(SubJobInfo)
|
||||||
|
}
|
||||||
|
],
|
||||||
columns: [
|
columns: [
|
||||||
'_reference',
|
'_reference',
|
||||||
'printer',
|
'printer',
|
||||||
|
|||||||
@ -1,3 +1,8 @@
|
|||||||
|
import { createElement, lazy } from 'react'
|
||||||
|
|
||||||
|
const TaxRateInfo = lazy(
|
||||||
|
() => import('../../components/Dashboard/Management/TaxRates/TaxRateInfo')
|
||||||
|
)
|
||||||
import TaxRateIcon from '../../components/Icons/TaxRateIcon'
|
import TaxRateIcon from '../../components/Icons/TaxRateIcon'
|
||||||
import InfoCircleIcon from '../../components/Icons/InfoCircleIcon'
|
import InfoCircleIcon from '../../components/Icons/InfoCircleIcon'
|
||||||
import EditIcon from '../../components/Icons/EditIcon'
|
import EditIcon from '../../components/Icons/EditIcon'
|
||||||
@ -15,39 +20,40 @@ export const TaxRate = {
|
|||||||
actions: [
|
actions: [
|
||||||
{
|
{
|
||||||
name: 'info',
|
name: 'info',
|
||||||
|
type: 'page',
|
||||||
|
pageName: 'info',
|
||||||
label: 'Info',
|
label: 'Info',
|
||||||
default: true,
|
default: true,
|
||||||
row: true,
|
row: true,
|
||||||
icon: InfoCircleIcon,
|
icon: InfoCircleIcon
|
||||||
url: (_id) => `/dashboard/management/taxrates/info?taxRateId=${_id}`
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: 'edit',
|
name: 'edit',
|
||||||
|
type: 'page',
|
||||||
|
pageName: 'info',
|
||||||
label: 'Edit',
|
label: 'Edit',
|
||||||
row: true,
|
row: true,
|
||||||
icon: EditIcon,
|
icon: EditIcon,
|
||||||
url: (_id) =>
|
|
||||||
`/dashboard/management/taxrates/info?taxRateId=${_id}&action=edit`,
|
|
||||||
visible: (objectData) => {
|
visible: (objectData) => {
|
||||||
return !(objectData?._isEditing && objectData?._isEditing == true)
|
return !(objectData?._isEditing && objectData?._isEditing == true)
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: 'finishEdit',
|
name: 'cancelEdit',
|
||||||
label: 'Save Edits',
|
label: 'Cancel Edits',
|
||||||
icon: CheckIcon,
|
type: 'page',
|
||||||
url: (_id) =>
|
pageName: 'info',
|
||||||
`/dashboard/management/taxrates/info?taxRateId=${_id}&action=finishEdit`,
|
icon: XMarkIcon,
|
||||||
visible: (objectData) => {
|
visible: (objectData) => {
|
||||||
return objectData?._isEditing && objectData?._isEditing == true
|
return objectData?._isEditing && objectData?._isEditing == true
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: 'cancelEdit',
|
name: 'finishEdit',
|
||||||
label: 'Cancel Edits',
|
label: 'Save Edits',
|
||||||
icon: XMarkIcon,
|
type: 'page',
|
||||||
url: (_id) =>
|
pageName: 'info',
|
||||||
`/dashboard/management/taxrates/info?taxRateId=${_id}&action=cancelEdit`,
|
icon: CheckIcon,
|
||||||
visible: (objectData) => {
|
visible: (objectData) => {
|
||||||
return objectData?._isEditing && objectData?._isEditing == true
|
return objectData?._isEditing && objectData?._isEditing == true
|
||||||
}
|
}
|
||||||
@ -55,11 +61,17 @@ export const TaxRate = {
|
|||||||
{ type: 'divider' },
|
{ type: 'divider' },
|
||||||
{
|
{
|
||||||
name: 'delete',
|
name: 'delete',
|
||||||
|
type: 'page',
|
||||||
|
pageName: 'info',
|
||||||
label: 'Delete',
|
label: 'Delete',
|
||||||
icon: BinIcon,
|
icon: BinIcon,
|
||||||
danger: true,
|
danger: true
|
||||||
url: (_id) =>
|
}
|
||||||
`/dashboard/management/taxrates/info?taxRateId=${_id}&action=delete`
|
],
|
||||||
|
pages: [
|
||||||
|
{
|
||||||
|
name: 'info',
|
||||||
|
content: () => createElement(TaxRateInfo)
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
columns: [
|
columns: [
|
||||||
|
|||||||
@ -1,3 +1,8 @@
|
|||||||
|
import { createElement, lazy } from 'react'
|
||||||
|
|
||||||
|
const TaxRecordInfo = lazy(
|
||||||
|
() => import('../../components/Dashboard/Finance/TaxRecords/TaxRecordInfo')
|
||||||
|
)
|
||||||
import TaxRecordIcon from '../../components/Icons/TaxRecordIcon'
|
import TaxRecordIcon from '../../components/Icons/TaxRecordIcon'
|
||||||
import InfoCircleIcon from '../../components/Icons/InfoCircleIcon'
|
import InfoCircleIcon from '../../components/Icons/InfoCircleIcon'
|
||||||
import EditIcon from '../../components/Icons/EditIcon'
|
import EditIcon from '../../components/Icons/EditIcon'
|
||||||
@ -15,39 +20,40 @@ export const TaxRecord = {
|
|||||||
actions: [
|
actions: [
|
||||||
{
|
{
|
||||||
name: 'info',
|
name: 'info',
|
||||||
|
type: 'page',
|
||||||
|
pageName: 'info',
|
||||||
label: 'Info',
|
label: 'Info',
|
||||||
default: true,
|
default: true,
|
||||||
row: true,
|
row: true,
|
||||||
icon: InfoCircleIcon,
|
icon: InfoCircleIcon
|
||||||
url: (_id) => `/dashboard/finance/taxrecords/info?taxRecordId=${_id}`
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: 'edit',
|
name: 'edit',
|
||||||
|
type: 'page',
|
||||||
|
pageName: 'info',
|
||||||
label: 'Edit',
|
label: 'Edit',
|
||||||
row: true,
|
row: true,
|
||||||
icon: EditIcon,
|
icon: EditIcon,
|
||||||
url: (_id) =>
|
|
||||||
`/dashboard/finance/taxrecords/info?taxRecordId=${_id}&action=edit`,
|
|
||||||
visible: (objectData) => {
|
visible: (objectData) => {
|
||||||
return !(objectData?._isEditing && objectData?._isEditing == true)
|
return !(objectData?._isEditing && objectData?._isEditing == true)
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: 'finishEdit',
|
name: 'cancelEdit',
|
||||||
label: 'Save Edits',
|
label: 'Cancel Edits',
|
||||||
icon: CheckIcon,
|
type: 'page',
|
||||||
url: (_id) =>
|
pageName: 'info',
|
||||||
`/dashboard/finance/taxrecords/info?taxRecordId=${_id}&action=finishEdit`,
|
icon: XMarkIcon,
|
||||||
visible: (objectData) => {
|
visible: (objectData) => {
|
||||||
return objectData?._isEditing && objectData?._isEditing == true
|
return objectData?._isEditing && objectData?._isEditing == true
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: 'cancelEdit',
|
name: 'finishEdit',
|
||||||
label: 'Cancel Edits',
|
label: 'Save Edits',
|
||||||
icon: XMarkIcon,
|
type: 'page',
|
||||||
url: (_id) =>
|
pageName: 'info',
|
||||||
`/dashboard/finance/taxrecords/info?taxRecordId=${_id}&action=cancelEdit`,
|
icon: CheckIcon,
|
||||||
visible: (objectData) => {
|
visible: (objectData) => {
|
||||||
return objectData?._isEditing && objectData?._isEditing == true
|
return objectData?._isEditing && objectData?._isEditing == true
|
||||||
}
|
}
|
||||||
@ -55,11 +61,17 @@ export const TaxRecord = {
|
|||||||
{ type: 'divider' },
|
{ type: 'divider' },
|
||||||
{
|
{
|
||||||
name: 'delete',
|
name: 'delete',
|
||||||
|
type: 'page',
|
||||||
|
pageName: 'info',
|
||||||
label: 'Delete',
|
label: 'Delete',
|
||||||
icon: BinIcon,
|
icon: BinIcon,
|
||||||
danger: true,
|
danger: true
|
||||||
url: (_id) =>
|
}
|
||||||
`/dashboard/finance/taxrecords/info?taxRecordId=${_id}&action=delete`
|
],
|
||||||
|
pages: [
|
||||||
|
{
|
||||||
|
name: 'info',
|
||||||
|
content: () => createElement(TaxRecordInfo)
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
columns: [
|
columns: [
|
||||||
|
|||||||
@ -1,6 +1,16 @@
|
|||||||
|
import { createElement, lazy } from 'react'
|
||||||
|
|
||||||
|
const UserInfo = lazy(
|
||||||
|
() => import('../../components/Dashboard/Management/Users/UserInfo')
|
||||||
|
)
|
||||||
|
const NewAppPassword = lazy(
|
||||||
|
() => import('../../components/Dashboard/Management/AppPasswords/NewAppPassword')
|
||||||
|
)
|
||||||
import PersonIcon from '../../components/Icons/PersonIcon'
|
import PersonIcon from '../../components/Icons/PersonIcon'
|
||||||
import InfoCircleIcon from '../../components/Icons/InfoCircleIcon'
|
import InfoCircleIcon from '../../components/Icons/InfoCircleIcon'
|
||||||
import EditIcon from '../../components/Icons/EditIcon'
|
import EditIcon from '../../components/Icons/EditIcon'
|
||||||
|
import CheckIcon from '../../components/Icons/CheckIcon'
|
||||||
|
import XMarkIcon from '../../components/Icons/XMarkIcon'
|
||||||
import PlusIcon from '../../components/Icons/PlusIcon'
|
import PlusIcon from '../../components/Icons/PlusIcon'
|
||||||
|
|
||||||
export const User = {
|
export const User = {
|
||||||
@ -13,31 +23,64 @@ export const User = {
|
|||||||
actions: [
|
actions: [
|
||||||
{
|
{
|
||||||
name: 'info',
|
name: 'info',
|
||||||
|
type: 'page',
|
||||||
|
pageName: 'info',
|
||||||
label: 'Info',
|
label: 'Info',
|
||||||
default: true,
|
default: true,
|
||||||
row: true,
|
row: true,
|
||||||
icon: InfoCircleIcon,
|
icon: InfoCircleIcon
|
||||||
url: (_id) => `/dashboard/management/users/info?userId=${_id}`
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: 'edit',
|
name: 'edit',
|
||||||
|
type: 'page',
|
||||||
|
pageName: 'info',
|
||||||
label: 'Edit',
|
label: 'Edit',
|
||||||
row: true,
|
row: true,
|
||||||
icon: EditIcon,
|
icon: EditIcon,
|
||||||
url: (_id) => `/dashboard/management/users/info?userId=${_id}&action=edit`
|
visible: (objectData) => {
|
||||||
|
return !(objectData?._isEditing && objectData?._isEditing == true)
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: 'cancelEdit',
|
||||||
|
label: 'Cancel Edits',
|
||||||
|
type: 'page',
|
||||||
|
pageName: 'info',
|
||||||
|
icon: XMarkIcon,
|
||||||
|
visible: (objectData) => {
|
||||||
|
return objectData?._isEditing && objectData?._isEditing == true
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: 'finishEdit',
|
||||||
|
label: 'Save Edits',
|
||||||
|
type: 'page',
|
||||||
|
pageName: 'info',
|
||||||
|
icon: CheckIcon,
|
||||||
|
visible: (objectData) => {
|
||||||
|
return objectData?._isEditing && objectData?._isEditing == true
|
||||||
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: 'newAppPassword',
|
name: 'newAppPassword',
|
||||||
|
type: 'modal',
|
||||||
|
modalWidth: 680,
|
||||||
label: 'New App Password',
|
label: 'New App Password',
|
||||||
type: 'button',
|
|
||||||
icon: PlusIcon,
|
icon: PlusIcon,
|
||||||
url: (_id) =>
|
|
||||||
`/dashboard/management/users/info?userId=${_id}&action=newAppPassword`,
|
|
||||||
disabled: (objectData) => {
|
disabled: (objectData) => {
|
||||||
return objectData?._user?._id != objectData?._id
|
return objectData?._user?._id != objectData?._id
|
||||||
|
},
|
||||||
|
content: (objectData, { onOk } = {}) => {
|
||||||
|
return createElement(NewAppPassword, { defaultValues: { user: objectData }, onOk, reset: true })
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
|
pages: [
|
||||||
|
{
|
||||||
|
name: 'info',
|
||||||
|
content: () => createElement(UserInfo)
|
||||||
|
}
|
||||||
|
],
|
||||||
columns: ['_reference', 'name', 'username', 'email', 'role', 'createdAt'],
|
columns: ['_reference', 'name', 'username', 'email', 'role', 'createdAt'],
|
||||||
filters: [
|
filters: [
|
||||||
'name',
|
'name',
|
||||||
|
|||||||
@ -1,3 +1,8 @@
|
|||||||
|
import { createElement, lazy } from 'react'
|
||||||
|
|
||||||
|
const VendorInfo = lazy(
|
||||||
|
() => import('../../components/Dashboard/Management/Vendors/VendorInfo')
|
||||||
|
)
|
||||||
import VendorIcon from '../../components/Icons/VendorIcon'
|
import VendorIcon from '../../components/Icons/VendorIcon'
|
||||||
import InfoCircleIcon from '../../components/Icons/InfoCircleIcon'
|
import InfoCircleIcon from '../../components/Icons/InfoCircleIcon'
|
||||||
import EditIcon from '../../components/Icons/EditIcon'
|
import EditIcon from '../../components/Icons/EditIcon'
|
||||||
@ -15,39 +20,40 @@ export const Vendor = {
|
|||||||
actions: [
|
actions: [
|
||||||
{
|
{
|
||||||
name: 'info',
|
name: 'info',
|
||||||
|
type: 'page',
|
||||||
|
pageName: 'info',
|
||||||
label: 'Info',
|
label: 'Info',
|
||||||
default: true,
|
default: true,
|
||||||
row: true,
|
row: true,
|
||||||
icon: InfoCircleIcon,
|
icon: InfoCircleIcon
|
||||||
url: (_id) => `/dashboard/management/vendors/info?vendorId=${_id}`
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: 'edit',
|
name: 'edit',
|
||||||
|
type: 'page',
|
||||||
|
pageName: 'info',
|
||||||
label: 'Edit',
|
label: 'Edit',
|
||||||
row: true,
|
row: true,
|
||||||
icon: EditIcon,
|
icon: EditIcon,
|
||||||
url: (_id) =>
|
|
||||||
`/dashboard/management/vendors/info?vendorId=${_id}&action=edit`,
|
|
||||||
visible: (objectData) => {
|
visible: (objectData) => {
|
||||||
return !(objectData?._isEditing && objectData?._isEditing == true)
|
return !(objectData?._isEditing && objectData?._isEditing == true)
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: 'finishEdit',
|
name: 'cancelEdit',
|
||||||
label: 'Save Edits',
|
label: 'Cancel Edits',
|
||||||
icon: CheckIcon,
|
type: 'page',
|
||||||
url: (_id) =>
|
pageName: 'info',
|
||||||
`/dashboard/management/vendors/info?vendorId=${_id}&action=finishEdit`,
|
icon: XMarkIcon,
|
||||||
visible: (objectData) => {
|
visible: (objectData) => {
|
||||||
return objectData?._isEditing && objectData?._isEditing == true
|
return objectData?._isEditing && objectData?._isEditing == true
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: 'cancelEdit',
|
name: 'finishEdit',
|
||||||
label: 'Cancel Edits',
|
label: 'Save Edits',
|
||||||
icon: XMarkIcon,
|
type: 'page',
|
||||||
url: (_id) =>
|
pageName: 'info',
|
||||||
`/dashboard/management/vendors/info?vendorId=${_id}&action=cancelEdit`,
|
icon: CheckIcon,
|
||||||
visible: (objectData) => {
|
visible: (objectData) => {
|
||||||
return objectData?._isEditing && objectData?._isEditing == true
|
return objectData?._isEditing && objectData?._isEditing == true
|
||||||
}
|
}
|
||||||
@ -55,11 +61,17 @@ export const Vendor = {
|
|||||||
{ type: 'divider' },
|
{ type: 'divider' },
|
||||||
{
|
{
|
||||||
name: 'delete',
|
name: 'delete',
|
||||||
|
type: 'page',
|
||||||
|
pageName: 'info',
|
||||||
label: 'Delete',
|
label: 'Delete',
|
||||||
icon: BinIcon,
|
icon: BinIcon,
|
||||||
danger: true,
|
danger: true
|
||||||
url: (_id) =>
|
}
|
||||||
`/dashboard/management/vendors/info?vendorId=${_id}&action=delete`
|
],
|
||||||
|
pages: [
|
||||||
|
{
|
||||||
|
name: 'info',
|
||||||
|
content: () => createElement(VendorInfo)
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
columns: [
|
columns: [
|
||||||
|
|||||||
@ -14,24 +14,15 @@ const TaxRecordsInfoRedirect = () => {
|
|||||||
const Invoices = lazy(
|
const Invoices = lazy(
|
||||||
() => import('../components/Dashboard/Finance/Invoices.jsx')
|
() => import('../components/Dashboard/Finance/Invoices.jsx')
|
||||||
)
|
)
|
||||||
const InvoiceInfo = lazy(
|
|
||||||
() => import('../components/Dashboard/Finance/Invoices/InvoiceInfo.jsx')
|
|
||||||
)
|
|
||||||
const Payments = lazy(
|
const Payments = lazy(
|
||||||
() => import('../components/Dashboard/Finance/Payments.jsx')
|
() => import('../components/Dashboard/Finance/Payments.jsx')
|
||||||
)
|
)
|
||||||
const PaymentInfo = lazy(
|
|
||||||
() => import('../components/Dashboard/Finance/Payments/PaymentInfo.jsx')
|
|
||||||
)
|
|
||||||
const FinanceOverview = lazy(
|
const FinanceOverview = lazy(
|
||||||
() => import('../components/Dashboard/Finance/FinanceOverview.jsx')
|
() => import('../components/Dashboard/Finance/FinanceOverview.jsx')
|
||||||
)
|
)
|
||||||
const TaxRecords = lazy(
|
const TaxRecords = lazy(
|
||||||
() => import('../components/Dashboard/Finance/TaxRecords.jsx')
|
() => import('../components/Dashboard/Finance/TaxRecords.jsx')
|
||||||
)
|
)
|
||||||
const TaxRecordInfo = lazy(
|
|
||||||
() => import('../components/Dashboard/Finance/TaxRecords/TaxRecordInfo.jsx')
|
|
||||||
)
|
|
||||||
|
|
||||||
const FinanceRoutes = [
|
const FinanceRoutes = [
|
||||||
<Route
|
<Route
|
||||||
@ -40,23 +31,8 @@ const FinanceRoutes = [
|
|||||||
element={<FinanceOverview />}
|
element={<FinanceOverview />}
|
||||||
/>,
|
/>,
|
||||||
<Route key='invoices' path='finance/invoices' element={<Invoices />} />,
|
<Route key='invoices' path='finance/invoices' element={<Invoices />} />,
|
||||||
<Route
|
|
||||||
key='invoices-info'
|
|
||||||
path='finance/invoices/info'
|
|
||||||
element={<InvoiceInfo />}
|
|
||||||
/>,
|
|
||||||
<Route key='payments' path='finance/payments' element={<Payments />} />,
|
<Route key='payments' path='finance/payments' element={<Payments />} />,
|
||||||
<Route
|
|
||||||
key='payments-info'
|
|
||||||
path='finance/payments/info'
|
|
||||||
element={<PaymentInfo />}
|
|
||||||
/>,
|
|
||||||
<Route key='taxrecords' path='finance/taxrecords' element={<TaxRecords />} />,
|
<Route key='taxrecords' path='finance/taxrecords' element={<TaxRecords />} />,
|
||||||
<Route
|
|
||||||
key='taxrecords-info'
|
|
||||||
path='finance/taxrecords/info'
|
|
||||||
element={<TaxRecordInfo />}
|
|
||||||
/>,
|
|
||||||
<Route
|
<Route
|
||||||
key='taxrecords-redirect'
|
key='taxrecords-redirect'
|
||||||
path='management/taxrecords'
|
path='management/taxrecords'
|
||||||
@ -70,4 +46,3 @@ const FinanceRoutes = [
|
|||||||
]
|
]
|
||||||
|
|
||||||
export default FinanceRoutes
|
export default FinanceRoutes
|
||||||
|
|
||||||
|
|||||||
@ -4,73 +4,36 @@ import { Route } from 'react-router-dom'
|
|||||||
const FilamentStocks = lazy(
|
const FilamentStocks = lazy(
|
||||||
() => import('../components/Dashboard/Inventory/FilamentStocks.jsx')
|
() => import('../components/Dashboard/Inventory/FilamentStocks.jsx')
|
||||||
)
|
)
|
||||||
const FilamentStockInfo = lazy(
|
|
||||||
() =>
|
|
||||||
import('../components/Dashboard/Inventory/FilamentStocks/FilamentStockInfo.jsx')
|
|
||||||
)
|
|
||||||
const PartStocks = lazy(
|
const PartStocks = lazy(
|
||||||
() => import('../components/Dashboard/Inventory/PartStocks.jsx')
|
() => import('../components/Dashboard/Inventory/PartStocks.jsx')
|
||||||
)
|
)
|
||||||
const ProductStocks = lazy(
|
const ProductStocks = lazy(
|
||||||
() => import('../components/Dashboard/Inventory/ProductStocks.jsx')
|
() => import('../components/Dashboard/Inventory/ProductStocks.jsx')
|
||||||
)
|
)
|
||||||
const ProductStockInfo = lazy(
|
|
||||||
() =>
|
|
||||||
import(
|
|
||||||
'../components/Dashboard/Inventory/ProductStocks/ProductStockInfo.jsx'
|
|
||||||
)
|
|
||||||
)
|
|
||||||
const PartStockInfo = lazy(
|
|
||||||
() => import('../components/Dashboard/Inventory/PartStocks/PartStockInfo.jsx')
|
|
||||||
)
|
|
||||||
const StockEvents = lazy(
|
const StockEvents = lazy(
|
||||||
() => import('../components/Dashboard/Inventory/StockEvents.jsx')
|
() => import('../components/Dashboard/Inventory/StockEvents.jsx')
|
||||||
)
|
)
|
||||||
const StockAudits = lazy(
|
const StockAudits = lazy(
|
||||||
() => import('../components/Dashboard/Inventory/StockAudits.jsx')
|
() => import('../components/Dashboard/Inventory/StockAudits.jsx')
|
||||||
)
|
)
|
||||||
const StockAuditInfo = lazy(
|
|
||||||
() =>
|
|
||||||
import('../components/Dashboard/Inventory/StockAudits/StockAuditInfo.jsx')
|
|
||||||
)
|
|
||||||
const PurchaseOrders = lazy(
|
const PurchaseOrders = lazy(
|
||||||
() => import('../components/Dashboard/Inventory/PurchaseOrders.jsx')
|
() => import('../components/Dashboard/Inventory/PurchaseOrders.jsx')
|
||||||
)
|
)
|
||||||
const PurchaseOrderInfo = lazy(
|
|
||||||
() =>
|
|
||||||
import('../components/Dashboard/Inventory/PurchaseOrders/PurchaseOrderInfo.jsx')
|
|
||||||
)
|
|
||||||
const OrderItems = lazy(
|
const OrderItems = lazy(
|
||||||
() => import('../components/Dashboard/Inventory/OrderItems.jsx')
|
() => import('../components/Dashboard/Inventory/OrderItems.jsx')
|
||||||
)
|
)
|
||||||
const OrderItemInfo = lazy(
|
|
||||||
() => import('../components/Dashboard/Inventory/OrderItems/OrderItemInfo.jsx')
|
|
||||||
)
|
|
||||||
const Shipments = lazy(
|
const Shipments = lazy(
|
||||||
() => import('../components/Dashboard/Inventory/Shipments.jsx')
|
() => import('../components/Dashboard/Inventory/Shipments.jsx')
|
||||||
)
|
)
|
||||||
const ShipmentInfo = lazy(
|
|
||||||
() => import('../components/Dashboard/Inventory/Shipments/ShipmentInfo.jsx')
|
|
||||||
)
|
|
||||||
const InventoryOverview = lazy(
|
const InventoryOverview = lazy(
|
||||||
() => import('../components/Dashboard/Inventory/InventoryOverview.jsx')
|
() => import('../components/Dashboard/Inventory/InventoryOverview.jsx')
|
||||||
)
|
)
|
||||||
const StockLocations = lazy(
|
const StockLocations = lazy(
|
||||||
() => import('../components/Dashboard/Inventory/StockLocations.jsx')
|
() => import('../components/Dashboard/Inventory/StockLocations.jsx')
|
||||||
)
|
)
|
||||||
const StockLocationInfo = lazy(
|
|
||||||
() =>
|
|
||||||
import('../components/Dashboard/Inventory/StockLocations/StockLocationInfo.jsx')
|
|
||||||
)
|
|
||||||
const StockTransfers = lazy(
|
const StockTransfers = lazy(
|
||||||
() => import('../components/Dashboard/Inventory/StockTransfers.jsx')
|
() => import('../components/Dashboard/Inventory/StockTransfers.jsx')
|
||||||
)
|
)
|
||||||
const StockTransferInfo = lazy(
|
|
||||||
() =>
|
|
||||||
import(
|
|
||||||
'../components/Dashboard/Inventory/StockTransfers/StockTransferInfo.jsx'
|
|
||||||
)
|
|
||||||
)
|
|
||||||
|
|
||||||
const InventoryRoutes = [
|
const InventoryRoutes = [
|
||||||
<Route
|
<Route
|
||||||
@ -83,51 +46,26 @@ const InventoryRoutes = [
|
|||||||
path='inventory/filamentstocks'
|
path='inventory/filamentstocks'
|
||||||
element={<FilamentStocks />}
|
element={<FilamentStocks />}
|
||||||
/>,
|
/>,
|
||||||
<Route
|
|
||||||
key='filamentstocks-info'
|
|
||||||
path='inventory/filamentstocks/info'
|
|
||||||
element={<FilamentStockInfo />}
|
|
||||||
/>,
|
|
||||||
<Route
|
<Route
|
||||||
key='partstocks'
|
key='partstocks'
|
||||||
path='inventory/partstocks'
|
path='inventory/partstocks'
|
||||||
element={<PartStocks />}
|
element={<PartStocks />}
|
||||||
/>,
|
/>,
|
||||||
<Route
|
|
||||||
key='partstocks-info'
|
|
||||||
path='inventory/partstocks/info'
|
|
||||||
element={<PartStockInfo />}
|
|
||||||
/>,
|
|
||||||
<Route
|
<Route
|
||||||
key='productstocks'
|
key='productstocks'
|
||||||
path='inventory/productstocks'
|
path='inventory/productstocks'
|
||||||
element={<ProductStocks />}
|
element={<ProductStocks />}
|
||||||
/>,
|
/>,
|
||||||
<Route
|
|
||||||
key='productstocks-info'
|
|
||||||
path='inventory/productstocks/info'
|
|
||||||
element={<ProductStockInfo />}
|
|
||||||
/>,
|
|
||||||
<Route
|
<Route
|
||||||
key='stocklocations'
|
key='stocklocations'
|
||||||
path='inventory/stocklocations'
|
path='inventory/stocklocations'
|
||||||
element={<StockLocations />}
|
element={<StockLocations />}
|
||||||
/>,
|
/>,
|
||||||
<Route
|
|
||||||
key='stocklocations-info'
|
|
||||||
path='inventory/stocklocations/info'
|
|
||||||
element={<StockLocationInfo />}
|
|
||||||
/>,
|
|
||||||
<Route
|
<Route
|
||||||
key='stocktransfers'
|
key='stocktransfers'
|
||||||
path='inventory/stocktransfers'
|
path='inventory/stocktransfers'
|
||||||
element={<StockTransfers />}
|
element={<StockTransfers />}
|
||||||
/>,
|
/>,
|
||||||
<Route
|
|
||||||
key='stocktransfers-info'
|
|
||||||
path='inventory/stocktransfers/info'
|
|
||||||
element={<StockTransferInfo />}
|
|
||||||
/>,
|
|
||||||
<Route
|
<Route
|
||||||
key='stockevents'
|
key='stockevents'
|
||||||
path='inventory/stockevents'
|
path='inventory/stockevents'
|
||||||
@ -138,37 +76,17 @@ const InventoryRoutes = [
|
|||||||
path='inventory/stockaudits'
|
path='inventory/stockaudits'
|
||||||
element={<StockAudits />}
|
element={<StockAudits />}
|
||||||
/>,
|
/>,
|
||||||
<Route
|
|
||||||
key='stockaudits-info'
|
|
||||||
path='inventory/stockaudits/info'
|
|
||||||
element={<StockAuditInfo />}
|
|
||||||
/>,
|
|
||||||
<Route
|
<Route
|
||||||
key='purchaseorders'
|
key='purchaseorders'
|
||||||
path='inventory/purchaseorders'
|
path='inventory/purchaseorders'
|
||||||
element={<PurchaseOrders />}
|
element={<PurchaseOrders />}
|
||||||
/>,
|
/>,
|
||||||
<Route
|
|
||||||
key='purchaseorders-info'
|
|
||||||
path='inventory/purchaseorders/info'
|
|
||||||
element={<PurchaseOrderInfo />}
|
|
||||||
/>,
|
|
||||||
<Route
|
<Route
|
||||||
key='orderitems'
|
key='orderitems'
|
||||||
path='inventory/orderitems'
|
path='inventory/orderitems'
|
||||||
element={<OrderItems />}
|
element={<OrderItems />}
|
||||||
/>,
|
/>,
|
||||||
<Route
|
<Route key='shipments' path='inventory/shipments' element={<Shipments />} />
|
||||||
key='orderitems-info'
|
|
||||||
path='inventory/orderitems/info'
|
|
||||||
element={<OrderItemInfo />}
|
|
||||||
/>,
|
|
||||||
<Route key='shipments' path='inventory/shipments' element={<Shipments />} />,
|
|
||||||
<Route
|
|
||||||
key='shipments-info'
|
|
||||||
path='inventory/shipments/info'
|
|
||||||
element={<ShipmentInfo />}
|
|
||||||
/>
|
|
||||||
]
|
]
|
||||||
|
|
||||||
export default InventoryRoutes
|
export default InventoryRoutes
|
||||||
|
|||||||
@ -4,69 +4,32 @@ import { Route } from 'react-router-dom'
|
|||||||
const Filaments = lazy(
|
const Filaments = lazy(
|
||||||
() => import('../components/Dashboard/Management/Filaments')
|
() => import('../components/Dashboard/Management/Filaments')
|
||||||
)
|
)
|
||||||
const FilamentInfo = lazy(
|
|
||||||
() => import('../components/Dashboard/Management/Filaments/FilamentInfo.jsx')
|
|
||||||
)
|
|
||||||
const FilamentSkus = lazy(
|
const FilamentSkus = lazy(
|
||||||
() => import('../components/Dashboard/Management/FilamentSkus.jsx')
|
() => import('../components/Dashboard/Management/FilamentSkus.jsx')
|
||||||
)
|
)
|
||||||
const FilamentSkuInfo = lazy(
|
|
||||||
() =>
|
|
||||||
import('../components/Dashboard/Management/FilamentSkus/FilamentSkuInfo.jsx')
|
|
||||||
)
|
|
||||||
const Parts = lazy(() => import('../components/Dashboard/Management/Parts.jsx'))
|
const Parts = lazy(() => import('../components/Dashboard/Management/Parts.jsx'))
|
||||||
const PartInfo = lazy(
|
|
||||||
() => import('../components/Dashboard/Management/Parts/PartInfo.jsx')
|
|
||||||
)
|
|
||||||
const PartSkus = lazy(
|
const PartSkus = lazy(
|
||||||
() => import('../components/Dashboard/Management/PartSkus.jsx')
|
() => import('../components/Dashboard/Management/PartSkus.jsx')
|
||||||
)
|
)
|
||||||
const PartSkuInfo = lazy(
|
|
||||||
() => import('../components/Dashboard/Management/PartSkus/PartSkuInfo.jsx')
|
|
||||||
)
|
|
||||||
const Products = lazy(
|
const Products = lazy(
|
||||||
() => import('../components/Dashboard/Management/Products.jsx')
|
() => import('../components/Dashboard/Management/Products.jsx')
|
||||||
)
|
)
|
||||||
const ProductInfo = lazy(
|
|
||||||
() => import('../components/Dashboard/Management/Products/ProductInfo.jsx')
|
|
||||||
)
|
|
||||||
const ProductCategories = lazy(
|
const ProductCategories = lazy(
|
||||||
() => import('../components/Dashboard/Management/ProductCategories.jsx')
|
() => import('../components/Dashboard/Management/ProductCategories.jsx')
|
||||||
)
|
)
|
||||||
const ProductCategoryInfo = lazy(
|
|
||||||
() =>
|
|
||||||
import('../components/Dashboard/Management/ProductCategories/ProductCategoryInfo.jsx')
|
|
||||||
)
|
|
||||||
const ProductSkus = lazy(
|
const ProductSkus = lazy(
|
||||||
() => import('../components/Dashboard/Management/ProductSkus.jsx')
|
() => import('../components/Dashboard/Management/ProductSkus.jsx')
|
||||||
)
|
)
|
||||||
const ProductSkuInfo = lazy(
|
|
||||||
() =>
|
|
||||||
import('../components/Dashboard/Management/ProductSkus/ProductSkuInfo.jsx')
|
|
||||||
)
|
|
||||||
const Vendors = lazy(() => import('../components/Dashboard/Management/Vendors'))
|
const Vendors = lazy(() => import('../components/Dashboard/Management/Vendors'))
|
||||||
const VendorInfo = lazy(
|
|
||||||
() => import('../components/Dashboard/Management/Vendors/VendorInfo')
|
|
||||||
)
|
|
||||||
const Materials = lazy(
|
const Materials = lazy(
|
||||||
() => import('../components/Dashboard/Management/Materials')
|
() => import('../components/Dashboard/Management/Materials')
|
||||||
)
|
)
|
||||||
const MaterialInfo = lazy(
|
|
||||||
() => import('../components/Dashboard/Management/Materials/MaterialInfo.jsx')
|
|
||||||
)
|
|
||||||
const Couriers = lazy(
|
const Couriers = lazy(
|
||||||
() => import('../components/Dashboard/Management/Couriers')
|
() => import('../components/Dashboard/Management/Couriers')
|
||||||
)
|
)
|
||||||
const CourierInfo = lazy(
|
|
||||||
() => import('../components/Dashboard/Management/Couriers/CourierInfo.jsx')
|
|
||||||
)
|
|
||||||
const CourierServices = lazy(
|
const CourierServices = lazy(
|
||||||
() => import('../components/Dashboard/Management/CourierServices')
|
() => import('../components/Dashboard/Management/CourierServices')
|
||||||
)
|
)
|
||||||
const CourierServiceInfo = lazy(
|
|
||||||
() =>
|
|
||||||
import('../components/Dashboard/Management/CourierServices/CourierServiceInfo.jsx')
|
|
||||||
)
|
|
||||||
const Settings = lazy(
|
const Settings = lazy(
|
||||||
() => import('../components/Dashboard/Management/Settings')
|
() => import('../components/Dashboard/Management/Settings')
|
||||||
)
|
)
|
||||||
@ -76,243 +39,103 @@ const AuditLogs = lazy(
|
|||||||
const NoteTypes = lazy(
|
const NoteTypes = lazy(
|
||||||
() => import('../components/Dashboard/Management/NoteTypes.jsx')
|
() => import('../components/Dashboard/Management/NoteTypes.jsx')
|
||||||
)
|
)
|
||||||
const NoteTypeInfo = lazy(
|
|
||||||
() => import('../components/Dashboard/Management/NoteTypes/NoteTypeInfo.jsx')
|
|
||||||
)
|
|
||||||
const NoteInfo = lazy(
|
const NoteInfo = lazy(
|
||||||
() => import('../components/Dashboard/Management/Notes/NoteInfo.jsx')
|
() => import('../components/Dashboard/Management/Notes/NoteInfo.jsx')
|
||||||
)
|
)
|
||||||
const Users = lazy(() => import('../components/Dashboard/Management/Users.jsx'))
|
const Users = lazy(() => import('../components/Dashboard/Management/Users.jsx'))
|
||||||
const UserInfo = lazy(
|
|
||||||
() => import('../components/Dashboard/Management/Users/UserInfo.jsx')
|
|
||||||
)
|
|
||||||
const AppPasswords = lazy(
|
const AppPasswords = lazy(
|
||||||
() => import('../components/Dashboard/Management/AppPasswords.jsx')
|
() => import('../components/Dashboard/Management/AppPasswords.jsx')
|
||||||
)
|
)
|
||||||
const AppPasswordInfo = lazy(
|
|
||||||
() =>
|
|
||||||
import('../components/Dashboard/Management/AppPasswords/AppPasswordInfo.jsx')
|
|
||||||
)
|
|
||||||
const Hosts = lazy(() => import('../components/Dashboard/Management/Hosts.jsx'))
|
const Hosts = lazy(() => import('../components/Dashboard/Management/Hosts.jsx'))
|
||||||
const HostInfo = lazy(
|
|
||||||
() => import('../components/Dashboard/Management/Hosts/HostInfo.jsx')
|
|
||||||
)
|
|
||||||
const DocumentSizes = lazy(
|
const DocumentSizes = lazy(
|
||||||
() => import('../components/Dashboard/Management/DocumentSizes.jsx')
|
() => import('../components/Dashboard/Management/DocumentSizes.jsx')
|
||||||
)
|
)
|
||||||
const DocumentSizeInfo = lazy(
|
|
||||||
() =>
|
|
||||||
import('../components/Dashboard/Management/DocumentSizes/DocumentSizeInfo.jsx')
|
|
||||||
)
|
|
||||||
const DocumentTemplates = lazy(
|
const DocumentTemplates = lazy(
|
||||||
() => import('../components/Dashboard/Management/DocumentTemplates.jsx')
|
() => import('../components/Dashboard/Management/DocumentTemplates.jsx')
|
||||||
)
|
)
|
||||||
const DocumentTemplateInfo = lazy(
|
|
||||||
() =>
|
|
||||||
import('../components/Dashboard/Management/DocumentTemplates/DocumentTemplateInfo.jsx')
|
|
||||||
)
|
|
||||||
const DocumentPrinters = lazy(
|
const DocumentPrinters = lazy(
|
||||||
() => import('../components/Dashboard/Management/DocumentPrinters.jsx')
|
() => import('../components/Dashboard/Management/DocumentPrinters.jsx')
|
||||||
)
|
)
|
||||||
const DocumentPrinterInfo = lazy(
|
|
||||||
() =>
|
|
||||||
import('../components/Dashboard/Management/DocumentPrinters/DocumentPrinterInfo.jsx')
|
|
||||||
)
|
|
||||||
const DocumentJobs = lazy(
|
const DocumentJobs = lazy(
|
||||||
() => import('../components/Dashboard/Management/DocumentJobs.jsx')
|
() => import('../components/Dashboard/Management/DocumentJobs.jsx')
|
||||||
)
|
)
|
||||||
const DocumentJobInfo = lazy(
|
|
||||||
() =>
|
|
||||||
import('../components/Dashboard/Management/DocumentJobs/DocumentJobInfo.jsx')
|
|
||||||
)
|
|
||||||
const DocumentTemplateDesign = lazy(
|
const DocumentTemplateDesign = lazy(
|
||||||
() =>
|
() =>
|
||||||
import('../components/Dashboard/Management/DocumentTemplates/DocumentTemplateDesign.jsx')
|
import('../components/Dashboard/Management/DocumentTemplates/DocumentTemplateDesign.jsx')
|
||||||
)
|
)
|
||||||
const Files = lazy(() => import('../components/Dashboard/Management/Files.jsx'))
|
const Files = lazy(() => import('../components/Dashboard/Management/Files.jsx'))
|
||||||
const FileInfo = lazy(
|
|
||||||
() => import('../components/Dashboard/Management/Files/FileInfo.jsx')
|
|
||||||
)
|
|
||||||
const TaxRates = lazy(
|
const TaxRates = lazy(
|
||||||
() => import('../components/Dashboard/Management/TaxRates.jsx')
|
() => import('../components/Dashboard/Management/TaxRates.jsx')
|
||||||
)
|
)
|
||||||
const TaxRateInfo = lazy(
|
|
||||||
() => import('../components/Dashboard/Management/TaxRates/TaxRateInfo.jsx')
|
|
||||||
)
|
|
||||||
const About = lazy(() => import('../components/Dashboard/Management/About.jsx'))
|
const About = lazy(() => import('../components/Dashboard/Management/About.jsx'))
|
||||||
|
|
||||||
const ManagementRoutes = [
|
const ManagementRoutes = [
|
||||||
<Route key='filaments' path='management/filaments' element={<Filaments />} />,
|
<Route key='filaments' path='management/filaments' element={<Filaments />} />,
|
||||||
<Route
|
|
||||||
key='filaments-info'
|
|
||||||
path='management/filaments/info'
|
|
||||||
element={<FilamentInfo />}
|
|
||||||
/>,
|
|
||||||
<Route
|
<Route
|
||||||
key='filamentskus'
|
key='filamentskus'
|
||||||
path='management/filamentskus'
|
path='management/filamentskus'
|
||||||
element={<FilamentSkus />}
|
element={<FilamentSkus />}
|
||||||
/>,
|
/>,
|
||||||
<Route
|
|
||||||
key='filamentskus-info'
|
|
||||||
path='management/filamentskus/info'
|
|
||||||
element={<FilamentSkuInfo />}
|
|
||||||
/>,
|
|
||||||
<Route key='parts' path='management/parts' element={<Parts />} />,
|
<Route key='parts' path='management/parts' element={<Parts />} />,
|
||||||
<Route
|
|
||||||
key='parts-info'
|
|
||||||
path='management/parts/info'
|
|
||||||
element={<PartInfo />}
|
|
||||||
/>,
|
|
||||||
<Route key='partskus' path='management/partskus' element={<PartSkus />} />,
|
<Route key='partskus' path='management/partskus' element={<PartSkus />} />,
|
||||||
<Route
|
|
||||||
key='partskus-info'
|
|
||||||
path='management/partskus/info'
|
|
||||||
element={<PartSkuInfo />}
|
|
||||||
/>,
|
|
||||||
<Route key='products' path='management/products' element={<Products />} />,
|
<Route key='products' path='management/products' element={<Products />} />,
|
||||||
<Route
|
|
||||||
key='products-info'
|
|
||||||
path='management/products/info'
|
|
||||||
element={<ProductInfo />}
|
|
||||||
/>,
|
|
||||||
<Route
|
<Route
|
||||||
key='productcategories'
|
key='productcategories'
|
||||||
path='management/productcategories'
|
path='management/productcategories'
|
||||||
element={<ProductCategories />}
|
element={<ProductCategories />}
|
||||||
/>,
|
/>,
|
||||||
<Route
|
|
||||||
key='productcategories-info'
|
|
||||||
path='management/productcategories/info'
|
|
||||||
element={<ProductCategoryInfo />}
|
|
||||||
/>,
|
|
||||||
<Route
|
<Route
|
||||||
key='productskus'
|
key='productskus'
|
||||||
path='management/productskus'
|
path='management/productskus'
|
||||||
element={<ProductSkus />}
|
element={<ProductSkus />}
|
||||||
/>,
|
/>,
|
||||||
<Route
|
|
||||||
key='productskus-info'
|
|
||||||
path='management/productskus/info'
|
|
||||||
element={<ProductSkuInfo />}
|
|
||||||
/>,
|
|
||||||
<Route key='vendors' path='management/vendors' element={<Vendors />} />,
|
<Route key='vendors' path='management/vendors' element={<Vendors />} />,
|
||||||
<Route key='hosts' path='management/hosts' element={<Hosts />} />,
|
<Route key='hosts' path='management/hosts' element={<Hosts />} />,
|
||||||
<Route
|
<Route key='users' path='management/users' element={<Users />} />,
|
||||||
key='hosts-info'
|
|
||||||
path='management/hosts/info'
|
|
||||||
element={<HostInfo />}
|
|
||||||
/>,
|
|
||||||
<Route
|
|
||||||
key='users-info'
|
|
||||||
path='management/users/info'
|
|
||||||
element={<UserInfo />}
|
|
||||||
/>,
|
|
||||||
<Route
|
|
||||||
key='vendors-info'
|
|
||||||
path='management/vendors/info'
|
|
||||||
element={<VendorInfo />}
|
|
||||||
/>,
|
|
||||||
<Route key='files' path='management/files' element={<Files />} />,
|
<Route key='files' path='management/files' element={<Files />} />,
|
||||||
<Route
|
|
||||||
key='files-info'
|
|
||||||
path='management/files/info'
|
|
||||||
element={<FileInfo />}
|
|
||||||
/>,
|
|
||||||
<Route key='materials' path='management/materials' element={<Materials />} />,
|
<Route key='materials' path='management/materials' element={<Materials />} />,
|
||||||
<Route
|
|
||||||
key='materials-info'
|
|
||||||
path='management/materials/info'
|
|
||||||
element={<MaterialInfo />}
|
|
||||||
/>,
|
|
||||||
<Route key='couriers' path='management/couriers' element={<Couriers />} />,
|
<Route key='couriers' path='management/couriers' element={<Couriers />} />,
|
||||||
<Route
|
|
||||||
key='couriers-info'
|
|
||||||
path='management/couriers/info'
|
|
||||||
element={<CourierInfo />}
|
|
||||||
/>,
|
|
||||||
<Route
|
<Route
|
||||||
key='courierServices'
|
key='courierServices'
|
||||||
path='management/courierServices'
|
path='management/courierServices'
|
||||||
element={<CourierServices />}
|
element={<CourierServices />}
|
||||||
/>,
|
/>,
|
||||||
<Route
|
|
||||||
key='courierServices-info'
|
|
||||||
path='management/courierServices/info'
|
|
||||||
element={<CourierServiceInfo />}
|
|
||||||
/>,
|
|
||||||
<Route key='notetypes' path='management/notetypes' element={<NoteTypes />} />,
|
<Route key='notetypes' path='management/notetypes' element={<NoteTypes />} />,
|
||||||
<Route
|
|
||||||
key='notetypes-info'
|
|
||||||
path='management/notetypes/info'
|
|
||||||
element={<NoteTypeInfo />}
|
|
||||||
/>,
|
|
||||||
<Route key='note-info' path='management/notes/info' element={<NoteInfo />} />,
|
<Route key='note-info' path='management/notes/info' element={<NoteInfo />} />,
|
||||||
<Route
|
<Route
|
||||||
key='documentsizes'
|
key='documentsizes'
|
||||||
path='management/documentsizes'
|
path='management/documentsizes'
|
||||||
element={<DocumentSizes />}
|
element={<DocumentSizes />}
|
||||||
/>,
|
/>,
|
||||||
<Route
|
|
||||||
key='documentsizes-info'
|
|
||||||
path='management/documentsizes/info'
|
|
||||||
element={<DocumentSizeInfo />}
|
|
||||||
/>,
|
|
||||||
<Route
|
<Route
|
||||||
key='documenttemplates'
|
key='documenttemplates'
|
||||||
path='management/documenttemplates'
|
path='management/documenttemplates'
|
||||||
element={<DocumentTemplates />}
|
element={<DocumentTemplates />}
|
||||||
/>,
|
/>,
|
||||||
<Route
|
|
||||||
key='documenttemplates-info'
|
|
||||||
path='management/documenttemplates/info'
|
|
||||||
element={<DocumentTemplateInfo />}
|
|
||||||
/>,
|
|
||||||
<Route
|
<Route
|
||||||
key='documentprinters'
|
key='documentprinters'
|
||||||
path='management/documentprinters'
|
path='management/documentprinters'
|
||||||
element={<DocumentPrinters />}
|
element={<DocumentPrinters />}
|
||||||
/>,
|
/>,
|
||||||
<Route
|
|
||||||
key='documentprinters-info'
|
|
||||||
path='management/documentprinters/info'
|
|
||||||
element={<DocumentPrinterInfo />}
|
|
||||||
/>,
|
|
||||||
<Route
|
<Route
|
||||||
key='documentjobs'
|
key='documentjobs'
|
||||||
path='management/documentjobs'
|
path='management/documentjobs'
|
||||||
element={<DocumentJobs />}
|
element={<DocumentJobs />}
|
||||||
/>,
|
/>,
|
||||||
<Route
|
|
||||||
key='documentjobs-info'
|
|
||||||
path='management/documentjobs/info'
|
|
||||||
element={<DocumentJobInfo />}
|
|
||||||
/>,
|
|
||||||
<Route
|
<Route
|
||||||
key='documenttemplates-design'
|
key='documenttemplates-design'
|
||||||
path='management/documenttemplates/design'
|
path='management/documenttemplates/design'
|
||||||
element={<DocumentTemplateDesign />}
|
element={<DocumentTemplateDesign />}
|
||||||
/>,
|
/>,
|
||||||
<Route key='users' path='management/users' element={<Users />} />,
|
|
||||||
<Route
|
<Route
|
||||||
key='apppasswords'
|
key='apppasswords'
|
||||||
path='management/apppasswords'
|
path='management/apppasswords'
|
||||||
element={<AppPasswords />}
|
element={<AppPasswords />}
|
||||||
/>,
|
/>,
|
||||||
<Route
|
|
||||||
key='apppasswords-info'
|
|
||||||
path='management/apppasswords/info'
|
|
||||||
element={<AppPasswordInfo />}
|
|
||||||
/>,
|
|
||||||
<Route key='settings' path='management/settings' element={<Settings />} />,
|
<Route key='settings' path='management/settings' element={<Settings />} />,
|
||||||
<Route key='about' path='management/about' element={<About />} />,
|
<Route key='about' path='management/about' element={<About />} />,
|
||||||
<Route key='auditlogs' path='management/auditlogs' element={<AuditLogs />} />,
|
<Route key='auditlogs' path='management/auditlogs' element={<AuditLogs />} />,
|
||||||
<Route key='taxrates' path='management/taxrates' element={<TaxRates />} />,
|
<Route key='taxrates' path='management/taxrates' element={<TaxRates />} />
|
||||||
<Route
|
|
||||||
key='taxrates-info'
|
|
||||||
path='management/taxrates/info'
|
|
||||||
element={<TaxRateInfo />}
|
|
||||||
/>
|
|
||||||
]
|
]
|
||||||
|
|
||||||
export default ManagementRoutes
|
export default ManagementRoutes
|
||||||
|
|||||||
@ -10,40 +10,19 @@ const Printers = lazy(
|
|||||||
const ControlPrinter = lazy(
|
const ControlPrinter = lazy(
|
||||||
() => import('../components/Dashboard/Production/Printers/ControlPrinter.jsx')
|
() => import('../components/Dashboard/Production/Printers/ControlPrinter.jsx')
|
||||||
)
|
)
|
||||||
const PrinterInfo = lazy(
|
|
||||||
() => import('../components/Dashboard/Production/Printers/PrinterInfo.jsx')
|
|
||||||
)
|
|
||||||
const PrinterProfiles = lazy(
|
const PrinterProfiles = lazy(
|
||||||
() => import('../components/Dashboard/Production/PrinterProfiles.jsx')
|
() => import('../components/Dashboard/Production/PrinterProfiles.jsx')
|
||||||
)
|
)
|
||||||
const PrinterProfileInfo = lazy(
|
|
||||||
() =>
|
|
||||||
import('../components/Dashboard/Production/PrinterProfiles/PrinterProfileInfo.jsx')
|
|
||||||
)
|
|
||||||
const FilamentProfiles = lazy(
|
const FilamentProfiles = lazy(
|
||||||
() => import('../components/Dashboard/Production/FilamentProfiles.jsx')
|
() => import('../components/Dashboard/Production/FilamentProfiles.jsx')
|
||||||
)
|
)
|
||||||
const FilamentProfileInfo = lazy(
|
|
||||||
() =>
|
|
||||||
import('../components/Dashboard/Production/FilamentProfiles/FilamentProfileInfo.jsx')
|
|
||||||
)
|
|
||||||
const Jobs = lazy(() => import('../components/Dashboard/Production/Jobs.jsx'))
|
const Jobs = lazy(() => import('../components/Dashboard/Production/Jobs.jsx'))
|
||||||
const JobInfo = lazy(
|
|
||||||
() => import('../components/Dashboard/Production/Jobs/JobInfo.jsx')
|
|
||||||
)
|
|
||||||
const SubJobs = lazy(
|
const SubJobs = lazy(
|
||||||
() => import('../components/Dashboard/Production/SubJobs.jsx')
|
() => import('../components/Dashboard/Production/SubJobs.jsx')
|
||||||
)
|
)
|
||||||
const SubJobInfo = lazy(
|
|
||||||
() => import('../components/Dashboard/Production/SubJobs/SubJobInfo.jsx')
|
|
||||||
)
|
|
||||||
const GCodeFiles = lazy(
|
const GCodeFiles = lazy(
|
||||||
() => import('../components/Dashboard/Production/GCodeFiles')
|
() => import('../components/Dashboard/Production/GCodeFiles')
|
||||||
)
|
)
|
||||||
const GCodeFileInfo = lazy(
|
|
||||||
() =>
|
|
||||||
import('../components/Dashboard/Production/GCodeFiles/GCodeFileInfo.jsx')
|
|
||||||
)
|
|
||||||
const GCodeFilePreview = lazy(
|
const GCodeFilePreview = lazy(
|
||||||
() =>
|
() =>
|
||||||
import('../components/Dashboard/Production/GCodeFiles/GCodeFilePreview.jsx')
|
import('../components/Dashboard/Production/GCodeFiles/GCodeFilePreview.jsx')
|
||||||
@ -61,49 +40,23 @@ const ProductionRoutes = [
|
|||||||
path='production/printers/control'
|
path='production/printers/control'
|
||||||
element={<ControlPrinter />}
|
element={<ControlPrinter />}
|
||||||
/>,
|
/>,
|
||||||
<Route
|
|
||||||
key='printers-info'
|
|
||||||
path='production/printers/info'
|
|
||||||
element={<PrinterInfo />}
|
|
||||||
/>,
|
|
||||||
<Route
|
<Route
|
||||||
key='printerprofiles'
|
key='printerprofiles'
|
||||||
path='production/printerprofiles'
|
path='production/printerprofiles'
|
||||||
element={<PrinterProfiles />}
|
element={<PrinterProfiles />}
|
||||||
/>,
|
/>,
|
||||||
<Route
|
|
||||||
key='printerprofiles-info'
|
|
||||||
path='production/printerprofiles/info'
|
|
||||||
element={<PrinterProfileInfo />}
|
|
||||||
/>,
|
|
||||||
<Route
|
<Route
|
||||||
key='filamentprofiles'
|
key='filamentprofiles'
|
||||||
path='production/filamentprofiles'
|
path='production/filamentprofiles'
|
||||||
element={<FilamentProfiles />}
|
element={<FilamentProfiles />}
|
||||||
/>,
|
/>,
|
||||||
<Route
|
|
||||||
key='filamentprofiles-info'
|
|
||||||
path='production/filamentprofiles/info'
|
|
||||||
element={<FilamentProfileInfo />}
|
|
||||||
/>,
|
|
||||||
<Route key='jobs' path='production/jobs' element={<Jobs />} />,
|
<Route key='jobs' path='production/jobs' element={<Jobs />} />,
|
||||||
<Route key='subjobs' path='production/subjobs' element={<SubJobs />} />,
|
<Route key='subjobs' path='production/subjobs' element={<SubJobs />} />,
|
||||||
<Route
|
|
||||||
key='subjobs-info'
|
|
||||||
path='production/subjobs/info'
|
|
||||||
element={<SubJobInfo />}
|
|
||||||
/>,
|
|
||||||
<Route key='jobs-info' path='production/jobs/info' element={<JobInfo />} />,
|
|
||||||
<Route
|
<Route
|
||||||
key='gcodefiles'
|
key='gcodefiles'
|
||||||
path='production/gcodefiles'
|
path='production/gcodefiles'
|
||||||
element={<GCodeFiles />}
|
element={<GCodeFiles />}
|
||||||
/>,
|
/>,
|
||||||
<Route
|
|
||||||
key='gcodefiles-info'
|
|
||||||
path='production/gcodefiles/info'
|
|
||||||
element={<GCodeFileInfo />}
|
|
||||||
/>,
|
|
||||||
<Route
|
<Route
|
||||||
key='gcodefiles-preview'
|
key='gcodefiles-preview'
|
||||||
path='production/gcodefiles/preview'
|
path='production/gcodefiles/preview'
|
||||||
|
|||||||
@ -2,74 +2,33 @@ import { lazy } from 'react'
|
|||||||
import { Route } from 'react-router-dom'
|
import { Route } from 'react-router-dom'
|
||||||
|
|
||||||
const Clients = lazy(() => import('../components/Dashboard/Sales/Clients.jsx'))
|
const Clients = lazy(() => import('../components/Dashboard/Sales/Clients.jsx'))
|
||||||
const ClientInfo = lazy(
|
|
||||||
() => import('../components/Dashboard/Sales/Clients/ClientInfo.jsx')
|
|
||||||
)
|
|
||||||
const SalesOrders = lazy(
|
const SalesOrders = lazy(
|
||||||
() => import('../components/Dashboard/Sales/SalesOrders.jsx')
|
() => import('../components/Dashboard/Sales/SalesOrders.jsx')
|
||||||
)
|
)
|
||||||
const SalesOrderInfo = lazy(
|
|
||||||
() => import('../components/Dashboard/Sales/SalesOrders/SalesOrderInfo.jsx')
|
|
||||||
)
|
|
||||||
const SalesOverview = lazy(
|
const SalesOverview = lazy(
|
||||||
() => import('../components/Dashboard/Sales/SalesOverview.jsx')
|
() => import('../components/Dashboard/Sales/SalesOverview.jsx')
|
||||||
)
|
)
|
||||||
const Marketplaces = lazy(
|
const Marketplaces = lazy(
|
||||||
() => import('../components/Dashboard/Sales/Marketplaces.jsx')
|
() => import('../components/Dashboard/Sales/Marketplaces.jsx')
|
||||||
)
|
)
|
||||||
const MarketplaceInfo = lazy(
|
|
||||||
() => import('../components/Dashboard/Sales/Marketplaces/MarketplaceInfo.jsx')
|
|
||||||
)
|
|
||||||
const Listings = lazy(
|
const Listings = lazy(
|
||||||
() => import('../components/Dashboard/Sales/Listings.jsx')
|
() => import('../components/Dashboard/Sales/Listings.jsx')
|
||||||
)
|
)
|
||||||
const ListingInfo = lazy(
|
|
||||||
() => import('../components/Dashboard/Sales/Listings/ListingInfo.jsx')
|
|
||||||
)
|
|
||||||
const ListingVarientInfo = lazy(
|
|
||||||
() =>
|
|
||||||
import('../components/Dashboard/Sales/ListingVarients/ListingVarientInfo.jsx')
|
|
||||||
)
|
|
||||||
|
|
||||||
const SalesRoutes = [
|
const SalesRoutes = [
|
||||||
<Route key='overview' path='sales/overview' element={<SalesOverview />} />,
|
<Route key='overview' path='sales/overview' element={<SalesOverview />} />,
|
||||||
<Route key='clients' path='sales/clients' element={<Clients />} />,
|
<Route key='clients' path='sales/clients' element={<Clients />} />,
|
||||||
<Route
|
|
||||||
key='clients-info'
|
|
||||||
path='sales/clients/info'
|
|
||||||
element={<ClientInfo />}
|
|
||||||
/>,
|
|
||||||
<Route
|
<Route
|
||||||
key='salesorders'
|
key='salesorders'
|
||||||
path='sales/salesorders'
|
path='sales/salesorders'
|
||||||
element={<SalesOrders />}
|
element={<SalesOrders />}
|
||||||
/>,
|
/>,
|
||||||
<Route
|
|
||||||
key='salesorders-info'
|
|
||||||
path='sales/salesorders/info'
|
|
||||||
element={<SalesOrderInfo />}
|
|
||||||
/>,
|
|
||||||
<Route
|
<Route
|
||||||
key='marketplaces'
|
key='marketplaces'
|
||||||
path='sales/marketplaces'
|
path='sales/marketplaces'
|
||||||
element={<Marketplaces />}
|
element={<Marketplaces />}
|
||||||
/>,
|
/>,
|
||||||
<Route
|
<Route key='listings' path='sales/listings' element={<Listings />} />
|
||||||
key='marketplaces-info'
|
|
||||||
path='sales/marketplaces/info'
|
|
||||||
element={<MarketplaceInfo />}
|
|
||||||
/>,
|
|
||||||
<Route key='listings' path='sales/listings' element={<Listings />} />,
|
|
||||||
<Route
|
|
||||||
key='listings-info'
|
|
||||||
path='sales/listings/info'
|
|
||||||
element={<ListingInfo />}
|
|
||||||
/>,
|
|
||||||
<Route
|
|
||||||
key='listingvarients-info'
|
|
||||||
path='sales/listingvarients/info'
|
|
||||||
element={<ListingVarientInfo />}
|
|
||||||
/>
|
|
||||||
]
|
]
|
||||||
|
|
||||||
export default SalesRoutes
|
export default SalesRoutes
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user