Add Bulk Object Actions to Management and Dashboard Components
All checks were successful
farmcontrol/farmcontrol-ui/pipeline/head This commit looks good
All checks were successful
farmcontrol/farmcontrol-ui/pipeline/head This commit looks good
- Integrated BulkObjectActions component across various management and dashboard components for improved batch processing capabilities. - Updated components including Invoices, PaymentPolicies, Payments, TaxRecords, and multiple Inventory and Management sections to include bulk action functionality. - Enhanced user experience by allowing users to perform actions on multiple items simultaneously, streamlining workflows and improving efficiency.
This commit is contained in:
parent
f01f978ec6
commit
ebcf959e85
11
assets/icons/duplicateicon.svg
Normal file
11
assets/icons/duplicateicon.svg
Normal file
@ -0,0 +1,11 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
|
||||
<svg width="100%" height="100%" viewBox="0 0 64 64" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" xml:space="preserve" xmlns:serif="http://www.serif.com/" style="fill-rule:evenodd;clip-rule:evenodd;stroke-linejoin:round;stroke-miterlimit:2;">
|
||||
<g transform="matrix(0.768446,0,0,0.768446,3,15.307494)">
|
||||
<path d="M17.266,59.484L42.172,59.484C47.656,59.484 51.984,57.859 54.875,54.938C57.844,52.016 59.438,47.672 59.438,42.219L59.438,17.281C59.438,11.812 57.844,7.484 54.875,4.547C51.969,1.625 47.656,0 42.172,0L17.266,0C11.797,0 7.438,1.641 4.547,4.547C1.594,7.484 0,11.812 0,17.281L0,42.219C0,47.672 1.578,52.016 4.547,54.938C7.453,57.875 11.797,59.484 17.266,59.484ZM17.766,51.422C14.406,51.422 11.953,50.672 10.391,49.109C8.797,47.547 8.062,45.125 8.062,41.703L8.062,17.781C8.062,14.375 8.797,11.953 10.391,10.375C11.922,8.844 14.406,8.062 17.766,8.062L41.656,8.062C45.047,8.062 47.484,8.828 49.047,10.375C50.641,11.953 51.375,14.375 51.375,17.781L51.375,41.703C51.375,45.125 50.641,47.547 49.047,49.109C47.5,50.656 45.047,51.422 41.656,51.422L17.766,51.422Z" style="fill-rule:nonzero;"/>
|
||||
<path d="M33.203,40.672L33.203,18.781C33.203,16.797 31.719,15.359 29.719,15.359C27.719,15.359 26.281,16.797 26.281,18.781L26.281,40.672C26.281,42.641 27.719,44.078 29.719,44.078C31.719,44.078 33.203,42.656 33.203,40.672ZM18.812,33.188L40.688,33.188C42.656,33.188 44.109,31.734 44.109,29.75C44.109,27.734 42.656,26.25 40.688,26.25L18.812,26.25C16.797,26.25 15.375,27.734 15.375,29.75C15.375,31.734 16.812,33.188 18.812,33.188Z" style="fill-rule:nonzero;"/>
|
||||
<g transform="matrix(1,0,0,1,16.03954,-16.03954)">
|
||||
<path d="M0.61,11.824C1.325,8.873 2.658,6.426 4.547,4.547C7.438,1.641 11.797,0 17.266,0L42.172,0C47.656,0 51.969,1.625 54.875,4.547C57.844,7.484 59.438,11.812 59.438,17.281L59.438,42.219C59.438,47.672 57.844,52.016 54.875,54.937C53.021,56.811 50.576,58.152 47.613,58.873C47.617,58.669 47.619,58.464 47.619,58.258L47.619,50.178C48.16,49.877 48.635,49.521 49.047,49.109C50.641,47.547 51.375,45.125 51.375,41.703L51.375,17.781C51.375,14.375 50.641,11.953 49.047,10.375C47.484,8.828 45.047,8.062 41.656,8.062L17.766,8.062C14.406,8.062 11.922,8.844 10.391,10.375C9.966,10.795 9.603,11.275 9.298,11.818L1.226,11.818C1.019,11.818 0.814,11.82 0.61,11.824Z"/>
|
||||
</g>
|
||||
</g>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 2.5 KiB |
@ -1439,6 +1439,47 @@ span.ant-skeleton-input.ant-skeleton-input-sm.text-skeleton {
|
||||
flex-direction: column;
|
||||
}
|
||||
|
||||
.object-table-select-cell {
|
||||
position: relative;
|
||||
display: inline-flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
width: 16px;
|
||||
height: 16px;
|
||||
}
|
||||
|
||||
.object-table-select-cell .object-table-row-checkbox,
|
||||
.object-table-select-cell .object-table-row-icon {
|
||||
position: absolute;
|
||||
inset: 0;
|
||||
}
|
||||
|
||||
.object-table-select-cell .object-table-row-checkbox {
|
||||
opacity: 0;
|
||||
pointer-events: none;
|
||||
transition: opacity 0.2s;
|
||||
}
|
||||
|
||||
.dashboard-table
|
||||
.ant-table-row:hover
|
||||
.object-table-select-cell
|
||||
.object-table-row-checkbox,
|
||||
.object-table-select-cell.object-table-select-cell-selected
|
||||
.object-table-row-checkbox {
|
||||
opacity: 1;
|
||||
pointer-events: auto;
|
||||
}
|
||||
|
||||
.dashboard-table
|
||||
.ant-table-row:hover
|
||||
.object-table-select-cell
|
||||
.object-table-row-icon,
|
||||
.object-table-select-cell.object-table-select-cell-selected
|
||||
.object-table-row-icon {
|
||||
transition: opacity 0.2s;
|
||||
opacity: 0;
|
||||
}
|
||||
|
||||
.objectKanbanContainerWrapper {
|
||||
position: relative;
|
||||
width: 100%;
|
||||
|
||||
@ -2,6 +2,7 @@ import { useRef } from 'react'
|
||||
import { Flex, Space } from 'antd'
|
||||
import ObjectTable from '../common/ObjectTable'
|
||||
import ObjectActions from '../common/ObjectActions'
|
||||
import BulkObjectActions from '../common/BulkObjectActions'
|
||||
import useColumnVisibility from '../hooks/useColumnVisibility'
|
||||
import ObjectTableViewButton from '../common/ObjectTableViewButton'
|
||||
import FilterSidebarButton from '../common/FilterSidebarButton'
|
||||
@ -31,6 +32,10 @@ const Invoices = () => {
|
||||
<Flex vertical={'true'} gap='large' className='h-100'>
|
||||
<Flex justify='space-between' style={{ minHeight: 0 }} gap='small'>
|
||||
<Space size='small'>
|
||||
<BulkObjectActions
|
||||
type='invoice'
|
||||
onReload={() => tableRef.current?.reload()}
|
||||
/>
|
||||
<ObjectActions
|
||||
type='invoice'
|
||||
pageName='list'
|
||||
|
||||
@ -2,6 +2,7 @@ import { useRef } from 'react'
|
||||
import { Flex, Space } from 'antd'
|
||||
import ObjectTable from '../common/ObjectTable'
|
||||
import ObjectActions from '../common/ObjectActions'
|
||||
import BulkObjectActions from '../common/BulkObjectActions'
|
||||
import useColumnVisibility from '../hooks/useColumnVisibility'
|
||||
import ObjectTableViewButton from '../common/ObjectTableViewButton'
|
||||
import FilterSidebarButton from '../common/FilterSidebarButton'
|
||||
@ -31,6 +32,10 @@ const PaymentPolicies = () => {
|
||||
<Flex vertical={'true'} gap='large' className='h-100'>
|
||||
<Flex justify='space-between' style={{ minHeight: 0 }} gap='small'>
|
||||
<Space size='small'>
|
||||
<BulkObjectActions
|
||||
type='paymentPolicy'
|
||||
onReload={() => tableRef.current?.reload()}
|
||||
/>
|
||||
<ObjectActions
|
||||
type='paymentPolicy'
|
||||
pageName='list'
|
||||
|
||||
@ -2,6 +2,7 @@ import { useRef } from 'react'
|
||||
import { Flex, Space } from 'antd'
|
||||
import ObjectTable from '../common/ObjectTable'
|
||||
import ObjectActions from '../common/ObjectActions'
|
||||
import BulkObjectActions from '../common/BulkObjectActions'
|
||||
import useColumnVisibility from '../hooks/useColumnVisibility'
|
||||
import ObjectTableViewButton from '../common/ObjectTableViewButton'
|
||||
import FilterSidebarButton from '../common/FilterSidebarButton'
|
||||
@ -35,6 +36,10 @@ const Payments = () => {
|
||||
<Flex vertical={'true'} gap='large' className='h-100'>
|
||||
<Flex justify='space-between' style={{ minHeight: 0 }} gap='small'>
|
||||
<Space size='small'>
|
||||
<BulkObjectActions
|
||||
type='payment'
|
||||
onReload={() => tableRef.current?.reload()}
|
||||
/>
|
||||
<ObjectActions
|
||||
type='payment'
|
||||
pageName='list'
|
||||
|
||||
@ -2,6 +2,7 @@ import { useRef } from 'react'
|
||||
import { Flex, Space } from 'antd'
|
||||
import ObjectTable from '../common/ObjectTable'
|
||||
import ObjectActions from '../common/ObjectActions'
|
||||
import BulkObjectActions from '../common/BulkObjectActions'
|
||||
import useColumnVisibility from '../hooks/useColumnVisibility'
|
||||
import ObjectTableViewButton from '../common/ObjectTableViewButton'
|
||||
import FilterSidebarButton from '../common/FilterSidebarButton'
|
||||
@ -35,6 +36,10 @@ const TaxRecords = () => {
|
||||
<Flex vertical={'true'} gap='large' className='h-100'>
|
||||
<Flex justify='space-between' style={{ minHeight: 0 }} gap='small'>
|
||||
<Space size='small'>
|
||||
<BulkObjectActions
|
||||
type='taxRecord'
|
||||
onReload={() => tableRef.current?.reload()}
|
||||
/>
|
||||
<ObjectActions
|
||||
type='taxRecord'
|
||||
pageName='list'
|
||||
|
||||
@ -7,6 +7,7 @@ import { Flex, Space } from 'antd'
|
||||
import useColumnVisibility from '../hooks/useColumnVisibility'
|
||||
import ObjectTable from '../common/ObjectTable'
|
||||
import ObjectActions from '../common/ObjectActions'
|
||||
import BulkObjectActions from '../common/BulkObjectActions'
|
||||
import ObjectTableViewButton from '../common/ObjectTableViewButton'
|
||||
import FilterSidebarButton from '../common/FilterSidebarButton'
|
||||
import SortSidebarButton from '../common/SortSidebarButton'
|
||||
@ -39,6 +40,10 @@ const FilamentStocks = () => {
|
||||
<Flex vertical={'true'} gap='large' className='h-100'>
|
||||
<Flex justify='space-between' style={{ minHeight: 0 }} gap='small'>
|
||||
<Space size='small'>
|
||||
<BulkObjectActions
|
||||
type='filamentStock'
|
||||
onReload={() => tableRef.current?.reload()}
|
||||
/>
|
||||
<ObjectActions
|
||||
type='filamentStock'
|
||||
pageName='list'
|
||||
|
||||
@ -2,6 +2,7 @@ import { useRef } from 'react'
|
||||
import { Flex, Space } from 'antd'
|
||||
import ObjectTable from '../common/ObjectTable'
|
||||
import ObjectActions from '../common/ObjectActions'
|
||||
import BulkObjectActions from '../common/BulkObjectActions'
|
||||
import useColumnVisibility from '../hooks/useColumnVisibility'
|
||||
import ObjectTableViewButton from '../common/ObjectTableViewButton'
|
||||
import FilterSidebarButton from '../common/FilterSidebarButton'
|
||||
@ -35,6 +36,10 @@ const OrderItems = () => {
|
||||
<Flex vertical={'true'} gap='large' className='h-100'>
|
||||
<Flex justify='space-between' style={{ minHeight: 0 }} gap='small'>
|
||||
<Space size='small'>
|
||||
<BulkObjectActions
|
||||
type='orderItem'
|
||||
onReload={() => tableRef.current?.reload()}
|
||||
/>
|
||||
<ObjectActions
|
||||
type='orderItem'
|
||||
pageName='list'
|
||||
|
||||
@ -7,6 +7,7 @@ import { Flex, Space } from 'antd'
|
||||
import useColumnVisibility from '../hooks/useColumnVisibility'
|
||||
import ObjectTable from '../common/ObjectTable'
|
||||
import ObjectActions from '../common/ObjectActions'
|
||||
import BulkObjectActions from '../common/BulkObjectActions'
|
||||
import ObjectTableViewButton from '../common/ObjectTableViewButton'
|
||||
import FilterSidebarButton from '../common/FilterSidebarButton'
|
||||
import SortSidebarButton from '../common/SortSidebarButton'
|
||||
@ -39,6 +40,10 @@ const PartStocks = () => {
|
||||
<Flex vertical={'true'} gap='large' className='h-100'>
|
||||
<Flex justify='space-between' style={{ minHeight: 0 }} gap='small'>
|
||||
<Space size='small'>
|
||||
<BulkObjectActions
|
||||
type='partStock'
|
||||
onReload={() => tableRef.current?.reload()}
|
||||
/>
|
||||
<ObjectActions
|
||||
type='partStock'
|
||||
pageName='list'
|
||||
|
||||
@ -8,6 +8,7 @@ import { Flex, Space } from 'antd'
|
||||
import useColumnVisibility from '../hooks/useColumnVisibility'
|
||||
import ObjectTable from '../common/ObjectTable'
|
||||
import ObjectActions from '../common/ObjectActions'
|
||||
import BulkObjectActions from '../common/BulkObjectActions'
|
||||
import ObjectTableViewButton from '../common/ObjectTableViewButton'
|
||||
import FilterSidebarButton from '../common/FilterSidebarButton'
|
||||
import SortSidebarButton from '../common/SortSidebarButton'
|
||||
@ -40,6 +41,10 @@ const ProductStocks = () => {
|
||||
<Flex vertical={'true'} gap='large' className='h-100'>
|
||||
<Flex justify='space-between' style={{ minHeight: 0 }} gap='small'>
|
||||
<Space size='small'>
|
||||
<BulkObjectActions
|
||||
type='productStock'
|
||||
onReload={() => tableRef.current?.reload()}
|
||||
/>
|
||||
<ObjectActions
|
||||
type='productStock'
|
||||
pageName='list'
|
||||
|
||||
@ -2,6 +2,7 @@ import { useRef } from 'react'
|
||||
import { Flex, Space } from 'antd'
|
||||
import ObjectTable from '../common/ObjectTable'
|
||||
import ObjectActions from '../common/ObjectActions'
|
||||
import BulkObjectActions from '../common/BulkObjectActions'
|
||||
import useColumnVisibility from '../hooks/useColumnVisibility'
|
||||
import ObjectTableViewButton from '../common/ObjectTableViewButton'
|
||||
import FilterSidebarButton from '../common/FilterSidebarButton'
|
||||
@ -35,6 +36,10 @@ const PurchaseOrders = () => {
|
||||
<Flex vertical={'true'} gap='large' className='h-100'>
|
||||
<Flex justify='space-between' style={{ minHeight: 0 }} gap='small'>
|
||||
<Space size='small'>
|
||||
<BulkObjectActions
|
||||
type='purchaseOrder'
|
||||
onReload={() => tableRef.current?.reload()}
|
||||
/>
|
||||
<ObjectActions
|
||||
type='purchaseOrder'
|
||||
pageName='list'
|
||||
|
||||
@ -2,6 +2,7 @@ import { useRef } from 'react'
|
||||
import { Flex, Space } from 'antd'
|
||||
import ObjectTable from '../common/ObjectTable'
|
||||
import ObjectActions from '../common/ObjectActions'
|
||||
import BulkObjectActions from '../common/BulkObjectActions'
|
||||
import useColumnVisibility from '../hooks/useColumnVisibility'
|
||||
import ObjectTableViewButton from '../common/ObjectTableViewButton'
|
||||
import FilterSidebarButton from '../common/FilterSidebarButton'
|
||||
@ -35,6 +36,10 @@ const Shipments = () => {
|
||||
<Flex vertical={'true'} gap='large' className='h-100'>
|
||||
<Flex justify='space-between' style={{ minHeight: 0 }} gap='small'>
|
||||
<Space size='small'>
|
||||
<BulkObjectActions
|
||||
type='shipment'
|
||||
onReload={() => tableRef.current?.reload()}
|
||||
/>
|
||||
<ObjectActions
|
||||
type='shipment'
|
||||
pageName='list'
|
||||
|
||||
@ -7,6 +7,7 @@ import { Flex, Space } from 'antd'
|
||||
import useColumnVisibility from '../hooks/useColumnVisibility'
|
||||
import ObjectTable from '../common/ObjectTable'
|
||||
import ObjectActions from '../common/ObjectActions'
|
||||
import BulkObjectActions from '../common/BulkObjectActions'
|
||||
import ObjectTableViewButton from '../common/ObjectTableViewButton'
|
||||
import FilterSidebarButton from '../common/FilterSidebarButton'
|
||||
import SortSidebarButton from '../common/SortSidebarButton'
|
||||
@ -39,6 +40,10 @@ const StockAudits = () => {
|
||||
<Flex vertical={'true'} gap='large' className='h-100'>
|
||||
<Flex justify='space-between' style={{ minHeight: 0 }} gap='small'>
|
||||
<Space size='small'>
|
||||
<BulkObjectActions
|
||||
type='stockAudit'
|
||||
onReload={() => tableRef.current?.reload()}
|
||||
/>
|
||||
<ObjectActions
|
||||
type='stockAudit'
|
||||
pageName='list'
|
||||
|
||||
@ -3,6 +3,7 @@ import { Flex, Space } from 'antd'
|
||||
import useColumnVisibility from '../hooks/useColumnVisibility'
|
||||
import ObjectTable from '../common/ObjectTable'
|
||||
import ObjectActions from '../common/ObjectActions'
|
||||
import BulkObjectActions from '../common/BulkObjectActions'
|
||||
import ObjectTableViewButton from '../common/ObjectTableViewButton'
|
||||
import FilterSidebarButton from '../common/FilterSidebarButton'
|
||||
import SortSidebarButton from '../common/SortSidebarButton'
|
||||
@ -35,6 +36,10 @@ const StockEvents = () => {
|
||||
<Flex vertical={'true'} gap='large' className='h-100'>
|
||||
<Flex justify='space-between' style={{ minHeight: 0 }} gap='small'>
|
||||
<Space size='small'>
|
||||
<BulkObjectActions
|
||||
type='stockEvent'
|
||||
onReload={() => tableRef.current?.reload()}
|
||||
/>
|
||||
<ObjectActions
|
||||
type='stockEvent'
|
||||
pageName='list'
|
||||
|
||||
@ -5,6 +5,7 @@ import { Flex, Space } from 'antd'
|
||||
import useColumnVisibility from '../hooks/useColumnVisibility'
|
||||
import ObjectTable from '../common/ObjectTable'
|
||||
import ObjectActions from '../common/ObjectActions'
|
||||
import BulkObjectActions from '../common/BulkObjectActions'
|
||||
import ObjectTableViewButton from '../common/ObjectTableViewButton'
|
||||
import FilterSidebarButton from '../common/FilterSidebarButton'
|
||||
import SortSidebarButton from '../common/SortSidebarButton'
|
||||
@ -37,6 +38,10 @@ const StockLocations = () => {
|
||||
<Flex vertical={'true'} gap='large' className='h-100'>
|
||||
<Flex justify='space-between' style={{ minHeight: 0 }} gap='small'>
|
||||
<Space size='small'>
|
||||
<BulkObjectActions
|
||||
type='stockLocation'
|
||||
onReload={() => tableRef.current?.reload()}
|
||||
/>
|
||||
<ObjectActions
|
||||
type='stockLocation'
|
||||
pageName='list'
|
||||
|
||||
@ -5,6 +5,7 @@ import { Flex, Space } from 'antd'
|
||||
import useColumnVisibility from '../hooks/useColumnVisibility'
|
||||
import ObjectTable from '../common/ObjectTable'
|
||||
import ObjectActions from '../common/ObjectActions'
|
||||
import BulkObjectActions from '../common/BulkObjectActions'
|
||||
import ObjectTableViewButton from '../common/ObjectTableViewButton'
|
||||
import FilterSidebarButton from '../common/FilterSidebarButton'
|
||||
import SortSidebarButton from '../common/SortSidebarButton'
|
||||
@ -37,6 +38,10 @@ const StockTransfers = () => {
|
||||
<Flex vertical={'true'} gap='large' className='h-100'>
|
||||
<Flex justify='space-between' style={{ minHeight: 0 }} gap='small'>
|
||||
<Space size='small'>
|
||||
<BulkObjectActions
|
||||
type='stockTransfer'
|
||||
onReload={() => tableRef.current?.reload()}
|
||||
/>
|
||||
<ObjectActions
|
||||
type='stockTransfer'
|
||||
pageName='list'
|
||||
|
||||
@ -4,6 +4,7 @@ import useColumnVisibility from '../hooks/useColumnVisibility'
|
||||
import ColumnViewButton from '../common/ColumnViewButton'
|
||||
import ObjectTable from '../common/ObjectTable'
|
||||
import ObjectActions from '../common/ObjectActions'
|
||||
import BulkObjectActions from '../common/BulkObjectActions'
|
||||
import ObjectTableViewButton from '../common/ObjectTableViewButton'
|
||||
import FilterSidebarButton from '../common/FilterSidebarButton'
|
||||
import SortSidebarButton from '../common/SortSidebarButton'
|
||||
@ -34,6 +35,10 @@ const AppPasswords = () => {
|
||||
<Flex vertical={'true'} gap='large' className='h-100'>
|
||||
<Flex justify='space-between' style={{ minHeight: 0 }} gap='small'>
|
||||
<Space>
|
||||
<BulkObjectActions
|
||||
type='appPassword'
|
||||
onReload={() => tableRef.current?.reload()}
|
||||
/>
|
||||
<ObjectActions
|
||||
type='appPassword'
|
||||
pageName='list'
|
||||
|
||||
@ -6,6 +6,7 @@ import useFilterSidebarVisibility from '../hooks/useFilterSidebarVisibility'
|
||||
import useSortSidebarVisibility from '../hooks/useSortSidebarVisibility'
|
||||
import ObjectTable from '../common/ObjectTable'
|
||||
import ObjectActions from '../common/ObjectActions'
|
||||
import BulkObjectActions from '../common/BulkObjectActions'
|
||||
import FilterSidebarButton from '../common/FilterSidebarButton'
|
||||
import SortSidebarButton from '../common/SortSidebarButton'
|
||||
import ColumnViewButton from '../common/ColumnViewButton'
|
||||
@ -32,6 +33,10 @@ const AuditLogs = () => {
|
||||
<Flex vertical={'true'} gap='large' className='h-100'>
|
||||
<Flex justify='space-between' style={{ minHeight: 0 }} gap='small'>
|
||||
<Space size='small'>
|
||||
<BulkObjectActions
|
||||
type='auditLog'
|
||||
onReload={() => tableRef.current?.reload()}
|
||||
/>
|
||||
<ObjectActions
|
||||
type='auditLog'
|
||||
pageName='list'
|
||||
|
||||
@ -2,6 +2,7 @@ import { useRef } from 'react'
|
||||
import { Flex, Space } from 'antd'
|
||||
import ObjectTable from '../common/ObjectTable'
|
||||
import ObjectActions from '../common/ObjectActions'
|
||||
import BulkObjectActions from '../common/BulkObjectActions'
|
||||
import useColumnVisibility from '../hooks/useColumnVisibility'
|
||||
import ObjectTableViewButton from '../common/ObjectTableViewButton'
|
||||
import FilterSidebarButton from '../common/FilterSidebarButton'
|
||||
@ -35,6 +36,10 @@ const CourierServices = () => {
|
||||
<Flex vertical={'true'} gap='large' className='h-100'>
|
||||
<Flex justify='space-between' style={{ minHeight: 0 }} gap='small'>
|
||||
<Space size='small'>
|
||||
<BulkObjectActions
|
||||
type='courierService'
|
||||
onReload={() => tableRef.current?.reload()}
|
||||
/>
|
||||
<ObjectActions
|
||||
type='courierService'
|
||||
pageName='list'
|
||||
|
||||
@ -2,6 +2,7 @@ import { useRef } from 'react'
|
||||
import { Flex, Space } from 'antd'
|
||||
import ObjectTable from '../common/ObjectTable'
|
||||
import ObjectActions from '../common/ObjectActions'
|
||||
import BulkObjectActions from '../common/BulkObjectActions'
|
||||
import useColumnVisibility from '../hooks/useColumnVisibility'
|
||||
import ObjectTableViewButton from '../common/ObjectTableViewButton'
|
||||
import FilterSidebarButton from '../common/FilterSidebarButton'
|
||||
@ -34,6 +35,10 @@ const Couriers = () => {
|
||||
<Flex vertical={'true'} gap='large' className='h-100'>
|
||||
<Flex justify='space-between' style={{ minHeight: 0 }} gap='small'>
|
||||
<Space size='small'>
|
||||
<BulkObjectActions
|
||||
type='courier'
|
||||
onReload={() => tableRef.current?.reload()}
|
||||
/>
|
||||
<ObjectActions
|
||||
type='courier'
|
||||
pageName='list'
|
||||
|
||||
@ -2,6 +2,7 @@ import { useRef } from 'react'
|
||||
import { Flex, Space } from 'antd'
|
||||
import ObjectTable from '../common/ObjectTable'
|
||||
import ObjectActions from '../common/ObjectActions'
|
||||
import BulkObjectActions from '../common/BulkObjectActions'
|
||||
import useColumnVisibility from '../hooks/useColumnVisibility'
|
||||
import ObjectTableViewButton from '../common/ObjectTableViewButton'
|
||||
import FilterSidebarButton from '../common/FilterSidebarButton'
|
||||
@ -35,6 +36,10 @@ const DocumentJobs = () => {
|
||||
<Flex vertical={'true'} gap='large' className='h-100'>
|
||||
<Flex justify='space-between' style={{ minHeight: 0 }} gap='small'>
|
||||
<Space size='small'>
|
||||
<BulkObjectActions
|
||||
type='documentJob'
|
||||
onReload={() => tableRef.current?.reload()}
|
||||
/>
|
||||
<ObjectActions
|
||||
type='documentJob'
|
||||
pageName='list'
|
||||
|
||||
@ -2,6 +2,7 @@ import { useRef } from 'react'
|
||||
import { Flex, Space } from 'antd'
|
||||
import ObjectTable from '../common/ObjectTable'
|
||||
import ObjectActions from '../common/ObjectActions'
|
||||
import BulkObjectActions from '../common/BulkObjectActions'
|
||||
import useColumnVisibility from '../hooks/useColumnVisibility'
|
||||
import ObjectTableViewButton from '../common/ObjectTableViewButton'
|
||||
import FilterSidebarButton from '../common/FilterSidebarButton'
|
||||
@ -35,6 +36,10 @@ const DocumentPrinters = () => {
|
||||
<Flex vertical={'true'} gap='large' className='h-100'>
|
||||
<Flex justify='space-between' style={{ minHeight: 0 }} gap='small'>
|
||||
<Space size='small'>
|
||||
<BulkObjectActions
|
||||
type='documentPrinter'
|
||||
onReload={() => tableRef.current?.reload()}
|
||||
/>
|
||||
<ObjectActions
|
||||
type='documentPrinter'
|
||||
pageName='list'
|
||||
|
||||
@ -2,6 +2,7 @@ import { useRef } from 'react'
|
||||
import { Flex, Space } from 'antd'
|
||||
import ObjectTable from '../common/ObjectTable'
|
||||
import ObjectActions from '../common/ObjectActions'
|
||||
import BulkObjectActions from '../common/BulkObjectActions'
|
||||
import useColumnVisibility from '../hooks/useColumnVisibility'
|
||||
import ObjectTableViewButton from '../common/ObjectTableViewButton'
|
||||
import FilterSidebarButton from '../common/FilterSidebarButton'
|
||||
@ -34,6 +35,10 @@ const DocumentSizes = () => {
|
||||
<Flex vertical={'true'} gap='large' className='h-100'>
|
||||
<Flex justify='space-between' style={{ minHeight: 0 }} gap='small'>
|
||||
<Space size='small'>
|
||||
<BulkObjectActions
|
||||
type='documentSize'
|
||||
onReload={() => tableRef.current?.reload()}
|
||||
/>
|
||||
<ObjectActions
|
||||
type='documentSize'
|
||||
pageName='list'
|
||||
|
||||
@ -2,6 +2,7 @@ import { useRef } from 'react'
|
||||
import { Flex, Space } from 'antd'
|
||||
import ObjectTable from '../common/ObjectTable'
|
||||
import ObjectActions from '../common/ObjectActions'
|
||||
import BulkObjectActions from '../common/BulkObjectActions'
|
||||
import useColumnVisibility from '../hooks/useColumnVisibility'
|
||||
import ObjectTableViewButton from '../common/ObjectTableViewButton'
|
||||
import FilterSidebarButton from '../common/FilterSidebarButton'
|
||||
@ -35,6 +36,10 @@ const DocumentTemplates = () => {
|
||||
<Flex vertical={'true'} gap='large' className='h-100'>
|
||||
<Flex justify='space-between' style={{ minHeight: 0 }} gap='small'>
|
||||
<Space size='small'>
|
||||
<BulkObjectActions
|
||||
type='documentTemplate'
|
||||
onReload={() => tableRef.current?.reload()}
|
||||
/>
|
||||
<ObjectActions
|
||||
type='documentTemplate'
|
||||
pageName='list'
|
||||
|
||||
@ -2,6 +2,7 @@ import { useRef } from 'react'
|
||||
import { Flex, Space } from 'antd'
|
||||
import ObjectTable from '../common/ObjectTable'
|
||||
import ObjectActions from '../common/ObjectActions'
|
||||
import BulkObjectActions from '../common/BulkObjectActions'
|
||||
import useColumnVisibility from '../hooks/useColumnVisibility'
|
||||
import ObjectTableViewButton from '../common/ObjectTableViewButton'
|
||||
import FilterSidebarButton from '../common/FilterSidebarButton'
|
||||
@ -31,6 +32,10 @@ const EmailAccounts = () => {
|
||||
<Flex vertical={'true'} gap='large' className='h-100'>
|
||||
<Flex justify='space-between' style={{ minHeight: 0 }} gap='small'>
|
||||
<Space size='small'>
|
||||
<BulkObjectActions
|
||||
type='emailAccount'
|
||||
onReload={() => tableRef.current?.reload()}
|
||||
/>
|
||||
<ObjectActions
|
||||
type='emailAccount'
|
||||
pageName='list'
|
||||
|
||||
@ -2,6 +2,7 @@ import { useRef } from 'react'
|
||||
import { Flex, Space } from 'antd'
|
||||
import ObjectTable from '../common/ObjectTable'
|
||||
import ObjectActions from '../common/ObjectActions'
|
||||
import BulkObjectActions from '../common/BulkObjectActions'
|
||||
import useColumnVisibility from '../hooks/useColumnVisibility'
|
||||
import ObjectTableViewButton from '../common/ObjectTableViewButton'
|
||||
import FilterSidebarButton from '../common/FilterSidebarButton'
|
||||
@ -31,6 +32,10 @@ const EmailMessages = () => {
|
||||
<Flex vertical={'true'} gap='large' className='h-100'>
|
||||
<Flex justify='space-between' style={{ minHeight: 0 }} gap='small'>
|
||||
<Space size='small'>
|
||||
<BulkObjectActions
|
||||
type='emailMessage'
|
||||
onReload={() => tableRef.current?.reload()}
|
||||
/>
|
||||
<ObjectActions
|
||||
type='emailMessage'
|
||||
pageName='list'
|
||||
|
||||
@ -2,6 +2,7 @@ import { useRef } from 'react'
|
||||
import { Flex, Space } from 'antd'
|
||||
import ObjectTable from '../common/ObjectTable'
|
||||
import ObjectActions from '../common/ObjectActions'
|
||||
import BulkObjectActions from '../common/BulkObjectActions'
|
||||
import useColumnVisibility from '../hooks/useColumnVisibility'
|
||||
import ObjectTableViewButton from '../common/ObjectTableViewButton'
|
||||
import FilterSidebarButton from '../common/FilterSidebarButton'
|
||||
@ -31,6 +32,10 @@ const EmailTemplates = () => {
|
||||
<Flex vertical={'true'} gap='large' className='h-100'>
|
||||
<Flex justify='space-between' style={{ minHeight: 0 }} gap='small'>
|
||||
<Space size='small'>
|
||||
<BulkObjectActions
|
||||
type='emailTemplate'
|
||||
onReload={() => tableRef.current?.reload()}
|
||||
/>
|
||||
<ObjectActions
|
||||
type='emailTemplate'
|
||||
pageName='list'
|
||||
|
||||
@ -5,6 +5,7 @@ import { Flex, Space } from 'antd'
|
||||
import useColumnVisibility from '../hooks/useColumnVisibility'
|
||||
import ObjectTable from '../common/ObjectTable'
|
||||
import ObjectActions from '../common/ObjectActions'
|
||||
import BulkObjectActions from '../common/BulkObjectActions'
|
||||
import ObjectTableViewButton from '../common/ObjectTableViewButton'
|
||||
import FilterSidebarButton from '../common/FilterSidebarButton'
|
||||
import SortSidebarButton from '../common/SortSidebarButton'
|
||||
@ -37,6 +38,10 @@ const FilamentSkus = () => {
|
||||
<Flex vertical={'true'} gap='large' className='h-100'>
|
||||
<Flex justify='space-between' style={{ minHeight: 0 }} gap='small'>
|
||||
<Space size='small'>
|
||||
<BulkObjectActions
|
||||
type='filamentSku'
|
||||
onReload={() => tableRef.current?.reload()}
|
||||
/>
|
||||
<ObjectActions
|
||||
type='filamentSku'
|
||||
pageName='list'
|
||||
|
||||
@ -8,6 +8,7 @@ import useColumnVisibility from '../hooks/useColumnVisibility'
|
||||
import ColumnViewButton from '../common/ColumnViewButton'
|
||||
import ObjectTable from '../common/ObjectTable'
|
||||
import ObjectActions from '../common/ObjectActions'
|
||||
import BulkObjectActions from '../common/BulkObjectActions'
|
||||
import ObjectTableViewButton from '../common/ObjectTableViewButton'
|
||||
import FilterSidebarButton from '../common/FilterSidebarButton'
|
||||
import SortSidebarButton from '../common/SortSidebarButton'
|
||||
@ -41,6 +42,10 @@ const Filaments = () => {
|
||||
<Flex vertical={'true'} gap='large' className='h-100'>
|
||||
<Flex justify='space-between' style={{ minHeight: 0 }} gap='small'>
|
||||
<Space>
|
||||
<BulkObjectActions
|
||||
type='filament'
|
||||
onReload={() => tableRef.current?.reload()}
|
||||
/>
|
||||
<ObjectActions
|
||||
type='filament'
|
||||
pageName='list'
|
||||
|
||||
@ -2,6 +2,7 @@ import { useRef } from 'react'
|
||||
import { Flex, Space } from 'antd'
|
||||
import ObjectTable from '../common/ObjectTable'
|
||||
import ObjectActions from '../common/ObjectActions'
|
||||
import BulkObjectActions from '../common/BulkObjectActions'
|
||||
import useColumnVisibility from '../hooks/useColumnVisibility'
|
||||
import ObjectTableViewButton from '../common/ObjectTableViewButton'
|
||||
import FilterSidebarButton from '../common/FilterSidebarButton'
|
||||
@ -33,6 +34,10 @@ const Files = () => {
|
||||
<Flex vertical={'true'} gap='large' className='h-100'>
|
||||
<Flex justify='space-between' style={{ minHeight: 0 }} gap='small'>
|
||||
<Space size='small'>
|
||||
<BulkObjectActions
|
||||
type='file'
|
||||
onReload={() => tableRef.current?.reload()}
|
||||
/>
|
||||
<ObjectActions
|
||||
type='file'
|
||||
pageName='list'
|
||||
|
||||
@ -12,6 +12,7 @@ import ListViewEditButtons from '../common/ListViewEditButtons'
|
||||
import { ObjectListViewProvider } from '../context/ObjectListViewContext'
|
||||
import ObjectTable from '../common/ObjectTable'
|
||||
import ObjectActions from '../common/ObjectActions'
|
||||
import BulkObjectActions from '../common/BulkObjectActions'
|
||||
import ObjectTableViewButton from '../common/ObjectTableViewButton'
|
||||
import FilterSidebarButton from '../common/FilterSidebarButton'
|
||||
import SortSidebarButton from '../common/SortSidebarButton'
|
||||
@ -40,6 +41,10 @@ const Hosts = () => {
|
||||
<Flex vertical={'true'} gap='large' className='h-100'>
|
||||
<Flex justify='space-between' style={{ minHeight: 0 }} gap='small'>
|
||||
<Space>
|
||||
<BulkObjectActions
|
||||
type='host'
|
||||
onReload={() => tableRef.current?.reload()}
|
||||
/>
|
||||
<ObjectActions
|
||||
type='host'
|
||||
pageName='list'
|
||||
|
||||
@ -6,6 +6,7 @@ import useColumnVisibility from '../hooks/useColumnVisibility'
|
||||
import ColumnViewButton from '../common/ColumnViewButton'
|
||||
import ObjectTable from '../common/ObjectTable'
|
||||
import ObjectActions from '../common/ObjectActions'
|
||||
import BulkObjectActions from '../common/BulkObjectActions'
|
||||
import ObjectTableViewButton from '../common/ObjectTableViewButton'
|
||||
import FilterSidebarButton from '../common/FilterSidebarButton'
|
||||
import SortSidebarButton from '../common/SortSidebarButton'
|
||||
@ -37,6 +38,10 @@ const Materials = () => {
|
||||
<Flex vertical={'true'} gap='large' className='h-100'>
|
||||
<Flex justify='space-between' style={{ minHeight: 0 }} gap='small'>
|
||||
<Space>
|
||||
<BulkObjectActions
|
||||
type='material'
|
||||
onReload={() => tableRef.current?.reload()}
|
||||
/>
|
||||
<ObjectActions
|
||||
type='material'
|
||||
pageName='list'
|
||||
|
||||
@ -2,6 +2,7 @@ import { useRef } from 'react'
|
||||
import { Flex, Space } from 'antd'
|
||||
import ObjectTable from '../common/ObjectTable'
|
||||
import ObjectActions from '../common/ObjectActions'
|
||||
import BulkObjectActions from '../common/BulkObjectActions'
|
||||
import useColumnVisibility from '../hooks/useColumnVisibility'
|
||||
import ObjectTableViewButton from '../common/ObjectTableViewButton'
|
||||
import FilterSidebarButton from '../common/FilterSidebarButton'
|
||||
@ -35,6 +36,10 @@ const NoteTypes = () => {
|
||||
<Flex vertical={'true'} gap='large' className='h-100'>
|
||||
<Flex justify='space-between' style={{ minHeight: 0 }} gap='small'>
|
||||
<Space size='small'>
|
||||
<BulkObjectActions
|
||||
type='noteType'
|
||||
onReload={() => tableRef.current?.reload()}
|
||||
/>
|
||||
<ObjectActions
|
||||
type='noteType'
|
||||
pageName='list'
|
||||
|
||||
@ -5,6 +5,7 @@ import { Flex, Space } from 'antd'
|
||||
import useColumnVisibility from '../hooks/useColumnVisibility'
|
||||
import ObjectTable from '../common/ObjectTable'
|
||||
import ObjectActions from '../common/ObjectActions'
|
||||
import BulkObjectActions from '../common/BulkObjectActions'
|
||||
import ObjectTableViewButton from '../common/ObjectTableViewButton'
|
||||
import FilterSidebarButton from '../common/FilterSidebarButton'
|
||||
import SortSidebarButton from '../common/SortSidebarButton'
|
||||
@ -36,6 +37,10 @@ const PartSkus = () => {
|
||||
<Flex vertical={'true'} gap='large' className='h-100'>
|
||||
<Flex justify='space-between' style={{ minHeight: 0 }} gap='small'>
|
||||
<Space size='small'>
|
||||
<BulkObjectActions
|
||||
type='partSku'
|
||||
onReload={() => tableRef.current?.reload()}
|
||||
/>
|
||||
<ObjectActions
|
||||
type='partSku'
|
||||
pageName='list'
|
||||
|
||||
@ -5,6 +5,7 @@ import { useRef } from 'react'
|
||||
import { Flex, Space } from 'antd'
|
||||
import ObjectTable from '../common/ObjectTable'
|
||||
import ObjectActions from '../common/ObjectActions'
|
||||
import BulkObjectActions from '../common/BulkObjectActions'
|
||||
|
||||
|
||||
import useColumnVisibility from '../hooks/useColumnVisibility'
|
||||
@ -40,6 +41,10 @@ const Parts = (filter) => {
|
||||
<Flex vertical={'true'} gap='large' className='h-100'>
|
||||
<Flex justify='space-between' style={{ minHeight: 0 }} gap='small'>
|
||||
<Space size='small'>
|
||||
<BulkObjectActions
|
||||
type='part'
|
||||
onReload={() => tableRef.current?.reload()}
|
||||
/>
|
||||
<ObjectActions
|
||||
type='part'
|
||||
pageName='list'
|
||||
|
||||
@ -2,6 +2,7 @@ import { useRef } from 'react'
|
||||
import { Flex, Space } from 'antd'
|
||||
import ObjectTable from '../common/ObjectTable'
|
||||
import ObjectActions from '../common/ObjectActions'
|
||||
import BulkObjectActions from '../common/BulkObjectActions'
|
||||
import useColumnVisibility from '../hooks/useColumnVisibility'
|
||||
import ObjectTableViewButton from '../common/ObjectTableViewButton'
|
||||
import FilterSidebarButton from '../common/FilterSidebarButton'
|
||||
@ -35,6 +36,10 @@ const PermissionSettingsList = () => {
|
||||
<Flex vertical={'true'} gap='large' className='h-100'>
|
||||
<Flex justify='space-between' style={{ minHeight: 0 }} gap='small'>
|
||||
<Space size='small'>
|
||||
<BulkObjectActions
|
||||
type='permissionSetting'
|
||||
onReload={() => tableRef.current?.reload()}
|
||||
/>
|
||||
<ObjectActions
|
||||
type='permissionSetting'
|
||||
pageName='list'
|
||||
|
||||
@ -6,6 +6,7 @@ import useColumnVisibility from '../hooks/useColumnVisibility'
|
||||
import ColumnViewButton from '../common/ColumnViewButton'
|
||||
import ObjectTable from '../common/ObjectTable'
|
||||
import ObjectActions from '../common/ObjectActions'
|
||||
import BulkObjectActions from '../common/BulkObjectActions'
|
||||
import ObjectTableViewButton from '../common/ObjectTableViewButton'
|
||||
import FilterSidebarButton from '../common/FilterSidebarButton'
|
||||
import SortSidebarButton from '../common/SortSidebarButton'
|
||||
@ -37,6 +38,10 @@ const ProductCategories = () => {
|
||||
<Flex vertical={'true'} gap='large' className='h-100'>
|
||||
<Flex justify='space-between' style={{ minHeight: 0 }} gap='small'>
|
||||
<Space>
|
||||
<BulkObjectActions
|
||||
type='productCategory'
|
||||
onReload={() => tableRef.current?.reload()}
|
||||
/>
|
||||
<ObjectActions
|
||||
type='productCategory'
|
||||
pageName='list'
|
||||
|
||||
@ -5,6 +5,7 @@ import { Flex, Space } from 'antd'
|
||||
import useColumnVisibility from '../hooks/useColumnVisibility'
|
||||
import ObjectTable from '../common/ObjectTable'
|
||||
import ObjectActions from '../common/ObjectActions'
|
||||
import BulkObjectActions from '../common/BulkObjectActions'
|
||||
import ObjectTableViewButton from '../common/ObjectTableViewButton'
|
||||
import FilterSidebarButton from '../common/FilterSidebarButton'
|
||||
import SortSidebarButton from '../common/SortSidebarButton'
|
||||
@ -37,6 +38,10 @@ const ProductSkus = () => {
|
||||
<Flex vertical={'true'} gap='large' className='h-100'>
|
||||
<Flex justify='space-between' style={{ minHeight: 0 }} gap='small'>
|
||||
<Space size='small'>
|
||||
<BulkObjectActions
|
||||
type='productSku'
|
||||
onReload={() => tableRef.current?.reload()}
|
||||
/>
|
||||
<ObjectActions
|
||||
type='productSku'
|
||||
pageName='list'
|
||||
|
||||
@ -17,6 +17,7 @@ import IdDisplay from '../common/IdDisplay'
|
||||
import TimeDisplay from '../common/TimeDisplay'
|
||||
import ObjectTable from '../common/ObjectTable'
|
||||
import ObjectActions from '../common/ObjectActions'
|
||||
import BulkObjectActions from '../common/BulkObjectActions'
|
||||
import ProductIcon from '../../Icons/ProductIcon'
|
||||
import InfoCircleIcon from '../../Icons/InfoCircleIcon'
|
||||
import XMarkIcon from '../../Icons/XMarkIcon'
|
||||
@ -309,6 +310,10 @@ const Products = () => {
|
||||
<Flex vertical={'true'} gap='large' className='h-100'>
|
||||
<Flex justify='space-between' style={{ minHeight: 0 }} gap='small'>
|
||||
<Space size='small'>
|
||||
<BulkObjectActions
|
||||
type='product'
|
||||
onReload={() => tableRef.current?.reload()}
|
||||
/>
|
||||
<ObjectActions
|
||||
type='product'
|
||||
pageName='list'
|
||||
|
||||
@ -2,6 +2,7 @@ import { useRef } from 'react'
|
||||
import { Flex, Space } from 'antd'
|
||||
import ObjectTable from '../common/ObjectTable'
|
||||
import ObjectActions from '../common/ObjectActions'
|
||||
import BulkObjectActions from '../common/BulkObjectActions'
|
||||
import useColumnVisibility from '../hooks/useColumnVisibility'
|
||||
import ObjectTableViewButton from '../common/ObjectTableViewButton'
|
||||
import FilterSidebarButton from '../common/FilterSidebarButton'
|
||||
@ -34,6 +35,10 @@ const StockAuditLevels = () => {
|
||||
<Flex vertical={'true'} gap='large' className='h-100'>
|
||||
<Flex justify='space-between' style={{ minHeight: 0 }} gap='small'>
|
||||
<Space size='small'>
|
||||
<BulkObjectActions
|
||||
type='stockAuditLevel'
|
||||
onReload={() => tableRef.current?.reload()}
|
||||
/>
|
||||
<ObjectActions
|
||||
type='stockAuditLevel'
|
||||
pageName='list'
|
||||
|
||||
@ -2,6 +2,7 @@ import { useRef } from 'react'
|
||||
import { Flex, Space } from 'antd'
|
||||
import ObjectTable from '../common/ObjectTable'
|
||||
import ObjectActions from '../common/ObjectActions'
|
||||
import BulkObjectActions from '../common/BulkObjectActions'
|
||||
import useColumnVisibility from '../hooks/useColumnVisibility'
|
||||
import ObjectTableViewButton from '../common/ObjectTableViewButton'
|
||||
import FilterSidebarButton from '../common/FilterSidebarButton'
|
||||
@ -34,6 +35,10 @@ const TaxRates = () => {
|
||||
<Flex vertical={'true'} gap='large' className='h-100'>
|
||||
<Flex justify='space-between' style={{ minHeight: 0 }} gap='small'>
|
||||
<Space size='small'>
|
||||
<BulkObjectActions
|
||||
type='taxRate'
|
||||
onReload={() => tableRef.current?.reload()}
|
||||
/>
|
||||
<ObjectActions
|
||||
type='taxRate'
|
||||
pageName='list'
|
||||
|
||||
@ -2,6 +2,7 @@ import { useRef } from 'react'
|
||||
import { Flex, Space } from 'antd'
|
||||
import ObjectTable from '../common/ObjectTable'
|
||||
import ObjectActions from '../common/ObjectActions'
|
||||
import BulkObjectActions from '../common/BulkObjectActions'
|
||||
import useColumnVisibility from '../hooks/useColumnVisibility'
|
||||
import ObjectTableViewButton from '../common/ObjectTableViewButton'
|
||||
import FilterSidebarButton from '../common/FilterSidebarButton'
|
||||
@ -34,6 +35,10 @@ const UserGroups = () => {
|
||||
<Flex vertical={'true'} gap='large' className='h-100'>
|
||||
<Flex justify='space-between' style={{ minHeight: 0 }} gap='small'>
|
||||
<Space size='small'>
|
||||
<BulkObjectActions
|
||||
type='userGroup'
|
||||
onReload={() => tableRef.current?.reload()}
|
||||
/>
|
||||
<ObjectActions
|
||||
type='userGroup'
|
||||
pageName='list'
|
||||
|
||||
@ -2,6 +2,7 @@ import { useRef } from 'react'
|
||||
import { Flex, Space } from 'antd'
|
||||
import ObjectTable from '../common/ObjectTable'
|
||||
import ObjectActions from '../common/ObjectActions'
|
||||
import BulkObjectActions from '../common/BulkObjectActions'
|
||||
import useColumnVisibility from '../hooks/useColumnVisibility'
|
||||
import ObjectTableViewButton from '../common/ObjectTableViewButton'
|
||||
import FilterSidebarButton from '../common/FilterSidebarButton'
|
||||
@ -34,6 +35,10 @@ const Users = () => {
|
||||
<Flex vertical={'true'} gap='large' className='h-100'>
|
||||
<Flex justify='space-between' style={{ minHeight: 0 }} gap='small'>
|
||||
<Space size='small'>
|
||||
<BulkObjectActions
|
||||
type='user'
|
||||
onReload={() => tableRef.current?.reload()}
|
||||
/>
|
||||
<ObjectActions
|
||||
type='user'
|
||||
pageName='list'
|
||||
|
||||
@ -2,6 +2,7 @@ import { useRef } from 'react'
|
||||
import { Flex, Space } from 'antd'
|
||||
import ObjectTable from '../common/ObjectTable'
|
||||
import ObjectActions from '../common/ObjectActions'
|
||||
import BulkObjectActions from '../common/BulkObjectActions'
|
||||
import useColumnVisibility from '../hooks/useColumnVisibility'
|
||||
import ObjectTableViewButton from '../common/ObjectTableViewButton'
|
||||
import FilterSidebarButton from '../common/FilterSidebarButton'
|
||||
@ -33,6 +34,10 @@ const Vendors = () => {
|
||||
<Flex vertical={'true'} gap='large' className='h-100'>
|
||||
<Flex justify='space-between' style={{ minHeight: 0 }} gap='small'>
|
||||
<Space size='small'>
|
||||
<BulkObjectActions
|
||||
type='vendor'
|
||||
onReload={() => tableRef.current?.reload()}
|
||||
/>
|
||||
<ObjectActions
|
||||
type='vendor'
|
||||
pageName='list'
|
||||
|
||||
@ -9,6 +9,7 @@ import FilterSidebarButton from '../common/FilterSidebarButton'
|
||||
import SortSidebarButton from '../common/SortSidebarButton'
|
||||
import ObjectTable from '../common/ObjectTable'
|
||||
import ObjectActions from '../common/ObjectActions'
|
||||
import BulkObjectActions from '../common/BulkObjectActions'
|
||||
import ObjectTableViewButton from '../common/ObjectTableViewButton'
|
||||
import useColumnVisibility from '../hooks/useColumnVisibility'
|
||||
import useFilterSidebarVisibility from '../hooks/useFilterSidebarVisibility'
|
||||
@ -33,6 +34,10 @@ const FilamentProfiles = () => {
|
||||
<Flex vertical={'true'} gap='large' className='h-100'>
|
||||
<Flex justify='space-between' style={{ minHeight: 0 }} gap='small'>
|
||||
<Space>
|
||||
<BulkObjectActions
|
||||
type='filamentProfile'
|
||||
onReload={() => tableRef.current?.reload()}
|
||||
/>
|
||||
<ObjectActions
|
||||
type='filamentProfile'
|
||||
pageName='list'
|
||||
|
||||
@ -5,6 +5,7 @@ import { Flex, Space } from 'antd'
|
||||
import useColumnVisibility from '../hooks/useColumnVisibility'
|
||||
import ObjectTable from '../common/ObjectTable'
|
||||
import ObjectActions from '../common/ObjectActions'
|
||||
import BulkObjectActions from '../common/BulkObjectActions'
|
||||
import ObjectTableViewButton from '../common/ObjectTableViewButton'
|
||||
import FilterSidebarButton from '../common/FilterSidebarButton'
|
||||
import SortSidebarButton from '../common/SortSidebarButton'
|
||||
@ -38,6 +39,10 @@ const GCodeFiles = () => {
|
||||
<Flex vertical={'true'} gap='large' className='h-100'>
|
||||
<Flex justify='space-between' style={{ minHeight: 0 }} gap='small'>
|
||||
<Space>
|
||||
<BulkObjectActions
|
||||
type='gcodeFile'
|
||||
onReload={() => tableRef.current?.reload()}
|
||||
/>
|
||||
<ObjectActions
|
||||
type='gcodeFile'
|
||||
pageName='list'
|
||||
|
||||
@ -5,6 +5,7 @@ import { Flex, Space } from 'antd'
|
||||
import useColumnVisibility from '../hooks/useColumnVisibility.jsx'
|
||||
import ObjectTable from '../common/ObjectTable.jsx'
|
||||
import ObjectActions from '../common/ObjectActions'
|
||||
import BulkObjectActions from '../common/BulkObjectActions'
|
||||
import ObjectTableViewButton from '../common/ObjectTableViewButton'
|
||||
import FilterSidebarButton from '../common/FilterSidebarButton'
|
||||
import SortSidebarButton from '../common/SortSidebarButton'
|
||||
@ -36,6 +37,10 @@ const Jobs = () => {
|
||||
<Flex vertical={'true'} gap='large' className='h-100'>
|
||||
<Flex justify='space-between' style={{ minHeight: 0 }} gap='small'>
|
||||
<Space size='small'>
|
||||
<BulkObjectActions
|
||||
type='job'
|
||||
onReload={() => tableRef.current?.reload()}
|
||||
/>
|
||||
<ObjectActions
|
||||
type='job'
|
||||
pageName='list'
|
||||
|
||||
@ -9,6 +9,7 @@ import FilterSidebarButton from '../common/FilterSidebarButton'
|
||||
import SortSidebarButton from '../common/SortSidebarButton'
|
||||
import ObjectTable from '../common/ObjectTable'
|
||||
import ObjectActions from '../common/ObjectActions'
|
||||
import BulkObjectActions from '../common/BulkObjectActions'
|
||||
import ObjectTableViewButton from '../common/ObjectTableViewButton'
|
||||
import useColumnVisibility from '../hooks/useColumnVisibility'
|
||||
import useFilterSidebarVisibility from '../hooks/useFilterSidebarVisibility'
|
||||
@ -32,6 +33,10 @@ const PrinterProfiles = () => {
|
||||
<Flex vertical={'true'} gap='large' className='h-100'>
|
||||
<Flex justify='space-between' style={{ minHeight: 0 }} gap='small'>
|
||||
<Space>
|
||||
<BulkObjectActions
|
||||
type='printerProfile'
|
||||
onReload={() => tableRef.current?.reload()}
|
||||
/>
|
||||
<ObjectActions
|
||||
type='printerProfile'
|
||||
pageName='list'
|
||||
|
||||
@ -4,6 +4,7 @@ import { useRef } from 'react'
|
||||
import { Space, Flex } from 'antd'
|
||||
import ObjectTable from '../common/ObjectTable'
|
||||
import ObjectActions from '../common/ObjectActions'
|
||||
import BulkObjectActions from '../common/BulkObjectActions'
|
||||
import ColumnViewButton from '../common/ColumnViewButton'
|
||||
import ExportListButton from '../common/ExportListButton'
|
||||
import ListViewTabs from '../common/ListViewTabs'
|
||||
@ -41,6 +42,10 @@ const Printers = () => {
|
||||
<Flex vertical={'true'} gap='large' className='h-100'>
|
||||
<Flex justify='space-between' style={{ minHeight: 0 }} gap='small'>
|
||||
<Space>
|
||||
<BulkObjectActions
|
||||
type='printer'
|
||||
onReload={() => tableRef.current?.reload()}
|
||||
/>
|
||||
<ObjectActions
|
||||
type='printer'
|
||||
pageName='list'
|
||||
|
||||
@ -5,6 +5,7 @@ import { Flex, Space } from 'antd'
|
||||
import useColumnVisibility from '../hooks/useColumnVisibility.jsx'
|
||||
import ObjectTable from '../common/ObjectTable.jsx'
|
||||
import ObjectActions from '../common/ObjectActions'
|
||||
import BulkObjectActions from '../common/BulkObjectActions'
|
||||
import ObjectTableViewButton from '../common/ObjectTableViewButton'
|
||||
import FilterSidebarButton from '../common/FilterSidebarButton'
|
||||
import SortSidebarButton from '../common/SortSidebarButton'
|
||||
@ -36,6 +37,10 @@ const SubJobs = () => {
|
||||
<Flex vertical={'true'} gap='large' className='h-100'>
|
||||
<Flex justify='space-between' style={{ minHeight: 0 }} gap='small'>
|
||||
<Space size='small'>
|
||||
<BulkObjectActions
|
||||
type='subJob'
|
||||
onReload={() => tableRef.current?.reload()}
|
||||
/>
|
||||
<ObjectActions
|
||||
type='subJob'
|
||||
pageName='list'
|
||||
|
||||
@ -2,6 +2,7 @@ import { useRef } from 'react'
|
||||
import { Flex, Space } from 'antd'
|
||||
import ObjectTable from '../common/ObjectTable'
|
||||
import ObjectActions from '../common/ObjectActions'
|
||||
import BulkObjectActions from '../common/BulkObjectActions'
|
||||
import useColumnVisibility from '../hooks/useColumnVisibility'
|
||||
import ObjectTableViewButton from '../common/ObjectTableViewButton'
|
||||
import FilterSidebarButton from '../common/FilterSidebarButton'
|
||||
@ -34,6 +35,10 @@ const Clients = () => {
|
||||
<Flex vertical={'true'} gap='large' className='h-100'>
|
||||
<Flex justify='space-between' style={{ minHeight: 0 }} gap='small'>
|
||||
<Space size='small'>
|
||||
<BulkObjectActions
|
||||
type='client'
|
||||
onReload={() => tableRef.current?.reload()}
|
||||
/>
|
||||
<ObjectActions
|
||||
type='client'
|
||||
pageName='list'
|
||||
|
||||
@ -2,6 +2,7 @@ import { useRef } from 'react'
|
||||
import { Flex, Space } from 'antd'
|
||||
import ObjectTable from '../common/ObjectTable'
|
||||
import ObjectActions from '../common/ObjectActions'
|
||||
import BulkObjectActions from '../common/BulkObjectActions'
|
||||
import useColumnVisibility from '../hooks/useColumnVisibility'
|
||||
import ObjectTableViewButton from '../common/ObjectTableViewButton'
|
||||
import FilterSidebarButton from '../common/FilterSidebarButton'
|
||||
@ -31,6 +32,10 @@ const FulfillmentPolicies = () => {
|
||||
<Flex vertical={'true'} gap='large' className='h-100'>
|
||||
<Flex justify='space-between' style={{ minHeight: 0 }} gap='small'>
|
||||
<Space size='small'>
|
||||
<BulkObjectActions
|
||||
type='fulfillmentPolicy'
|
||||
onReload={() => tableRef.current?.reload()}
|
||||
/>
|
||||
<ObjectActions
|
||||
type='fulfillmentPolicy'
|
||||
pageName='list'
|
||||
|
||||
@ -2,6 +2,7 @@ import { useRef } from 'react'
|
||||
import { Flex, Space } from 'antd'
|
||||
import ObjectTable from '../common/ObjectTable'
|
||||
import ObjectActions from '../common/ObjectActions'
|
||||
import BulkObjectActions from '../common/BulkObjectActions'
|
||||
import useColumnVisibility from '../hooks/useColumnVisibility'
|
||||
import ObjectTableViewButton from '../common/ObjectTableViewButton'
|
||||
import FilterSidebarButton from '../common/FilterSidebarButton'
|
||||
@ -35,6 +36,10 @@ const ListingVarients = () => {
|
||||
<Flex vertical={'true'} gap='large' className='h-100'>
|
||||
<Flex justify='space-between' style={{ minHeight: 0 }} gap='small'>
|
||||
<Space size='small'>
|
||||
<BulkObjectActions
|
||||
type='listingVarient'
|
||||
onReload={() => tableRef.current?.reload()}
|
||||
/>
|
||||
<ObjectActions
|
||||
type='listingVarient'
|
||||
pageName='list'
|
||||
|
||||
@ -2,6 +2,7 @@ import { useRef } from 'react'
|
||||
import { Flex, Space } from 'antd'
|
||||
import ObjectTable from '../common/ObjectTable'
|
||||
import ObjectActions from '../common/ObjectActions'
|
||||
import BulkObjectActions from '../common/BulkObjectActions'
|
||||
import useColumnVisibility from '../hooks/useColumnVisibility'
|
||||
import ObjectTableViewButton from '../common/ObjectTableViewButton'
|
||||
import FilterSidebarButton from '../common/FilterSidebarButton'
|
||||
@ -35,6 +36,10 @@ const Listings = () => {
|
||||
<Flex vertical={'true'} gap='large' className='h-100'>
|
||||
<Flex justify='space-between' style={{ minHeight: 0 }} gap='small'>
|
||||
<Space size='small'>
|
||||
<BulkObjectActions
|
||||
type='listing'
|
||||
onReload={() => tableRef.current?.reload()}
|
||||
/>
|
||||
<ObjectActions
|
||||
type='listing'
|
||||
pageName='list'
|
||||
|
||||
@ -2,6 +2,7 @@ import { useRef } from 'react'
|
||||
import { Flex, Space } from 'antd'
|
||||
import ObjectTable from '../common/ObjectTable'
|
||||
import ObjectActions from '../common/ObjectActions'
|
||||
import BulkObjectActions from '../common/BulkObjectActions'
|
||||
import useColumnVisibility from '../hooks/useColumnVisibility'
|
||||
import ObjectTableViewButton from '../common/ObjectTableViewButton'
|
||||
import FilterSidebarButton from '../common/FilterSidebarButton'
|
||||
@ -35,6 +36,10 @@ const Marketplaces = () => {
|
||||
<Flex vertical={'true'} gap='large' className='h-100'>
|
||||
<Flex justify='space-between' style={{ minHeight: 0 }} gap='small'>
|
||||
<Space size='small'>
|
||||
<BulkObjectActions
|
||||
type='marketplace'
|
||||
onReload={() => tableRef.current?.reload()}
|
||||
/>
|
||||
<ObjectActions
|
||||
type='marketplace'
|
||||
pageName='list'
|
||||
|
||||
@ -2,6 +2,7 @@ import { useRef } from 'react'
|
||||
import { Flex, Space } from 'antd'
|
||||
import ObjectTable from '../common/ObjectTable'
|
||||
import ObjectActions from '../common/ObjectActions'
|
||||
import BulkObjectActions from '../common/BulkObjectActions'
|
||||
import useColumnVisibility from '../hooks/useColumnVisibility'
|
||||
import ObjectTableViewButton from '../common/ObjectTableViewButton'
|
||||
import FilterSidebarButton from '../common/FilterSidebarButton'
|
||||
@ -30,6 +31,10 @@ const ReturnPolicies = () => {
|
||||
<Flex vertical={'true'} gap='large' className='h-100'>
|
||||
<Flex justify='space-between' style={{ minHeight: 0 }} gap='small'>
|
||||
<Space size='small'>
|
||||
<BulkObjectActions
|
||||
type='returnPolicy'
|
||||
onReload={() => tableRef.current?.reload()}
|
||||
/>
|
||||
<ObjectActions
|
||||
type='returnPolicy'
|
||||
pageName='list'
|
||||
|
||||
@ -2,6 +2,7 @@ import { useRef } from 'react'
|
||||
import { Flex, Space } from 'antd'
|
||||
import ObjectTable from '../common/ObjectTable'
|
||||
import ObjectActions from '../common/ObjectActions'
|
||||
import BulkObjectActions from '../common/BulkObjectActions'
|
||||
import useColumnVisibility from '../hooks/useColumnVisibility'
|
||||
import ObjectTableViewButton from '../common/ObjectTableViewButton'
|
||||
import FilterSidebarButton from '../common/FilterSidebarButton'
|
||||
@ -35,6 +36,10 @@ const SalesOrders = () => {
|
||||
<Flex vertical={'true'} gap='large' className='h-100'>
|
||||
<Flex justify='space-between' style={{ minHeight: 0 }} gap='small'>
|
||||
<Space size='small'>
|
||||
<BulkObjectActions
|
||||
type='salesOrder'
|
||||
onReload={() => tableRef.current?.reload()}
|
||||
/>
|
||||
<ObjectActions
|
||||
type='salesOrder'
|
||||
pageName='list'
|
||||
|
||||
196
src/components/Dashboard/common/BulkObjectActions.jsx
Normal file
196
src/components/Dashboard/common/BulkObjectActions.jsx
Normal file
@ -0,0 +1,196 @@
|
||||
import { useContext, useEffect, useMemo, useRef, useState } from 'react'
|
||||
import { Button, Divider, Dropdown, Flex, Modal } from 'antd'
|
||||
import PropTypes from 'prop-types'
|
||||
import { createElement } from 'react'
|
||||
import { getModelByName } from '../../../database/ObjectModels'
|
||||
import { hasActionPermission } from '../../../database/permissions'
|
||||
import { AuthContext } from '../context/AuthContext'
|
||||
import { ApiServerContext } from '../context/ApiServerContext'
|
||||
import { useObjectListView } from '../context/ObjectListViewContext'
|
||||
import { useMessageContext } from '../context/MessageContext'
|
||||
import MessageDialogView from './MessageDialogView'
|
||||
import BinIcon from '../../Icons/BinIcon'
|
||||
|
||||
const BulkObjectActions = ({ type, onReload }) => {
|
||||
const model = getModelByName(type)
|
||||
const { userProfile } = useContext(AuthContext)
|
||||
const { deleteObjects, fetchObjects } = useContext(ApiServerContext)
|
||||
const { showSuccess, showError } = useMessageContext()
|
||||
const { bulkSelection, clearBulkSelection } = useObjectListView()
|
||||
const [activeAction, setActiveAction] = useState(null)
|
||||
const [actionLoading, setActionLoading] = useState(false)
|
||||
const [selectedObjects, setSelectedObjects] = useState([])
|
||||
const [selectionLoading, setSelectionLoading] = useState(false)
|
||||
const fetchObjectsRef = useRef(fetchObjects)
|
||||
fetchObjectsRef.current = fetchObjects
|
||||
|
||||
const selectionKey = useMemo(
|
||||
() =>
|
||||
JSON.stringify({
|
||||
filter: bulkSelection?.filter || {},
|
||||
masterFilter: bulkSelection?.masterFilter || {}
|
||||
}),
|
||||
[bulkSelection?.filter, bulkSelection?.masterFilter]
|
||||
)
|
||||
|
||||
useEffect(() => {
|
||||
if (!bulkSelection) {
|
||||
setSelectedObjects([])
|
||||
setSelectionLoading(false)
|
||||
return
|
||||
}
|
||||
|
||||
let cancelled = false
|
||||
|
||||
const loadSelectedObjects = async () => {
|
||||
setSelectionLoading(true)
|
||||
try {
|
||||
if (Array.isArray(bulkSelection.selectedObjects)) {
|
||||
setSelectedObjects(bulkSelection.selectedObjects)
|
||||
return
|
||||
}
|
||||
|
||||
const objects = []
|
||||
const filter = {
|
||||
...(bulkSelection.masterFilter || {}),
|
||||
...(bulkSelection.filter || {})
|
||||
}
|
||||
let page = 1
|
||||
|
||||
while (!cancelled) {
|
||||
const result = await fetchObjectsRef.current(type, {
|
||||
page,
|
||||
limit: 100,
|
||||
filter
|
||||
})
|
||||
objects.push(...(result?.data || []))
|
||||
if (!result?.hasMore) break
|
||||
page += 1
|
||||
}
|
||||
|
||||
if (!cancelled) setSelectedObjects(objects)
|
||||
} catch (error) {
|
||||
console.error(`Error loading selected ${model.labelPlural}:`, error)
|
||||
if (!cancelled) setSelectedObjects([])
|
||||
} finally {
|
||||
if (!cancelled) setSelectionLoading(false)
|
||||
}
|
||||
}
|
||||
|
||||
loadSelectedObjects()
|
||||
return () => {
|
||||
cancelled = true
|
||||
}
|
||||
// selectionKey intentionally represents both selection filters.
|
||||
// eslint-disable-next-line react-hooks/exhaustive-deps
|
||||
}, [selectionKey, type])
|
||||
|
||||
const actions = useMemo(
|
||||
() =>
|
||||
(model.actions || []).filter(
|
||||
(action) =>
|
||||
action.bulk === true &&
|
||||
hasActionPermission(userProfile, model, action.name)
|
||||
),
|
||||
[model, userProfile]
|
||||
)
|
||||
|
||||
if (!bulkSelection || actions.length === 0) return null
|
||||
|
||||
const isActionDisabled = (action) => {
|
||||
if (selectionLoading || selectedObjects.length === 0) return true
|
||||
if (typeof action.disabled === 'function') {
|
||||
return selectedObjects
|
||||
.map((objectData) =>
|
||||
action.disabled({ ...objectData, _user: userProfile })
|
||||
)
|
||||
.every(Boolean)
|
||||
}
|
||||
return action.disabled === true
|
||||
}
|
||||
|
||||
const menu = {
|
||||
items: actions.map((action) => ({
|
||||
key: action.name,
|
||||
label: action.label,
|
||||
danger: action.danger === true,
|
||||
icon: action.icon ? createElement(action.icon) : undefined,
|
||||
disabled: isActionDisabled(action)
|
||||
})),
|
||||
onClick: ({ key }) => {
|
||||
const action = actions.find((item) => item.name === key)
|
||||
if (action) setActiveAction(action)
|
||||
}
|
||||
}
|
||||
|
||||
const closeModal = () => {
|
||||
if (!actionLoading) setActiveAction(null)
|
||||
}
|
||||
|
||||
const runBulkDelete = async () => {
|
||||
setActionLoading(true)
|
||||
try {
|
||||
const result = await deleteObjects(type, {
|
||||
filter: bulkSelection.filter || {},
|
||||
masterFilter: bulkSelection.masterFilter || {}
|
||||
})
|
||||
const deletedCount = result?.deletedCount || 0
|
||||
const failedCount = result?.failedCount || 0
|
||||
|
||||
showSuccess(
|
||||
`${deletedCount} ${deletedCount === 1 ? model.label.toLowerCase() : model.labelPlural.toLowerCase()} deleted successfully!`
|
||||
)
|
||||
if (failedCount > 0) {
|
||||
showError(
|
||||
`${failedCount} ${failedCount === 1 ? model.label.toLowerCase() : model.labelPlural.toLowerCase()} could not be deleted.`
|
||||
)
|
||||
}
|
||||
setActiveAction(null)
|
||||
clearBulkSelection()
|
||||
onReload?.()
|
||||
} catch (error) {
|
||||
console.error(`Error deleting ${model.labelPlural.toLowerCase()}:`, error)
|
||||
showError(`Failed to delete selected ${model.labelPlural.toLowerCase()}.`)
|
||||
} finally {
|
||||
setActionLoading(false)
|
||||
}
|
||||
}
|
||||
|
||||
return (
|
||||
<>
|
||||
<Flex align='center' gap='small'>
|
||||
<Dropdown menu={menu} trigger={['hover']}>
|
||||
<Button loading={selectionLoading}>Bulk</Button>
|
||||
</Dropdown>
|
||||
<Divider type='vertical' style={{ marginInline: 0, height: 18 }} />
|
||||
</Flex>
|
||||
<Modal
|
||||
open={activeAction != null}
|
||||
destroyOnHidden={true}
|
||||
width={520}
|
||||
onCancel={closeModal}
|
||||
footer={null}
|
||||
centered
|
||||
>
|
||||
{activeAction?.name === 'delete' && (
|
||||
<MessageDialogView
|
||||
icon={<BinIcon />}
|
||||
title={`Are you sure you want to delete the selected ${model.labelPlural.toLowerCase()}?`}
|
||||
description='This will permanently delete every object matching the selection.'
|
||||
onOk={runBulkDelete}
|
||||
okText='Delete'
|
||||
okLoading={actionLoading}
|
||||
danger
|
||||
/>
|
||||
)}
|
||||
</Modal>
|
||||
</>
|
||||
)
|
||||
}
|
||||
|
||||
BulkObjectActions.propTypes = {
|
||||
type: PropTypes.string.isRequired,
|
||||
onReload: PropTypes.func
|
||||
}
|
||||
|
||||
export default BulkObjectActions
|
||||
@ -185,7 +185,7 @@ const ObjectActions = ({
|
||||
const navigate = useNavigate()
|
||||
const location = useLocation()
|
||||
const { showActionsModal } = useActionsModal()
|
||||
const { setOnModalOk } = useActions()
|
||||
const { setOnModalOk, setCurrentObject, setCurrentObjectType } = useActions()
|
||||
const { userProfile } = useContext(AuthContext)
|
||||
const onReloadRef = useRef(onReload)
|
||||
onReloadRef.current = onReload
|
||||
@ -227,8 +227,11 @@ const ObjectActions = ({
|
||||
|
||||
const currentUrlWithActions = location.pathname + location.search
|
||||
|
||||
const openActionsModal = () =>
|
||||
const openActionsModal = () => {
|
||||
setCurrentObject(objectData)
|
||||
setCurrentObjectType(type)
|
||||
showActionsModal(id, type, objectData, pageName)
|
||||
}
|
||||
|
||||
const menu = {
|
||||
items: mapActionsToMenuItems(
|
||||
|
||||
@ -19,7 +19,8 @@ import {
|
||||
Space,
|
||||
Form,
|
||||
Splitter,
|
||||
Card
|
||||
Card,
|
||||
Checkbox
|
||||
} from 'antd'
|
||||
import { LoadingOutlined } from '@ant-design/icons'
|
||||
import PropTypes from 'prop-types'
|
||||
@ -403,6 +404,13 @@ const ObjectTable = forwardRef(
|
||||
}
|
||||
const tableRef = useRef(null)
|
||||
const model = getModelByName(type)
|
||||
const bulkActions =
|
||||
model.actions?.filter(
|
||||
(action) =>
|
||||
action.bulk === true &&
|
||||
hasActionPermission(userProfile, model, action.name)
|
||||
) || []
|
||||
const canBulkSelect = bulkActions.length > 0 && objectListView != null
|
||||
const activeFilterRef = useRef({})
|
||||
const tableSorterRef = useRef({})
|
||||
const listViewIdRef = useRef(listViewId)
|
||||
@ -1123,6 +1131,100 @@ const ObjectTable = forwardRef(
|
||||
[effectiveFilter, resolvedMasterFilter]
|
||||
)
|
||||
|
||||
const bulkSelection = objectListView?.bulkSelection
|
||||
const selectedRowIds = useMemo(
|
||||
() => bulkSelection?.selectedIds || [],
|
||||
[bulkSelection?.selectedIds]
|
||||
)
|
||||
const selectedRowIdSet = useMemo(
|
||||
() => new Set(selectedRowIds.map((id) => String(id))),
|
||||
[selectedRowIds]
|
||||
)
|
||||
const selectionScopeKey = useMemo(
|
||||
() =>
|
||||
JSON.stringify({
|
||||
type,
|
||||
viewMode: viewMode.type,
|
||||
filter: subscriptionFilter
|
||||
}),
|
||||
[subscriptionFilter, type, viewMode.type]
|
||||
)
|
||||
const previousSelectionScopeKeyRef = useRef(selectionScopeKey)
|
||||
|
||||
useEffect(() => {
|
||||
if (previousSelectionScopeKeyRef.current === selectionScopeKey) return
|
||||
previousSelectionScopeKeyRef.current = selectionScopeKey
|
||||
objectListView?.clearBulkSelection?.()
|
||||
}, [objectListView, selectionScopeKey])
|
||||
|
||||
const setExplicitSelection = useCallback(
|
||||
(ids) => {
|
||||
const uniqueIds = [...new Set(ids.map((id) => String(id)))]
|
||||
if (uniqueIds.length === 0) {
|
||||
objectListView?.clearBulkSelection?.()
|
||||
return
|
||||
}
|
||||
objectListView?.setBulkSelection?.({
|
||||
allMatching: false,
|
||||
selectedIds: uniqueIds,
|
||||
selectedObjects: uniqueIds
|
||||
.map((id) =>
|
||||
tableData.find((item) => String(item?._id) === String(id))
|
||||
)
|
||||
.filter(Boolean),
|
||||
filter: { _id: uniqueIds.join('|') },
|
||||
masterFilter: {}
|
||||
})
|
||||
},
|
||||
[objectListView, tableData]
|
||||
)
|
||||
|
||||
const toggleRowSelection = useCallback(
|
||||
(record, checked) => {
|
||||
if (!record?._id || record.isSkeleton) return
|
||||
const id = String(record._id)
|
||||
if (bulkSelection?.allMatching) {
|
||||
const loadedIds = tableData
|
||||
.filter((item) => !item?.isSkeleton && item?._id != null)
|
||||
.map((item) => String(item._id))
|
||||
setExplicitSelection(
|
||||
checked ? loadedIds : loadedIds.filter((itemId) => itemId !== id)
|
||||
)
|
||||
return
|
||||
}
|
||||
|
||||
const nextIds = checked
|
||||
? [...selectedRowIds, id]
|
||||
: selectedRowIds.filter((itemId) => String(itemId) !== id)
|
||||
setExplicitSelection(nextIds)
|
||||
},
|
||||
[
|
||||
bulkSelection?.allMatching,
|
||||
selectedRowIds,
|
||||
setExplicitSelection,
|
||||
tableData
|
||||
]
|
||||
)
|
||||
|
||||
const toggleSelectAll = useCallback(
|
||||
(checked) => {
|
||||
if (!checked) {
|
||||
objectListView?.clearBulkSelection?.()
|
||||
return
|
||||
}
|
||||
objectListView?.setBulkSelection?.({
|
||||
allMatching: true,
|
||||
selectedIds: [],
|
||||
selectedObjects: tableData.filter(
|
||||
(item) => !item?.isSkeleton && item?._id != null
|
||||
),
|
||||
filter: effectiveFilter,
|
||||
masterFilter: resolvedMasterFilter
|
||||
})
|
||||
},
|
||||
[effectiveFilter, objectListView, resolvedMasterFilter, tableData]
|
||||
)
|
||||
|
||||
const tableFilterContextValue = useMemo(
|
||||
() => ({
|
||||
filter: effectiveFilter,
|
||||
@ -1760,12 +1862,59 @@ const ObjectTable = forwardRef(
|
||||
// Table columns from model properties
|
||||
const columnsWithSkeleton = [
|
||||
{
|
||||
title: lazyLoading ? <LoadingOutlined /> : isCards ? model.icon : null,
|
||||
title:
|
||||
loading || lazyLoading ? (
|
||||
<div style={{ marginLeft: 7 }}>
|
||||
<LoadingOutlined style={{ fontSize: 14 }} />
|
||||
</div>
|
||||
) : canBulkSelect ? (
|
||||
<div style={{ marginLeft: 7 }}>
|
||||
<Checkbox
|
||||
checked={bulkSelection?.allMatching === true}
|
||||
indeterminate={
|
||||
!bulkSelection?.allMatching && selectedRowIds.length > 0
|
||||
}
|
||||
onChange={(event) => toggleSelectAll(event.target.checked)}
|
||||
aria-label={`Select all ${model.labelPlural || model.label}`}
|
||||
/>
|
||||
</div>
|
||||
) : isCards ? (
|
||||
model.icon
|
||||
) : null,
|
||||
key: 'icon',
|
||||
width: 45,
|
||||
fixed: 'left',
|
||||
render: () => {
|
||||
return <Flex justify='center'>{createElement(model.icon)}</Flex>
|
||||
render: (_, record) => {
|
||||
const selected =
|
||||
bulkSelection?.allMatching === true ||
|
||||
selectedRowIdSet.has(String(record?._id))
|
||||
|
||||
if (!canBulkSelect || record?.isSkeleton) {
|
||||
return <Flex justify='center'>{createElement(model.icon)}</Flex>
|
||||
}
|
||||
|
||||
return (
|
||||
<Flex justify='center'>
|
||||
<div
|
||||
className={classNames('object-table-select-cell', {
|
||||
'object-table-select-cell-selected': selected
|
||||
})}
|
||||
>
|
||||
<Checkbox
|
||||
checked={selected}
|
||||
onClick={(event) => event.stopPropagation()}
|
||||
onChange={(event) =>
|
||||
toggleRowSelection(record, event.target.checked)
|
||||
}
|
||||
className='object-table-row-checkbox'
|
||||
aria-label={`Select ${record?.name || record?._reference || record?._id}`}
|
||||
/>
|
||||
<div className='object-table-row-icon'>
|
||||
{createElement(model.icon)}
|
||||
</div>
|
||||
</div>
|
||||
</Flex>
|
||||
)
|
||||
}
|
||||
}
|
||||
]
|
||||
|
||||
@ -1641,6 +1641,37 @@ const ApiServerProvider = ({ children }) => {
|
||||
}
|
||||
}
|
||||
|
||||
const deleteObjects = async (
|
||||
type,
|
||||
{ filter = {}, masterFilter = {} } = {}
|
||||
) => {
|
||||
const deleteUrl = `${config.backendUrl}/${getObjectEndpoint(type)}/delete`
|
||||
logger.debug('Deleting objects by filter:', type, {
|
||||
filter,
|
||||
masterFilter
|
||||
})
|
||||
try {
|
||||
const response = await axios.delete(deleteUrl, {
|
||||
params: {
|
||||
filter: JSON.stringify(filter),
|
||||
masterFilter: JSON.stringify(masterFilter)
|
||||
},
|
||||
headers: {
|
||||
Accept: 'application/json',
|
||||
Authorization: `Bearer ${token}`
|
||||
}
|
||||
})
|
||||
logger.debug('Objects deleted successfully')
|
||||
return response.data
|
||||
} catch (err) {
|
||||
console.error(err)
|
||||
showError(err, () => {
|
||||
deleteObjects(type, { filter, masterFilter })
|
||||
})
|
||||
throw err
|
||||
}
|
||||
}
|
||||
|
||||
// Update filament information
|
||||
const createObject = async (type, value) => {
|
||||
const createUrl = `${config.backendUrl}/${getObjectEndpoint(type)}`
|
||||
@ -2910,6 +2941,7 @@ const ApiServerProvider = ({ children }) => {
|
||||
getObjectFunction,
|
||||
sendObjectFunction,
|
||||
deleteObject,
|
||||
deleteObjects,
|
||||
subscribeToObjectUpdates,
|
||||
subscribeToAllObjectUpdates,
|
||||
subscribeToObjectEvent,
|
||||
|
||||
@ -144,6 +144,11 @@ export const ObjectListViewProvider = ({ children, objectType, tableRef }) => {
|
||||
const [isEditing, setIsEditing] = useState(false)
|
||||
const [viewSyncReady, setViewSyncReady] = useState(false)
|
||||
const [userViewModeOverride, setUserViewModeOverride] = useState(null)
|
||||
const [bulkSelection, setBulkSelection] = useState(null)
|
||||
|
||||
const clearBulkSelection = useCallback(() => {
|
||||
setBulkSelection(null)
|
||||
}, [])
|
||||
|
||||
const editSnapshotRef = useRef([])
|
||||
const wasEditingRef = useRef(false)
|
||||
@ -295,6 +300,7 @@ export const ObjectListViewProvider = ({ children, objectType, tableRef }) => {
|
||||
setViewSyncReady(false)
|
||||
setViewsFetched(false)
|
||||
setActiveTabKey(ALL_TAB_KEY)
|
||||
clearBulkSelection()
|
||||
|
||||
const cached = readCachedViews(objectType)
|
||||
if (cached) {
|
||||
@ -308,7 +314,7 @@ export const ObjectListViewProvider = ({ children, objectType, tableRef }) => {
|
||||
setDraftViews([])
|
||||
setInitialLoading(true)
|
||||
}
|
||||
}, [objectType])
|
||||
}, [objectType, clearBulkSelection])
|
||||
|
||||
useEffect(() => {
|
||||
loadViews()
|
||||
@ -984,6 +990,9 @@ export const ObjectListViewProvider = ({ children, objectType, tableRef }) => {
|
||||
handleFilterSortChange,
|
||||
handleViewModeChange,
|
||||
userOverridesRef,
|
||||
bulkSelection,
|
||||
setBulkSelection,
|
||||
clearBulkSelection,
|
||||
reloadViews: () => loadViewsRef.current(true),
|
||||
viewTabSignatures
|
||||
}),
|
||||
@ -1013,6 +1022,8 @@ export const ObjectListViewProvider = ({ children, objectType, tableRef }) => {
|
||||
removeView,
|
||||
handleFilterSortChange,
|
||||
handleViewModeChange,
|
||||
bulkSelection,
|
||||
clearBulkSelection,
|
||||
viewTabSignatures
|
||||
]
|
||||
)
|
||||
|
||||
6
src/components/Icons/DuplicateIcon.jsx
Normal file
6
src/components/Icons/DuplicateIcon.jsx
Normal file
@ -0,0 +1,6 @@
|
||||
import Icon from '@ant-design/icons'
|
||||
import CustomIconSvg from '../../../assets/icons/duplicateicon.svg?react'
|
||||
|
||||
const DuplicateIcon = (props) => <Icon component={CustomIconSvg} {...props} />
|
||||
|
||||
export default DuplicateIcon
|
||||
@ -12,6 +12,9 @@ const RegenerateAppPasswordSecret = lazy(
|
||||
() =>
|
||||
import('../../components/Dashboard/Management/AppPasswords/RegenerateAppPasswordSecret')
|
||||
)
|
||||
const DeleteObject = lazy(
|
||||
() => import('../../components/Dashboard/common/DeleteObject')
|
||||
)
|
||||
import AppPasswordIcon from '../../components/Icons/AppPasswordIcon'
|
||||
import PlusIcon from '../../components/Icons/PlusIcon'
|
||||
import InfoCircleIcon from '../../components/Icons/InfoCircleIcon'
|
||||
@ -20,6 +23,8 @@ import CheckIcon from '../../components/Icons/CheckIcon'
|
||||
import XMarkIcon from '../../components/Icons/XMarkIcon'
|
||||
import LockIcon from '../../components/Icons/LockIcon'
|
||||
import ListIcon from '../../components/Icons/ListIcon'
|
||||
import DuplicateIcon from '../../components/Icons/DuplicateIcon'
|
||||
import BinIcon from '../../components/Icons/BinIcon'
|
||||
|
||||
export const AppPassword = {
|
||||
name: 'appPassword',
|
||||
@ -44,6 +49,16 @@ export const AppPassword = {
|
||||
})
|
||||
}
|
||||
},
|
||||
{
|
||||
name: 'duplicate',
|
||||
type: 'alias',
|
||||
objectType: 'appPassword',
|
||||
aliasAction: 'new',
|
||||
pageName: 'info',
|
||||
label: 'Duplicate',
|
||||
icon: DuplicateIcon,
|
||||
objectData: (objectData) => objectData
|
||||
},
|
||||
{
|
||||
name: 'list',
|
||||
type: 'page',
|
||||
@ -111,6 +126,20 @@ export const AppPassword = {
|
||||
onOk
|
||||
})
|
||||
}
|
||||
},
|
||||
{ type: 'divider' },
|
||||
{
|
||||
name: 'delete',
|
||||
bulk: true,
|
||||
type: 'modal',
|
||||
modalWidth: 520,
|
||||
modalCentered: true,
|
||||
label: 'Delete',
|
||||
icon: BinIcon,
|
||||
danger: true,
|
||||
content: (objectData, { onOk } = {}) => {
|
||||
return createElement(DeleteObject, { objectData, onOk })
|
||||
}
|
||||
}
|
||||
],
|
||||
pages: [
|
||||
|
||||
@ -17,6 +17,7 @@ import CheckIcon from '../../components/Icons/CheckIcon'
|
||||
import XMarkIcon from '../../components/Icons/XMarkIcon'
|
||||
import BinIcon from '../../components/Icons/BinIcon'
|
||||
import ListIcon from '../../components/Icons/ListIcon'
|
||||
import DuplicateIcon from '../../components/Icons/DuplicateIcon'
|
||||
|
||||
export const Client = {
|
||||
name: 'client',
|
||||
@ -41,6 +42,16 @@ export const Client = {
|
||||
})
|
||||
}
|
||||
},
|
||||
{
|
||||
name: 'duplicate',
|
||||
type: 'alias',
|
||||
objectType: 'client',
|
||||
aliasAction: 'new',
|
||||
pageName: 'info',
|
||||
label: 'Duplicate',
|
||||
icon: DuplicateIcon,
|
||||
objectData: (objectData) => objectData
|
||||
},
|
||||
{
|
||||
name: 'list',
|
||||
type: 'page',
|
||||
@ -91,6 +102,7 @@ export const Client = {
|
||||
{ type: 'divider' },
|
||||
{
|
||||
name: 'delete',
|
||||
bulk: true,
|
||||
type: 'modal',
|
||||
modalWidth: 520,
|
||||
modalCentered: true,
|
||||
|
||||
@ -17,6 +17,7 @@ import CheckIcon from '../../components/Icons/CheckIcon'
|
||||
import XMarkIcon from '../../components/Icons/XMarkIcon'
|
||||
import BinIcon from '../../components/Icons/BinIcon'
|
||||
import ListIcon from '../../components/Icons/ListIcon'
|
||||
import DuplicateIcon from '../../components/Icons/DuplicateIcon'
|
||||
|
||||
export const Courier = {
|
||||
name: 'courier',
|
||||
@ -41,6 +42,16 @@ export const Courier = {
|
||||
})
|
||||
}
|
||||
},
|
||||
{
|
||||
name: 'duplicate',
|
||||
type: 'alias',
|
||||
objectType: 'courier',
|
||||
aliasAction: 'new',
|
||||
pageName: 'info',
|
||||
label: 'Duplicate',
|
||||
icon: DuplicateIcon,
|
||||
objectData: (objectData) => objectData
|
||||
},
|
||||
{
|
||||
name: 'list',
|
||||
type: 'page',
|
||||
@ -91,6 +102,7 @@ export const Courier = {
|
||||
{ type: 'divider' },
|
||||
{
|
||||
name: 'delete',
|
||||
bulk: true,
|
||||
type: 'modal',
|
||||
modalWidth: 520,
|
||||
modalCentered: true,
|
||||
|
||||
@ -19,6 +19,7 @@ import CheckIcon from '../../components/Icons/CheckIcon'
|
||||
import XMarkIcon from '../../components/Icons/XMarkIcon'
|
||||
import BinIcon from '../../components/Icons/BinIcon'
|
||||
import ListIcon from '../../components/Icons/ListIcon'
|
||||
import DuplicateIcon from '../../components/Icons/DuplicateIcon'
|
||||
|
||||
export const CourierService = {
|
||||
name: 'courierService',
|
||||
@ -43,6 +44,16 @@ export const CourierService = {
|
||||
})
|
||||
}
|
||||
},
|
||||
{
|
||||
name: 'duplicate',
|
||||
type: 'alias',
|
||||
objectType: 'courierService',
|
||||
aliasAction: 'new',
|
||||
pageName: 'info',
|
||||
label: 'Duplicate',
|
||||
icon: DuplicateIcon,
|
||||
objectData: (objectData) => objectData
|
||||
},
|
||||
{
|
||||
name: 'list',
|
||||
type: 'page',
|
||||
@ -93,6 +104,7 @@ export const CourierService = {
|
||||
{ type: 'divider' },
|
||||
{
|
||||
name: 'delete',
|
||||
bulk: true,
|
||||
type: 'modal',
|
||||
modalWidth: 520,
|
||||
modalCentered: true,
|
||||
|
||||
@ -16,6 +16,7 @@ import XMarkIcon from '../../components/Icons/XMarkIcon'
|
||||
import DocumentJobIcon from '../../components/Icons/DocumentJobIcon'
|
||||
import dayjs from 'dayjs'
|
||||
import ListIcon from '../../components/Icons/ListIcon'
|
||||
import DuplicateIcon from '../../components/Icons/DuplicateIcon'
|
||||
|
||||
export const DocumentJob = {
|
||||
name: 'documentJob',
|
||||
@ -40,6 +41,16 @@ export const DocumentJob = {
|
||||
})
|
||||
}
|
||||
},
|
||||
{
|
||||
name: 'duplicate',
|
||||
type: 'alias',
|
||||
objectType: 'documentJob',
|
||||
aliasAction: 'new',
|
||||
pageName: 'info',
|
||||
label: 'Duplicate',
|
||||
icon: DuplicateIcon,
|
||||
objectData: (objectData) => objectData
|
||||
},
|
||||
{
|
||||
name: 'list',
|
||||
type: 'page',
|
||||
|
||||
@ -8,6 +8,9 @@ const NewDocumentPrinter = lazy(
|
||||
() =>
|
||||
import('../../components/Dashboard/Management/DocumentPrinters/NewDocumentPrinter')
|
||||
)
|
||||
const DeleteObject = lazy(
|
||||
() => import('../../components/Dashboard/common/DeleteObject')
|
||||
)
|
||||
import InfoCircleIcon from '../../components/Icons/InfoCircleIcon'
|
||||
import PlusIcon from '../../components/Icons/PlusIcon'
|
||||
import EditIcon from '../../components/Icons/EditIcon'
|
||||
@ -15,6 +18,8 @@ import CheckIcon from '../../components/Icons/CheckIcon'
|
||||
import XMarkIcon from '../../components/Icons/XMarkIcon'
|
||||
import DocumentPrinterIcon from '../../components/Icons/DocumentPrinterIcon'
|
||||
import ListIcon from '../../components/Icons/ListIcon'
|
||||
import DuplicateIcon from '../../components/Icons/DuplicateIcon'
|
||||
import BinIcon from '../../components/Icons/BinIcon'
|
||||
|
||||
export const DocumentPrinter = {
|
||||
name: 'documentPrinter',
|
||||
@ -39,6 +44,16 @@ export const DocumentPrinter = {
|
||||
})
|
||||
}
|
||||
},
|
||||
{
|
||||
name: 'duplicate',
|
||||
type: 'alias',
|
||||
objectType: 'documentPrinter',
|
||||
aliasAction: 'new',
|
||||
pageName: 'info',
|
||||
label: 'Duplicate',
|
||||
icon: DuplicateIcon,
|
||||
objectData: (objectData) => objectData
|
||||
},
|
||||
{
|
||||
name: 'list',
|
||||
type: 'page',
|
||||
@ -85,6 +100,20 @@ export const DocumentPrinter = {
|
||||
visible: (objectData) => {
|
||||
return objectData?._isEditing && objectData?._isEditing == true
|
||||
}
|
||||
},
|
||||
{ type: 'divider' },
|
||||
{
|
||||
name: 'delete',
|
||||
bulk: true,
|
||||
type: 'modal',
|
||||
modalWidth: 520,
|
||||
modalCentered: true,
|
||||
label: 'Delete',
|
||||
icon: BinIcon,
|
||||
danger: true,
|
||||
content: (objectData, { onOk } = {}) => {
|
||||
return createElement(DeleteObject, { objectData, onOk })
|
||||
}
|
||||
}
|
||||
],
|
||||
pages: [
|
||||
|
||||
@ -8,6 +8,9 @@ const NewDocumentSize = lazy(
|
||||
() =>
|
||||
import('../../components/Dashboard/Management/DocumentSizes/NewDocumentSize')
|
||||
)
|
||||
const DeleteObject = lazy(
|
||||
() => import('../../components/Dashboard/common/DeleteObject')
|
||||
)
|
||||
import InfoCircleIcon from '../../components/Icons/InfoCircleIcon'
|
||||
import PlusIcon from '../../components/Icons/PlusIcon'
|
||||
import EditIcon from '../../components/Icons/EditIcon'
|
||||
@ -15,6 +18,8 @@ import CheckIcon from '../../components/Icons/CheckIcon'
|
||||
import XMarkIcon from '../../components/Icons/XMarkIcon'
|
||||
import DocumentSizeIcon from '../../components/Icons/DocumentSizeIcon'
|
||||
import ListIcon from '../../components/Icons/ListIcon'
|
||||
import DuplicateIcon from '../../components/Icons/DuplicateIcon'
|
||||
import BinIcon from '../../components/Icons/BinIcon'
|
||||
|
||||
export const DocumentSize = {
|
||||
name: 'documentSize',
|
||||
@ -39,6 +44,16 @@ export const DocumentSize = {
|
||||
})
|
||||
}
|
||||
},
|
||||
{
|
||||
name: 'duplicate',
|
||||
type: 'alias',
|
||||
objectType: 'documentSize',
|
||||
aliasAction: 'new',
|
||||
pageName: 'info',
|
||||
label: 'Duplicate',
|
||||
icon: DuplicateIcon,
|
||||
objectData: (objectData) => objectData
|
||||
},
|
||||
{
|
||||
name: 'list',
|
||||
type: 'page',
|
||||
@ -85,6 +100,20 @@ export const DocumentSize = {
|
||||
visible: (objectData) => {
|
||||
return objectData?._isEditing && objectData?._isEditing == true
|
||||
}
|
||||
},
|
||||
{ type: 'divider' },
|
||||
{
|
||||
name: 'delete',
|
||||
bulk: true,
|
||||
type: 'modal',
|
||||
modalWidth: 520,
|
||||
modalCentered: true,
|
||||
label: 'Delete',
|
||||
icon: BinIcon,
|
||||
danger: true,
|
||||
content: (objectData, { onOk } = {}) => {
|
||||
return createElement(DeleteObject, { objectData, onOk })
|
||||
}
|
||||
}
|
||||
],
|
||||
pages: [
|
||||
|
||||
@ -8,6 +8,9 @@ const NewDocumentTemplate = lazy(
|
||||
() =>
|
||||
import('../../components/Dashboard/Management/DocumentTemplates/NewDocumentTemplate')
|
||||
)
|
||||
const DeleteObject = lazy(
|
||||
() => import('../../components/Dashboard/common/DeleteObject')
|
||||
)
|
||||
import InfoCircleIcon from '../../components/Icons/InfoCircleIcon'
|
||||
import PlusIcon from '../../components/Icons/PlusIcon'
|
||||
import EditIcon from '../../components/Icons/EditIcon'
|
||||
@ -16,6 +19,8 @@ import XMarkIcon from '../../components/Icons/XMarkIcon'
|
||||
import DesignIcon from '../../components/Icons/DesignIcon'
|
||||
import DocumentTemplateIcon from '../../components/Icons/DocumentTemplateIcon'
|
||||
import ListIcon from '../../components/Icons/ListIcon'
|
||||
import DuplicateIcon from '../../components/Icons/DuplicateIcon'
|
||||
import BinIcon from '../../components/Icons/BinIcon'
|
||||
|
||||
export const DocumentTemplate = {
|
||||
name: 'documentTemplate',
|
||||
@ -40,6 +45,16 @@ export const DocumentTemplate = {
|
||||
})
|
||||
}
|
||||
},
|
||||
{
|
||||
name: 'duplicate',
|
||||
type: 'alias',
|
||||
objectType: 'documentTemplate',
|
||||
aliasAction: 'new',
|
||||
pageName: 'info',
|
||||
label: 'Duplicate',
|
||||
icon: DuplicateIcon,
|
||||
objectData: (objectData) => objectData
|
||||
},
|
||||
{
|
||||
name: 'list',
|
||||
type: 'page',
|
||||
@ -94,6 +109,20 @@ export const DocumentTemplate = {
|
||||
visible: (objectData) => {
|
||||
return objectData?._isEditing && objectData?._isEditing == true
|
||||
}
|
||||
},
|
||||
{ type: 'divider' },
|
||||
{
|
||||
name: 'delete',
|
||||
bulk: true,
|
||||
type: 'modal',
|
||||
modalWidth: 520,
|
||||
modalCentered: true,
|
||||
label: 'Delete',
|
||||
icon: BinIcon,
|
||||
danger: true,
|
||||
content: (objectData, { onOk } = {}) => {
|
||||
return createElement(DeleteObject, { objectData, onOk })
|
||||
}
|
||||
}
|
||||
],
|
||||
pages: [
|
||||
|
||||
@ -8,6 +8,9 @@ const NewEmailAccount = lazy(
|
||||
() =>
|
||||
import('../../components/Dashboard/Management/EmailAccounts/NewEmailAccount')
|
||||
)
|
||||
const DeleteObject = lazy(
|
||||
() => import('../../components/Dashboard/common/DeleteObject')
|
||||
)
|
||||
import InfoCircleIcon from '../../components/Icons/InfoCircleIcon'
|
||||
import PlusIcon from '../../components/Icons/PlusIcon'
|
||||
import EditIcon from '../../components/Icons/EditIcon'
|
||||
@ -15,6 +18,8 @@ import CheckIcon from '../../components/Icons/CheckIcon'
|
||||
import XMarkIcon from '../../components/Icons/XMarkIcon'
|
||||
import ListIcon from '../../components/Icons/ListIcon'
|
||||
import EmailAccountIcon from '../../components/Icons/EmailAccountIcon'
|
||||
import DuplicateIcon from '../../components/Icons/DuplicateIcon'
|
||||
import BinIcon from '../../components/Icons/BinIcon'
|
||||
|
||||
export const EmailAccount = {
|
||||
name: 'emailAccount',
|
||||
@ -40,6 +45,16 @@ export const EmailAccount = {
|
||||
})
|
||||
}
|
||||
},
|
||||
{
|
||||
name: 'duplicate',
|
||||
type: 'alias',
|
||||
objectType: 'emailAccount',
|
||||
aliasAction: 'new',
|
||||
pageName: 'info',
|
||||
label: 'Duplicate',
|
||||
icon: DuplicateIcon,
|
||||
objectData: (objectData) => objectData
|
||||
},
|
||||
{
|
||||
name: 'list',
|
||||
type: 'page',
|
||||
@ -86,6 +101,20 @@ export const EmailAccount = {
|
||||
visible: (objectData) => {
|
||||
return objectData?._isEditing && objectData?._isEditing == true
|
||||
}
|
||||
},
|
||||
{ type: 'divider' },
|
||||
{
|
||||
name: 'delete',
|
||||
bulk: true,
|
||||
type: 'modal',
|
||||
modalWidth: 520,
|
||||
modalCentered: true,
|
||||
label: 'Delete',
|
||||
icon: BinIcon,
|
||||
danger: true,
|
||||
content: (objectData, { onOk } = {}) => {
|
||||
return createElement(DeleteObject, { objectData, onOk })
|
||||
}
|
||||
}
|
||||
],
|
||||
pages: [
|
||||
|
||||
@ -4,6 +4,7 @@ import InfoCircleIcon from '../../components/Icons/InfoCircleIcon'
|
||||
import PlusIcon from '../../components/Icons/PlusIcon'
|
||||
import ListIcon from '../../components/Icons/ListIcon'
|
||||
import EmailMessageIcon from '../../components/Icons/EmailMessageIcon'
|
||||
import DuplicateIcon from '../../components/Icons/DuplicateIcon'
|
||||
|
||||
const EmailMessageInfo = lazy(
|
||||
() =>
|
||||
@ -36,6 +37,16 @@ export const EmailMessage = {
|
||||
content: (objectData, { onOk } = {}) =>
|
||||
createElement(NewEmailMessage, { defaultValues: objectData, onOk })
|
||||
},
|
||||
{
|
||||
name: 'duplicate',
|
||||
type: 'alias',
|
||||
objectType: 'emailMessage',
|
||||
aliasAction: 'new',
|
||||
pageName: 'info',
|
||||
label: 'Duplicate',
|
||||
icon: DuplicateIcon,
|
||||
objectData: (objectData) => objectData
|
||||
},
|
||||
{
|
||||
name: 'list',
|
||||
type: 'page',
|
||||
|
||||
@ -8,6 +8,9 @@ const NewEmailTemplate = lazy(
|
||||
() =>
|
||||
import('../../components/Dashboard/Management/EmailTemplates/NewEmailTemplate')
|
||||
)
|
||||
const DeleteObject = lazy(
|
||||
() => import('../../components/Dashboard/common/DeleteObject')
|
||||
)
|
||||
import InfoCircleIcon from '../../components/Icons/InfoCircleIcon'
|
||||
import PlusIcon from '../../components/Icons/PlusIcon'
|
||||
import EditIcon from '../../components/Icons/EditIcon'
|
||||
@ -16,6 +19,8 @@ import XMarkIcon from '../../components/Icons/XMarkIcon'
|
||||
import DesignIcon from '../../components/Icons/DesignIcon'
|
||||
import ListIcon from '../../components/Icons/ListIcon'
|
||||
import EmailTemplateIcon from '../../components/Icons/EmailTemplateIcon'
|
||||
import DuplicateIcon from '../../components/Icons/DuplicateIcon'
|
||||
import BinIcon from '../../components/Icons/BinIcon'
|
||||
|
||||
export const EmailTemplate = {
|
||||
name: 'emailTemplate',
|
||||
@ -41,6 +46,16 @@ export const EmailTemplate = {
|
||||
})
|
||||
}
|
||||
},
|
||||
{
|
||||
name: 'duplicate',
|
||||
type: 'alias',
|
||||
objectType: 'emailTemplate',
|
||||
aliasAction: 'new',
|
||||
pageName: 'info',
|
||||
label: 'Duplicate',
|
||||
icon: DuplicateIcon,
|
||||
objectData: (objectData) => objectData
|
||||
},
|
||||
{
|
||||
name: 'list',
|
||||
type: 'page',
|
||||
@ -95,6 +110,20 @@ export const EmailTemplate = {
|
||||
visible: (objectData) => {
|
||||
return objectData?._isEditing && objectData?._isEditing == true
|
||||
}
|
||||
},
|
||||
{ type: 'divider' },
|
||||
{
|
||||
name: 'delete',
|
||||
bulk: true,
|
||||
type: 'modal',
|
||||
modalWidth: 520,
|
||||
modalCentered: true,
|
||||
label: 'Delete',
|
||||
icon: BinIcon,
|
||||
danger: true,
|
||||
content: (objectData, { onOk } = {}) => {
|
||||
return createElement(DeleteObject, { objectData, onOk })
|
||||
}
|
||||
}
|
||||
],
|
||||
pages: [
|
||||
|
||||
@ -17,6 +17,7 @@ import FilamentIcon from '../../components/Icons/FilamentIcon'
|
||||
import InfoCircleIcon from '../../components/Icons/InfoCircleIcon'
|
||||
import BinIcon from '../../components/Icons/BinIcon'
|
||||
import ListIcon from '../../components/Icons/ListIcon'
|
||||
import DuplicateIcon from '../../components/Icons/DuplicateIcon'
|
||||
|
||||
export const Filament = {
|
||||
name: 'filament',
|
||||
@ -41,6 +42,16 @@ export const Filament = {
|
||||
})
|
||||
}
|
||||
},
|
||||
{
|
||||
name: 'duplicate',
|
||||
type: 'alias',
|
||||
objectType: 'filament',
|
||||
aliasAction: 'new',
|
||||
pageName: 'info',
|
||||
label: 'Duplicate',
|
||||
icon: DuplicateIcon,
|
||||
objectData: (objectData) => objectData
|
||||
},
|
||||
{
|
||||
name: 'list',
|
||||
type: 'page',
|
||||
@ -102,6 +113,7 @@ export const Filament = {
|
||||
{ type: 'divider' },
|
||||
{
|
||||
name: 'delete',
|
||||
bulk: true,
|
||||
type: 'modal',
|
||||
modalWidth: 520,
|
||||
modalCentered: true,
|
||||
|
||||
@ -19,6 +19,7 @@ import CheckIcon from '../../components/Icons/CheckIcon'
|
||||
import XMarkIcon from '../../components/Icons/XMarkIcon'
|
||||
import BinIcon from '../../components/Icons/BinIcon'
|
||||
import ListIcon from '../../components/Icons/ListIcon'
|
||||
import DuplicateIcon from '../../components/Icons/DuplicateIcon'
|
||||
|
||||
export const FilamentProfile = {
|
||||
name: 'filamentProfile',
|
||||
@ -43,6 +44,16 @@ export const FilamentProfile = {
|
||||
})
|
||||
}
|
||||
},
|
||||
{
|
||||
name: 'duplicate',
|
||||
type: 'alias',
|
||||
objectType: 'filamentProfile',
|
||||
aliasAction: 'new',
|
||||
pageName: 'info',
|
||||
label: 'Duplicate',
|
||||
icon: DuplicateIcon,
|
||||
objectData: (objectData) => objectData
|
||||
},
|
||||
{
|
||||
name: 'list',
|
||||
type: 'page',
|
||||
@ -93,6 +104,7 @@ export const FilamentProfile = {
|
||||
{ type: 'divider' },
|
||||
{
|
||||
name: 'delete',
|
||||
bulk: true,
|
||||
type: 'modal',
|
||||
modalWidth: 520,
|
||||
modalCentered: true,
|
||||
|
||||
@ -19,6 +19,7 @@ import CheckIcon from '../../components/Icons/CheckIcon'
|
||||
import XMarkIcon from '../../components/Icons/XMarkIcon'
|
||||
import BinIcon from '../../components/Icons/BinIcon'
|
||||
import ListIcon from '../../components/Icons/ListIcon'
|
||||
import DuplicateIcon from '../../components/Icons/DuplicateIcon'
|
||||
|
||||
export const FilamentSku = {
|
||||
name: 'filamentSku',
|
||||
@ -43,6 +44,16 @@ export const FilamentSku = {
|
||||
})
|
||||
}
|
||||
},
|
||||
{
|
||||
name: 'duplicate',
|
||||
type: 'alias',
|
||||
objectType: 'filamentSku',
|
||||
aliasAction: 'new',
|
||||
pageName: 'info',
|
||||
label: 'Duplicate',
|
||||
icon: DuplicateIcon,
|
||||
objectData: (objectData) => objectData
|
||||
},
|
||||
{
|
||||
name: 'list',
|
||||
type: 'page',
|
||||
@ -93,6 +104,7 @@ export const FilamentSku = {
|
||||
{ type: 'divider' },
|
||||
{
|
||||
name: 'delete',
|
||||
bulk: true,
|
||||
type: 'modal',
|
||||
modalWidth: 520,
|
||||
modalCentered: true,
|
||||
|
||||
@ -23,6 +23,7 @@ import CheckIcon from '../../components/Icons/CheckIcon'
|
||||
import XMarkIcon from '../../components/Icons/XMarkIcon'
|
||||
import BinIcon from '../../components/Icons/BinIcon'
|
||||
import ListIcon from '../../components/Icons/ListIcon'
|
||||
import DuplicateIcon from '../../components/Icons/DuplicateIcon'
|
||||
|
||||
export const FilamentStock = {
|
||||
name: 'filamentStock',
|
||||
@ -47,6 +48,16 @@ export const FilamentStock = {
|
||||
})
|
||||
}
|
||||
},
|
||||
{
|
||||
name: 'duplicate',
|
||||
type: 'alias',
|
||||
objectType: 'filamentStock',
|
||||
aliasAction: 'new',
|
||||
pageName: 'info',
|
||||
label: 'Duplicate',
|
||||
icon: DuplicateIcon,
|
||||
objectData: (objectData) => objectData
|
||||
},
|
||||
{
|
||||
name: 'list',
|
||||
type: 'page',
|
||||
@ -99,6 +110,7 @@ export const FilamentStock = {
|
||||
},
|
||||
{
|
||||
name: 'delete',
|
||||
bulk: true,
|
||||
type: 'modal',
|
||||
modalWidth: 520,
|
||||
modalCentered: true,
|
||||
|
||||
@ -90,6 +90,7 @@ export const File = {
|
||||
{ type: 'divider' },
|
||||
{
|
||||
name: 'delete',
|
||||
bulk: true,
|
||||
type: 'modal',
|
||||
modalWidth: 520,
|
||||
modalCentered: true,
|
||||
|
||||
@ -20,6 +20,7 @@ import XMarkIcon from '../../components/Icons/XMarkIcon'
|
||||
import BinIcon from '../../components/Icons/BinIcon'
|
||||
import ListIcon from '../../components/Icons/ListIcon'
|
||||
import { marketplaceSyncMappingsProperty } from './marketplaceMappings'
|
||||
import DuplicateIcon from '../../components/Icons/DuplicateIcon'
|
||||
|
||||
export const FulfillmentPolicy = {
|
||||
name: 'fulfillmentPolicy',
|
||||
@ -45,6 +46,16 @@ export const FulfillmentPolicy = {
|
||||
})
|
||||
}
|
||||
},
|
||||
{
|
||||
name: 'duplicate',
|
||||
type: 'alias',
|
||||
objectType: 'fulfillmentPolicy',
|
||||
aliasAction: 'new',
|
||||
pageName: 'info',
|
||||
label: 'Duplicate',
|
||||
icon: DuplicateIcon,
|
||||
objectData: (objectData) => objectData
|
||||
},
|
||||
{
|
||||
name: 'list',
|
||||
type: 'page',
|
||||
@ -95,6 +106,7 @@ export const FulfillmentPolicy = {
|
||||
{ type: 'divider' },
|
||||
{
|
||||
name: 'delete',
|
||||
bulk: true,
|
||||
type: 'modal',
|
||||
modalWidth: 520,
|
||||
modalCentered: true,
|
||||
|
||||
@ -6,6 +6,9 @@ const GCodeFileInfo = lazy(
|
||||
const NewGCodeFile = lazy(
|
||||
() => import('../../components/Dashboard/Production/GCodeFiles/NewGCodeFile')
|
||||
)
|
||||
const DeleteObject = lazy(
|
||||
() => import('../../components/Dashboard/common/DeleteObject')
|
||||
)
|
||||
import DownloadIcon from '../../components/Icons/DownloadIcon'
|
||||
import PlusIcon from '../../components/Icons/PlusIcon'
|
||||
import EditIcon from '../../components/Icons/EditIcon'
|
||||
@ -15,6 +18,8 @@ import GCodeFileIcon from '../../components/Icons/GCodeFileIcon'
|
||||
import InfoCircleIcon from '../../components/Icons/InfoCircleIcon'
|
||||
import EyeIcon from '../../components/Icons/EyeIcon'
|
||||
import ListIcon from '../../components/Icons/ListIcon'
|
||||
import DuplicateIcon from '../../components/Icons/DuplicateIcon'
|
||||
import BinIcon from '../../components/Icons/BinIcon'
|
||||
|
||||
export const GCodeFile = {
|
||||
name: 'gcodeFile',
|
||||
@ -35,6 +40,16 @@ export const GCodeFile = {
|
||||
return createElement(NewGCodeFile, { defaultValues: objectData, onOk, reset: true })
|
||||
}
|
||||
},
|
||||
{
|
||||
name: 'duplicate',
|
||||
type: 'alias',
|
||||
objectType: 'gcodeFile',
|
||||
aliasAction: 'new',
|
||||
pageName: 'info',
|
||||
label: 'Duplicate',
|
||||
icon: DuplicateIcon,
|
||||
objectData: (objectData) => objectData
|
||||
},
|
||||
{
|
||||
name: 'list',
|
||||
type: 'page',
|
||||
@ -97,6 +112,20 @@ export const GCodeFile = {
|
||||
visible: (objectData) => {
|
||||
return objectData?._isEditing && objectData?._isEditing == true
|
||||
}
|
||||
},
|
||||
{ type: 'divider' },
|
||||
{
|
||||
name: 'delete',
|
||||
bulk: true,
|
||||
type: 'modal',
|
||||
modalWidth: 520,
|
||||
modalCentered: true,
|
||||
label: 'Delete',
|
||||
icon: BinIcon,
|
||||
danger: true,
|
||||
content: (objectData, { onOk } = {}) => {
|
||||
return createElement(DeleteObject, { objectData, onOk })
|
||||
}
|
||||
}
|
||||
],
|
||||
pages: [
|
||||
|
||||
@ -21,6 +21,7 @@ import XMarkIcon from '../../components/Icons/XMarkIcon'
|
||||
import BinIcon from '../../components/Icons/BinIcon'
|
||||
import OTPIcon from '../../components/Icons/OTPIcon'
|
||||
import ListIcon from '../../components/Icons/ListIcon'
|
||||
import DuplicateIcon from '../../components/Icons/DuplicateIcon'
|
||||
|
||||
export const Host = {
|
||||
name: 'host',
|
||||
@ -45,6 +46,16 @@ export const Host = {
|
||||
})
|
||||
}
|
||||
},
|
||||
{
|
||||
name: 'duplicate',
|
||||
type: 'alias',
|
||||
objectType: 'host',
|
||||
aliasAction: 'new',
|
||||
pageName: 'info',
|
||||
label: 'Duplicate',
|
||||
icon: DuplicateIcon,
|
||||
objectData: (objectData) => objectData
|
||||
},
|
||||
{
|
||||
name: 'list',
|
||||
type: 'page',
|
||||
@ -107,6 +118,7 @@ export const Host = {
|
||||
},
|
||||
{
|
||||
name: 'delete',
|
||||
bulk: true,
|
||||
type: 'modal',
|
||||
modalWidth: 520,
|
||||
modalCentered: true,
|
||||
|
||||
@ -23,6 +23,7 @@ import EditIcon from '../../components/Icons/EditIcon'
|
||||
import XMarkIcon from '../../components/Icons/XMarkIcon'
|
||||
import BinIcon from '../../components/Icons/BinIcon'
|
||||
import ListIcon from '../../components/Icons/ListIcon'
|
||||
import DuplicateIcon from '../../components/Icons/DuplicateIcon'
|
||||
|
||||
export const Invoice = {
|
||||
name: 'invoice',
|
||||
@ -47,6 +48,16 @@ export const Invoice = {
|
||||
})
|
||||
}
|
||||
},
|
||||
{
|
||||
name: 'duplicate',
|
||||
type: 'alias',
|
||||
objectType: 'invoice',
|
||||
aliasAction: 'new',
|
||||
pageName: 'info',
|
||||
label: 'Duplicate',
|
||||
icon: DuplicateIcon,
|
||||
objectData: (objectData) => objectData
|
||||
},
|
||||
{
|
||||
name: 'list',
|
||||
type: 'page',
|
||||
@ -99,6 +110,7 @@ export const Invoice = {
|
||||
},
|
||||
{
|
||||
name: 'delete',
|
||||
bulk: true,
|
||||
type: 'modal',
|
||||
modalWidth: 520,
|
||||
modalCentered: true,
|
||||
|
||||
@ -21,6 +21,7 @@ import EditIcon from '../../components/Icons/EditIcon'
|
||||
import BinIcon from '../../components/Icons/BinIcon'
|
||||
import dayjs from 'dayjs'
|
||||
import ListIcon from '../../components/Icons/ListIcon'
|
||||
import DuplicateIcon from '../../components/Icons/DuplicateIcon'
|
||||
|
||||
export const Job = {
|
||||
name: 'job',
|
||||
@ -45,6 +46,16 @@ export const Job = {
|
||||
})
|
||||
}
|
||||
},
|
||||
{
|
||||
name: 'duplicate',
|
||||
type: 'alias',
|
||||
objectType: 'job',
|
||||
aliasAction: 'new',
|
||||
pageName: 'info',
|
||||
label: 'Duplicate',
|
||||
icon: DuplicateIcon,
|
||||
objectData: (objectData) => objectData
|
||||
},
|
||||
{
|
||||
name: 'list',
|
||||
type: 'page',
|
||||
@ -97,6 +108,7 @@ export const Job = {
|
||||
},
|
||||
{
|
||||
name: 'delete',
|
||||
bulk: true,
|
||||
type: 'modal',
|
||||
modalWidth: 520,
|
||||
modalCentered: true,
|
||||
|
||||
@ -23,6 +23,7 @@ import CheckIcon from '../../components/Icons/CheckIcon'
|
||||
import XMarkIcon from '../../components/Icons/XMarkIcon'
|
||||
import BinIcon from '../../components/Icons/BinIcon'
|
||||
import ListIcon from '../../components/Icons/ListIcon'
|
||||
import DuplicateIcon from '../../components/Icons/DuplicateIcon'
|
||||
|
||||
export const Listing = {
|
||||
name: 'listing',
|
||||
@ -47,6 +48,16 @@ export const Listing = {
|
||||
})
|
||||
}
|
||||
},
|
||||
{
|
||||
name: 'duplicate',
|
||||
type: 'alias',
|
||||
objectType: 'listing',
|
||||
aliasAction: 'new',
|
||||
pageName: 'info',
|
||||
label: 'Duplicate',
|
||||
icon: DuplicateIcon,
|
||||
objectData: (objectData) => objectData
|
||||
},
|
||||
{
|
||||
name: 'list',
|
||||
type: 'page',
|
||||
@ -139,6 +150,7 @@ export const Listing = {
|
||||
{ type: 'divider' },
|
||||
{
|
||||
name: 'delete',
|
||||
bulk: true,
|
||||
type: 'modal',
|
||||
modalWidth: 520,
|
||||
modalCentered: true,
|
||||
|
||||
@ -27,6 +27,7 @@ import CheckIcon from '../../components/Icons/CheckIcon'
|
||||
import XMarkIcon from '../../components/Icons/XMarkIcon'
|
||||
import BinIcon from '../../components/Icons/BinIcon'
|
||||
import ListIcon from '../../components/Icons/ListIcon'
|
||||
import DuplicateIcon from '../../components/Icons/DuplicateIcon'
|
||||
|
||||
export const ListingVarient = {
|
||||
name: 'listingVarient',
|
||||
@ -51,6 +52,16 @@ export const ListingVarient = {
|
||||
})
|
||||
}
|
||||
},
|
||||
{
|
||||
name: 'duplicate',
|
||||
type: 'alias',
|
||||
objectType: 'listingVarient',
|
||||
aliasAction: 'new',
|
||||
pageName: 'info',
|
||||
label: 'Duplicate',
|
||||
icon: DuplicateIcon,
|
||||
objectData: (objectData) => objectData
|
||||
},
|
||||
{
|
||||
name: 'list',
|
||||
type: 'page',
|
||||
@ -135,6 +146,7 @@ export const ListingVarient = {
|
||||
{ type: 'divider' },
|
||||
{
|
||||
name: 'delete',
|
||||
bulk: true,
|
||||
type: 'modal',
|
||||
modalWidth: 520,
|
||||
modalCentered: true,
|
||||
|
||||
@ -47,6 +47,7 @@ import ReloadIcon from '../../components/Icons/ReloadIcon'
|
||||
import LinkIcon from '../../components/Icons/LinkIcon'
|
||||
import BinIcon from '../../components/Icons/BinIcon'
|
||||
import ListIcon from '../../components/Icons/ListIcon'
|
||||
import DuplicateIcon from '../../components/Icons/DuplicateIcon'
|
||||
|
||||
export const Marketplace = {
|
||||
name: 'marketplace',
|
||||
@ -71,6 +72,16 @@ export const Marketplace = {
|
||||
})
|
||||
}
|
||||
},
|
||||
{
|
||||
name: 'duplicate',
|
||||
type: 'alias',
|
||||
objectType: 'marketplace',
|
||||
aliasAction: 'new',
|
||||
pageName: 'info',
|
||||
label: 'Duplicate',
|
||||
icon: DuplicateIcon,
|
||||
objectData: (objectData) => objectData
|
||||
},
|
||||
{
|
||||
name: 'list',
|
||||
type: 'page',
|
||||
@ -271,6 +282,7 @@ export const Marketplace = {
|
||||
{ type: 'divider' },
|
||||
{
|
||||
name: 'delete',
|
||||
bulk: true,
|
||||
type: 'modal',
|
||||
modalWidth: 520,
|
||||
modalCentered: true,
|
||||
|
||||
@ -17,6 +17,7 @@ import CheckIcon from '../../components/Icons/CheckIcon'
|
||||
import XMarkIcon from '../../components/Icons/XMarkIcon'
|
||||
import BinIcon from '../../components/Icons/BinIcon'
|
||||
import ListIcon from '../../components/Icons/ListIcon'
|
||||
import DuplicateIcon from '../../components/Icons/DuplicateIcon'
|
||||
|
||||
export const Material = {
|
||||
name: 'material',
|
||||
@ -41,6 +42,16 @@ export const Material = {
|
||||
})
|
||||
}
|
||||
},
|
||||
{
|
||||
name: 'duplicate',
|
||||
type: 'alias',
|
||||
objectType: 'material',
|
||||
aliasAction: 'new',
|
||||
pageName: 'info',
|
||||
label: 'Duplicate',
|
||||
icon: DuplicateIcon,
|
||||
objectData: (objectData) => objectData
|
||||
},
|
||||
{
|
||||
name: 'list',
|
||||
type: 'page',
|
||||
@ -91,6 +102,7 @@ export const Material = {
|
||||
{ type: 'divider' },
|
||||
{
|
||||
name: 'delete',
|
||||
bulk: true,
|
||||
type: 'modal',
|
||||
modalWidth: 520,
|
||||
modalCentered: true,
|
||||
|
||||
@ -6,6 +6,9 @@ const NoteTypeInfo = lazy(
|
||||
const NewNoteType = lazy(
|
||||
() => import('../../components/Dashboard/Management/NoteTypes/NewNoteType')
|
||||
)
|
||||
const DeleteObject = lazy(
|
||||
() => import('../../components/Dashboard/common/DeleteObject')
|
||||
)
|
||||
import NoteTypeIcon from '../../components/Icons/NoteTypeIcon'
|
||||
import PlusIcon from '../../components/Icons/PlusIcon'
|
||||
import InfoCircleIcon from '../../components/Icons/InfoCircleIcon'
|
||||
@ -13,6 +16,8 @@ import EditIcon from '../../components/Icons/EditIcon'
|
||||
import CheckIcon from '../../components/Icons/CheckIcon'
|
||||
import XMarkIcon from '../../components/Icons/XMarkIcon'
|
||||
import ListIcon from '../../components/Icons/ListIcon'
|
||||
import DuplicateIcon from '../../components/Icons/DuplicateIcon'
|
||||
import BinIcon from '../../components/Icons/BinIcon'
|
||||
|
||||
export const NoteType = {
|
||||
name: 'noteType',
|
||||
@ -37,6 +42,16 @@ export const NoteType = {
|
||||
})
|
||||
}
|
||||
},
|
||||
{
|
||||
name: 'duplicate',
|
||||
type: 'alias',
|
||||
objectType: 'noteType',
|
||||
aliasAction: 'new',
|
||||
pageName: 'info',
|
||||
label: 'Duplicate',
|
||||
icon: DuplicateIcon,
|
||||
objectData: (objectData) => objectData
|
||||
},
|
||||
{
|
||||
name: 'list',
|
||||
type: 'page',
|
||||
@ -83,6 +98,20 @@ export const NoteType = {
|
||||
visible: (objectData) => {
|
||||
return objectData?._isEditing && objectData?._isEditing == true
|
||||
}
|
||||
},
|
||||
{ type: 'divider' },
|
||||
{
|
||||
name: 'delete',
|
||||
bulk: true,
|
||||
type: 'modal',
|
||||
modalWidth: 520,
|
||||
modalCentered: true,
|
||||
label: 'Delete',
|
||||
icon: BinIcon,
|
||||
danger: true,
|
||||
content: (objectData, { onOk } = {}) => {
|
||||
return createElement(DeleteObject, { objectData, onOk })
|
||||
}
|
||||
}
|
||||
],
|
||||
pages: [
|
||||
|
||||
@ -17,6 +17,7 @@ import CheckIcon from '../../components/Icons/CheckIcon'
|
||||
import XMarkIcon from '../../components/Icons/XMarkIcon'
|
||||
import BinIcon from '../../components/Icons/BinIcon'
|
||||
import ListIcon from '../../components/Icons/ListIcon'
|
||||
import DuplicateIcon from '../../components/Icons/DuplicateIcon'
|
||||
|
||||
export const OrderItem = {
|
||||
name: 'orderItem',
|
||||
@ -41,6 +42,16 @@ export const OrderItem = {
|
||||
})
|
||||
}
|
||||
},
|
||||
{
|
||||
name: 'duplicate',
|
||||
type: 'alias',
|
||||
objectType: 'orderItem',
|
||||
aliasAction: 'new',
|
||||
pageName: 'info',
|
||||
label: 'Duplicate',
|
||||
icon: DuplicateIcon,
|
||||
objectData: (objectData) => objectData
|
||||
},
|
||||
{
|
||||
name: 'list',
|
||||
type: 'page',
|
||||
@ -93,6 +104,7 @@ export const OrderItem = {
|
||||
},
|
||||
{
|
||||
name: 'delete',
|
||||
bulk: true,
|
||||
type: 'modal',
|
||||
modalWidth: 520,
|
||||
modalCentered: true,
|
||||
|
||||
@ -6,6 +6,9 @@ const PartInfo = lazy(
|
||||
const NewPart = lazy(
|
||||
() => import('../../components/Dashboard/Management/Parts/NewPart')
|
||||
)
|
||||
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'
|
||||
@ -13,6 +16,8 @@ import XMarkIcon from '../../components/Icons/XMarkIcon'
|
||||
import InfoCircleIcon from '../../components/Icons/InfoCircleIcon'
|
||||
import PartIcon from '../../components/Icons/PartIcon'
|
||||
import ListIcon from '../../components/Icons/ListIcon'
|
||||
import DuplicateIcon from '../../components/Icons/DuplicateIcon'
|
||||
import BinIcon from '../../components/Icons/BinIcon'
|
||||
|
||||
export const Part = {
|
||||
name: 'part',
|
||||
@ -37,6 +42,16 @@ export const Part = {
|
||||
})
|
||||
}
|
||||
},
|
||||
{
|
||||
name: 'duplicate',
|
||||
type: 'alias',
|
||||
objectType: 'part',
|
||||
aliasAction: 'new',
|
||||
pageName: 'info',
|
||||
label: 'Duplicate',
|
||||
icon: DuplicateIcon,
|
||||
objectData: (objectData) => objectData
|
||||
},
|
||||
{
|
||||
name: 'list',
|
||||
type: 'page',
|
||||
@ -94,6 +109,20 @@ export const Part = {
|
||||
return !(objectData?._isEditing && objectData?._isEditing == true)
|
||||
},
|
||||
objectData: (objectData) => ({ part: objectData })
|
||||
},
|
||||
{ type: 'divider' },
|
||||
{
|
||||
name: 'delete',
|
||||
bulk: true,
|
||||
type: 'modal',
|
||||
modalWidth: 520,
|
||||
modalCentered: true,
|
||||
label: 'Delete',
|
||||
icon: BinIcon,
|
||||
danger: true,
|
||||
content: (objectData, { onOk } = {}) => {
|
||||
return createElement(DeleteObject, { objectData, onOk })
|
||||
}
|
||||
}
|
||||
],
|
||||
pages: [
|
||||
|
||||
@ -17,6 +17,7 @@ import CheckIcon from '../../components/Icons/CheckIcon'
|
||||
import XMarkIcon from '../../components/Icons/XMarkIcon'
|
||||
import BinIcon from '../../components/Icons/BinIcon'
|
||||
import ListIcon from '../../components/Icons/ListIcon'
|
||||
import DuplicateIcon from '../../components/Icons/DuplicateIcon'
|
||||
|
||||
export const PartSku = {
|
||||
name: 'partSku',
|
||||
@ -41,6 +42,16 @@ export const PartSku = {
|
||||
})
|
||||
}
|
||||
},
|
||||
{
|
||||
name: 'duplicate',
|
||||
type: 'alias',
|
||||
objectType: 'partSku',
|
||||
aliasAction: 'new',
|
||||
pageName: 'info',
|
||||
label: 'Duplicate',
|
||||
icon: DuplicateIcon,
|
||||
objectData: (objectData) => objectData
|
||||
},
|
||||
{
|
||||
name: 'list',
|
||||
type: 'page',
|
||||
@ -91,6 +102,7 @@ export const PartSku = {
|
||||
{ type: 'divider' },
|
||||
{
|
||||
name: 'delete',
|
||||
bulk: true,
|
||||
type: 'modal',
|
||||
modalWidth: 520,
|
||||
modalCentered: true,
|
||||
|
||||
@ -21,6 +21,7 @@ import CheckIcon from '../../components/Icons/CheckIcon'
|
||||
import XMarkIcon from '../../components/Icons/XMarkIcon'
|
||||
import BinIcon from '../../components/Icons/BinIcon'
|
||||
import ListIcon from '../../components/Icons/ListIcon'
|
||||
import DuplicateIcon from '../../components/Icons/DuplicateIcon'
|
||||
|
||||
export const PartStock = {
|
||||
name: 'partStock',
|
||||
@ -45,6 +46,16 @@ export const PartStock = {
|
||||
})
|
||||
}
|
||||
},
|
||||
{
|
||||
name: 'duplicate',
|
||||
type: 'alias',
|
||||
objectType: 'partStock',
|
||||
aliasAction: 'new',
|
||||
pageName: 'info',
|
||||
label: 'Duplicate',
|
||||
icon: DuplicateIcon,
|
||||
objectData: (objectData) => objectData
|
||||
},
|
||||
{
|
||||
name: 'list',
|
||||
type: 'page',
|
||||
@ -97,6 +108,7 @@ export const PartStock = {
|
||||
},
|
||||
{
|
||||
name: 'delete',
|
||||
bulk: true,
|
||||
type: 'modal',
|
||||
modalWidth: 520,
|
||||
modalCentered: true,
|
||||
|
||||
@ -29,6 +29,7 @@ import EditIcon from '../../components/Icons/EditIcon'
|
||||
import XMarkIcon from '../../components/Icons/XMarkIcon'
|
||||
import BinIcon from '../../components/Icons/BinIcon'
|
||||
import ListIcon from '../../components/Icons/ListIcon'
|
||||
import DuplicateIcon from '../../components/Icons/DuplicateIcon'
|
||||
|
||||
export const Payment = {
|
||||
name: 'payment',
|
||||
@ -53,6 +54,16 @@ export const Payment = {
|
||||
})
|
||||
}
|
||||
},
|
||||
{
|
||||
name: 'duplicate',
|
||||
type: 'alias',
|
||||
objectType: 'payment',
|
||||
aliasAction: 'new',
|
||||
pageName: 'info',
|
||||
label: 'Duplicate',
|
||||
icon: DuplicateIcon,
|
||||
objectData: (objectData) => objectData
|
||||
},
|
||||
{
|
||||
name: 'list',
|
||||
type: 'page',
|
||||
@ -105,6 +116,7 @@ export const Payment = {
|
||||
},
|
||||
{
|
||||
name: 'delete',
|
||||
bulk: true,
|
||||
type: 'modal',
|
||||
modalWidth: 520,
|
||||
modalCentered: true,
|
||||
|
||||
@ -20,6 +20,7 @@ import XMarkIcon from '../../components/Icons/XMarkIcon'
|
||||
import BinIcon from '../../components/Icons/BinIcon'
|
||||
import ListIcon from '../../components/Icons/ListIcon'
|
||||
import { marketplaceSyncMappingsProperty } from './marketplaceMappings'
|
||||
import DuplicateIcon from '../../components/Icons/DuplicateIcon'
|
||||
|
||||
export const PaymentPolicy = {
|
||||
name: 'paymentPolicy',
|
||||
@ -45,6 +46,16 @@ export const PaymentPolicy = {
|
||||
})
|
||||
}
|
||||
},
|
||||
{
|
||||
name: 'duplicate',
|
||||
type: 'alias',
|
||||
objectType: 'paymentPolicy',
|
||||
aliasAction: 'new',
|
||||
pageName: 'info',
|
||||
label: 'Duplicate',
|
||||
icon: DuplicateIcon,
|
||||
objectData: (objectData) => objectData
|
||||
},
|
||||
{
|
||||
name: 'list',
|
||||
type: 'page',
|
||||
@ -95,6 +106,7 @@ export const PaymentPolicy = {
|
||||
{ type: 'divider' },
|
||||
{
|
||||
name: 'delete',
|
||||
bulk: true,
|
||||
type: 'modal',
|
||||
modalWidth: 520,
|
||||
modalCentered: true,
|
||||
|
||||
@ -19,6 +19,7 @@ import CheckIcon from '../../components/Icons/CheckIcon'
|
||||
import XMarkIcon from '../../components/Icons/XMarkIcon'
|
||||
import BinIcon from '../../components/Icons/BinIcon'
|
||||
import ListIcon from '../../components/Icons/ListIcon'
|
||||
import DuplicateIcon from '../../components/Icons/DuplicateIcon'
|
||||
|
||||
export const PermissionSetting = {
|
||||
name: 'permissionSetting',
|
||||
@ -44,6 +45,16 @@ export const PermissionSetting = {
|
||||
})
|
||||
}
|
||||
},
|
||||
{
|
||||
name: 'duplicate',
|
||||
type: 'alias',
|
||||
objectType: 'permissionSetting',
|
||||
aliasAction: 'new',
|
||||
pageName: 'info',
|
||||
label: 'Duplicate',
|
||||
icon: DuplicateIcon,
|
||||
objectData: (objectData) => objectData
|
||||
},
|
||||
{
|
||||
name: 'list',
|
||||
type: 'page',
|
||||
@ -94,6 +105,7 @@ export const PermissionSetting = {
|
||||
{ type: 'divider' },
|
||||
{
|
||||
name: 'delete',
|
||||
bulk: true,
|
||||
type: 'modal',
|
||||
modalWidth: 520,
|
||||
modalCentered: true,
|
||||
|
||||
@ -25,6 +25,9 @@ const RestartMoonraker = lazy(
|
||||
() =>
|
||||
import('../../components/Dashboard/Production/Printers/RestartMoonraker')
|
||||
)
|
||||
const DeleteObject = lazy(
|
||||
() => import('../../components/Dashboard/common/DeleteObject')
|
||||
)
|
||||
import PrinterIcon from '../../components/Icons/PrinterIcon'
|
||||
import PlusIcon from '../../components/Icons/PlusIcon'
|
||||
import InfoCircleIcon from '../../components/Icons/InfoCircleIcon'
|
||||
@ -39,6 +42,8 @@ import FilamentStockIcon from '../../components/Icons/FilamentStockIcon'
|
||||
import ControlIcon from '../../components/Icons/ControlIcon'
|
||||
import JobIcon from '../../components/Icons/JobIcon'
|
||||
import ListIcon from '../../components/Icons/ListIcon'
|
||||
import DuplicateIcon from '../../components/Icons/DuplicateIcon'
|
||||
import BinIcon from '../../components/Icons/BinIcon'
|
||||
|
||||
export const Printer = {
|
||||
name: 'printer',
|
||||
@ -63,6 +68,16 @@ export const Printer = {
|
||||
})
|
||||
}
|
||||
},
|
||||
{
|
||||
name: 'duplicate',
|
||||
type: 'alias',
|
||||
objectType: 'printer',
|
||||
aliasAction: 'new',
|
||||
pageName: 'info',
|
||||
label: 'Duplicate',
|
||||
icon: DuplicateIcon,
|
||||
objectData: (objectData) => objectData
|
||||
},
|
||||
{
|
||||
name: 'list',
|
||||
type: 'page',
|
||||
@ -292,6 +307,20 @@ export const Printer = {
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
{ type: 'divider' },
|
||||
{
|
||||
name: 'delete',
|
||||
bulk: true,
|
||||
type: 'modal',
|
||||
modalWidth: 520,
|
||||
modalCentered: true,
|
||||
label: 'Delete',
|
||||
icon: BinIcon,
|
||||
danger: true,
|
||||
content: (objectData, { onOk } = {}) => {
|
||||
return createElement(DeleteObject, { objectData, onOk })
|
||||
}
|
||||
}
|
||||
],
|
||||
pages: [
|
||||
|
||||
@ -19,6 +19,7 @@ import CheckIcon from '../../components/Icons/CheckIcon'
|
||||
import XMarkIcon from '../../components/Icons/XMarkIcon'
|
||||
import BinIcon from '../../components/Icons/BinIcon'
|
||||
import ListIcon from '../../components/Icons/ListIcon'
|
||||
import DuplicateIcon from '../../components/Icons/DuplicateIcon'
|
||||
|
||||
const THUMBNAIL_PROPERTIES = [
|
||||
{
|
||||
@ -308,6 +309,16 @@ export const PrinterProfile = {
|
||||
})
|
||||
}
|
||||
},
|
||||
{
|
||||
name: 'duplicate',
|
||||
type: 'alias',
|
||||
objectType: 'printerProfile',
|
||||
aliasAction: 'new',
|
||||
pageName: 'info',
|
||||
label: 'Duplicate',
|
||||
icon: DuplicateIcon,
|
||||
objectData: (objectData) => objectData
|
||||
},
|
||||
{
|
||||
name: 'list',
|
||||
type: 'page',
|
||||
@ -358,6 +369,7 @@ export const PrinterProfile = {
|
||||
{ type: 'divider' },
|
||||
{
|
||||
name: 'delete',
|
||||
bulk: true,
|
||||
type: 'modal',
|
||||
modalWidth: 520,
|
||||
modalCentered: true,
|
||||
|
||||
@ -6,6 +6,9 @@ const ProductInfo = lazy(
|
||||
const NewProduct = lazy(
|
||||
() => import('../../components/Dashboard/Management/Products/NewProduct')
|
||||
)
|
||||
const DeleteObject = lazy(
|
||||
() => import('../../components/Dashboard/common/DeleteObject')
|
||||
)
|
||||
import ProductIcon from '../../components/Icons/ProductIcon'
|
||||
import PlusIcon from '../../components/Icons/PlusIcon'
|
||||
import InfoCircleIcon from '../../components/Icons/InfoCircleIcon'
|
||||
@ -13,6 +16,8 @@ import EditIcon from '../../components/Icons/EditIcon'
|
||||
import CheckIcon from '../../components/Icons/CheckIcon'
|
||||
import XMarkIcon from '../../components/Icons/XMarkIcon'
|
||||
import ListIcon from '../../components/Icons/ListIcon'
|
||||
import DuplicateIcon from '../../components/Icons/DuplicateIcon'
|
||||
import BinIcon from '../../components/Icons/BinIcon'
|
||||
|
||||
export const Product = {
|
||||
name: 'product',
|
||||
@ -37,6 +42,16 @@ export const Product = {
|
||||
})
|
||||
}
|
||||
},
|
||||
{
|
||||
name: 'duplicate',
|
||||
type: 'alias',
|
||||
objectType: 'product',
|
||||
aliasAction: 'new',
|
||||
pageName: 'info',
|
||||
label: 'Duplicate',
|
||||
icon: DuplicateIcon,
|
||||
objectData: (objectData) => objectData
|
||||
},
|
||||
{
|
||||
name: 'list',
|
||||
type: 'page',
|
||||
@ -96,6 +111,20 @@ export const Product = {
|
||||
return !(objectData?._isEditing && objectData?._isEditing == true)
|
||||
},
|
||||
objectData: (objectData) => ({ product: objectData })
|
||||
},
|
||||
{ type: 'divider' },
|
||||
{
|
||||
name: 'delete',
|
||||
bulk: true,
|
||||
type: 'modal',
|
||||
modalWidth: 520,
|
||||
modalCentered: true,
|
||||
label: 'Delete',
|
||||
icon: BinIcon,
|
||||
danger: true,
|
||||
content: (objectData, { onOk } = {}) => {
|
||||
return createElement(DeleteObject, { objectData, onOk })
|
||||
}
|
||||
}
|
||||
],
|
||||
pages: [
|
||||
|
||||
@ -20,6 +20,7 @@ import CheckIcon from '../../components/Icons/CheckIcon'
|
||||
import XMarkIcon from '../../components/Icons/XMarkIcon'
|
||||
import BinIcon from '../../components/Icons/BinIcon'
|
||||
import ListIcon from '../../components/Icons/ListIcon'
|
||||
import DuplicateIcon from '../../components/Icons/DuplicateIcon'
|
||||
|
||||
export const ProductCategory = {
|
||||
name: 'productCategory',
|
||||
@ -45,6 +46,16 @@ export const ProductCategory = {
|
||||
})
|
||||
}
|
||||
},
|
||||
{
|
||||
name: 'duplicate',
|
||||
type: 'alias',
|
||||
objectType: 'productCategory',
|
||||
aliasAction: 'new',
|
||||
pageName: 'info',
|
||||
label: 'Duplicate',
|
||||
icon: DuplicateIcon,
|
||||
objectData: (objectData) => objectData
|
||||
},
|
||||
{
|
||||
name: 'list',
|
||||
type: 'page',
|
||||
@ -95,6 +106,7 @@ export const ProductCategory = {
|
||||
{ type: 'divider' },
|
||||
{
|
||||
name: 'delete',
|
||||
bulk: true,
|
||||
type: 'modal',
|
||||
modalWidth: 520,
|
||||
modalCentered: true,
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Loading…
x
Reference in New Issue
Block a user