Compare commits
No commits in common. "bcb7460bf2e9feea81f4f6331cea811e9acbc513" and "978f44453826fe4bcc6f4e336519896d73799d79" have entirely different histories.
bcb7460bf2
...
978f444538
@ -1,6 +1,6 @@
|
||||
import { useRef, useState, useEffect, useMemo } from 'react'
|
||||
import { useLocation } from 'react-router-dom'
|
||||
import { Card, Flex, Space, Spin } from 'antd'
|
||||
import { Card, Flex, Space } from 'antd'
|
||||
import { LoadingOutlined } from '@ant-design/icons'
|
||||
import loglevel from 'loglevel'
|
||||
import config from '../../../../config.js'
|
||||
@ -92,6 +92,10 @@ const InvoiceInfo = () => {
|
||||
objectFormRef?.current?.handleUpdate?.()
|
||||
return true
|
||||
},
|
||||
delete: () => {
|
||||
objectFormRef?.current?.handleDelete?.()
|
||||
return true
|
||||
}
|
||||
}
|
||||
|
||||
return (
|
||||
@ -269,14 +273,9 @@ const InvoiceInfo = () => {
|
||||
onToggle={(expanded) => updateCollapseState('notes', expanded)}
|
||||
collapseKey='notes'
|
||||
>
|
||||
<Spin
|
||||
spinning={objectFormState.loading}
|
||||
indicator={<LoadingOutlined />}
|
||||
>
|
||||
<Card>
|
||||
<Card>
|
||||
<NotesPanel _id={invoiceId} type='invoice' />
|
||||
</Card>
|
||||
</Spin>
|
||||
</Card>
|
||||
</InfoCollapse>
|
||||
<InfoCollapse
|
||||
title='Audit Logs'
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
import { useRef, useState, useEffect, useMemo } from 'react'
|
||||
import { useLocation } from 'react-router-dom'
|
||||
import { Card, Flex, Space, Spin } from 'antd'
|
||||
import { Card, Flex, Space } from 'antd'
|
||||
import { LoadingOutlined } from '@ant-design/icons'
|
||||
import loglevel from 'loglevel'
|
||||
import config from '../../../../config.js'
|
||||
@ -85,6 +85,10 @@ const PaymentInfo = () => {
|
||||
objectFormRef?.current?.handleUpdate?.()
|
||||
return true
|
||||
},
|
||||
delete: () => {
|
||||
objectFormRef?.current?.handleDelete?.()
|
||||
return true
|
||||
}
|
||||
}
|
||||
|
||||
return (
|
||||
@ -204,14 +208,9 @@ const PaymentInfo = () => {
|
||||
onToggle={(expanded) => updateCollapseState('notes', expanded)}
|
||||
collapseKey='notes'
|
||||
>
|
||||
<Spin
|
||||
spinning={objectFormState.loading}
|
||||
indicator={<LoadingOutlined />}
|
||||
>
|
||||
<Card>
|
||||
<Card>
|
||||
<NotesPanel _id={paymentId} type='payment' />
|
||||
</Card>
|
||||
</Spin>
|
||||
</Card>
|
||||
</InfoCollapse>
|
||||
<InfoCollapse
|
||||
title='Audit Logs'
|
||||
|
||||
@ -1,7 +1,6 @@
|
||||
import { useRef, useState, useMemo } from 'react'
|
||||
import { useLocation } from 'react-router-dom'
|
||||
import { Card, Flex, Space, Spin } from 'antd'
|
||||
import { LoadingOutlined } from '@ant-design/icons'
|
||||
import { Card, Flex, Space } from 'antd'
|
||||
import loglevel from 'loglevel'
|
||||
import config from '../../../../config'
|
||||
import useCollapseState from '../../hooks/useCollapseState'
|
||||
@ -78,6 +77,10 @@ const TaxRecordInfo = () => {
|
||||
objectFormRef?.current?.handleUpdate?.()
|
||||
return true
|
||||
},
|
||||
delete: () => {
|
||||
objectFormRef?.current?.handleDelete?.()
|
||||
return true
|
||||
}
|
||||
}
|
||||
|
||||
return (
|
||||
@ -188,14 +191,9 @@ const TaxRecordInfo = () => {
|
||||
onToggle={(expanded) => updateCollapseState('notes', expanded)}
|
||||
collapseKey='notes'
|
||||
>
|
||||
<Spin
|
||||
spinning={objectFormState.loading}
|
||||
indicator={<LoadingOutlined />}
|
||||
>
|
||||
<Card>
|
||||
<Card>
|
||||
<NotesPanel _id={taxRecordId} type='taxRecord' />
|
||||
</Card>
|
||||
</Spin>
|
||||
</Card>
|
||||
</InfoCollapse>
|
||||
<InfoCollapse
|
||||
title='Audit Logs'
|
||||
|
||||
@ -1,7 +1,6 @@
|
||||
import { useRef, useState, useMemo } from 'react'
|
||||
import { useLocation } from 'react-router-dom'
|
||||
import { Card, Flex, Space, Spin } from 'antd'
|
||||
import { LoadingOutlined } from '@ant-design/icons'
|
||||
import { Card, Flex, Space } from 'antd'
|
||||
import useCollapseState from '../../hooks/useCollapseState'
|
||||
import ObjectForm from '../../common/ObjectForm'
|
||||
import ObjectInfo from '../../common/ObjectInfo'
|
||||
@ -227,14 +226,9 @@ const FilamentStockInfo = () => {
|
||||
onToggle={(expanded) => updateCollapseState('notes', expanded)}
|
||||
collapseKey='notes'
|
||||
>
|
||||
<Spin
|
||||
spinning={objectFormState.loading}
|
||||
indicator={<LoadingOutlined />}
|
||||
>
|
||||
<Card>
|
||||
<Card>
|
||||
<NotesPanel _id={filamentStockId} type='filamentStock' />
|
||||
</Card>
|
||||
</Spin>
|
||||
</Card>
|
||||
</InfoCollapse>
|
||||
<InfoCollapse
|
||||
title='Audit Logs'
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
import { useRef, useState, useMemo } from 'react'
|
||||
import { useLocation } from 'react-router-dom'
|
||||
import { Card, Flex, Space, Spin } from 'antd'
|
||||
import { Card, Flex, Space } from 'antd'
|
||||
import { LoadingOutlined } from '@ant-design/icons'
|
||||
import loglevel from 'loglevel'
|
||||
import config from '../../../../config.js'
|
||||
@ -78,6 +78,10 @@ const OrderItemInfo = () => {
|
||||
objectFormRef?.current?.handleUpdate?.()
|
||||
return true
|
||||
},
|
||||
delete: () => {
|
||||
objectFormRef?.current?.handleDelete?.()
|
||||
return true
|
||||
}
|
||||
}
|
||||
|
||||
return (
|
||||
@ -193,14 +197,9 @@ const OrderItemInfo = () => {
|
||||
onToggle={(expanded) => updateCollapseState('notes', expanded)}
|
||||
collapseKey='notes'
|
||||
>
|
||||
<Spin
|
||||
spinning={objectFormState.loading}
|
||||
indicator={<LoadingOutlined />}
|
||||
>
|
||||
<Card>
|
||||
<Card>
|
||||
<NotesPanel _id={orderItemId} type='orderItem' />
|
||||
</Card>
|
||||
</Spin>
|
||||
</Card>
|
||||
</InfoCollapse>
|
||||
<InfoCollapse
|
||||
title='Audit Logs'
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
import { useRef, useState, useMemo } from 'react'
|
||||
import { useLocation } from 'react-router-dom'
|
||||
import { Card, Flex, Space, Spin } from 'antd'
|
||||
import { Card, Flex, Space } from 'antd'
|
||||
import { LoadingOutlined } from '@ant-design/icons'
|
||||
import loglevel from 'loglevel'
|
||||
import config from '../../../../config.js'
|
||||
@ -246,14 +246,9 @@ const PartStockInfo = () => {
|
||||
onToggle={(expanded) => updateCollapseState('notes', expanded)}
|
||||
collapseKey='notes'
|
||||
>
|
||||
<Spin
|
||||
spinning={objectFormState.loading}
|
||||
indicator={<LoadingOutlined />}
|
||||
>
|
||||
<Card>
|
||||
<Card>
|
||||
<NotesPanel _id={partStockId} type='partStock' />
|
||||
</Card>
|
||||
</Spin>
|
||||
</Card>
|
||||
</InfoCollapse>
|
||||
|
||||
<InfoCollapse
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
import { useRef, useState, useEffect, useMemo } from 'react'
|
||||
import { useLocation } from 'react-router-dom'
|
||||
import { Card, Flex, Space, Spin } from 'antd'
|
||||
import { Card, Flex, Space } from 'antd'
|
||||
import { LoadingOutlined } from '@ant-design/icons'
|
||||
import loglevel from 'loglevel'
|
||||
import config from '../../../../config.js'
|
||||
@ -98,6 +98,10 @@ const ProductStockInfo = () => {
|
||||
objectFormRef?.current.handleUpdate()
|
||||
return true
|
||||
},
|
||||
delete: () => {
|
||||
objectFormRef?.current.handleDelete?.()
|
||||
return true
|
||||
}
|
||||
}
|
||||
|
||||
return (
|
||||
@ -276,14 +280,9 @@ const ProductStockInfo = () => {
|
||||
onToggle={(expanded) => updateCollapseState('notes', expanded)}
|
||||
collapseKey='notes'
|
||||
>
|
||||
<Spin
|
||||
spinning={objectFormState.loading}
|
||||
indicator={<LoadingOutlined />}
|
||||
>
|
||||
<Card>
|
||||
<Card>
|
||||
<NotesPanel _id={productStockId} type='productStock' />
|
||||
</Card>
|
||||
</Spin>
|
||||
</Card>
|
||||
</InfoCollapse>
|
||||
|
||||
<InfoCollapse
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
import { useRef, useState, useEffect, useMemo } from 'react'
|
||||
import { useLocation } from 'react-router-dom'
|
||||
import { Card, Flex, Space, Spin } from 'antd'
|
||||
import { Card, Flex, Space } from 'antd'
|
||||
import { LoadingOutlined } from '@ant-design/icons'
|
||||
import loglevel from 'loglevel'
|
||||
import config from '../../../../config.js'
|
||||
@ -103,6 +103,10 @@ const PurchaseOrderInfo = () => {
|
||||
objectFormRef?.current?.handleUpdate?.()
|
||||
return true
|
||||
},
|
||||
delete: () => {
|
||||
objectFormRef?.current?.handleDelete?.()
|
||||
return true
|
||||
}
|
||||
}
|
||||
|
||||
return (
|
||||
@ -309,14 +313,9 @@ const PurchaseOrderInfo = () => {
|
||||
onToggle={(expanded) => updateCollapseState('notes', expanded)}
|
||||
collapseKey='notes'
|
||||
>
|
||||
<Spin
|
||||
spinning={objectFormState.loading}
|
||||
indicator={<LoadingOutlined />}
|
||||
>
|
||||
<Card>
|
||||
<Card>
|
||||
<NotesPanel _id={purchaseOrderId} type='purchaseOrder' />
|
||||
</Card>
|
||||
</Spin>
|
||||
</Card>
|
||||
</InfoCollapse>
|
||||
<InfoCollapse
|
||||
title='Audit Logs'
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
import { useRef, useState, useMemo } from 'react'
|
||||
import { useLocation } from 'react-router-dom'
|
||||
import { Card, Flex, Modal, Space, Spin } from 'antd'
|
||||
import { Card, Flex, Modal, Space } from 'antd'
|
||||
import { LoadingOutlined } from '@ant-design/icons'
|
||||
import loglevel from 'loglevel'
|
||||
import config from '../../../../config.js'
|
||||
@ -96,6 +96,10 @@ const PurchaseOrderInfo = () => {
|
||||
objectFormRef?.current?.handleUpdate?.()
|
||||
return true
|
||||
},
|
||||
delete: () => {
|
||||
objectFormRef?.current?.handleDelete?.()
|
||||
return true
|
||||
},
|
||||
newOrderItem: () => {
|
||||
setNewOrderItemOpen(true)
|
||||
return true
|
||||
@ -270,14 +274,9 @@ const PurchaseOrderInfo = () => {
|
||||
onToggle={(expanded) => updateCollapseState('notes', expanded)}
|
||||
collapseKey='notes'
|
||||
>
|
||||
<Spin
|
||||
spinning={objectFormState.loading}
|
||||
indicator={<LoadingOutlined />}
|
||||
>
|
||||
<Card>
|
||||
<Card>
|
||||
<NotesPanel _id={purchaseOrderId} type='purchaseOrder' />
|
||||
</Card>
|
||||
</Spin>
|
||||
</Card>
|
||||
</InfoCollapse>
|
||||
<InfoCollapse
|
||||
title='Audit Logs'
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
import { useRef, useState, useEffect, useMemo } from 'react'
|
||||
import { useLocation } from 'react-router-dom'
|
||||
import { Card, Flex, Space, Spin } from 'antd'
|
||||
import { Card, Flex, Space } from 'antd'
|
||||
import { LoadingOutlined } from '@ant-design/icons'
|
||||
import loglevel from 'loglevel'
|
||||
import config from '../../../../config.js'
|
||||
@ -88,6 +88,10 @@ const ShipmentInfo = () => {
|
||||
objectFormRef?.current?.handleUpdate?.()
|
||||
return true
|
||||
},
|
||||
delete: () => {
|
||||
objectFormRef?.current?.handleDelete?.()
|
||||
return true
|
||||
}
|
||||
}
|
||||
|
||||
return (
|
||||
@ -229,14 +233,9 @@ const ShipmentInfo = () => {
|
||||
onToggle={(expanded) => updateCollapseState('notes', expanded)}
|
||||
collapseKey='notes'
|
||||
>
|
||||
<Spin
|
||||
spinning={objectFormState.loading}
|
||||
indicator={<LoadingOutlined />}
|
||||
>
|
||||
<Card>
|
||||
<Card>
|
||||
<NotesPanel _id={shipmentId} type='shipment' />
|
||||
</Card>
|
||||
</Spin>
|
||||
</Card>
|
||||
</InfoCollapse>
|
||||
<InfoCollapse
|
||||
title='Audit Logs'
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
import { useRef, useState, useMemo } from 'react'
|
||||
import { useLocation } from 'react-router-dom'
|
||||
import { Card, Flex, Space, Spin } from 'antd'
|
||||
import { Card, Flex, Space } from 'antd'
|
||||
import { LoadingOutlined } from '@ant-design/icons'
|
||||
import loglevel from 'loglevel'
|
||||
import config from '../../../../config.js'
|
||||
@ -202,14 +202,9 @@ const StockAuditInfo = () => {
|
||||
onToggle={(expanded) => updateCollapseState('notes', expanded)}
|
||||
collapseKey='notes'
|
||||
>
|
||||
<Spin
|
||||
spinning={objectFormState.loading}
|
||||
indicator={<LoadingOutlined />}
|
||||
>
|
||||
<Card>
|
||||
<Card>
|
||||
<NotesPanel _id={stockAuditId} type='stockAudit' />
|
||||
</Card>
|
||||
</Spin>
|
||||
</Card>
|
||||
</InfoCollapse>
|
||||
|
||||
<InfoCollapse
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
import { useRef, useState, useMemo } from 'react'
|
||||
import { useLocation } from 'react-router-dom'
|
||||
import { Card, Flex, Space, Spin } from 'antd'
|
||||
import { Card, Flex, Space } from 'antd'
|
||||
import { LoadingOutlined } from '@ant-design/icons'
|
||||
import loglevel from 'loglevel'
|
||||
import config from '../../../../config.js'
|
||||
@ -200,14 +200,9 @@ const StockLocationInfo = () => {
|
||||
onToggle={(expanded) => updateCollapseState('notes', expanded)}
|
||||
collapseKey='notes'
|
||||
>
|
||||
<Spin
|
||||
spinning={objectFormState.loading}
|
||||
indicator={<LoadingOutlined />}
|
||||
>
|
||||
<Card>
|
||||
<Card>
|
||||
<NotesPanel _id={stockLocationId} type='stockLocation' />
|
||||
</Card>
|
||||
</Spin>
|
||||
</Card>
|
||||
</InfoCollapse>
|
||||
|
||||
<InfoCollapse
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
import { useRef, useState, useEffect, useMemo } from 'react'
|
||||
import { useLocation } from 'react-router-dom'
|
||||
import { Card, Flex, Space, Spin } from 'antd'
|
||||
import { Card, Flex, Space } from 'antd'
|
||||
import { LoadingOutlined } from '@ant-design/icons'
|
||||
import useCollapseState from '../../hooks/useCollapseState.jsx'
|
||||
import NotesPanel from '../../common/NotesPanel.jsx'
|
||||
@ -88,6 +88,10 @@ const StockTransferInfo = () => {
|
||||
objectFormRef?.current.handleUpdate()
|
||||
return true
|
||||
},
|
||||
delete: () => {
|
||||
objectFormRef?.current.handleDelete?.()
|
||||
return true
|
||||
}
|
||||
}
|
||||
|
||||
return (
|
||||
@ -227,14 +231,9 @@ const StockTransferInfo = () => {
|
||||
onToggle={(expanded) => updateCollapseState('notes', expanded)}
|
||||
collapseKey='notes'
|
||||
>
|
||||
<Spin
|
||||
spinning={objectFormState.loading}
|
||||
indicator={<LoadingOutlined />}
|
||||
>
|
||||
<Card>
|
||||
<Card>
|
||||
<NotesPanel _id={stockTransferId} type='stockTransfer' />
|
||||
</Card>
|
||||
</Spin>
|
||||
</Card>
|
||||
</InfoCollapse>
|
||||
|
||||
<InfoCollapse
|
||||
|
||||
@ -1,7 +1,6 @@
|
||||
import { useRef, useState, useMemo } from 'react'
|
||||
import { useLocation } from 'react-router-dom'
|
||||
import { Card, Flex, Space, Spin } from 'antd'
|
||||
import { LoadingOutlined } from '@ant-design/icons'
|
||||
import { Card, Flex, Space } from 'antd'
|
||||
import loglevel from 'loglevel'
|
||||
import config from '../../../../config'
|
||||
import useCollapseState from '../../hooks/useCollapseState'
|
||||
@ -80,6 +79,10 @@ const CourierServiceInfo = () => {
|
||||
objectFormRef?.current?.handleUpdate?.()
|
||||
return true
|
||||
},
|
||||
delete: () => {
|
||||
objectFormRef?.current?.handleDelete?.()
|
||||
return true
|
||||
}
|
||||
}
|
||||
|
||||
return (
|
||||
@ -190,14 +193,9 @@ const CourierServiceInfo = () => {
|
||||
onToggle={(expanded) => updateCollapseState('notes', expanded)}
|
||||
collapseKey='notes'
|
||||
>
|
||||
<Spin
|
||||
spinning={objectFormState.loading}
|
||||
indicator={<LoadingOutlined />}
|
||||
>
|
||||
<Card>
|
||||
<Card>
|
||||
<NotesPanel _id={courierServiceId} type='courierService' />
|
||||
</Card>
|
||||
</Spin>
|
||||
</Card>
|
||||
</InfoCollapse>
|
||||
<InfoCollapse
|
||||
title='Audit Logs'
|
||||
|
||||
@ -1,7 +1,6 @@
|
||||
import { useRef, useState, useMemo } from 'react'
|
||||
import { useLocation } from 'react-router-dom'
|
||||
import { Card, Flex, Space, Spin } from 'antd'
|
||||
import { LoadingOutlined } from '@ant-design/icons'
|
||||
import { Card, Flex, Space } from 'antd'
|
||||
import loglevel from 'loglevel'
|
||||
import config from '../../../../config'
|
||||
import useCollapseState from '../../hooks/useCollapseState'
|
||||
@ -76,6 +75,10 @@ const CourierInfo = () => {
|
||||
objectFormRef?.current?.handleUpdate?.()
|
||||
return true
|
||||
},
|
||||
delete: () => {
|
||||
objectFormRef?.current?.handleDelete?.()
|
||||
return true
|
||||
}
|
||||
}
|
||||
|
||||
return (
|
||||
@ -207,14 +210,9 @@ const CourierInfo = () => {
|
||||
onToggle={(expanded) => updateCollapseState('notes', expanded)}
|
||||
collapseKey='notes'
|
||||
>
|
||||
<Spin
|
||||
spinning={objectFormState.loading}
|
||||
indicator={<LoadingOutlined />}
|
||||
>
|
||||
<Card>
|
||||
<Card>
|
||||
<NotesPanel _id={courierId} type='courier' />
|
||||
</Card>
|
||||
</Spin>
|
||||
</Card>
|
||||
</InfoCollapse>
|
||||
<InfoCollapse
|
||||
title='Audit Logs'
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
import { useRef, useState, useMemo } from 'react'
|
||||
import { useLocation } from 'react-router-dom'
|
||||
import { Card, Flex, Space, Spin } from 'antd'
|
||||
import { Card, Flex, Space } from 'antd'
|
||||
import { LoadingOutlined } from '@ant-design/icons'
|
||||
import loglevel from 'loglevel'
|
||||
import config from '../../../../config.js'
|
||||
@ -191,14 +191,9 @@ const DocumentJobInfo = () => {
|
||||
onToggle={(expanded) => updateCollapseState('notes', expanded)}
|
||||
collapseKey='notes'
|
||||
>
|
||||
<Spin
|
||||
spinning={objectFormState.loading}
|
||||
indicator={<LoadingOutlined />}
|
||||
>
|
||||
<Card>
|
||||
<Card>
|
||||
<NotesPanel _id={documentJobId} type='documentJob' />
|
||||
</Card>
|
||||
</Spin>
|
||||
</Card>
|
||||
</InfoCollapse>
|
||||
<InfoCollapse
|
||||
title='Audit Logs'
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
import { useRef, useState, useMemo } from 'react'
|
||||
import { useLocation } from 'react-router-dom'
|
||||
import { Card, Flex, Space, Spin } from 'antd'
|
||||
import { Card, Flex, Space } from 'antd'
|
||||
import { LoadingOutlined } from '@ant-design/icons'
|
||||
import loglevel from 'loglevel'
|
||||
import config from '../../../../config.js'
|
||||
@ -99,7 +99,7 @@ const DocumentPrinterInfo = () => {
|
||||
<Space size='small'>
|
||||
<ObjectActions
|
||||
type='documentPrinter'
|
||||
pageName='info'
|
||||
pageName='info'
|
||||
id={documentPrinterId}
|
||||
disabled={objectFormState.loading}
|
||||
objectData={objectFormState.objectData}
|
||||
@ -204,14 +204,9 @@ const DocumentPrinterInfo = () => {
|
||||
onToggle={(expanded) => updateCollapseState('notes', expanded)}
|
||||
collapseKey='notes'
|
||||
>
|
||||
<Spin
|
||||
spinning={objectFormState.loading}
|
||||
indicator={<LoadingOutlined />}
|
||||
>
|
||||
<Card>
|
||||
<NotesPanel _id={documentPrinterId} type='documentPrinter' />
|
||||
</Card>
|
||||
</Spin>
|
||||
<Card>
|
||||
<NotesPanel _id={documentPrinterId} type='documentPrinter' />
|
||||
</Card>
|
||||
</InfoCollapse>
|
||||
|
||||
<InfoCollapse
|
||||
@ -229,10 +224,10 @@ const DocumentPrinterInfo = () => {
|
||||
<ObjectTable
|
||||
type='auditLog'
|
||||
masterFilter={{
|
||||
parent:
|
||||
getModelByName('documentPrinter').prefix +
|
||||
':' +
|
||||
documentPrinterId
|
||||
parent:
|
||||
getModelByName('documentPrinter').prefix +
|
||||
':' +
|
||||
documentPrinterId
|
||||
}}
|
||||
visibleColumns={{ _id: false, parent: false }}
|
||||
/>
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
import { useRef, useState, useMemo } from 'react'
|
||||
import { useLocation } from 'react-router-dom'
|
||||
import { Card, Flex, Space, Spin } from 'antd'
|
||||
import { Card, Flex, Space } from 'antd'
|
||||
import { LoadingOutlined } from '@ant-design/icons'
|
||||
import loglevel from 'loglevel'
|
||||
import config from '../../../../config.js'
|
||||
@ -192,14 +192,9 @@ const DocumentSizeInfo = () => {
|
||||
onToggle={(expanded) => updateCollapseState('notes', expanded)}
|
||||
collapseKey='notes'
|
||||
>
|
||||
<Spin
|
||||
spinning={objectFormState.loading}
|
||||
indicator={<LoadingOutlined />}
|
||||
>
|
||||
<Card>
|
||||
<Card>
|
||||
<NotesPanel _id={documentSizeId} type='documentSize' />
|
||||
</Card>
|
||||
</Spin>
|
||||
</Card>
|
||||
</InfoCollapse>
|
||||
<InfoCollapse
|
||||
title='Audit Logs'
|
||||
|
||||
@ -1,7 +1,6 @@
|
||||
import { useState, useRef, useMemo } from 'react'
|
||||
import { useLocation } from 'react-router-dom'
|
||||
import { Space, Flex, Card, Spin } from 'antd'
|
||||
import { LoadingOutlined } from '@ant-design/icons'
|
||||
import { Space, Flex, Card } from 'antd'
|
||||
import loglevel from 'loglevel'
|
||||
import config from '../../../../config.js'
|
||||
import useCollapseState from '../../hooks/useCollapseState.jsx'
|
||||
@ -174,14 +173,9 @@ const DocumentTemplateDesign = () => {
|
||||
onToggle={(expanded) => updateCollapseState('notes', expanded)}
|
||||
collapseKey='notes'
|
||||
>
|
||||
<Spin
|
||||
spinning={objectFormState.loading}
|
||||
indicator={<LoadingOutlined />}
|
||||
>
|
||||
<Card>
|
||||
<Card>
|
||||
<NotesPanel _id={documentTemplateId} type='documentTemplate' />
|
||||
</Card>
|
||||
</Spin>
|
||||
</Card>
|
||||
</InfoCollapse>
|
||||
</Flex>
|
||||
</ScrollBox>
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
import { useRef, useState, useMemo } from 'react'
|
||||
import { useLocation } from 'react-router-dom'
|
||||
import { Card, Flex, Space, Spin } from 'antd'
|
||||
import { Card, Flex, Space } from 'antd'
|
||||
import { LoadingOutlined } from '@ant-design/icons'
|
||||
import loglevel from 'loglevel'
|
||||
import config from '../../../../config.js'
|
||||
@ -205,14 +205,9 @@ const DocumentTemplateInfo = () => {
|
||||
onToggle={(expanded) => updateCollapseState('notes', expanded)}
|
||||
collapseKey='notes'
|
||||
>
|
||||
<Spin
|
||||
spinning={objectFormState.loading}
|
||||
indicator={<LoadingOutlined />}
|
||||
>
|
||||
<Card>
|
||||
<Card>
|
||||
<NotesPanel _id={documentTemplateId} type='documentTemplate' />
|
||||
</Card>
|
||||
</Spin>
|
||||
</Card>
|
||||
</InfoCollapse>
|
||||
|
||||
<InfoCollapse
|
||||
|
||||
@ -1,7 +1,6 @@
|
||||
import { useRef, useState, useMemo } from 'react'
|
||||
import { useLocation } from 'react-router-dom'
|
||||
import { Card, Flex, Space, Spin } from 'antd'
|
||||
import { LoadingOutlined } from '@ant-design/icons'
|
||||
import { Card, Flex, Space } from 'antd'
|
||||
import useCollapseState from '../../hooks/useCollapseState'
|
||||
import NotesPanel from '../../common/NotesPanel'
|
||||
import InfoCollapse from '../../common/InfoCollapse'
|
||||
@ -75,6 +74,10 @@ const FilamentSkuInfo = () => {
|
||||
objectFormRef?.current?.handleUpdate?.()
|
||||
return true
|
||||
},
|
||||
delete: () => {
|
||||
objectFormRef?.current?.handleDelete?.()
|
||||
return true
|
||||
}
|
||||
}
|
||||
|
||||
return (
|
||||
@ -185,14 +188,9 @@ const FilamentSkuInfo = () => {
|
||||
onToggle={(expanded) => updateCollapseState('notes', expanded)}
|
||||
collapseKey='notes'
|
||||
>
|
||||
<Spin
|
||||
spinning={objectFormState.loading}
|
||||
indicator={<LoadingOutlined />}
|
||||
>
|
||||
<Card>
|
||||
<Card>
|
||||
<NotesPanel _id={filamentSkuId} type='filamentSku' />
|
||||
</Card>
|
||||
</Spin>
|
||||
</Card>
|
||||
</InfoCollapse>
|
||||
<InfoCollapse
|
||||
title='Audit Logs'
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
import { useRef, useState, useEffect, useMemo } from 'react'
|
||||
import { useLocation } from 'react-router-dom'
|
||||
import { Card, Flex, Space, Spin } from 'antd'
|
||||
import { Card, Flex, Space } from 'antd'
|
||||
import { LoadingOutlined } from '@ant-design/icons'
|
||||
import loglevel from 'loglevel'
|
||||
import config from '../../../../config'
|
||||
@ -93,6 +93,10 @@ const FilamentInfo = () => {
|
||||
objectFormRef?.current?.handleUpdate?.()
|
||||
return true
|
||||
},
|
||||
delete: () => {
|
||||
objectFormRef?.current?.handleDelete?.()
|
||||
return true
|
||||
}
|
||||
}
|
||||
|
||||
return (
|
||||
@ -254,14 +258,9 @@ const FilamentInfo = () => {
|
||||
onToggle={(expanded) => updateCollapseState('notes', expanded)}
|
||||
collapseKey='notes'
|
||||
>
|
||||
<Spin
|
||||
spinning={objectFormState.loading}
|
||||
indicator={<LoadingOutlined />}
|
||||
>
|
||||
<Card>
|
||||
<Card>
|
||||
<NotesPanel _id={filamentId} type='filament' />
|
||||
</Card>
|
||||
</Spin>
|
||||
</Card>
|
||||
</InfoCollapse>
|
||||
|
||||
<InfoCollapse
|
||||
|
||||
@ -1,7 +1,6 @@
|
||||
import { useContext, useRef, useState, useMemo } from 'react'
|
||||
import { useLocation } from 'react-router-dom'
|
||||
import { Card, Flex, Space, Spin } from 'antd'
|
||||
import { LoadingOutlined } from '@ant-design/icons'
|
||||
import { Card, Flex, Space } from 'antd'
|
||||
import loglevel from 'loglevel'
|
||||
import config from '../../../../config.js'
|
||||
import useCollapseState from '../../hooks/useCollapseState.jsx'
|
||||
@ -88,6 +87,10 @@ const FileInfo = () => {
|
||||
fetchFileContent(objectFormState?.objectData, true)
|
||||
return true
|
||||
},
|
||||
delete: () => {
|
||||
objectFormRef?.current?.handleDelete?.()
|
||||
return true
|
||||
}
|
||||
}
|
||||
|
||||
return (
|
||||
@ -238,14 +241,9 @@ const FileInfo = () => {
|
||||
onToggle={(expanded) => updateCollapseState('notes', expanded)}
|
||||
collapseKey='notes'
|
||||
>
|
||||
<Spin
|
||||
spinning={objectFormState.loading}
|
||||
indicator={<LoadingOutlined />}
|
||||
>
|
||||
<Card>
|
||||
<Card>
|
||||
<NotesPanel _id={fileId} type='file' />
|
||||
</Card>
|
||||
</Spin>
|
||||
</Card>
|
||||
</InfoCollapse>
|
||||
<InfoCollapse
|
||||
title='Audit Logs'
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
import { useRef, useState, useEffect, useMemo } from 'react'
|
||||
import { useLocation } from 'react-router-dom'
|
||||
import { Card, Flex, Space, Spin } from 'antd'
|
||||
import { Card, Flex, Space } from 'antd'
|
||||
import { LoadingOutlined } from '@ant-design/icons'
|
||||
import loglevel from 'loglevel'
|
||||
import config from '../../../../config.js'
|
||||
@ -88,6 +88,10 @@ const HostInfo = () => {
|
||||
objectFormRef?.current.handleUpdate()
|
||||
return true
|
||||
},
|
||||
delete: () => {
|
||||
objectFormRef?.current?.handleDelete?.()
|
||||
return true
|
||||
}
|
||||
}
|
||||
|
||||
return (
|
||||
@ -249,14 +253,9 @@ const HostInfo = () => {
|
||||
onToggle={(expanded) => updateCollapseState('notes', expanded)}
|
||||
collapseKey='notes'
|
||||
>
|
||||
<Spin
|
||||
spinning={objectFormState.loading}
|
||||
indicator={<LoadingOutlined />}
|
||||
>
|
||||
<Card>
|
||||
<Card>
|
||||
<NotesPanel _id={hostId} type='host' />
|
||||
</Card>
|
||||
</Spin>
|
||||
</Card>
|
||||
</InfoCollapse>
|
||||
|
||||
<InfoCollapse
|
||||
|
||||
@ -1,7 +1,6 @@
|
||||
import { useRef, useState, useMemo } from 'react'
|
||||
import { useLocation } from 'react-router-dom'
|
||||
import { Card, Flex, Space, Spin } from 'antd'
|
||||
import { LoadingOutlined } from '@ant-design/icons'
|
||||
import { Card, Flex, Space } from 'antd'
|
||||
import loglevel from 'loglevel'
|
||||
import config from '../../../../config'
|
||||
import useCollapseState from '../../hooks/useCollapseState'
|
||||
@ -78,6 +77,10 @@ const MaterialInfo = () => {
|
||||
objectFormRef?.current?.handleUpdate?.()
|
||||
return true
|
||||
},
|
||||
delete: () => {
|
||||
objectFormRef?.current?.handleDelete?.()
|
||||
return true
|
||||
}
|
||||
}
|
||||
|
||||
return (
|
||||
@ -188,14 +191,9 @@ const MaterialInfo = () => {
|
||||
onToggle={(expanded) => updateCollapseState('notes', expanded)}
|
||||
collapseKey='notes'
|
||||
>
|
||||
<Spin
|
||||
spinning={objectFormState.loading}
|
||||
indicator={<LoadingOutlined />}
|
||||
>
|
||||
<Card>
|
||||
<Card>
|
||||
<NotesPanel _id={materialId} type='material' />
|
||||
</Card>
|
||||
</Spin>
|
||||
</Card>
|
||||
</InfoCollapse>
|
||||
<InfoCollapse
|
||||
title='Audit Logs'
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
import { useRef, useState, useMemo } from 'react'
|
||||
import { useLocation } from 'react-router-dom'
|
||||
import { Card, Flex, Space, Spin } from 'antd'
|
||||
import { Card, Flex, Space } from 'antd'
|
||||
import { LoadingOutlined } from '@ant-design/icons'
|
||||
import loglevel from 'loglevel'
|
||||
import config from '../../../../config.js'
|
||||
@ -78,6 +78,10 @@ const NoteInfo = () => {
|
||||
objectFormRef?.current?.handleUpdate?.()
|
||||
return true
|
||||
},
|
||||
delete: () => {
|
||||
objectFormRef?.current?.handleDelete?.()
|
||||
return true
|
||||
}
|
||||
}
|
||||
|
||||
return (
|
||||
@ -215,14 +219,9 @@ const NoteInfo = () => {
|
||||
onToggle={(expanded) => updateCollapseState('notes', expanded)}
|
||||
collapseKey='notes'
|
||||
>
|
||||
<Spin
|
||||
spinning={objectFormState.loading}
|
||||
indicator={<LoadingOutlined />}
|
||||
>
|
||||
<Card>
|
||||
<Card>
|
||||
<NotesPanel _id={noteId} type='note' />
|
||||
</Card>
|
||||
</Spin>
|
||||
</Card>
|
||||
</InfoCollapse>
|
||||
<InfoCollapse
|
||||
title='Audit Logs'
|
||||
|
||||
@ -1,7 +1,6 @@
|
||||
import { useRef, useState, useMemo } from 'react'
|
||||
import { useLocation } from 'react-router-dom'
|
||||
import { Card, Flex, Space, Spin } from 'antd'
|
||||
import { LoadingOutlined } from '@ant-design/icons'
|
||||
import { Card, Flex, Space } from 'antd'
|
||||
import useCollapseState from '../../hooks/useCollapseState'
|
||||
import NotesPanel from '../../common/NotesPanel'
|
||||
import InfoCollapse from '../../common/InfoCollapse'
|
||||
@ -70,6 +69,10 @@ const PartSkuInfo = () => {
|
||||
objectFormRef?.current?.handleUpdate?.()
|
||||
return true
|
||||
},
|
||||
delete: () => {
|
||||
objectFormRef?.current?.handleDelete?.()
|
||||
return true
|
||||
}
|
||||
}
|
||||
|
||||
return (
|
||||
@ -180,14 +183,9 @@ const PartSkuInfo = () => {
|
||||
onToggle={(expanded) => updateCollapseState('notes', expanded)}
|
||||
collapseKey='notes'
|
||||
>
|
||||
<Spin
|
||||
spinning={objectFormState.loading}
|
||||
indicator={<LoadingOutlined />}
|
||||
>
|
||||
<Card>
|
||||
<Card>
|
||||
<NotesPanel _id={partSkuId} type='partSku' />
|
||||
</Card>
|
||||
</Spin>
|
||||
</Card>
|
||||
</InfoCollapse>
|
||||
<InfoCollapse
|
||||
title='Audit Logs'
|
||||
|
||||
@ -1,7 +1,6 @@
|
||||
import { useRef, useState, useEffect, useMemo } from 'react'
|
||||
import { useLocation } from 'react-router-dom'
|
||||
import { Card, Flex, Space, Spin } from 'antd'
|
||||
import { LoadingOutlined } from '@ant-design/icons'
|
||||
import { Card, Flex, Space } from 'antd'
|
||||
import useCollapseState from '../../hooks/useCollapseState'
|
||||
import NotesPanel from '../../common/NotesPanel'
|
||||
import InfoCollapse from '../../common/InfoCollapse'
|
||||
@ -210,14 +209,9 @@ const PartInfo = () => {
|
||||
onToggle={(expanded) => updateCollapseState('notes', expanded)}
|
||||
collapseKey='notes'
|
||||
>
|
||||
<Spin
|
||||
spinning={objectFormState.loading}
|
||||
indicator={<LoadingOutlined />}
|
||||
>
|
||||
<Card>
|
||||
<Card>
|
||||
<NotesPanel _id={partId} type='part' />
|
||||
</Card>
|
||||
</Spin>
|
||||
</Card>
|
||||
</InfoCollapse>
|
||||
<InfoCollapse
|
||||
title='Audit Logs'
|
||||
|
||||
@ -81,6 +81,10 @@ const PermissionSettingInfo = () => {
|
||||
objectFormRef?.current?.handleUpdate?.()
|
||||
return true
|
||||
},
|
||||
delete: () => {
|
||||
objectFormRef?.current?.handleDelete?.()
|
||||
return true
|
||||
}
|
||||
}
|
||||
|
||||
return (
|
||||
@ -222,17 +226,12 @@ const PermissionSettingInfo = () => {
|
||||
onToggle={(expanded) => updateCollapseState('notes', expanded)}
|
||||
collapseKey='notes'
|
||||
>
|
||||
<Spin
|
||||
spinning={objectFormState.loading}
|
||||
indicator={<LoadingOutlined />}
|
||||
>
|
||||
<Card>
|
||||
<Card>
|
||||
<NotesPanel
|
||||
_id={permissionSettingId}
|
||||
type='permissionSetting'
|
||||
/>
|
||||
</Card>
|
||||
</Spin>
|
||||
</Card>
|
||||
</InfoCollapse>
|
||||
<InfoCollapse
|
||||
title='Audit Logs'
|
||||
|
||||
@ -1,7 +1,6 @@
|
||||
import { useRef, useState, useMemo } from 'react'
|
||||
import { useLocation } from 'react-router-dom'
|
||||
import { Card, Flex, Space, Spin } from 'antd'
|
||||
import { LoadingOutlined } from '@ant-design/icons'
|
||||
import { Card, Flex, Space } from 'antd'
|
||||
import useCollapseState from '../../hooks/useCollapseState'
|
||||
import NotesPanel from '../../common/NotesPanel'
|
||||
import InfoCollapse from '../../common/InfoCollapse'
|
||||
@ -75,6 +74,10 @@ const ProductCategoryInfo = () => {
|
||||
objectFormRef?.current?.handleUpdate?.()
|
||||
return true
|
||||
},
|
||||
delete: () => {
|
||||
objectFormRef?.current?.handleDelete?.()
|
||||
return true
|
||||
}
|
||||
}
|
||||
|
||||
return (
|
||||
@ -185,14 +188,9 @@ const ProductCategoryInfo = () => {
|
||||
onToggle={(expanded) => updateCollapseState('notes', expanded)}
|
||||
collapseKey='notes'
|
||||
>
|
||||
<Spin
|
||||
spinning={objectFormState.loading}
|
||||
indicator={<LoadingOutlined />}
|
||||
>
|
||||
<Card>
|
||||
<Card>
|
||||
<NotesPanel _id={productCategoryId} type='productCategory' />
|
||||
</Card>
|
||||
</Spin>
|
||||
</Card>
|
||||
</InfoCollapse>
|
||||
<InfoCollapse
|
||||
title='Audit Logs'
|
||||
|
||||
@ -1,7 +1,6 @@
|
||||
import { useRef, useState, useMemo } from 'react'
|
||||
import { useLocation } from 'react-router-dom'
|
||||
import { Card, Flex, Space, Spin } from 'antd'
|
||||
import { LoadingOutlined } from '@ant-design/icons'
|
||||
import { Card, Flex, Space } from 'antd'
|
||||
import useCollapseState from '../../hooks/useCollapseState'
|
||||
import NotesPanel from '../../common/NotesPanel'
|
||||
import InfoCollapse from '../../common/InfoCollapse'
|
||||
@ -76,6 +75,10 @@ const ProductSkuInfo = () => {
|
||||
objectFormRef?.current?.handleUpdate?.()
|
||||
return true
|
||||
},
|
||||
delete: () => {
|
||||
objectFormRef?.current?.handleDelete?.()
|
||||
return true
|
||||
}
|
||||
}
|
||||
|
||||
return (
|
||||
@ -212,14 +215,9 @@ const ProductSkuInfo = () => {
|
||||
onToggle={(expanded) => updateCollapseState('notes', expanded)}
|
||||
collapseKey='notes'
|
||||
>
|
||||
<Spin
|
||||
spinning={objectFormState.loading}
|
||||
indicator={<LoadingOutlined />}
|
||||
>
|
||||
<Card>
|
||||
<Card>
|
||||
<NotesPanel _id={productSkuId} type='productSku' />
|
||||
</Card>
|
||||
</Spin>
|
||||
</Card>
|
||||
</InfoCollapse>
|
||||
<InfoCollapse
|
||||
title='Audit Logs'
|
||||
|
||||
@ -1,7 +1,6 @@
|
||||
import { useRef, useState, useEffect, useMemo } from 'react'
|
||||
import { useLocation } from 'react-router-dom'
|
||||
import { Card, Flex, Space, Spin } from 'antd'
|
||||
import { LoadingOutlined } from '@ant-design/icons'
|
||||
import { Card, Flex, Space } from 'antd'
|
||||
import useCollapseState from '../../hooks/useCollapseState'
|
||||
import NotesPanel from '../../common/NotesPanel'
|
||||
import InfoCollapse from '../../common/InfoCollapse'
|
||||
@ -217,14 +216,9 @@ const ProductInfo = () => {
|
||||
onToggle={(expanded) => updateCollapseState('notes', expanded)}
|
||||
collapseKey='notes'
|
||||
>
|
||||
<Spin
|
||||
spinning={objectFormState.loading}
|
||||
indicator={<LoadingOutlined />}
|
||||
>
|
||||
<Card>
|
||||
<Card>
|
||||
<NotesPanel _id={productId} type='product' />
|
||||
</Card>
|
||||
</Spin>
|
||||
</Card>
|
||||
</InfoCollapse>
|
||||
<InfoCollapse
|
||||
title='Audit Logs'
|
||||
|
||||
@ -1,7 +1,6 @@
|
||||
import { useRef, useState, useMemo } from 'react'
|
||||
import { useLocation } from 'react-router-dom'
|
||||
import { Card, Flex, Space, Spin } from 'antd'
|
||||
import { LoadingOutlined } from '@ant-design/icons'
|
||||
import { Card, Flex, Space } from 'antd'
|
||||
import loglevel from 'loglevel'
|
||||
import config from '../../../../config'
|
||||
import useCollapseState from '../../hooks/useCollapseState'
|
||||
@ -75,6 +74,10 @@ const TaxRateInfo = () => {
|
||||
objectFormRef?.current?.handleUpdate?.()
|
||||
return true
|
||||
},
|
||||
delete: () => {
|
||||
objectFormRef?.current?.handleDelete?.()
|
||||
return true
|
||||
}
|
||||
}
|
||||
|
||||
return (
|
||||
@ -185,14 +188,9 @@ const TaxRateInfo = () => {
|
||||
onToggle={(expanded) => updateCollapseState('notes', expanded)}
|
||||
collapseKey='notes'
|
||||
>
|
||||
<Spin
|
||||
spinning={objectFormState.loading}
|
||||
indicator={<LoadingOutlined />}
|
||||
>
|
||||
<Card>
|
||||
<Card>
|
||||
<NotesPanel _id={taxRateId} type='taxRate' />
|
||||
</Card>
|
||||
</Spin>
|
||||
</Card>
|
||||
</InfoCollapse>
|
||||
<InfoCollapse
|
||||
title='Audit Logs'
|
||||
|
||||
@ -81,6 +81,10 @@ const UserGroupInfo = () => {
|
||||
objectFormRef?.current?.handleUpdate?.()
|
||||
return true
|
||||
},
|
||||
delete: () => {
|
||||
objectFormRef?.current?.handleDelete?.()
|
||||
return true
|
||||
}
|
||||
}
|
||||
|
||||
return (
|
||||
@ -238,14 +242,9 @@ const UserGroupInfo = () => {
|
||||
onToggle={(expanded) => updateCollapseState('notes', expanded)}
|
||||
collapseKey='notes'
|
||||
>
|
||||
<Spin
|
||||
spinning={objectFormState.loading}
|
||||
indicator={<LoadingOutlined />}
|
||||
>
|
||||
<Card>
|
||||
<Card>
|
||||
<NotesPanel _id={userGroupId} type='userGroup' />
|
||||
</Card>
|
||||
</Spin>
|
||||
</Card>
|
||||
</InfoCollapse>
|
||||
<InfoCollapse
|
||||
title='Audit Logs'
|
||||
|
||||
@ -259,14 +259,9 @@ const UserInfo = () => {
|
||||
onToggle={(expanded) => updateCollapseState('notes', expanded)}
|
||||
collapseKey='notes'
|
||||
>
|
||||
<Spin
|
||||
spinning={objectFormState.loading}
|
||||
indicator={<LoadingOutlined />}
|
||||
>
|
||||
<Card>
|
||||
<Card>
|
||||
<NotesPanel _id={userId} type='user' />
|
||||
</Card>
|
||||
</Spin>
|
||||
</Card>
|
||||
</InfoCollapse>
|
||||
<InfoCollapse
|
||||
title='Audit Logs'
|
||||
|
||||
@ -1,7 +1,6 @@
|
||||
import { useRef, useState, useMemo } from 'react'
|
||||
import { useLocation } from 'react-router-dom'
|
||||
import { Card, Flex, Space, Spin } from 'antd'
|
||||
import { LoadingOutlined } from '@ant-design/icons'
|
||||
import { Card, Flex, Space } from 'antd'
|
||||
import loglevel from 'loglevel'
|
||||
import config from '../../../../config'
|
||||
import useCollapseState from '../../hooks/useCollapseState'
|
||||
@ -75,6 +74,10 @@ const VendorInfo = () => {
|
||||
objectFormRef?.current?.handleUpdate?.()
|
||||
return true
|
||||
},
|
||||
delete: () => {
|
||||
objectFormRef?.current?.handleDelete?.()
|
||||
return true
|
||||
}
|
||||
}
|
||||
|
||||
return (
|
||||
@ -185,14 +188,9 @@ const VendorInfo = () => {
|
||||
onToggle={(expanded) => updateCollapseState('notes', expanded)}
|
||||
collapseKey='notes'
|
||||
>
|
||||
<Spin
|
||||
spinning={objectFormState.loading}
|
||||
indicator={<LoadingOutlined />}
|
||||
>
|
||||
<Card>
|
||||
<Card>
|
||||
<NotesPanel _id={vendorId} type='vendor' />
|
||||
</Card>
|
||||
</Spin>
|
||||
</Card>
|
||||
</InfoCollapse>
|
||||
<InfoCollapse
|
||||
title='Audit Logs'
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
import { useRef, useState, useMemo } from 'react'
|
||||
import { useLocation } from 'react-router-dom'
|
||||
import { Card, Flex, Space, Spin } from 'antd'
|
||||
import { Card, Flex, Space } from 'antd'
|
||||
import { LoadingOutlined } from '@ant-design/icons'
|
||||
import ActionHandler from '../../common/ActionHandler'
|
||||
import AuditLogIcon from '../../../Icons/AuditLogIcon'
|
||||
@ -112,6 +112,10 @@ const FilamentProfileInfo = () => {
|
||||
objectFormRef.current?.handleUpdate?.()
|
||||
return true
|
||||
},
|
||||
delete: () => {
|
||||
objectFormRef.current?.handleDelete?.()
|
||||
return true
|
||||
}
|
||||
}
|
||||
|
||||
return (
|
||||
@ -524,14 +528,9 @@ const FilamentProfileInfo = () => {
|
||||
onToggle={(expanded) => updateCollapseState('notes', expanded)}
|
||||
collapseKey='notes'
|
||||
>
|
||||
<Spin
|
||||
spinning={objectFormState.loading}
|
||||
indicator={<LoadingOutlined />}
|
||||
>
|
||||
<Card>
|
||||
<Card>
|
||||
<NotesPanel _id={filamentProfileId} type='filamentProfile' />
|
||||
</Card>
|
||||
</Spin>
|
||||
</Card>
|
||||
</InfoCollapse>
|
||||
|
||||
<InfoCollapse
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
import { useRef, useState, useMemo } from 'react'
|
||||
import { useLocation } from 'react-router-dom'
|
||||
import { Card, Flex, Space, Spin } from 'antd'
|
||||
import { Card, Flex, Space } from 'antd'
|
||||
import { LoadingOutlined } from '@ant-design/icons'
|
||||
import loglevel from 'loglevel'
|
||||
import config from '../../../../config.js'
|
||||
@ -225,14 +225,9 @@ const GCodeFileInfo = () => {
|
||||
onToggle={(expanded) => updateCollapseState('notes', expanded)}
|
||||
collapseKey='notes'
|
||||
>
|
||||
<Spin
|
||||
spinning={objectFormState.loading}
|
||||
indicator={<LoadingOutlined />}
|
||||
>
|
||||
<Card>
|
||||
<Card>
|
||||
<NotesPanel _id={gcodeFileId} type='gcodeFile' />
|
||||
</Card>
|
||||
</Spin>
|
||||
</Card>
|
||||
</InfoCollapse>
|
||||
|
||||
<InfoCollapse
|
||||
|
||||
@ -1,7 +1,6 @@
|
||||
import { useRef, useState, useMemo } from 'react'
|
||||
import { useLocation } from 'react-router-dom'
|
||||
import { Space, Flex, Card, Spin } from 'antd'
|
||||
import { LoadingOutlined } from '@ant-design/icons'
|
||||
import { Space, Flex, Card } from 'antd'
|
||||
import loglevel from 'loglevel'
|
||||
import config from '../../../../config.js'
|
||||
import useCollapseState from '../../hooks/useCollapseState.jsx'
|
||||
@ -144,14 +143,9 @@ const GCodeFilePreview = () => {
|
||||
onToggle={(expanded) => updateCollapseState('notes', expanded)}
|
||||
collapseKey='notes'
|
||||
>
|
||||
<Spin
|
||||
spinning={objectFormState.loading}
|
||||
indicator={<LoadingOutlined />}
|
||||
>
|
||||
<Card>
|
||||
<Card>
|
||||
<NotesPanel _id={gcodeFileId} type='gcodeFile' />
|
||||
</Card>
|
||||
</Spin>
|
||||
</Card>
|
||||
</InfoCollapse>
|
||||
</Flex>
|
||||
</ScrollBox>
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
import { useRef, useState, useEffect, useMemo } from 'react'
|
||||
import { useLocation } from 'react-router-dom'
|
||||
import { Card, Flex, Space, Spin } from 'antd'
|
||||
import { Card, Flex, Space } from 'antd'
|
||||
import { LoadingOutlined } from '@ant-design/icons'
|
||||
import loglevel from 'loglevel'
|
||||
import config from '../../../../config.js'
|
||||
@ -219,14 +219,9 @@ const JobInfo = () => {
|
||||
onToggle={(expanded) => updateCollapseState('notes', expanded)}
|
||||
collapseKey='notes'
|
||||
>
|
||||
<Spin
|
||||
spinning={objectFormState.loading}
|
||||
indicator={<LoadingOutlined />}
|
||||
>
|
||||
<Card>
|
||||
<Card>
|
||||
<NotesPanel _id={jobId} type='job' />
|
||||
</Card>
|
||||
</Spin>
|
||||
</Card>
|
||||
</InfoCollapse>
|
||||
|
||||
<InfoCollapse
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
import { useRef, useState, useMemo } from 'react'
|
||||
import { useLocation } from 'react-router-dom'
|
||||
import { Card, Flex, Space, Spin } from 'antd'
|
||||
import { Card, Flex, Space } from 'antd'
|
||||
import { LoadingOutlined } from '@ant-design/icons'
|
||||
import ActionHandler from '../../common/ActionHandler'
|
||||
import AuditLogIcon from '../../../Icons/AuditLogIcon'
|
||||
@ -90,6 +90,10 @@ const PrinterProfileInfo = () => {
|
||||
objectFormRef.current?.handleUpdate?.()
|
||||
return true
|
||||
},
|
||||
delete: () => {
|
||||
objectFormRef.current?.handleDelete?.()
|
||||
return true
|
||||
}
|
||||
}
|
||||
|
||||
return (
|
||||
@ -375,14 +379,9 @@ const PrinterProfileInfo = () => {
|
||||
onToggle={(expanded) => updateCollapseState('notes', expanded)}
|
||||
collapseKey='notes'
|
||||
>
|
||||
<Spin
|
||||
spinning={objectFormState.loading}
|
||||
indicator={<LoadingOutlined />}
|
||||
>
|
||||
<Card>
|
||||
<Card>
|
||||
<NotesPanel _id={printerProfileId} type='printerProfile' />
|
||||
</Card>
|
||||
</Spin>
|
||||
</Card>
|
||||
</InfoCollapse>
|
||||
|
||||
<InfoCollapse
|
||||
|
||||
@ -1,7 +1,6 @@
|
||||
import { useState, useRef, useEffect, useContext, useMemo } from 'react'
|
||||
import { useLocation } from 'react-router-dom'
|
||||
import { Space, Flex, Card, Splitter, Divider, Spin } from 'antd'
|
||||
import { LoadingOutlined } from '@ant-design/icons'
|
||||
import { Space, Flex, Card, Splitter, Divider } from 'antd'
|
||||
import loglevel from 'loglevel'
|
||||
import config from '../../../../config.js'
|
||||
import useCollapseState from '../../hooks/useCollapseState.jsx'
|
||||
@ -621,14 +620,9 @@ const ControlPrinter = ({ slicerIntegration = false }) => {
|
||||
onToggle={(expanded) => updateCollapseState('notes', expanded)}
|
||||
collapseKey='notes'
|
||||
>
|
||||
<Spin
|
||||
spinning={objectFormState.loading}
|
||||
indicator={<LoadingOutlined />}
|
||||
>
|
||||
<Card>
|
||||
<Card>
|
||||
<NotesPanel _id={printerId} type='printer' />
|
||||
</Card>
|
||||
</Spin>
|
||||
</Card>
|
||||
</InfoCollapse>
|
||||
</Flex>
|
||||
</ScrollBox>
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
import { useRef, useState, useEffect, useMemo } from 'react'
|
||||
import { useLocation } from 'react-router-dom'
|
||||
import { Card, Flex, Space, Spin } from 'antd'
|
||||
import { Card, Flex, Space } from 'antd'
|
||||
import { LoadingOutlined } from '@ant-design/icons'
|
||||
import loglevel from 'loglevel'
|
||||
import config from '../../../../config.js'
|
||||
@ -239,14 +239,9 @@ const PrinterInfo = () => {
|
||||
onToggle={(expanded) => updateCollapseState('notes', expanded)}
|
||||
collapseKey='notes'
|
||||
>
|
||||
<Spin
|
||||
spinning={objectFormState.loading}
|
||||
indicator={<LoadingOutlined />}
|
||||
>
|
||||
<Card>
|
||||
<Card>
|
||||
<NotesPanel _id={printerId} type='printer' />
|
||||
</Card>
|
||||
</Spin>
|
||||
</Card>
|
||||
</InfoCollapse>
|
||||
|
||||
<InfoCollapse
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
import { useRef, useState, useMemo } from 'react'
|
||||
import { useLocation } from 'react-router-dom'
|
||||
import { Card, Flex, Space, Spin } from 'antd'
|
||||
import { Card, Flex, Space } from 'antd'
|
||||
import { LoadingOutlined } from '@ant-design/icons'
|
||||
import useCollapseState from '../../hooks/useCollapseState'
|
||||
import NotesPanel from '../../common/NotesPanel'
|
||||
@ -198,14 +198,9 @@ const SubJobInfo = () => {
|
||||
onToggle={(expanded) => updateCollapseState('notes', expanded)}
|
||||
collapseKey='notes'
|
||||
>
|
||||
<Spin
|
||||
spinning={objectFormState.loading}
|
||||
indicator={<LoadingOutlined />}
|
||||
>
|
||||
<Card>
|
||||
<Card>
|
||||
<NotesPanel _id={subJobId} type='subJob' />
|
||||
</Card>
|
||||
</Spin>
|
||||
</Card>
|
||||
</InfoCollapse>
|
||||
<InfoCollapse
|
||||
title='Audit Logs'
|
||||
|
||||
@ -1,7 +1,6 @@
|
||||
import { useRef, useState, useMemo } from 'react'
|
||||
import { useLocation } from 'react-router-dom'
|
||||
import { Card, Flex, Space, Spin } from 'antd'
|
||||
import { LoadingOutlined } from '@ant-design/icons'
|
||||
import { Card, Flex, Space } from 'antd'
|
||||
import loglevel from 'loglevel'
|
||||
import config from '../../../../config'
|
||||
import useCollapseState from '../../hooks/useCollapseState'
|
||||
@ -75,6 +74,10 @@ const ClientInfo = () => {
|
||||
objectFormRef?.current?.handleUpdate?.()
|
||||
return true
|
||||
},
|
||||
delete: () => {
|
||||
objectFormRef?.current?.handleDelete?.()
|
||||
return true
|
||||
}
|
||||
}
|
||||
|
||||
return (
|
||||
@ -185,14 +188,9 @@ const ClientInfo = () => {
|
||||
onToggle={(expanded) => updateCollapseState('notes', expanded)}
|
||||
collapseKey='notes'
|
||||
>
|
||||
<Spin
|
||||
spinning={objectFormState.loading}
|
||||
indicator={<LoadingOutlined />}
|
||||
>
|
||||
<Card>
|
||||
<Card>
|
||||
<NotesPanel _id={clientId} type='client' />
|
||||
</Card>
|
||||
</Spin>
|
||||
</Card>
|
||||
</InfoCollapse>
|
||||
<InfoCollapse
|
||||
title='Audit Logs'
|
||||
|
||||
@ -1,7 +1,6 @@
|
||||
import { useRef, useState, useEffect, useMemo } from 'react'
|
||||
import { useLocation } from 'react-router-dom'
|
||||
import { Card, Flex, Space, Spin } from 'antd'
|
||||
import { LoadingOutlined } from '@ant-design/icons'
|
||||
import { Card, Flex, Space } from 'antd'
|
||||
import loglevel from 'loglevel'
|
||||
import config from '../../../../config'
|
||||
import useCollapseState from '../../hooks/useCollapseState'
|
||||
@ -89,6 +88,10 @@ const ListingVarientInfo = () => {
|
||||
objectFormRef?.current?.handleUpdate?.()
|
||||
return true
|
||||
},
|
||||
delete: () => {
|
||||
objectFormRef?.current?.handleDelete?.()
|
||||
return true
|
||||
}
|
||||
}
|
||||
|
||||
return (
|
||||
@ -202,14 +205,9 @@ const ListingVarientInfo = () => {
|
||||
onToggle={(expanded) => updateCollapseState('notes', expanded)}
|
||||
collapseKey='notes'
|
||||
>
|
||||
<Spin
|
||||
spinning={objectFormState.loading}
|
||||
indicator={<LoadingOutlined />}
|
||||
>
|
||||
<Card>
|
||||
<Card>
|
||||
<NotesPanel _id={listingVarientId} type='listingVarient' />
|
||||
</Card>
|
||||
</Spin>
|
||||
</Card>
|
||||
</InfoCollapse>
|
||||
<InfoCollapse
|
||||
title='Audit Logs'
|
||||
|
||||
@ -1,7 +1,6 @@
|
||||
import { useRef, useState, useEffect, useMemo } from 'react'
|
||||
import { useLocation } from 'react-router-dom'
|
||||
import { Card, Flex, Space, Spin } from 'antd'
|
||||
import { LoadingOutlined } from '@ant-design/icons'
|
||||
import { Card, Flex, Space } from 'antd'
|
||||
import loglevel from 'loglevel'
|
||||
import config from '../../../../config'
|
||||
import useCollapseState from '../../hooks/useCollapseState'
|
||||
@ -87,6 +86,10 @@ const ListingInfo = () => {
|
||||
objectFormRef?.current?.handleUpdate?.()
|
||||
return true
|
||||
},
|
||||
delete: () => {
|
||||
objectFormRef?.current?.handleDelete?.()
|
||||
return true
|
||||
}
|
||||
}
|
||||
|
||||
return (
|
||||
@ -220,14 +223,9 @@ const ListingInfo = () => {
|
||||
onToggle={(expanded) => updateCollapseState('notes', expanded)}
|
||||
collapseKey='notes'
|
||||
>
|
||||
<Spin
|
||||
spinning={objectFormState.loading}
|
||||
indicator={<LoadingOutlined />}
|
||||
>
|
||||
<Card>
|
||||
<Card>
|
||||
<NotesPanel _id={listingId} type='listing' />
|
||||
</Card>
|
||||
</Spin>
|
||||
</Card>
|
||||
</InfoCollapse>
|
||||
<InfoCollapse
|
||||
title='Audit Logs'
|
||||
|
||||
@ -1,7 +1,6 @@
|
||||
import { useContext, useRef, useState, useEffect, useMemo } from 'react'
|
||||
import { useLocation } from 'react-router-dom'
|
||||
import { Card, Flex, message, Space, Spin } from 'antd'
|
||||
import { LoadingOutlined } from '@ant-design/icons'
|
||||
import { Card, Flex, message, Space } from 'antd'
|
||||
import loglevel from 'loglevel'
|
||||
import config from '../../../../config'
|
||||
import useCollapseState from '../../hooks/useCollapseState'
|
||||
@ -144,6 +143,10 @@ const MarketplaceInfo = () => {
|
||||
objectFormRef?.current?.handleUpdate?.()
|
||||
return true
|
||||
},
|
||||
delete: () => {
|
||||
objectFormRef?.current?.handleDelete?.()
|
||||
return true
|
||||
},
|
||||
connect: () => {
|
||||
startAuthorization()
|
||||
return true
|
||||
@ -266,14 +269,9 @@ const MarketplaceInfo = () => {
|
||||
onToggle={(expanded) => updateCollapseState('notes', expanded)}
|
||||
collapseKey='notes'
|
||||
>
|
||||
<Spin
|
||||
spinning={objectFormState.loading}
|
||||
indicator={<LoadingOutlined />}
|
||||
>
|
||||
<Card>
|
||||
<Card>
|
||||
<NotesPanel _id={marketplaceId} type='marketplace' />
|
||||
</Card>
|
||||
</Spin>
|
||||
</Card>
|
||||
</InfoCollapse>
|
||||
<InfoCollapse
|
||||
title='Audit Logs'
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
import { useRef, useState, useEffect, useMemo } from 'react'
|
||||
import { useLocation } from 'react-router-dom'
|
||||
import { Space, Flex, Card, Spin } from 'antd'
|
||||
import { Space, Flex, Card } from 'antd'
|
||||
import { LoadingOutlined } from '@ant-design/icons'
|
||||
import loglevel from 'loglevel'
|
||||
import config from '../../../../config.js'
|
||||
@ -101,6 +101,10 @@ const SalesOrderInfo = () => {
|
||||
objectFormRef?.current?.handleUpdate?.()
|
||||
return true
|
||||
},
|
||||
delete: () => {
|
||||
objectFormRef?.current?.handleDelete?.()
|
||||
return true
|
||||
}
|
||||
}
|
||||
|
||||
return (
|
||||
@ -307,14 +311,9 @@ const SalesOrderInfo = () => {
|
||||
onToggle={(expanded) => updateCollapseState('notes', expanded)}
|
||||
collapseKey='notes'
|
||||
>
|
||||
<Spin
|
||||
spinning={objectFormState.loading}
|
||||
indicator={<LoadingOutlined />}
|
||||
>
|
||||
<Card>
|
||||
<Card>
|
||||
<NotesPanel _id={salesOrderId} type='salesOrder' />
|
||||
</Card>
|
||||
</Spin>
|
||||
</Card>
|
||||
</InfoCollapse>
|
||||
<InfoCollapse
|
||||
title='Audit Logs'
|
||||
|
||||
@ -16,9 +16,7 @@ const ActionHandler = forwardRef(
|
||||
) => {
|
||||
const location = useLocation()
|
||||
const navigate = useNavigate()
|
||||
const searchParams = new URLSearchParams(location.search)
|
||||
const action = searchParams.get(actionParam)
|
||||
const actionObjectType = searchParams.get('actionObjectType')
|
||||
const action = new URLSearchParams(location.search).get(actionParam)
|
||||
|
||||
// Ref to track last executed action
|
||||
const lastExecutedAction = useRef(null)
|
||||
@ -46,7 +44,6 @@ const ActionHandler = forwardRef(
|
||||
if (
|
||||
loading == false &&
|
||||
action &&
|
||||
!actionObjectType &&
|
||||
actions[action] &&
|
||||
lastExecutedAction.current !== action
|
||||
) {
|
||||
@ -74,7 +71,6 @@ const ActionHandler = forwardRef(
|
||||
}, [
|
||||
loading,
|
||||
action,
|
||||
actionObjectType,
|
||||
actions,
|
||||
actionParam,
|
||||
clearAfterExecute,
|
||||
|
||||
@ -1,76 +0,0 @@
|
||||
import { useState, useContext } from 'react'
|
||||
import PropTypes from 'prop-types'
|
||||
import { useLocation, useNavigate } from 'react-router-dom'
|
||||
import { ApiServerContext } from '../context/ApiServerContext'
|
||||
import { useMessageContext } from '../context/MessageContext'
|
||||
import { useActions } from '../context/ActionsContext'
|
||||
import { getModelByName } from '../../../database/ObjectModels'
|
||||
import MessageDialogView from './MessageDialogView.jsx'
|
||||
import BinIcon from '../../Icons/BinIcon'
|
||||
|
||||
const capitalizeFirstLetter = (value) => {
|
||||
return String(value).charAt(0).toUpperCase() + String(value).slice(1)
|
||||
}
|
||||
|
||||
const DeleteObject = ({ onOk, objectData, objectType: objectTypeProp }) => {
|
||||
const [deleteLoading, setDeleteLoading] = useState(false)
|
||||
const { deleteObject } = useContext(ApiServerContext)
|
||||
const { showSuccess, showError } = useMessageContext()
|
||||
const { currentObjectType } = useActions()
|
||||
const location = useLocation()
|
||||
const navigate = useNavigate()
|
||||
|
||||
const objectType =
|
||||
objectTypeProp ||
|
||||
new URLSearchParams(location.search).get('actionObjectType') ||
|
||||
currentObjectType
|
||||
|
||||
const model = objectType ? getModelByName(objectType) : null
|
||||
const modelLabel = model?.label || 'object'
|
||||
const objectName =
|
||||
objectData?.name || objectData?._reference || objectData?._id
|
||||
|
||||
const handleDelete = async () => {
|
||||
if (!objectData?._id || !objectType) return
|
||||
setDeleteLoading(true)
|
||||
try {
|
||||
await deleteObject(objectData._id, objectType)
|
||||
showSuccess(
|
||||
`${capitalizeFirstLetter(modelLabel.toLowerCase())} deleted successfully!`
|
||||
)
|
||||
const onInfoPage = model?.url && location.pathname === `${model.url}/info`
|
||||
if (onInfoPage) {
|
||||
navigate(model.url)
|
||||
} else {
|
||||
onOk()
|
||||
}
|
||||
} catch (error) {
|
||||
console.error('Error deleting object:', error)
|
||||
showError(`Failed to delete ${modelLabel.toLowerCase()}.`)
|
||||
} finally {
|
||||
setDeleteLoading(false)
|
||||
}
|
||||
}
|
||||
|
||||
return (
|
||||
<MessageDialogView
|
||||
icon={<BinIcon />}
|
||||
title={`Are you sure you want to delete this ${modelLabel.toLowerCase()}?`}
|
||||
description={
|
||||
objectName ? `This will permanently delete ${objectName}.` : undefined
|
||||
}
|
||||
onOk={handleDelete}
|
||||
okText='Delete'
|
||||
okLoading={deleteLoading}
|
||||
danger
|
||||
/>
|
||||
)
|
||||
}
|
||||
|
||||
DeleteObject.propTypes = {
|
||||
onOk: PropTypes.func.isRequired,
|
||||
objectData: PropTypes.object,
|
||||
objectType: PropTypes.string
|
||||
}
|
||||
|
||||
export default DeleteObject
|
||||
58
src/components/Dashboard/common/DeleteObjectModal.jsx
Normal file
58
src/components/Dashboard/common/DeleteObjectModal.jsx
Normal file
@ -0,0 +1,58 @@
|
||||
import PropTypes from 'prop-types'
|
||||
import { Modal, Button, Space, Typography } from 'antd'
|
||||
import { getModelByName } from '../../../database/ObjectModels'
|
||||
import BinIcon from '../../Icons/BinIcon'
|
||||
|
||||
const { Text } = Typography
|
||||
|
||||
const DeleteObjectModal = ({ open, onOk, onCancel, loading, objectType }) => {
|
||||
const model = getModelByName(objectType)
|
||||
return (
|
||||
<Modal
|
||||
open={open}
|
||||
title={
|
||||
<Space size={'middle'}>
|
||||
<BinIcon />
|
||||
{`Confirm Delete ${model.label}`}
|
||||
</Space>
|
||||
}
|
||||
onOk={onOk}
|
||||
onCancel={onCancel}
|
||||
okText='Delete'
|
||||
cancelText='Cancel'
|
||||
okType='danger'
|
||||
closable={false}
|
||||
centered
|
||||
maskClosable={false}
|
||||
footer={[
|
||||
<Button key='cancel' onClick={onCancel} disabled={loading}>
|
||||
Cancel
|
||||
</Button>,
|
||||
<Button
|
||||
key='delete'
|
||||
type='primary'
|
||||
danger
|
||||
onClick={onOk}
|
||||
loading={loading}
|
||||
disabled={loading}
|
||||
>
|
||||
Delete
|
||||
</Button>
|
||||
]}
|
||||
>
|
||||
<Text>
|
||||
Are you sure you want to delete this {model.label.toLowerCase()}?
|
||||
</Text>
|
||||
</Modal>
|
||||
)
|
||||
}
|
||||
|
||||
DeleteObjectModal.propTypes = {
|
||||
open: PropTypes.bool.isRequired,
|
||||
onOk: PropTypes.func.isRequired,
|
||||
onCancel: PropTypes.func.isRequired,
|
||||
loading: PropTypes.bool,
|
||||
objectType: PropTypes.string.isRequired
|
||||
}
|
||||
|
||||
export default DeleteObjectModal
|
||||
@ -10,8 +10,7 @@ const MessageDialogView = ({
|
||||
description,
|
||||
onOk,
|
||||
okText,
|
||||
okLoading,
|
||||
danger = false
|
||||
okLoading
|
||||
}) => {
|
||||
return (
|
||||
<Flex vertical gap={'middle'}>
|
||||
@ -21,12 +20,7 @@ const MessageDialogView = ({
|
||||
</Flex>
|
||||
{description && <Text>{description}</Text>}
|
||||
<Flex justify={'end'}>
|
||||
<Button
|
||||
type='primary'
|
||||
danger={danger}
|
||||
onClick={onOk}
|
||||
loading={okLoading}
|
||||
>
|
||||
<Button type='primary' onClick={onOk} loading={okLoading}>
|
||||
{okText || 'OK'}
|
||||
</Button>
|
||||
</Flex>
|
||||
@ -40,8 +34,7 @@ MessageDialogView.propTypes = {
|
||||
description: PropTypes.node,
|
||||
onOk: PropTypes.func.isRequired,
|
||||
okText: PropTypes.string,
|
||||
okLoading: PropTypes.bool,
|
||||
danger: PropTypes.bool
|
||||
okLoading: PropTypes.bool
|
||||
}
|
||||
|
||||
export default MessageDialogView
|
||||
|
||||
@ -3,7 +3,6 @@ import { Form } from 'antd'
|
||||
import { ApiServerContext } from '../context/ApiServerContext'
|
||||
import { useMessageContext } from '../context/MessageContext'
|
||||
import PropTypes from 'prop-types'
|
||||
import merge from 'lodash/merge'
|
||||
import mergeWith from 'lodash/mergeWith'
|
||||
import set from 'lodash/set'
|
||||
import { getModelByName } from '../../../database/ObjectModels'
|
||||
@ -19,16 +18,6 @@ const buildObjectFromEntries = (entries = []) => {
|
||||
}, {})
|
||||
}
|
||||
|
||||
const applyComputedEntries = (base, entries = []) => {
|
||||
const result = merge({}, base || {})
|
||||
entries.forEach((entry) => {
|
||||
const { namePath, value } = entry || {}
|
||||
if (!Array.isArray(namePath) || value === undefined) return
|
||||
set(result, namePath, value)
|
||||
})
|
||||
return result
|
||||
}
|
||||
|
||||
const arrayReplaceCustomizer = (objValue, srcValue, key) => {
|
||||
if (Array.isArray(srcValue)) {
|
||||
return srcValue
|
||||
@ -183,9 +172,12 @@ const NewObjectForm = ({ type, style, defaultValues = {}, children }) => {
|
||||
if (Object.keys(defaultValues).length > 0) {
|
||||
// Calculate computed values for initial data
|
||||
const computedEntries = calculateComputedValues(defaultValues, model)
|
||||
const initialFormData = applyComputedEntries(
|
||||
const computedValuesObject = buildObjectFromEntries(computedEntries)
|
||||
const initialFormData = mergeWith(
|
||||
{},
|
||||
defaultValues,
|
||||
computedEntries
|
||||
computedValuesObject,
|
||||
arrayReplaceCustomizer
|
||||
)
|
||||
form.setFieldsValue(initialFormData)
|
||||
setObjectData((prev) =>
|
||||
@ -204,9 +196,12 @@ const NewObjectForm = ({ type, style, defaultValues = {}, children }) => {
|
||||
try {
|
||||
setSubmitLoading(true)
|
||||
const computedEntries = calculateComputedValues(objectData, model)
|
||||
const computedObjectData = applyComputedEntries(
|
||||
const computedValuesObject = buildObjectFromEntries(computedEntries)
|
||||
const computedObjectData = mergeWith(
|
||||
{},
|
||||
objectData,
|
||||
computedEntries
|
||||
computedValuesObject,
|
||||
arrayReplaceCustomizer
|
||||
)
|
||||
const newObject = await createObject(type, computedObjectData)
|
||||
showSuccess('Object created successfully')
|
||||
@ -258,7 +253,14 @@ const NewObjectForm = ({ type, style, defaultValues = {}, children }) => {
|
||||
})
|
||||
}
|
||||
|
||||
const allValues = applyComputedEntries(allFormValues, computedEntries)
|
||||
// Merge all values (user input + computed values)
|
||||
const computedValuesObject = buildObjectFromEntries(computedEntries)
|
||||
const allValues = mergeWith(
|
||||
{},
|
||||
allFormValues,
|
||||
computedValuesObject,
|
||||
arrayReplaceCustomizer
|
||||
)
|
||||
setObjectData((prev) => {
|
||||
return mergeWith({}, prev, allValues, arrayReplaceCustomizer)
|
||||
})
|
||||
|
||||
@ -64,7 +64,7 @@ const ObjectChildTable = ({
|
||||
additionalColumns = [],
|
||||
emptyText = 'No items',
|
||||
isEditing = false,
|
||||
value,
|
||||
value = [],
|
||||
rollups = [],
|
||||
onChange,
|
||||
hiddenPropertyWidth = '300px',
|
||||
@ -159,13 +159,10 @@ const ObjectChildTable = ({
|
||||
)
|
||||
}, [columns, properties])
|
||||
|
||||
// Form.Item may not have hydrated yet; fall back to objectData the same way
|
||||
// rollups already do.
|
||||
// When used inside antd Form.Item without Form.List, `value` will be the controlled array.
|
||||
const itemsSource = useMemo(() => {
|
||||
if (Array.isArray(value)) return value
|
||||
if (name && Array.isArray(objectData?.[name])) return objectData[name]
|
||||
return []
|
||||
}, [value, name, objectData])
|
||||
return value ?? []
|
||||
}, [value])
|
||||
|
||||
const handleRemoveItem = useCallback(
|
||||
(record, index) => {
|
||||
@ -268,11 +265,12 @@ const ObjectChildTable = ({
|
||||
<ObjectProperty
|
||||
{...property}
|
||||
longId={false}
|
||||
inTable={true}
|
||||
objectData={record}
|
||||
parentData={objectData}
|
||||
isEditing={isEditing}
|
||||
useFormItem={false}
|
||||
name={undefined}
|
||||
value={record[property.name]}
|
||||
onChange={handleCellChange}
|
||||
/>
|
||||
)
|
||||
@ -386,7 +384,10 @@ const ObjectChildTable = ({
|
||||
const rollupDataSource = useMemo(() => {
|
||||
if (!rollups || rollups.length === 0) return []
|
||||
|
||||
const itemsForRollup = itemsSource
|
||||
// Use value from form/props, or fall back to objectData when entering edit mode
|
||||
// (form may not have populated the field yet)
|
||||
const itemsForRollup =
|
||||
value ?? (name && objectData ? objectData[name] : null) ?? []
|
||||
|
||||
// Build parent object with children array for rollup functions (e.g. objectData.parts)
|
||||
const updatedObjectData = { ...objectData }
|
||||
@ -419,7 +420,7 @@ const ObjectChildTable = ({
|
||||
})
|
||||
|
||||
return [summaryRow]
|
||||
}, [properties, rollups, objectData, itemsSource, name])
|
||||
}, [properties, rollups, objectData, value, name])
|
||||
|
||||
const rollupColumns = useMemo(() => {
|
||||
const propertyColumns = resolvedProperties.map((property, index) => {
|
||||
@ -633,8 +634,7 @@ const ObjectChildTable = ({
|
||||
setMinimalModelOpen(true)
|
||||
}}
|
||||
>
|
||||
{itemsSource?.length || 0}{' '}
|
||||
{itemsSource?.length == 1 ? 'item' : 'items'}
|
||||
{value?.length || 0} {value?.length == 1 ? 'item' : 'items'}
|
||||
</Link>
|
||||
<Modal
|
||||
open={minimalModelOpen}
|
||||
|
||||
@ -11,6 +11,7 @@ import { Form } from 'antd'
|
||||
import { ApiServerContext } from '../context/ApiServerContext'
|
||||
import { AuthContext } from '../context/AuthContext'
|
||||
import { useMessageContext } from '../context/MessageContext'
|
||||
import DeleteObjectModal from './DeleteObjectModal'
|
||||
import merge from 'lodash/merge'
|
||||
import mergeWith from 'lodash/mergeWith'
|
||||
import set from 'lodash/set'
|
||||
@ -78,19 +79,6 @@ const buildObjectFromEntries = (entries = []) => {
|
||||
}, {})
|
||||
}
|
||||
|
||||
// Patch computed fields onto a full object. Building them as a sparse tree and
|
||||
// merge-replacing arrays would wipe stored child-row fields (shipment, amount,
|
||||
// etc.) while leaving calculated columns intact.
|
||||
const applyComputedEntries = (base, entries = []) => {
|
||||
const result = merge({}, base || {})
|
||||
entries.forEach((entry) => {
|
||||
const { namePath, value } = entry || {}
|
||||
if (!Array.isArray(namePath) || value === undefined) return
|
||||
set(result, namePath, value)
|
||||
})
|
||||
return result
|
||||
}
|
||||
|
||||
const getEditDisabled = (model, objectData, userProfile) => {
|
||||
if (model?.readOnly === true) {
|
||||
return true
|
||||
@ -156,9 +144,12 @@ const ObjectForm = forwardRef(
|
||||
const [form] = Form.useForm()
|
||||
const formUpdateValues = Form.useWatch([], form)
|
||||
const { showSuccess, showError } = useMessageContext()
|
||||
const [deleteModalOpen, setDeleteModalOpen] = useState(false)
|
||||
const [deleteLoading, setDeleteLoading] = useState(false)
|
||||
const {
|
||||
fetchObject,
|
||||
updateObject,
|
||||
deleteObject,
|
||||
setObjectActivity,
|
||||
clearObjectActivity,
|
||||
fetchObjectActivities,
|
||||
@ -365,9 +356,12 @@ const ObjectForm = forwardRef(
|
||||
serverObjectData.current,
|
||||
model
|
||||
)
|
||||
const resetFormData = applyComputedEntries(
|
||||
const computedValuesObject = buildObjectFromEntries(computedEntries)
|
||||
const resetFormData = mergeWith(
|
||||
{},
|
||||
serverObjectData.current,
|
||||
computedEntries
|
||||
computedValuesObject,
|
||||
arrayReplaceCustomizer
|
||||
)
|
||||
setIsEditing(false)
|
||||
isEditingRef.current = false
|
||||
@ -504,7 +498,13 @@ const ObjectForm = forwardRef(
|
||||
|
||||
// Calculate and set computed values on initial load
|
||||
const computedEntries = calculateComputedValues(data, model)
|
||||
const initialFormData = applyComputedEntries(data, computedEntries)
|
||||
const computedValuesObject = buildObjectFromEntries(computedEntries)
|
||||
const initialFormData = mergeWith(
|
||||
{},
|
||||
data,
|
||||
computedValuesObject,
|
||||
arrayReplaceCustomizer
|
||||
)
|
||||
setObjectData({ ...initialFormData, _isEditing: isEditingRef.current })
|
||||
form.setFieldsValue(initialFormData)
|
||||
setFetchLoading(false)
|
||||
@ -703,11 +703,17 @@ const ObjectForm = forwardRef(
|
||||
setIsEditing(true)
|
||||
|
||||
const computedEntries = calculateComputedValues(objectData, model)
|
||||
const computedValuesObject = buildObjectFromEntries(computedEntries)
|
||||
setObjectData((prev) => ({
|
||||
...prev,
|
||||
...computedValuesObject,
|
||||
_isEditing: true
|
||||
}))
|
||||
const nextObjectData = {
|
||||
...applyComputedEntries(objectData, computedEntries),
|
||||
...objectData,
|
||||
...computedValuesObject,
|
||||
_isEditing: true
|
||||
}
|
||||
setObjectData(nextObjectData)
|
||||
onStateChangeRef.current({
|
||||
isEditing: true,
|
||||
objectData: nextObjectData,
|
||||
@ -773,10 +779,34 @@ const ObjectForm = forwardRef(
|
||||
onStateChangeRef.current({ editLoading: false })
|
||||
}
|
||||
|
||||
const handleDelete = () => {
|
||||
setDeleteModalOpen(true)
|
||||
}
|
||||
|
||||
const confirmDelete = async () => {
|
||||
setDeleteLoading(true)
|
||||
try {
|
||||
await deleteObject(id, type)
|
||||
setDeleteModalOpen(false)
|
||||
showSuccess(`${getModelMessageLabel(type)} deleted successfully!`)
|
||||
navigate(-2)
|
||||
// Optionally: trigger a callback to parent to remove this object from view
|
||||
} catch (err) {
|
||||
console.error(err)
|
||||
showError(
|
||||
`Failed to delete ${getModelMessageLabel(type).toLowerCase()}.`
|
||||
)
|
||||
} finally {
|
||||
setDeleteLoading(false)
|
||||
}
|
||||
}
|
||||
|
||||
useImperativeHandle(ref, () => ({
|
||||
startEditing,
|
||||
cancelEditing,
|
||||
handleUpdate,
|
||||
handleDelete,
|
||||
confirmDelete,
|
||||
handleFetchObject,
|
||||
editLoading,
|
||||
fetchLoading,
|
||||
@ -787,6 +817,14 @@ const ObjectForm = forwardRef(
|
||||
|
||||
return (
|
||||
<>
|
||||
<DeleteObjectModal
|
||||
open={deleteModalOpen}
|
||||
onOk={confirmDelete}
|
||||
onCancel={() => setDeleteModalOpen(false)}
|
||||
loading={deleteLoading}
|
||||
objectType={type}
|
||||
objectName={objectData?.name || objectData?.label || ''}
|
||||
/>
|
||||
<Form
|
||||
form={form}
|
||||
layout='vertical'
|
||||
@ -830,9 +868,12 @@ const ObjectForm = forwardRef(
|
||||
})
|
||||
}
|
||||
|
||||
const mergedFormValues = applyComputedEntries(
|
||||
const computedValuesObject = buildObjectFromEntries(computedEntries)
|
||||
const mergedFormValues = mergeWith(
|
||||
{},
|
||||
allFormValues,
|
||||
computedEntries
|
||||
computedValuesObject,
|
||||
arrayReplaceCustomizer
|
||||
)
|
||||
|
||||
mergedFormValues._isEditing = isEditingRef.current
|
||||
@ -861,7 +902,8 @@ const ObjectForm = forwardRef(
|
||||
editLoading,
|
||||
editDisabled: getEditDisabled(model, objectData, userProfile),
|
||||
activities,
|
||||
handleFetchObject
|
||||
handleFetchObject,
|
||||
handleDelete
|
||||
})}
|
||||
</Form>
|
||||
</>
|
||||
|
||||
@ -460,7 +460,6 @@ const ObjectTable = forwardRef(
|
||||
disabled={disabled || objectData?.isSkeleton}
|
||||
type={'text'}
|
||||
size={'small'}
|
||||
danger={action?.danger || false}
|
||||
onClick={() => {
|
||||
if (denied) return
|
||||
if (
|
||||
|
||||
@ -174,9 +174,10 @@ const ActionsProvider = ({ children }) => {
|
||||
|
||||
const [modalCentered, setModalCentered] = useState(false)
|
||||
useEffect(() => {
|
||||
if (!resolvedModalAction) return
|
||||
setModalCentered(resolvedModalAction.modalCentered === true)
|
||||
}, [resolvedModalAction])
|
||||
if (resolvedModalAction?.modalCentered !== undefined) {
|
||||
setModalCentered(resolvedModalAction.modalCentered)
|
||||
}
|
||||
}, [resolvedModalAction?.modalCentered])
|
||||
|
||||
const modalContentData =
|
||||
modalAction?.type === 'alias'
|
||||
|
||||
@ -6,9 +6,6 @@ const ClientInfo = lazy(
|
||||
const NewClient = lazy(
|
||||
() => import('../../components/Dashboard/Sales/Clients/NewClient')
|
||||
)
|
||||
const DeleteObject = lazy(
|
||||
() => import('../../components/Dashboard/common/DeleteObject')
|
||||
)
|
||||
import ClientIcon from '../../components/Icons/ClientIcon'
|
||||
import PlusIcon from '../../components/Icons/PlusIcon'
|
||||
import InfoCircleIcon from '../../components/Icons/InfoCircleIcon'
|
||||
@ -87,15 +84,11 @@ export const Client = {
|
||||
{ type: 'divider' },
|
||||
{
|
||||
name: 'delete',
|
||||
type: 'modal',
|
||||
modalWidth: 520,
|
||||
modalCentered: true,
|
||||
type: 'page',
|
||||
pageName: 'info',
|
||||
label: 'Delete',
|
||||
icon: BinIcon,
|
||||
danger: true,
|
||||
content: (objectData, { onOk } = {}) => {
|
||||
return createElement(DeleteObject, { objectData, onOk })
|
||||
}
|
||||
danger: true
|
||||
}
|
||||
],
|
||||
pages: [
|
||||
|
||||
@ -6,9 +6,6 @@ const CourierInfo = lazy(
|
||||
const NewCourier = lazy(
|
||||
() => import('../../components/Dashboard/Management/Couriers/NewCourier')
|
||||
)
|
||||
const DeleteObject = lazy(
|
||||
() => import('../../components/Dashboard/common/DeleteObject')
|
||||
)
|
||||
import CourierIcon from '../../components/Icons/CourierIcon'
|
||||
import PlusIcon from '../../components/Icons/PlusIcon'
|
||||
import InfoCircleIcon from '../../components/Icons/InfoCircleIcon'
|
||||
@ -87,15 +84,11 @@ export const Courier = {
|
||||
{ type: 'divider' },
|
||||
{
|
||||
name: 'delete',
|
||||
type: 'modal',
|
||||
modalWidth: 520,
|
||||
modalCentered: true,
|
||||
type: 'page',
|
||||
pageName: 'info',
|
||||
label: 'Delete',
|
||||
icon: BinIcon,
|
||||
danger: true,
|
||||
content: (objectData, { onOk } = {}) => {
|
||||
return createElement(DeleteObject, { objectData, onOk })
|
||||
}
|
||||
danger: true
|
||||
}
|
||||
],
|
||||
pages: [
|
||||
|
||||
@ -6,9 +6,6 @@ const CourierServiceInfo = lazy(
|
||||
const NewCourierService = lazy(
|
||||
() => import('../../components/Dashboard/Management/CourierServices/NewCourierService')
|
||||
)
|
||||
const DeleteObject = lazy(
|
||||
() => import('../../components/Dashboard/common/DeleteObject')
|
||||
)
|
||||
import CourierServiceIcon from '../../components/Icons/CourierServiceIcon'
|
||||
import PlusIcon from '../../components/Icons/PlusIcon'
|
||||
import InfoCircleIcon from '../../components/Icons/InfoCircleIcon'
|
||||
@ -87,15 +84,11 @@ export const CourierService = {
|
||||
{ type: 'divider' },
|
||||
{
|
||||
name: 'delete',
|
||||
type: 'modal',
|
||||
modalWidth: 520,
|
||||
modalCentered: true,
|
||||
type: 'page',
|
||||
pageName: 'info',
|
||||
label: 'Delete',
|
||||
icon: BinIcon,
|
||||
danger: true,
|
||||
content: (objectData, { onOk } = {}) => {
|
||||
return createElement(DeleteObject, { objectData, onOk })
|
||||
}
|
||||
danger: true
|
||||
}
|
||||
],
|
||||
pages: [
|
||||
|
||||
@ -6,9 +6,6 @@ const FilamentInfo = lazy(
|
||||
const NewFilament = lazy(
|
||||
() => import('../../components/Dashboard/Management/Filaments/NewFilament')
|
||||
)
|
||||
const DeleteObject = lazy(
|
||||
() => import('../../components/Dashboard/common/DeleteObject')
|
||||
)
|
||||
import EditIcon from '../../components/Icons/EditIcon'
|
||||
import PlusIcon from '../../components/Icons/PlusIcon'
|
||||
import CheckIcon from '../../components/Icons/CheckIcon'
|
||||
@ -98,17 +95,13 @@ export const Filament = {
|
||||
{ type: 'divider' },
|
||||
{
|
||||
name: 'delete',
|
||||
type: 'modal',
|
||||
modalWidth: 520,
|
||||
modalCentered: true,
|
||||
type: 'page',
|
||||
pageName: 'info',
|
||||
label: 'Delete',
|
||||
icon: BinIcon,
|
||||
danger: true,
|
||||
visible: (objectData) => {
|
||||
return !(objectData?._isEditing && objectData?._isEditing == true)
|
||||
},
|
||||
content: (objectData, { onOk } = {}) => {
|
||||
return createElement(DeleteObject, { objectData, onOk })
|
||||
}
|
||||
}
|
||||
],
|
||||
|
||||
@ -7,9 +7,6 @@ const FilamentProfileInfo = lazy(
|
||||
const NewFilamentProfile = lazy(
|
||||
() => import('../../components/Dashboard/Production/FilamentProfiles/NewFilamentProfile')
|
||||
)
|
||||
const DeleteObject = lazy(
|
||||
() => import('../../components/Dashboard/common/DeleteObject')
|
||||
)
|
||||
import FilamentProfileIcon from '../../components/Icons/FilamentProfileIcon'
|
||||
import PlusIcon from '../../components/Icons/PlusIcon'
|
||||
import InfoCircleIcon from '../../components/Icons/InfoCircleIcon'
|
||||
@ -88,16 +85,12 @@ export const FilamentProfile = {
|
||||
{ type: 'divider' },
|
||||
{
|
||||
name: 'delete',
|
||||
type: 'modal',
|
||||
modalWidth: 520,
|
||||
modalCentered: true,
|
||||
type: 'page',
|
||||
pageName: 'info',
|
||||
label: 'Delete',
|
||||
row: true,
|
||||
icon: BinIcon,
|
||||
danger: true,
|
||||
content: (objectData, { onOk } = {}) => {
|
||||
return createElement(DeleteObject, { objectData, onOk })
|
||||
}
|
||||
danger: true
|
||||
}
|
||||
],
|
||||
pages: [
|
||||
|
||||
@ -6,9 +6,6 @@ const FilamentSkuInfo = lazy(
|
||||
const NewFilamentSku = lazy(
|
||||
() => import('../../components/Dashboard/Management/FilamentSkus/NewFilamentSku')
|
||||
)
|
||||
const DeleteObject = lazy(
|
||||
() => import('../../components/Dashboard/common/DeleteObject')
|
||||
)
|
||||
import FilamentSkuIcon from '../../components/Icons/FilamentSkuIcon'
|
||||
import PlusIcon from '../../components/Icons/PlusIcon'
|
||||
import InfoCircleIcon from '../../components/Icons/InfoCircleIcon'
|
||||
@ -87,15 +84,11 @@ export const FilamentSku = {
|
||||
{ type: 'divider' },
|
||||
{
|
||||
name: 'delete',
|
||||
type: 'modal',
|
||||
modalWidth: 520,
|
||||
modalCentered: true,
|
||||
type: 'page',
|
||||
pageName: 'info',
|
||||
label: 'Delete',
|
||||
icon: BinIcon,
|
||||
danger: true,
|
||||
content: (objectData, { onOk } = {}) => {
|
||||
return createElement(DeleteObject, { objectData, onOk })
|
||||
}
|
||||
danger: true
|
||||
}
|
||||
],
|
||||
pages: [
|
||||
|
||||
@ -3,9 +3,6 @@ import { createElement, lazy } from 'react'
|
||||
const FileInfo = lazy(
|
||||
() => import('../../components/Dashboard/Management/Files/FileInfo')
|
||||
)
|
||||
const DeleteObject = lazy(
|
||||
() => import('../../components/Dashboard/common/DeleteObject')
|
||||
)
|
||||
import DownloadIcon from '../../components/Icons/DownloadIcon'
|
||||
import FileIcon from '../../components/Icons/FileIcon'
|
||||
import InfoCircleIcon from '../../components/Icons/InfoCircleIcon'
|
||||
@ -81,15 +78,11 @@ export const File = {
|
||||
{ type: 'divider' },
|
||||
{
|
||||
name: 'delete',
|
||||
type: 'modal',
|
||||
modalWidth: 520,
|
||||
modalCentered: true,
|
||||
type: 'page',
|
||||
pageName: 'info',
|
||||
label: 'Delete',
|
||||
icon: BinIcon,
|
||||
danger: true,
|
||||
content: (objectData, { onOk } = {}) => {
|
||||
return createElement(DeleteObject, { objectData, onOk })
|
||||
}
|
||||
danger: true
|
||||
}
|
||||
],
|
||||
pages: [
|
||||
|
||||
@ -9,9 +9,6 @@ const NewHost = lazy(
|
||||
const HostOTP = lazy(
|
||||
() => import('../../components/Dashboard/Management/Hosts/HostOtp')
|
||||
)
|
||||
const DeleteObject = lazy(
|
||||
() => import('../../components/Dashboard/common/DeleteObject')
|
||||
)
|
||||
import HostIcon from '../../components/Icons/HostIcon'
|
||||
import PlusIcon from '../../components/Icons/PlusIcon'
|
||||
import InfoCircleIcon from '../../components/Icons/InfoCircleIcon'
|
||||
@ -103,15 +100,11 @@ export const Host = {
|
||||
},
|
||||
{
|
||||
name: 'delete',
|
||||
type: 'modal',
|
||||
modalWidth: 520,
|
||||
modalCentered: true,
|
||||
type: 'page',
|
||||
pageName: 'info',
|
||||
label: 'Delete',
|
||||
icon: BinIcon,
|
||||
danger: true,
|
||||
content: (objectData, { onOk } = {}) => {
|
||||
return createElement(DeleteObject, { objectData, onOk })
|
||||
}
|
||||
danger: true
|
||||
}
|
||||
],
|
||||
pages: [
|
||||
|
||||
@ -12,9 +12,6 @@ const PostInvoice = lazy(
|
||||
const AcknowledgeInvoice = lazy(
|
||||
() => import('../../components/Dashboard/Finance/Invoices/AcknowledgeInvoice')
|
||||
)
|
||||
const DeleteObject = lazy(
|
||||
() => import('../../components/Dashboard/common/DeleteObject')
|
||||
)
|
||||
import InvoiceIcon from '../../components/Icons/InvoiceIcon'
|
||||
import PlusIcon from '../../components/Icons/PlusIcon'
|
||||
import InfoCircleIcon from '../../components/Icons/InfoCircleIcon'
|
||||
@ -95,9 +92,8 @@ export const Invoice = {
|
||||
},
|
||||
{
|
||||
name: 'delete',
|
||||
type: 'modal',
|
||||
modalWidth: 520,
|
||||
modalCentered: true,
|
||||
type: 'page',
|
||||
pageName: 'info',
|
||||
label: 'Delete',
|
||||
icon: BinIcon,
|
||||
danger: true,
|
||||
@ -106,9 +102,6 @@ export const Invoice = {
|
||||
},
|
||||
disabled: (objectData) => {
|
||||
return objectData?.state?.type != 'draft'
|
||||
},
|
||||
content: (objectData, { onOk } = {}) => {
|
||||
return createElement(DeleteObject, { objectData, onOk })
|
||||
}
|
||||
},
|
||||
{ type: 'divider' },
|
||||
|
||||
@ -9,9 +9,6 @@ const NewJob = lazy(
|
||||
const DeployJob = lazy(
|
||||
() => import('../../components/Dashboard/Production/Jobs/DeployJob')
|
||||
)
|
||||
const DeleteObject = lazy(
|
||||
() => import('../../components/Dashboard/common/DeleteObject')
|
||||
)
|
||||
import JobIcon from '../../components/Icons/JobIcon'
|
||||
import PlusIcon from '../../components/Icons/PlusIcon'
|
||||
import InfoCircleIcon from '../../components/Icons/InfoCircleIcon'
|
||||
@ -93,9 +90,8 @@ export const Job = {
|
||||
},
|
||||
{
|
||||
name: 'delete',
|
||||
type: 'modal',
|
||||
modalWidth: 520,
|
||||
modalCentered: true,
|
||||
type: 'page',
|
||||
pageName: 'info',
|
||||
label: 'Delete',
|
||||
icon: BinIcon,
|
||||
danger: true,
|
||||
@ -104,9 +100,6 @@ export const Job = {
|
||||
},
|
||||
disabled: (objectData) => {
|
||||
return objectData?.state?.type != 'draft'
|
||||
},
|
||||
content: (objectData, { onOk } = {}) => {
|
||||
return createElement(DeleteObject, { objectData, onOk })
|
||||
}
|
||||
},
|
||||
{ type: 'divider' },
|
||||
|
||||
@ -12,9 +12,6 @@ const PublishListing = lazy(
|
||||
const UnpublishListing = lazy(
|
||||
() => import('../../components/Dashboard/Sales/Listings/UnpublishListing')
|
||||
)
|
||||
const DeleteObject = lazy(
|
||||
() => import('../../components/Dashboard/common/DeleteObject')
|
||||
)
|
||||
import ListingIcon from '../../components/Icons/ListingIcon'
|
||||
import PlusIcon from '../../components/Icons/PlusIcon'
|
||||
import InfoCircleIcon from '../../components/Icons/InfoCircleIcon'
|
||||
@ -129,15 +126,11 @@ export const Listing = {
|
||||
{ type: 'divider' },
|
||||
{
|
||||
name: 'delete',
|
||||
type: 'modal',
|
||||
modalWidth: 520,
|
||||
modalCentered: true,
|
||||
type: 'page',
|
||||
pageName: 'info',
|
||||
label: 'Delete',
|
||||
icon: BinIcon,
|
||||
danger: true,
|
||||
content: (objectData, { onOk } = {}) => {
|
||||
return createElement(DeleteObject, { objectData, onOk })
|
||||
}
|
||||
danger: true
|
||||
}
|
||||
],
|
||||
pages: [
|
||||
|
||||
@ -12,9 +12,6 @@ const PublishListingVarient = lazy(
|
||||
const UnpublishListingVarient = lazy(
|
||||
() => import('../../components/Dashboard/Sales/ListingVarients/UnpublishListingVarient')
|
||||
)
|
||||
const DeleteObject = lazy(
|
||||
() => import('../../components/Dashboard/common/DeleteObject')
|
||||
)
|
||||
import ListingVarientIcon from '../../components/Icons/ListingVarientIcon'
|
||||
import PlusIcon from '../../components/Icons/PlusIcon'
|
||||
import InfoCircleIcon from '../../components/Icons/InfoCircleIcon'
|
||||
@ -121,15 +118,11 @@ export const ListingVarient = {
|
||||
{ type: 'divider' },
|
||||
{
|
||||
name: 'delete',
|
||||
type: 'modal',
|
||||
modalWidth: 520,
|
||||
modalCentered: true,
|
||||
type: 'page',
|
||||
pageName: 'info',
|
||||
label: 'Delete',
|
||||
icon: BinIcon,
|
||||
danger: true,
|
||||
content: (objectData, { onOk } = {}) => {
|
||||
return createElement(DeleteObject, { objectData, onOk })
|
||||
}
|
||||
danger: true
|
||||
}
|
||||
],
|
||||
pages: [
|
||||
|
||||
@ -12,9 +12,6 @@ const SyncListings = lazy(
|
||||
const SyncOrders = lazy(
|
||||
() => import('../../components/Dashboard/Sales/Marketplaces/SyncOrders')
|
||||
)
|
||||
const DeleteObject = lazy(
|
||||
() => import('../../components/Dashboard/common/DeleteObject')
|
||||
)
|
||||
import MarketplaceIcon from '../../components/Icons/MarketplaceIcon'
|
||||
import PlusIcon from '../../components/Icons/PlusIcon'
|
||||
import InfoCircleIcon from '../../components/Icons/InfoCircleIcon'
|
||||
@ -157,15 +154,11 @@ export const Marketplace = {
|
||||
{ type: 'divider' },
|
||||
{
|
||||
name: 'delete',
|
||||
type: 'modal',
|
||||
modalWidth: 520,
|
||||
modalCentered: true,
|
||||
type: 'page',
|
||||
pageName: 'info',
|
||||
label: 'Delete',
|
||||
icon: BinIcon,
|
||||
danger: true,
|
||||
content: (objectData, { onOk } = {}) => {
|
||||
return createElement(DeleteObject, { objectData, onOk })
|
||||
}
|
||||
danger: true
|
||||
}
|
||||
],
|
||||
pages: [
|
||||
|
||||
@ -6,9 +6,6 @@ const MaterialInfo = lazy(
|
||||
const NewMaterial = lazy(
|
||||
() => import('../../components/Dashboard/Management/Materials/NewMaterial')
|
||||
)
|
||||
const DeleteObject = lazy(
|
||||
() => import('../../components/Dashboard/common/DeleteObject')
|
||||
)
|
||||
import MaterialIcon from '../../components/Icons/MaterialIcon'
|
||||
import PlusIcon from '../../components/Icons/PlusIcon'
|
||||
import InfoCircleIcon from '../../components/Icons/InfoCircleIcon'
|
||||
@ -87,15 +84,11 @@ export const Material = {
|
||||
{ type: 'divider' },
|
||||
{
|
||||
name: 'delete',
|
||||
type: 'modal',
|
||||
modalWidth: 520,
|
||||
modalCentered: true,
|
||||
type: 'page',
|
||||
pageName: 'info',
|
||||
label: 'Delete',
|
||||
icon: BinIcon,
|
||||
danger: true,
|
||||
content: (objectData, { onOk } = {}) => {
|
||||
return createElement(DeleteObject, { objectData, onOk })
|
||||
}
|
||||
danger: true
|
||||
}
|
||||
],
|
||||
pages: [
|
||||
|
||||
@ -6,9 +6,6 @@ const OrderItemInfo = lazy(
|
||||
const NewOrderItem = lazy(
|
||||
() => import('../../components/Dashboard/Inventory/OrderItems/NewOrderItem')
|
||||
)
|
||||
const DeleteObject = lazy(
|
||||
() => import('../../components/Dashboard/common/DeleteObject')
|
||||
)
|
||||
import OrderItemIcon from '../../components/Icons/OrderItemIcon'
|
||||
import PlusIcon from '../../components/Icons/PlusIcon'
|
||||
import InfoCircleIcon from '../../components/Icons/InfoCircleIcon'
|
||||
@ -34,11 +31,7 @@ export const OrderItem = {
|
||||
label: 'New Order Item',
|
||||
icon: PlusIcon,
|
||||
content: (objectData, { onOk } = {}) => {
|
||||
return createElement(NewOrderItem, {
|
||||
defaultValues: objectData,
|
||||
onOk,
|
||||
reset: true
|
||||
})
|
||||
return createElement(NewOrderItem, { defaultValues: objectData, onOk, reset: true })
|
||||
}
|
||||
},
|
||||
{
|
||||
@ -93,11 +86,9 @@ export const OrderItem = {
|
||||
},
|
||||
{
|
||||
name: 'delete',
|
||||
type: 'modal',
|
||||
modalWidth: 520,
|
||||
modalCentered: true,
|
||||
type: 'page',
|
||||
pageName: 'info',
|
||||
label: 'Delete',
|
||||
row: true,
|
||||
icon: BinIcon,
|
||||
danger: true,
|
||||
visible: (objectData) => {
|
||||
@ -105,9 +96,6 @@ export const OrderItem = {
|
||||
},
|
||||
disabled: (objectData) => {
|
||||
return objectData?.state?.type != 'draft'
|
||||
},
|
||||
content: (objectData, { onOk } = {}) => {
|
||||
return createElement(DeleteObject, { objectData, onOk })
|
||||
}
|
||||
}
|
||||
],
|
||||
|
||||
@ -6,9 +6,6 @@ const PartSkuInfo = lazy(
|
||||
const NewPartSku = lazy(
|
||||
() => import('../../components/Dashboard/Management/PartSkus/NewPartSku')
|
||||
)
|
||||
const DeleteObject = lazy(
|
||||
() => import('../../components/Dashboard/common/DeleteObject')
|
||||
)
|
||||
import PartSkuIcon from '../../components/Icons/PartSkuIcon'
|
||||
import PlusIcon from '../../components/Icons/PlusIcon'
|
||||
import InfoCircleIcon from '../../components/Icons/InfoCircleIcon'
|
||||
@ -87,15 +84,11 @@ export const PartSku = {
|
||||
{ type: 'divider' },
|
||||
{
|
||||
name: 'delete',
|
||||
type: 'modal',
|
||||
modalWidth: 520,
|
||||
modalCentered: true,
|
||||
type: 'page',
|
||||
pageName: 'info',
|
||||
label: 'Delete',
|
||||
icon: BinIcon,
|
||||
danger: true,
|
||||
content: (objectData, { onOk } = {}) => {
|
||||
return createElement(DeleteObject, { objectData, onOk })
|
||||
}
|
||||
danger: true
|
||||
}
|
||||
],
|
||||
pages: [
|
||||
|
||||
@ -18,9 +18,6 @@ const DeclinePayment = lazy(
|
||||
const CancelPayment = lazy(
|
||||
() => import('../../components/Dashboard/Finance/Payments/CancelPayment')
|
||||
)
|
||||
const DeleteObject = lazy(
|
||||
() => import('../../components/Dashboard/common/DeleteObject')
|
||||
)
|
||||
import PaymentIcon from '../../components/Icons/PaymentIcon'
|
||||
import PlusIcon from '../../components/Icons/PlusIcon'
|
||||
import InfoCircleIcon from '../../components/Icons/InfoCircleIcon'
|
||||
@ -101,9 +98,8 @@ export const Payment = {
|
||||
},
|
||||
{
|
||||
name: 'delete',
|
||||
type: 'modal',
|
||||
modalWidth: 520,
|
||||
modalCentered: true,
|
||||
type: 'page',
|
||||
pageName: 'info',
|
||||
label: 'Delete',
|
||||
icon: BinIcon,
|
||||
danger: true,
|
||||
@ -112,9 +108,6 @@ export const Payment = {
|
||||
},
|
||||
disabled: (objectData) => {
|
||||
return objectData?.state?.type != 'draft'
|
||||
},
|
||||
content: (objectData, { onOk } = {}) => {
|
||||
return createElement(DeleteObject, { objectData, onOk })
|
||||
}
|
||||
},
|
||||
{ type: 'divider' },
|
||||
|
||||
@ -7,9 +7,6 @@ const PermissionSettingInfo = lazy(
|
||||
const NewPermissionSetting = lazy(
|
||||
() => import('../../components/Dashboard/Management/PermissionSettings/NewPermissionSetting')
|
||||
)
|
||||
const DeleteObject = lazy(
|
||||
() => import('../../components/Dashboard/common/DeleteObject')
|
||||
)
|
||||
import PermissionSettingIcon from '../../components/Icons/PermissionSettingIcon'
|
||||
import PlusIcon from '../../components/Icons/PlusIcon'
|
||||
import InfoCircleIcon from '../../components/Icons/InfoCircleIcon'
|
||||
@ -89,15 +86,11 @@ export const PermissionSetting = {
|
||||
{ type: 'divider' },
|
||||
{
|
||||
name: 'delete',
|
||||
type: 'modal',
|
||||
modalWidth: 520,
|
||||
modalCentered: true,
|
||||
type: 'page',
|
||||
pageName: 'info',
|
||||
label: 'Delete',
|
||||
icon: BinIcon,
|
||||
danger: true,
|
||||
content: (objectData, { onOk } = {}) => {
|
||||
return createElement(DeleteObject, { objectData, onOk })
|
||||
}
|
||||
danger: true
|
||||
}
|
||||
],
|
||||
pages: [
|
||||
|
||||
@ -6,9 +6,6 @@ const PrinterProfileInfo = lazy(
|
||||
const NewPrinterProfile = lazy(
|
||||
() => import('../../components/Dashboard/Production/PrinterProfiles/NewPrinterProfile')
|
||||
)
|
||||
const DeleteObject = lazy(
|
||||
() => import('../../components/Dashboard/common/DeleteObject')
|
||||
)
|
||||
import PrinterProfileIcon from '../../components/Icons/PrinterProfileIcon'
|
||||
import PlusIcon from '../../components/Icons/PlusIcon'
|
||||
import InfoCircleIcon from '../../components/Icons/InfoCircleIcon'
|
||||
@ -352,16 +349,12 @@ export const PrinterProfile = {
|
||||
{ type: 'divider' },
|
||||
{
|
||||
name: 'delete',
|
||||
type: 'modal',
|
||||
modalWidth: 520,
|
||||
modalCentered: true,
|
||||
type: 'page',
|
||||
pageName: 'info',
|
||||
label: 'Delete',
|
||||
row: true,
|
||||
icon: BinIcon,
|
||||
danger: true,
|
||||
content: (objectData, { onOk } = {}) => {
|
||||
return createElement(DeleteObject, { objectData, onOk })
|
||||
}
|
||||
danger: true
|
||||
}
|
||||
],
|
||||
pages: [
|
||||
|
||||
@ -6,9 +6,6 @@ const ProductCategoryInfo = lazy(
|
||||
const NewProductCategory = lazy(
|
||||
() => import('../../components/Dashboard/Management/ProductCategories/NewProductCategory')
|
||||
)
|
||||
const DeleteObject = lazy(
|
||||
() => import('../../components/Dashboard/common/DeleteObject')
|
||||
)
|
||||
import ProductCategoryIcon from '../../components/Icons/ProductCategoryIcon'
|
||||
import PlusIcon from '../../components/Icons/PlusIcon'
|
||||
import InfoCircleIcon from '../../components/Icons/InfoCircleIcon'
|
||||
@ -88,15 +85,11 @@ export const ProductCategory = {
|
||||
{ type: 'divider' },
|
||||
{
|
||||
name: 'delete',
|
||||
type: 'modal',
|
||||
modalWidth: 520,
|
||||
modalCentered: true,
|
||||
type: 'page',
|
||||
pageName: 'info',
|
||||
label: 'Delete',
|
||||
icon: BinIcon,
|
||||
danger: true,
|
||||
content: (objectData, { onOk } = {}) => {
|
||||
return createElement(DeleteObject, { objectData, onOk })
|
||||
}
|
||||
danger: true
|
||||
}
|
||||
],
|
||||
pages: [
|
||||
|
||||
@ -6,9 +6,6 @@ const ProductSkuInfo = lazy(
|
||||
const NewProductSku = lazy(
|
||||
() => import('../../components/Dashboard/Management/ProductSkus/NewProductSku')
|
||||
)
|
||||
const DeleteObject = lazy(
|
||||
() => import('../../components/Dashboard/common/DeleteObject')
|
||||
)
|
||||
import ProductSkuIcon from '../../components/Icons/ProductSkuIcon'
|
||||
import PlusIcon from '../../components/Icons/PlusIcon'
|
||||
import InfoCircleIcon from '../../components/Icons/InfoCircleIcon'
|
||||
@ -87,15 +84,11 @@ export const ProductSku = {
|
||||
{ type: 'divider' },
|
||||
{
|
||||
name: 'delete',
|
||||
type: 'modal',
|
||||
modalWidth: 520,
|
||||
modalCentered: true,
|
||||
type: 'page',
|
||||
pageName: 'info',
|
||||
label: 'Delete',
|
||||
icon: BinIcon,
|
||||
danger: true,
|
||||
content: (objectData, { onOk } = {}) => {
|
||||
return createElement(DeleteObject, { objectData, onOk })
|
||||
}
|
||||
danger: true
|
||||
}
|
||||
],
|
||||
pages: [
|
||||
|
||||
@ -9,9 +9,6 @@ const NewProductStock = lazy(
|
||||
const PostProductStock = lazy(
|
||||
() => import('../../components/Dashboard/Inventory/ProductStocks/PostProductStock')
|
||||
)
|
||||
const DeleteObject = lazy(
|
||||
() => import('../../components/Dashboard/common/DeleteObject')
|
||||
)
|
||||
import ProductStockIcon from '../../components/Icons/ProductStockIcon'
|
||||
import PlusIcon from '../../components/Icons/PlusIcon'
|
||||
import { getModelByName } from '../ObjectModels.js'
|
||||
@ -93,9 +90,8 @@ export const ProductStock = {
|
||||
},
|
||||
{
|
||||
name: 'delete',
|
||||
type: 'modal',
|
||||
modalWidth: 520,
|
||||
modalCentered: true,
|
||||
type: 'page',
|
||||
pageName: 'info',
|
||||
label: 'Delete',
|
||||
icon: BinIcon,
|
||||
danger: true,
|
||||
@ -104,9 +100,6 @@ export const ProductStock = {
|
||||
},
|
||||
disabled: (objectData) => {
|
||||
return objectData?.state?.type != 'draft'
|
||||
},
|
||||
content: (objectData, { onOk } = {}) => {
|
||||
return createElement(DeleteObject, { objectData, onOk })
|
||||
}
|
||||
},
|
||||
{ type: 'divider' },
|
||||
|
||||
@ -15,9 +15,6 @@ const AcknowledgePurchaseOrder = lazy(
|
||||
const CancelPurchaseOrder = lazy(
|
||||
() => import('../../components/Dashboard/Inventory/PurchaseOrders/CancelPurchaseOrder')
|
||||
)
|
||||
const DeleteObject = lazy(
|
||||
() => import('../../components/Dashboard/common/DeleteObject')
|
||||
)
|
||||
import PurchaseOrderIcon from '../../components/Icons/PurchaseOrderIcon'
|
||||
import PlusIcon from '../../components/Icons/PlusIcon'
|
||||
import InfoCircleIcon from '../../components/Icons/InfoCircleIcon'
|
||||
@ -98,9 +95,8 @@ export const PurchaseOrder = {
|
||||
},
|
||||
{
|
||||
name: 'delete',
|
||||
type: 'modal',
|
||||
modalWidth: 520,
|
||||
modalCentered: true,
|
||||
type: 'page',
|
||||
pageName: 'info',
|
||||
label: 'Delete',
|
||||
icon: BinIcon,
|
||||
danger: true,
|
||||
@ -109,9 +105,6 @@ export const PurchaseOrder = {
|
||||
},
|
||||
disabled: (objectData) => {
|
||||
return objectData?.state?.type != 'draft'
|
||||
},
|
||||
content: (objectData, { onOk } = {}) => {
|
||||
return createElement(DeleteObject, { objectData, onOk })
|
||||
}
|
||||
},
|
||||
{ type: 'divider' },
|
||||
|
||||
@ -15,9 +15,6 @@ const ConfirmSalesOrder = lazy(
|
||||
const CancelSalesOrder = lazy(
|
||||
() => import('../../components/Dashboard/Sales/SalesOrders/CancelSalesOrder')
|
||||
)
|
||||
const DeleteObject = lazy(
|
||||
() => import('../../components/Dashboard/common/DeleteObject')
|
||||
)
|
||||
import SalesOrderIcon from '../../components/Icons/SalesOrderIcon'
|
||||
import PlusIcon from '../../components/Icons/PlusIcon'
|
||||
import InfoCircleIcon from '../../components/Icons/InfoCircleIcon'
|
||||
@ -98,9 +95,8 @@ export const SalesOrder = {
|
||||
},
|
||||
{
|
||||
name: 'delete',
|
||||
type: 'modal',
|
||||
modalWidth: 520,
|
||||
modalCentered: true,
|
||||
type: 'page',
|
||||
pageName: 'info',
|
||||
label: 'Delete',
|
||||
icon: BinIcon,
|
||||
danger: true,
|
||||
@ -109,9 +105,6 @@ export const SalesOrder = {
|
||||
},
|
||||
disabled: (objectData) => {
|
||||
return objectData?.state?.type != 'draft'
|
||||
},
|
||||
content: (objectData, { onOk } = {}) => {
|
||||
return createElement(DeleteObject, { objectData, onOk })
|
||||
}
|
||||
},
|
||||
{ type: 'divider' },
|
||||
|
||||
@ -15,9 +15,6 @@ const ReceiveShipment = lazy(
|
||||
const CancelShipment = lazy(
|
||||
() => import('../../components/Dashboard/Inventory/Shipments/CancelShipment')
|
||||
)
|
||||
const DeleteObject = lazy(
|
||||
() => import('../../components/Dashboard/common/DeleteObject')
|
||||
)
|
||||
import ShipmentIcon from '../../components/Icons/ShipmentIcon'
|
||||
import PlusIcon from '../../components/Icons/PlusIcon'
|
||||
import InfoCircleIcon from '../../components/Icons/InfoCircleIcon'
|
||||
@ -98,9 +95,8 @@ export const Shipment = {
|
||||
},
|
||||
{
|
||||
name: 'delete',
|
||||
type: 'modal',
|
||||
modalWidth: 520,
|
||||
modalCentered: true,
|
||||
type: 'page',
|
||||
pageName: 'info',
|
||||
label: 'Delete',
|
||||
icon: BinIcon,
|
||||
danger: true,
|
||||
@ -109,9 +105,6 @@ export const Shipment = {
|
||||
},
|
||||
disabled: (objectData) => {
|
||||
return objectData?.state?.type != 'draft'
|
||||
},
|
||||
content: (objectData, { onOk } = {}) => {
|
||||
return createElement(DeleteObject, { objectData, onOk })
|
||||
}
|
||||
},
|
||||
{ type: 'divider' },
|
||||
|
||||
@ -9,9 +9,6 @@ const NewStockTransfer = lazy(
|
||||
const PostStockTransfer = lazy(
|
||||
() => import('../../components/Dashboard/Inventory/StockTransfers/PostStockTransfer')
|
||||
)
|
||||
const DeleteObject = lazy(
|
||||
() => import('../../components/Dashboard/common/DeleteObject')
|
||||
)
|
||||
import StockTransferIcon from '../../components/Icons/StockTransferIcon'
|
||||
import PlusIcon from '../../components/Icons/PlusIcon'
|
||||
import InfoCircleIcon from '../../components/Icons/InfoCircleIcon'
|
||||
@ -92,9 +89,8 @@ export const StockTransfer = {
|
||||
},
|
||||
{
|
||||
name: 'delete',
|
||||
type: 'modal',
|
||||
modalWidth: 520,
|
||||
modalCentered: true,
|
||||
type: 'page',
|
||||
pageName: 'info',
|
||||
label: 'Delete',
|
||||
icon: BinIcon,
|
||||
danger: true,
|
||||
@ -103,9 +99,6 @@ export const StockTransfer = {
|
||||
},
|
||||
disabled: (objectData) => {
|
||||
return objectData?.state?.type != 'draft'
|
||||
},
|
||||
content: (objectData, { onOk } = {}) => {
|
||||
return createElement(DeleteObject, { objectData, onOk })
|
||||
}
|
||||
},
|
||||
{ type: 'divider' },
|
||||
|
||||
@ -6,9 +6,6 @@ const TaxRateInfo = lazy(
|
||||
const NewTaxRate = lazy(
|
||||
() => import('../../components/Dashboard/Management/TaxRates/NewTaxRate')
|
||||
)
|
||||
const DeleteObject = lazy(
|
||||
() => import('../../components/Dashboard/common/DeleteObject')
|
||||
)
|
||||
import TaxRateIcon from '../../components/Icons/TaxRateIcon'
|
||||
import PlusIcon from '../../components/Icons/PlusIcon'
|
||||
import InfoCircleIcon from '../../components/Icons/InfoCircleIcon'
|
||||
@ -87,15 +84,11 @@ export const TaxRate = {
|
||||
{ type: 'divider' },
|
||||
{
|
||||
name: 'delete',
|
||||
type: 'modal',
|
||||
modalWidth: 520,
|
||||
modalCentered: true,
|
||||
type: 'page',
|
||||
pageName: 'info',
|
||||
label: 'Delete',
|
||||
icon: BinIcon,
|
||||
danger: true,
|
||||
content: (objectData, { onOk } = {}) => {
|
||||
return createElement(DeleteObject, { objectData, onOk })
|
||||
}
|
||||
danger: true
|
||||
}
|
||||
],
|
||||
pages: [
|
||||
|
||||
@ -6,9 +6,6 @@ const TaxRecordInfo = lazy(
|
||||
const NewTaxRecord = lazy(
|
||||
() => import('../../components/Dashboard/Finance/TaxRecords/NewTaxRecord')
|
||||
)
|
||||
const DeleteObject = lazy(
|
||||
() => import('../../components/Dashboard/common/DeleteObject')
|
||||
)
|
||||
import TaxRecordIcon from '../../components/Icons/TaxRecordIcon'
|
||||
import PlusIcon from '../../components/Icons/PlusIcon'
|
||||
import InfoCircleIcon from '../../components/Icons/InfoCircleIcon'
|
||||
@ -87,15 +84,11 @@ export const TaxRecord = {
|
||||
{ type: 'divider' },
|
||||
{
|
||||
name: 'delete',
|
||||
type: 'modal',
|
||||
modalWidth: 520,
|
||||
modalCentered: true,
|
||||
type: 'page',
|
||||
pageName: 'info',
|
||||
label: 'Delete',
|
||||
icon: BinIcon,
|
||||
danger: true,
|
||||
content: (objectData, { onOk } = {}) => {
|
||||
return createElement(DeleteObject, { objectData, onOk })
|
||||
}
|
||||
danger: true
|
||||
}
|
||||
],
|
||||
pages: [
|
||||
|
||||
@ -6,9 +6,6 @@ const UserGroupInfo = lazy(
|
||||
const NewUserGroup = lazy(
|
||||
() => import('../../components/Dashboard/Management/UserGroups/NewUserGroup')
|
||||
)
|
||||
const DeleteObject = lazy(
|
||||
() => import('../../components/Dashboard/common/DeleteObject')
|
||||
)
|
||||
import PersonGroupIcon from '../../components/Icons/PersonGroupIcon'
|
||||
import PlusIcon from '../../components/Icons/PlusIcon'
|
||||
import InfoCircleIcon from '../../components/Icons/InfoCircleIcon'
|
||||
@ -88,15 +85,11 @@ export const UserGroup = {
|
||||
{ type: 'divider' },
|
||||
{
|
||||
name: 'delete',
|
||||
type: 'modal',
|
||||
modalWidth: 520,
|
||||
modalCentered: true,
|
||||
type: 'page',
|
||||
pageName: 'info',
|
||||
label: 'Delete',
|
||||
icon: BinIcon,
|
||||
danger: true,
|
||||
content: (objectData, { onOk } = {}) => {
|
||||
return createElement(DeleteObject, { objectData, onOk })
|
||||
}
|
||||
danger: true
|
||||
}
|
||||
],
|
||||
pages: [
|
||||
|
||||
@ -6,9 +6,6 @@ const VendorInfo = lazy(
|
||||
const NewVendor = lazy(
|
||||
() => import('../../components/Dashboard/Management/Vendors/NewVendor')
|
||||
)
|
||||
const DeleteObject = lazy(
|
||||
() => import('../../components/Dashboard/common/DeleteObject')
|
||||
)
|
||||
import VendorIcon from '../../components/Icons/VendorIcon'
|
||||
import PlusIcon from '../../components/Icons/PlusIcon'
|
||||
import InfoCircleIcon from '../../components/Icons/InfoCircleIcon'
|
||||
@ -87,15 +84,11 @@ export const Vendor = {
|
||||
{ type: 'divider' },
|
||||
{
|
||||
name: 'delete',
|
||||
type: 'modal',
|
||||
modalWidth: 520,
|
||||
modalCentered: true,
|
||||
type: 'page',
|
||||
pageName: 'info',
|
||||
label: 'Delete',
|
||||
icon: BinIcon,
|
||||
danger: true,
|
||||
content: (objectData, { onOk } = {}) => {
|
||||
return createElement(DeleteObject, { objectData, onOk })
|
||||
}
|
||||
danger: true
|
||||
}
|
||||
],
|
||||
pages: [
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user