Compare commits
No commits in common. "d7827ecb6d013dbe73a654b85b1e46960c68d210" and "5e7e9510fb7c9355a229a07f310701ae1f6f4afb" have entirely different histories.
d7827ecb6d
...
5e7e9510fb
@ -2,7 +2,7 @@
|
||||
|
||||
import { useState, useRef } from 'react'
|
||||
|
||||
import { Button, Flex, Space, Modal, Dropdown } from 'antd'
|
||||
import { Button, Flex, Space, Modal, Dropdown, message } from 'antd'
|
||||
|
||||
import NewFilamentStock from './FilamentStocks/NewFilamentStock'
|
||||
import PlusIcon from '../../Icons/PlusIcon'
|
||||
@ -15,6 +15,7 @@ import useViewMode from '../hooks/useViewMode'
|
||||
import ColumnViewButton from '../common/ColumnViewButton'
|
||||
|
||||
const FilamentStocks = () => {
|
||||
const [messageApi, contextHolder] = message.useMessage()
|
||||
const tableRef = useRef()
|
||||
|
||||
const [newFilamentStockOpen, setNewFilamentStockOpen] = useState(false)
|
||||
@ -50,6 +51,7 @@ const FilamentStocks = () => {
|
||||
return (
|
||||
<>
|
||||
<Flex vertical={'true'} gap='large'>
|
||||
{contextHolder}
|
||||
<Flex justify={'space-between'}>
|
||||
<Space size='small'>
|
||||
<Dropdown menu={actionItems}>
|
||||
@ -92,6 +94,7 @@ const FilamentStocks = () => {
|
||||
<NewFilamentStock
|
||||
onOk={() => {
|
||||
setNewFilamentStockOpen(false)
|
||||
messageApi.success('New filament stock created successfully.')
|
||||
tableRef.current?.reload()
|
||||
}}
|
||||
reset={newFilamentStockOpen}
|
||||
|
||||
@ -51,11 +51,9 @@ const NewFilamentStock = ({ onOk, reset, defaultValues }) => {
|
||||
loading={submitLoading}
|
||||
formValid={formValid}
|
||||
title='New Filament Stock'
|
||||
onSubmit={async () => {
|
||||
const result = await handleSubmit()
|
||||
if (result) {
|
||||
onSubmit={() => {
|
||||
handleSubmit()
|
||||
onOk()
|
||||
}
|
||||
}}
|
||||
/>
|
||||
)
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
import { useState, useRef } from 'react'
|
||||
import { Button, Flex, Space, Modal, Dropdown } from 'antd'
|
||||
import { Button, Flex, Space, Modal, Dropdown, message } from 'antd'
|
||||
import NewOrderItem from './OrderItems/NewOrderItem'
|
||||
import ObjectTable from '../common/ObjectTable'
|
||||
import PlusIcon from '../../Icons/PlusIcon'
|
||||
@ -11,6 +11,7 @@ import useViewMode from '../hooks/useViewMode'
|
||||
import ColumnViewButton from '../common/ColumnViewButton'
|
||||
|
||||
const OrderItems = () => {
|
||||
const [messageApi, contextHolder] = message.useMessage()
|
||||
const [newOrderItemOpen, setNewOrderItemOpen] = useState(false)
|
||||
const tableRef = useRef()
|
||||
|
||||
@ -45,6 +46,7 @@ const OrderItems = () => {
|
||||
return (
|
||||
<>
|
||||
<Flex vertical={'true'} gap='large'>
|
||||
{contextHolder}
|
||||
<Flex justify={'space-between'}>
|
||||
<Space size='small'>
|
||||
<Dropdown menu={actionItems}>
|
||||
@ -86,6 +88,7 @@ const OrderItems = () => {
|
||||
<NewOrderItem
|
||||
onOk={() => {
|
||||
setNewOrderItemOpen(false)
|
||||
messageApi.success('New order item created successfully.')
|
||||
tableRef.current?.reload()
|
||||
}}
|
||||
reset={newOrderItemOpen}
|
||||
|
||||
@ -79,11 +79,9 @@ const NewOrderItem = ({ onOk, reset, defaultValues }) => {
|
||||
loading={submitLoading}
|
||||
formValid={formValid}
|
||||
title='New Order Item'
|
||||
onSubmit={async () => {
|
||||
const result = await handleSubmit()
|
||||
if (result) {
|
||||
onSubmit={() => {
|
||||
handleSubmit()
|
||||
onOk()
|
||||
}
|
||||
}}
|
||||
/>
|
||||
)
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
|
||||
import { useState, useRef } from 'react'
|
||||
|
||||
import { Button, Flex, Space, Modal, Dropdown } from 'antd'
|
||||
import { Button, Flex, Space, Modal, Dropdown, message } from 'antd'
|
||||
|
||||
import NewPartStock from './PartStocks/NewPartStock'
|
||||
import PlusIcon from '../../Icons/PlusIcon'
|
||||
@ -15,6 +15,7 @@ import useViewMode from '../hooks/useViewMode'
|
||||
import ColumnViewButton from '../common/ColumnViewButton'
|
||||
|
||||
const PartStocks = () => {
|
||||
const [messageApi, contextHolder] = message.useMessage()
|
||||
const tableRef = useRef()
|
||||
|
||||
const [newPartStockOpen, setNewPartStockOpen] = useState(false)
|
||||
@ -50,6 +51,7 @@ const PartStocks = () => {
|
||||
return (
|
||||
<>
|
||||
<Flex vertical={'true'} gap='large'>
|
||||
{contextHolder}
|
||||
<Flex justify={'space-between'}>
|
||||
<Space size='small'>
|
||||
<Dropdown menu={actionItems}>
|
||||
@ -92,6 +94,7 @@ const PartStocks = () => {
|
||||
<NewPartStock
|
||||
onOk={() => {
|
||||
setNewPartStockOpen(false)
|
||||
messageApi.success('New part stock created successfully.')
|
||||
tableRef.current?.reload()
|
||||
}}
|
||||
reset={newPartStockOpen}
|
||||
|
||||
@ -51,11 +51,9 @@ const NewPartStock = ({ onOk, reset, defaultValues }) => {
|
||||
loading={submitLoading}
|
||||
formValid={formValid}
|
||||
title='New Part Stock'
|
||||
onSubmit={async () => {
|
||||
const result = await handleSubmit()
|
||||
if (result) {
|
||||
onSubmit={() => {
|
||||
handleSubmit()
|
||||
onOk()
|
||||
}
|
||||
}}
|
||||
/>
|
||||
)
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
import { useState, useRef } from 'react'
|
||||
import { Button, Flex, Space, Modal, Dropdown } from 'antd'
|
||||
import { Button, Flex, Space, Modal, Dropdown, message } from 'antd'
|
||||
import NewPurchaseOrder from './PurchaseOrders/NewPurchaseOrder'
|
||||
import ObjectTable from '../common/ObjectTable'
|
||||
import PlusIcon from '../../Icons/PlusIcon'
|
||||
@ -11,6 +11,7 @@ import useViewMode from '../hooks/useViewMode'
|
||||
import ColumnViewButton from '../common/ColumnViewButton'
|
||||
|
||||
const PurchaseOrders = () => {
|
||||
const [messageApi, contextHolder] = message.useMessage()
|
||||
const [newPurchaseOrderOpen, setNewPurchaseOrderOpen] = useState(false)
|
||||
const tableRef = useRef()
|
||||
|
||||
@ -45,6 +46,7 @@ const PurchaseOrders = () => {
|
||||
return (
|
||||
<>
|
||||
<Flex vertical={'true'} gap='large'>
|
||||
{contextHolder}
|
||||
<Flex justify={'space-between'}>
|
||||
<Space size='small'>
|
||||
<Dropdown menu={actionItems}>
|
||||
@ -86,6 +88,7 @@ const PurchaseOrders = () => {
|
||||
<NewPurchaseOrder
|
||||
onOk={() => {
|
||||
setNewPurchaseOrderOpen(false)
|
||||
messageApi.success('New purchase order created successfully.')
|
||||
tableRef.current?.reload()
|
||||
}}
|
||||
reset={newPurchaseOrderOpen}
|
||||
|
||||
@ -70,11 +70,9 @@ const NewPurchaseOrder = ({ onOk, reset, defaultValues }) => {
|
||||
loading={submitLoading}
|
||||
formValid={formValid}
|
||||
title='New Purchase Order'
|
||||
onSubmit={async () => {
|
||||
const result = await handleSubmit()
|
||||
if (result) {
|
||||
onSubmit={() => {
|
||||
handleSubmit()
|
||||
onOk()
|
||||
}
|
||||
}}
|
||||
/>
|
||||
)
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
import { useState, useRef } from 'react'
|
||||
import { Button, Flex, Space, Modal, Dropdown } from 'antd'
|
||||
import { Button, Flex, Space, Modal, Dropdown, message } from 'antd'
|
||||
import NewShipment from './Shipments/NewShipment'
|
||||
import ObjectTable from '../common/ObjectTable'
|
||||
import PlusIcon from '../../Icons/PlusIcon'
|
||||
@ -11,6 +11,7 @@ import useViewMode from '../hooks/useViewMode'
|
||||
import ColumnViewButton from '../common/ColumnViewButton'
|
||||
|
||||
const Shipments = () => {
|
||||
const [messageApi, contextHolder] = message.useMessage()
|
||||
const [newShipmentOpen, setNewShipmentOpen] = useState(false)
|
||||
const tableRef = useRef()
|
||||
|
||||
@ -45,6 +46,7 @@ const Shipments = () => {
|
||||
return (
|
||||
<>
|
||||
<Flex vertical={'true'} gap='large'>
|
||||
{contextHolder}
|
||||
<Flex justify={'space-between'}>
|
||||
<Space size='small'>
|
||||
<Dropdown menu={actionItems}>
|
||||
@ -86,6 +88,7 @@ const Shipments = () => {
|
||||
<NewShipment
|
||||
onOk={() => {
|
||||
setNewShipmentOpen(false)
|
||||
messageApi.success('New shipment created successfully.')
|
||||
tableRef.current?.reload()
|
||||
}}
|
||||
reset={newShipmentOpen}
|
||||
|
||||
@ -74,11 +74,9 @@ const NewShipment = ({ onOk, reset, defaultValues }) => {
|
||||
loading={submitLoading}
|
||||
formValid={formValid}
|
||||
title='New Shipment'
|
||||
onSubmit={async () => {
|
||||
const result = await handleSubmit()
|
||||
if (result) {
|
||||
onSubmit={() => {
|
||||
handleSubmit()
|
||||
onOk()
|
||||
}
|
||||
}}
|
||||
/>
|
||||
)
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
|
||||
import { useState, useRef } from 'react'
|
||||
|
||||
import { Button, Flex, Space, Modal, Dropdown } from 'antd'
|
||||
import { Button, Flex, Space, Modal, Dropdown, message } from 'antd'
|
||||
|
||||
import NewStockAudit from './StockAudits/NewStockAudit'
|
||||
import PlusIcon from '../../Icons/PlusIcon'
|
||||
@ -15,6 +15,7 @@ import useViewMode from '../hooks/useViewMode'
|
||||
import ColumnViewButton from '../common/ColumnViewButton'
|
||||
|
||||
const StockAudits = () => {
|
||||
const [messageApi, contextHolder] = message.useMessage()
|
||||
const tableRef = useRef()
|
||||
|
||||
const [newStockAuditOpen, setNewStockAuditOpen] = useState(false)
|
||||
@ -50,6 +51,7 @@ const StockAudits = () => {
|
||||
return (
|
||||
<>
|
||||
<Flex vertical={'true'} gap='large'>
|
||||
{contextHolder}
|
||||
<Flex justify={'space-between'}>
|
||||
<Space size='small'>
|
||||
<Dropdown menu={actionItems}>
|
||||
@ -92,6 +94,7 @@ const StockAudits = () => {
|
||||
<NewStockAudit
|
||||
onOk={() => {
|
||||
setNewStockAuditOpen(false)
|
||||
messageApi.success('New stock audit created successfully.')
|
||||
tableRef.current?.reload()
|
||||
}}
|
||||
reset={newStockAuditOpen}
|
||||
|
||||
@ -51,11 +51,9 @@ const NewStockAudit = ({ onOk, reset, defaultValues }) => {
|
||||
loading={submitLoading}
|
||||
formValid={formValid}
|
||||
title='New Stock Audit'
|
||||
onSubmit={async () => {
|
||||
const result = await handleSubmit()
|
||||
if (result) {
|
||||
onSubmit={() => {
|
||||
handleSubmit()
|
||||
onOk()
|
||||
}
|
||||
}}
|
||||
/>
|
||||
)
|
||||
|
||||
@ -9,7 +9,6 @@ import DashboardNavigation from './common/DashboardNavigation'
|
||||
import DashboardBreadcrumb from './common/DashboardBreadcrumb'
|
||||
import DeveloperSidebar from './Developer/DeveloperSidebar'
|
||||
import { useThemeContext } from './context/ThemeContext'
|
||||
import { MessageProvider } from './context/MessageContext'
|
||||
|
||||
const { Content } = Layout
|
||||
|
||||
@ -23,7 +22,6 @@ const DashboardLayout = ({ children }) => {
|
||||
const { isDarkMode } = useThemeContext()
|
||||
|
||||
return (
|
||||
<MessageProvider>
|
||||
<Layout
|
||||
style={{ height: 'var(--unit-100vh)' }}
|
||||
className={isDarkMode ? 'dark-mode' : 'light-mode'}
|
||||
@ -54,7 +52,6 @@ const DashboardLayout = ({ children }) => {
|
||||
</Layout>
|
||||
</Layout>
|
||||
</Layout>
|
||||
</MessageProvider>
|
||||
)
|
||||
}
|
||||
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
import { useState, useRef } from 'react'
|
||||
import { Button, Flex, Space, Modal, Dropdown } from 'antd'
|
||||
import { Button, Flex, Space, Modal, Dropdown, message } from 'antd'
|
||||
import NewCourierService from './CourierServices/NewCourierService'
|
||||
import ObjectTable from '../common/ObjectTable'
|
||||
import PlusIcon from '../../Icons/PlusIcon'
|
||||
@ -11,6 +11,7 @@ import useViewMode from '../hooks/useViewMode'
|
||||
import ColumnViewButton from '../common/ColumnViewButton'
|
||||
|
||||
const CourierServices = () => {
|
||||
const [messageApi, contextHolder] = message.useMessage()
|
||||
const [newCourierServiceOpen, setNewCourierServiceOpen] = useState(false)
|
||||
const tableRef = useRef()
|
||||
|
||||
@ -45,6 +46,7 @@ const CourierServices = () => {
|
||||
return (
|
||||
<>
|
||||
<Flex vertical={'true'} gap='large'>
|
||||
{contextHolder}
|
||||
<Flex justify={'space-between'}>
|
||||
<Space size='small'>
|
||||
<Dropdown menu={actionItems}>
|
||||
@ -83,6 +85,7 @@ const CourierServices = () => {
|
||||
<NewCourierService
|
||||
onOk={() => {
|
||||
setNewCourierServiceOpen(false)
|
||||
messageApi.success('New courier service created successfully.')
|
||||
tableRef.current?.reload()
|
||||
}}
|
||||
reset={!newCourierServiceOpen}
|
||||
|
||||
@ -68,11 +68,9 @@ const NewCourierService = ({ onOk, defaultValues }) => {
|
||||
loading={submitLoading}
|
||||
formValid={formValid}
|
||||
title='New Courier Service'
|
||||
onSubmit={async () => {
|
||||
const result = await handleSubmit()
|
||||
if (result) {
|
||||
onSubmit={() => {
|
||||
handleSubmit()
|
||||
onOk()
|
||||
}
|
||||
}}
|
||||
/>
|
||||
)
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
import { useState, useRef } from 'react'
|
||||
import { Button, Flex, Space, Modal, Dropdown } from 'antd'
|
||||
import { Button, Flex, Space, Modal, Dropdown, message } from 'antd'
|
||||
import NewCourier from './Couriers/NewCourier'
|
||||
import ObjectTable from '../common/ObjectTable'
|
||||
import PlusIcon from '../../Icons/PlusIcon'
|
||||
@ -11,6 +11,7 @@ import useViewMode from '../hooks/useViewMode'
|
||||
import ColumnViewButton from '../common/ColumnViewButton'
|
||||
|
||||
const Couriers = () => {
|
||||
const [messageApi, contextHolder] = message.useMessage()
|
||||
const [newCourierOpen, setNewCourierOpen] = useState(false)
|
||||
const tableRef = useRef()
|
||||
|
||||
@ -44,6 +45,7 @@ const Couriers = () => {
|
||||
return (
|
||||
<>
|
||||
<Flex vertical={'true'} gap='large'>
|
||||
{contextHolder}
|
||||
<Flex justify={'space-between'}>
|
||||
<Space size='small'>
|
||||
<Dropdown menu={actionItems}>
|
||||
@ -82,6 +84,7 @@ const Couriers = () => {
|
||||
<NewCourier
|
||||
onOk={() => {
|
||||
setNewCourierOpen(false)
|
||||
messageApi.success('New courier created successfully.')
|
||||
tableRef.current?.reload()
|
||||
}}
|
||||
reset={!newCourierOpen}
|
||||
|
||||
@ -61,11 +61,9 @@ const NewCourier = ({ onOk, defaultValues }) => {
|
||||
loading={submitLoading}
|
||||
formValid={formValid}
|
||||
title='New Courier'
|
||||
onSubmit={async () => {
|
||||
const result = await handleSubmit()
|
||||
if (result) {
|
||||
onSubmit={() => {
|
||||
handleSubmit()
|
||||
onOk()
|
||||
}
|
||||
}}
|
||||
/>
|
||||
)
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
import { useState, useRef } from 'react'
|
||||
import { Button, Flex, Space, Modal, Dropdown } from 'antd'
|
||||
import { Button, Flex, Space, Modal, Dropdown, message } from 'antd'
|
||||
import NewDocumentJob from './DocumentJobs/NewDocumentJob'
|
||||
import ObjectTable from '../common/ObjectTable'
|
||||
import PlusIcon from '../../Icons/PlusIcon'
|
||||
@ -11,6 +11,7 @@ import useViewMode from '../hooks/useViewMode'
|
||||
import ColumnViewButton from '../common/ColumnViewButton'
|
||||
|
||||
const DocumentJobs = () => {
|
||||
const [messageApi, contextHolder] = message.useMessage()
|
||||
const [newDocumentJobOpen, setNewDocumentJobOpen] = useState(false)
|
||||
const tableRef = useRef()
|
||||
|
||||
@ -45,6 +46,7 @@ const DocumentJobs = () => {
|
||||
return (
|
||||
<>
|
||||
<Flex vertical={'true'} gap='large'>
|
||||
{contextHolder}
|
||||
<Flex justify={'space-between'}>
|
||||
<Space size='small'>
|
||||
<Dropdown menu={actionItems}>
|
||||
@ -83,6 +85,7 @@ const DocumentJobs = () => {
|
||||
<NewDocumentJob
|
||||
onOk={() => {
|
||||
setNewDocumentJobOpen(false)
|
||||
messageApi.success('New note type created successfully.')
|
||||
tableRef.current?.reload()
|
||||
}}
|
||||
reset={!newDocumentJobOpen}
|
||||
|
||||
@ -68,7 +68,6 @@ const NewDocumentJob = ({ onOk, defaultValues = {} }) => {
|
||||
}
|
||||
onSubmit={async () => {
|
||||
const newDocumentJob = await handleSubmit()
|
||||
if (newDocumentJob) {
|
||||
await sendObjectAction(
|
||||
newDocumentJob.documentPrinter._id,
|
||||
'documentPrinter',
|
||||
@ -80,7 +79,6 @@ const NewDocumentJob = ({ onOk, defaultValues = {} }) => {
|
||||
if (onOk) {
|
||||
onOk()
|
||||
}
|
||||
}
|
||||
}}
|
||||
actions={[
|
||||
{
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
import { useRef, useState } from 'react'
|
||||
import { Button, Flex, Space, Dropdown, Modal } from 'antd'
|
||||
import { Button, Flex, Space, Dropdown, message, Modal } from 'antd'
|
||||
import PlusIcon from '../../Icons/PlusIcon'
|
||||
import ObjectTable from '../common/ObjectTable'
|
||||
import ReloadIcon from '../../Icons/ReloadIcon'
|
||||
@ -11,6 +11,7 @@ import ColumnViewButton from '../common/ColumnViewButton'
|
||||
import NewDocumentPrinter from './DocumentPrinters/NewDocumentPrinter'
|
||||
|
||||
const DocumentPrinters = () => {
|
||||
const [messageApi, contextHolder] = message.useMessage()
|
||||
const tableRef = useRef()
|
||||
const [newDocumentPrinterOpen, setNewDocumentPrinterOpen] = useState(false)
|
||||
const [viewMode, setViewMode] = useViewMode('documentPrinter')
|
||||
@ -44,6 +45,7 @@ const DocumentPrinters = () => {
|
||||
return (
|
||||
<>
|
||||
<Flex vertical={'true'} gap='large'>
|
||||
{contextHolder}
|
||||
<Flex justify={'space-between'}>
|
||||
<Space size='small'>
|
||||
<Dropdown menu={actionItems}>
|
||||
@ -82,6 +84,7 @@ const DocumentPrinters = () => {
|
||||
<NewDocumentPrinter
|
||||
onOk={() => {
|
||||
setNewDocumentPrinterOpen(false)
|
||||
messageApi.success('New note type created successfully.')
|
||||
tableRef.current?.reload()
|
||||
}}
|
||||
reset={!newDocumentPrinterOpen}
|
||||
|
||||
@ -66,11 +66,9 @@ const NewDocumentPrinter = ({ onOk, defaultValues }) => {
|
||||
loading={submitLoading}
|
||||
formValid={formValid}
|
||||
title='New Document Printer'
|
||||
onSubmit={async () => {
|
||||
const result = await handleSubmit()
|
||||
if (result) {
|
||||
onSubmit={() => {
|
||||
handleSubmit()
|
||||
onOk()
|
||||
}
|
||||
}}
|
||||
/>
|
||||
)
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
import { useState, useRef } from 'react'
|
||||
import { Button, Flex, Space, Modal, Dropdown } from 'antd'
|
||||
import { Button, Flex, Space, Modal, Dropdown, message } from 'antd'
|
||||
import NewDocumentSize from './DocumentSizes/NewDocumentSize'
|
||||
import ObjectTable from '../common/ObjectTable'
|
||||
import PlusIcon from '../../Icons/PlusIcon'
|
||||
@ -11,6 +11,7 @@ import useViewMode from '../hooks/useViewMode'
|
||||
import ColumnViewButton from '../common/ColumnViewButton'
|
||||
|
||||
const DocumentSizes = () => {
|
||||
const [messageApi, contextHolder] = message.useMessage()
|
||||
const [newDocumentSizeOpen, setNewDocumentSizeOpen] = useState(false)
|
||||
const tableRef = useRef()
|
||||
const [viewMode, setViewMode] = useViewMode('documentSize')
|
||||
@ -43,6 +44,7 @@ const DocumentSizes = () => {
|
||||
return (
|
||||
<>
|
||||
<Flex vertical={'true'} gap='large'>
|
||||
{contextHolder}
|
||||
<Flex justify={'space-between'}>
|
||||
<Space size='small'>
|
||||
<Dropdown menu={actionItems}>
|
||||
@ -81,6 +83,7 @@ const DocumentSizes = () => {
|
||||
<NewDocumentSize
|
||||
onOk={() => {
|
||||
setNewDocumentSizeOpen(false)
|
||||
messageApi.success('New document size created successfully.')
|
||||
tableRef.current?.reload()
|
||||
}}
|
||||
reset={!newDocumentSizeOpen}
|
||||
|
||||
@ -47,11 +47,9 @@ const NewDocumentSize = ({ onOk, defaultValues }) => {
|
||||
loading={submitLoading}
|
||||
formValid={formValid}
|
||||
title='New Document Size'
|
||||
onSubmit={async () => {
|
||||
const result = await handleSubmit()
|
||||
if (result) {
|
||||
onSubmit={() => {
|
||||
handleSubmit()
|
||||
onOk()
|
||||
}
|
||||
}}
|
||||
/>
|
||||
)
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
import { useState, useRef } from 'react'
|
||||
import { Button, Flex, Space, Modal, Dropdown } from 'antd'
|
||||
import { Button, Flex, Space, Modal, Dropdown, message } from 'antd'
|
||||
import NewDocumentTemplate from './DocumentTemplates/NewDocumentTemplate'
|
||||
import ObjectTable from '../common/ObjectTable'
|
||||
import PlusIcon from '../../Icons/PlusIcon'
|
||||
@ -11,6 +11,7 @@ import useViewMode from '../hooks/useViewMode'
|
||||
import ColumnViewButton from '../common/ColumnViewButton'
|
||||
|
||||
const DocumentTemplates = () => {
|
||||
const [messageApi, contextHolder] = message.useMessage()
|
||||
const [newDocumentTemplateOpen, setNewDocumentTemplateOpen] = useState(false)
|
||||
const tableRef = useRef()
|
||||
|
||||
@ -45,6 +46,7 @@ const DocumentTemplates = () => {
|
||||
return (
|
||||
<>
|
||||
<Flex vertical={'true'} gap='large'>
|
||||
{contextHolder}
|
||||
<Flex justify={'space-between'}>
|
||||
<Space size='small'>
|
||||
<Dropdown menu={actionItems}>
|
||||
@ -83,6 +85,7 @@ const DocumentTemplates = () => {
|
||||
<NewDocumentTemplate
|
||||
onOk={() => {
|
||||
setNewDocumentTemplateOpen(false)
|
||||
messageApi.success('New note type created successfully.')
|
||||
tableRef.current?.reload()
|
||||
}}
|
||||
reset={!newDocumentTemplateOpen}
|
||||
|
||||
@ -66,11 +66,9 @@ const NewDocumentTemplate = ({ onOk, defaultValues }) => {
|
||||
loading={submitLoading}
|
||||
formValid={formValid}
|
||||
title='New Document Template'
|
||||
onSubmit={async () => {
|
||||
const result = await handleSubmit()
|
||||
if (result) {
|
||||
onSubmit={() => {
|
||||
handleSubmit()
|
||||
onOk()
|
||||
}
|
||||
}}
|
||||
/>
|
||||
)
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
// src/filaments.js
|
||||
|
||||
import { useRef, useState } from 'react'
|
||||
import { Button, Flex, Space, Modal, Dropdown } from 'antd'
|
||||
import { Button, Flex, Space, Modal, message, Dropdown } from 'antd'
|
||||
|
||||
import NewFilament from './Filaments/NewFilament'
|
||||
|
||||
@ -15,6 +15,7 @@ import GridIcon from '../../Icons/GridIcon'
|
||||
import useViewMode from '../hooks/useViewMode'
|
||||
|
||||
const Filaments = () => {
|
||||
const [messageApi, contextHolder] = message.useMessage()
|
||||
const [newFilamentOpen, setNewFilamentOpen] = useState(false)
|
||||
const tableRef = useRef()
|
||||
|
||||
@ -50,6 +51,7 @@ const Filaments = () => {
|
||||
return (
|
||||
<>
|
||||
<Flex vertical={'true'} gap='large'>
|
||||
{contextHolder}
|
||||
<Flex justify={'space-between'}>
|
||||
<Space>
|
||||
<Dropdown menu={actionItems}>
|
||||
@ -90,6 +92,7 @@ const Filaments = () => {
|
||||
<NewFilament
|
||||
onOk={() => {
|
||||
setNewFilamentOpen(false)
|
||||
messageApi.success('New filament added successfully.')
|
||||
tableRef.current?.reload()
|
||||
}}
|
||||
reset={newFilamentOpen}
|
||||
|
||||
@ -61,11 +61,9 @@ const NewFilament = ({ onOk }) => {
|
||||
loading={submitLoading}
|
||||
formValid={formValid}
|
||||
title='New Filament'
|
||||
onSubmit={async () => {
|
||||
const result = await handleSubmit()
|
||||
if (result) {
|
||||
onSubmit={() => {
|
||||
handleSubmit()
|
||||
onOk()
|
||||
}
|
||||
}}
|
||||
/>
|
||||
)
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
// src/hosts.js
|
||||
|
||||
import { useRef, useState } from 'react'
|
||||
import { Button, Flex, Space, Modal, Dropdown } from 'antd'
|
||||
import { Button, Flex, Space, Modal, message, Dropdown } from 'antd'
|
||||
|
||||
import NewHost from './Hosts/NewHost'
|
||||
|
||||
@ -15,6 +15,7 @@ import GridIcon from '../../Icons/GridIcon'
|
||||
import useViewMode from '../hooks/useViewMode'
|
||||
|
||||
const Hosts = () => {
|
||||
const [messageApi, contextHolder] = message.useMessage()
|
||||
const [newHostOpen, setNewHostOpen] = useState(false)
|
||||
const tableRef = useRef()
|
||||
|
||||
@ -49,6 +50,7 @@ const Hosts = () => {
|
||||
return (
|
||||
<>
|
||||
<Flex vertical={'true'} gap='large'>
|
||||
{contextHolder}
|
||||
<Flex justify={'space-between'}>
|
||||
<Space>
|
||||
<Dropdown menu={actionItems}>
|
||||
@ -89,6 +91,7 @@ const Hosts = () => {
|
||||
<NewHost
|
||||
onOk={() => {
|
||||
setNewHostOpen(false)
|
||||
messageApi.success('New host added successfully.')
|
||||
tableRef.current?.reload()
|
||||
}}
|
||||
reset={newHostOpen}
|
||||
|
||||
@ -94,11 +94,9 @@ const NewHost = ({ onOk }) => {
|
||||
totalSteps={steps.length}
|
||||
onPrevious={() => setCurrentStep((prev) => prev - 1)}
|
||||
onNext={() => setCurrentStep((prev) => prev + 1)}
|
||||
onSubmit={async () => {
|
||||
const result = await handleSubmit()
|
||||
if (result) {
|
||||
onSubmit={() => {
|
||||
handleSubmit()
|
||||
onOk()
|
||||
}
|
||||
}}
|
||||
formValid={formValid}
|
||||
submitLoading={submitLoading}
|
||||
|
||||
@ -9,12 +9,12 @@ import {
|
||||
Flex,
|
||||
Space,
|
||||
Modal,
|
||||
message,
|
||||
Dropdown,
|
||||
Spin
|
||||
} from 'antd'
|
||||
import { createStyles } from 'antd-style'
|
||||
import { LoadingOutlined } from '@ant-design/icons'
|
||||
import { useMessageContext } from '../context/MessageContext'
|
||||
|
||||
import { AuthContext } from '../context/AuthContext'
|
||||
|
||||
@ -47,7 +47,7 @@ const useStyle = createStyles(({ css, token }) => {
|
||||
})
|
||||
|
||||
const Materials = () => {
|
||||
const { showError } = useMessageContext()
|
||||
const [messageApi, contextHolder] = message.useMessage()
|
||||
const navigate = useNavigate()
|
||||
const { styles } = useStyle()
|
||||
|
||||
@ -87,11 +87,12 @@ const Materials = () => {
|
||||
setLazyLoading(false)
|
||||
} catch (error) {
|
||||
if (error.response) {
|
||||
showError(
|
||||
`Error updating material details: ${error.response.status}`
|
||||
messageApi.error(
|
||||
'Error updating material details:',
|
||||
error.response.status
|
||||
)
|
||||
} else {
|
||||
showError(
|
||||
messageApi.error(
|
||||
'An unexpected error occurred. Please try again later.'
|
||||
)
|
||||
}
|
||||
@ -99,7 +100,7 @@ const Materials = () => {
|
||||
setLazyLoading(false)
|
||||
}
|
||||
},
|
||||
[showError]
|
||||
[messageApi]
|
||||
)
|
||||
|
||||
useEffect(() => {
|
||||
@ -240,6 +241,7 @@ const Materials = () => {
|
||||
return (
|
||||
<>
|
||||
<Flex vertical={'true'} gap='large'>
|
||||
{contextHolder}
|
||||
<Space>
|
||||
<Dropdown menu={actionItems}>
|
||||
<Button>Actions</Button>
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
import { useState, useRef } from 'react'
|
||||
import { Button, Flex, Space, Modal, Dropdown } from 'antd'
|
||||
import { Button, Flex, Space, Modal, Dropdown, message } from 'antd'
|
||||
import NewNoteType from './NoteTypes/NewNoteType'
|
||||
import ObjectTable from '../common/ObjectTable'
|
||||
import PlusIcon from '../../Icons/PlusIcon'
|
||||
@ -11,6 +11,7 @@ import useViewMode from '../hooks/useViewMode'
|
||||
import ColumnViewButton from '../common/ColumnViewButton'
|
||||
|
||||
const NoteTypes = () => {
|
||||
const [messageApi, contextHolder] = message.useMessage()
|
||||
const [newNoteTypeOpen, setNewNoteTypeOpen] = useState(false)
|
||||
const tableRef = useRef()
|
||||
|
||||
@ -45,6 +46,7 @@ const NoteTypes = () => {
|
||||
return (
|
||||
<>
|
||||
<Flex vertical={'true'} gap='large'>
|
||||
{contextHolder}
|
||||
<Flex justify={'space-between'}>
|
||||
<Space size='small'>
|
||||
<Dropdown menu={actionItems}>
|
||||
@ -83,6 +85,7 @@ const NoteTypes = () => {
|
||||
<NewNoteType
|
||||
onOk={() => {
|
||||
setNewNoteTypeOpen(false)
|
||||
messageApi.success('New note type created successfully.')
|
||||
tableRef.current?.reload()
|
||||
}}
|
||||
reset={!newNoteTypeOpen}
|
||||
|
||||
@ -66,11 +66,9 @@ const NewNoteType = ({ onOk }) => {
|
||||
loading={submitLoading}
|
||||
formValid={formValid}
|
||||
title='New Note Type'
|
||||
onSubmit={async () => {
|
||||
const result = await handleSubmit()
|
||||
if (result) {
|
||||
onSubmit={() => {
|
||||
handleSubmit()
|
||||
onOk()
|
||||
}
|
||||
}}
|
||||
/>
|
||||
)
|
||||
|
||||
@ -31,11 +31,9 @@ const NewNote = ({ onOk, defaultValues = {} }) => {
|
||||
loading={submitLoading}
|
||||
formValid={formValid}
|
||||
title='New Note'
|
||||
onSubmit={async () => {
|
||||
const result = await handleSubmit()
|
||||
if (result) {
|
||||
onSubmit={() => {
|
||||
handleSubmit()
|
||||
onOk()
|
||||
}
|
||||
}}
|
||||
/>
|
||||
)
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
|
||||
import { useState, useRef } from 'react'
|
||||
|
||||
import { Button, Flex, Space, Modal, Dropdown } from 'antd'
|
||||
import { Button, Flex, Space, Modal, Dropdown, message } from 'antd'
|
||||
import ObjectTable from '../common/ObjectTable'
|
||||
import NewPart from './Parts/NewPart'
|
||||
|
||||
@ -18,6 +18,8 @@ import useViewMode from '../hooks/useViewMode'
|
||||
import ColumnViewButton from '../common/ColumnViewButton'
|
||||
|
||||
const Parts = (filter) => {
|
||||
const [messageApi, contextHolder] = message.useMessage()
|
||||
|
||||
const [newPartOpen, setNewPartOpen] = useState(false)
|
||||
const tableRef = useRef()
|
||||
const [viewMode, setViewMode] = useViewMode('part')
|
||||
@ -49,6 +51,7 @@ const Parts = (filter) => {
|
||||
return (
|
||||
<>
|
||||
<Flex vertical={'true'} gap='large'>
|
||||
{contextHolder}
|
||||
<Flex justify={'space-between'}>
|
||||
<Space size='small'>
|
||||
<Dropdown menu={actionItems}>
|
||||
@ -90,6 +93,7 @@ const Parts = (filter) => {
|
||||
<NewPart
|
||||
onOk={() => {
|
||||
setNewPartOpen(false)
|
||||
messageApi.success('Part created successfully!')
|
||||
tableRef.current?.reload()
|
||||
}}
|
||||
reset={newPartOpen}
|
||||
|
||||
@ -103,11 +103,9 @@ const NewPart = ({ onOk, defaultValues }) => {
|
||||
loading={submitLoading}
|
||||
formValid={formValid}
|
||||
title='New Part'
|
||||
onSubmit={async () => {
|
||||
const result = await handleSubmit()
|
||||
if (result) {
|
||||
onSubmit={() => {
|
||||
handleSubmit()
|
||||
onOk()
|
||||
}
|
||||
}}
|
||||
/>
|
||||
)
|
||||
|
||||
@ -8,6 +8,7 @@ import {
|
||||
Space,
|
||||
Modal,
|
||||
Dropdown,
|
||||
message,
|
||||
Tag,
|
||||
Checkbox,
|
||||
Popover,
|
||||
@ -30,6 +31,7 @@ import ListIcon from '../../Icons/ListIcon'
|
||||
import useViewMode from '../hooks/useViewMode'
|
||||
|
||||
const Products = () => {
|
||||
const [messageApi, contextHolder] = message.useMessage()
|
||||
const navigate = useNavigate()
|
||||
const [newProductOpen, setNewProductOpen] = useState(false)
|
||||
const tableRef = useRef()
|
||||
@ -320,6 +322,7 @@ const Products = () => {
|
||||
return (
|
||||
<>
|
||||
<Flex vertical={'true'} gap='large'>
|
||||
{contextHolder}
|
||||
<Flex justify={'space-between'}>
|
||||
<Space size='small'>
|
||||
<Dropdown menu={actionItems}>
|
||||
@ -360,6 +363,7 @@ const Products = () => {
|
||||
<NewProduct
|
||||
onOk={() => {
|
||||
setNewProductOpen(false)
|
||||
messageApi.success('Product created successfully!')
|
||||
tableRef.current?.reload()
|
||||
}}
|
||||
reset={newProductOpen}
|
||||
|
||||
@ -88,11 +88,9 @@ const NewProduct = ({ onOk, defaultValues }) => {
|
||||
loading={submitLoading}
|
||||
formValid={formValid}
|
||||
title='New Product'
|
||||
onSubmit={async () => {
|
||||
const result = await handleSubmit()
|
||||
if (result) {
|
||||
onSubmit={() => {
|
||||
handleSubmit()
|
||||
onOk()
|
||||
}
|
||||
}}
|
||||
/>
|
||||
)
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
import { useState, useRef } from 'react'
|
||||
import { Button, Flex, Space, Modal, Dropdown } from 'antd'
|
||||
import { Button, Flex, Space, Modal, Dropdown, message } from 'antd'
|
||||
import NewTaxRate from './TaxRates/NewTaxRate'
|
||||
import ObjectTable from '../common/ObjectTable'
|
||||
import PlusIcon from '../../Icons/PlusIcon'
|
||||
@ -11,6 +11,7 @@ import useViewMode from '../hooks/useViewMode'
|
||||
import ColumnViewButton from '../common/ColumnViewButton'
|
||||
|
||||
const TaxRates = () => {
|
||||
const [messageApi, contextHolder] = message.useMessage()
|
||||
const [newTaxRateOpen, setNewTaxRateOpen] = useState(false)
|
||||
const tableRef = useRef()
|
||||
|
||||
@ -44,6 +45,7 @@ const TaxRates = () => {
|
||||
return (
|
||||
<>
|
||||
<Flex vertical={'true'} gap='large'>
|
||||
{contextHolder}
|
||||
<Flex justify={'space-between'}>
|
||||
<Space size='small'>
|
||||
<Dropdown menu={actionItems}>
|
||||
@ -82,6 +84,7 @@ const TaxRates = () => {
|
||||
<NewTaxRate
|
||||
onOk={() => {
|
||||
setNewTaxRateOpen(false)
|
||||
messageApi.success('New tax rate created successfully.')
|
||||
tableRef.current?.reload()
|
||||
}}
|
||||
reset={!newTaxRateOpen}
|
||||
|
||||
@ -61,11 +61,9 @@ const NewTaxRate = ({ onOk, defaultValues }) => {
|
||||
loading={submitLoading}
|
||||
formValid={formValid}
|
||||
title='New Tax Rate'
|
||||
onSubmit={async () => {
|
||||
const result = await handleSubmit()
|
||||
if (result) {
|
||||
onSubmit={() => {
|
||||
handleSubmit()
|
||||
onOk()
|
||||
}
|
||||
}}
|
||||
/>
|
||||
)
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
import { useState, useRef } from 'react'
|
||||
import { Button, Flex, Space, Modal, Dropdown } from 'antd'
|
||||
import { Button, Flex, Space, Modal, Dropdown, message } from 'antd'
|
||||
import NewTaxRecord from './TaxRecords/NewTaxRecord'
|
||||
import ObjectTable from '../common/ObjectTable'
|
||||
import PlusIcon from '../../Icons/PlusIcon'
|
||||
@ -11,6 +11,7 @@ import useViewMode from '../hooks/useViewMode'
|
||||
import ColumnViewButton from '../common/ColumnViewButton'
|
||||
|
||||
const TaxRecords = () => {
|
||||
const [messageApi, contextHolder] = message.useMessage()
|
||||
const [newTaxRecordOpen, setNewTaxRecordOpen] = useState(false)
|
||||
const tableRef = useRef()
|
||||
|
||||
@ -45,6 +46,7 @@ const TaxRecords = () => {
|
||||
return (
|
||||
<>
|
||||
<Flex vertical={'true'} gap='large'>
|
||||
{contextHolder}
|
||||
<Flex justify={'space-between'}>
|
||||
<Space size='small'>
|
||||
<Dropdown menu={actionItems}>
|
||||
@ -83,6 +85,7 @@ const TaxRecords = () => {
|
||||
<NewTaxRecord
|
||||
onOk={() => {
|
||||
setNewTaxRecordOpen(false)
|
||||
messageApi.success('New tax record created successfully.')
|
||||
tableRef.current?.reload()
|
||||
}}
|
||||
reset={!newTaxRecordOpen}
|
||||
|
||||
@ -61,11 +61,9 @@ const NewTaxRecord = ({ onOk, defaultValues }) => {
|
||||
loading={submitLoading}
|
||||
formValid={formValid}
|
||||
title='New Tax Record'
|
||||
onSubmit={async () => {
|
||||
const result = await handleSubmit()
|
||||
if (result) {
|
||||
onSubmit={() => {
|
||||
handleSubmit()
|
||||
onOk()
|
||||
}
|
||||
}}
|
||||
/>
|
||||
)
|
||||
|
||||
@ -1,18 +1,18 @@
|
||||
import PropTypes from 'prop-types'
|
||||
import { useState, useEffect } from 'react'
|
||||
import { useState } from 'react'
|
||||
import axios from 'axios'
|
||||
import { useMediaQuery } from 'react-responsive'
|
||||
import {
|
||||
Form,
|
||||
Input,
|
||||
Button,
|
||||
message,
|
||||
Typography,
|
||||
Flex,
|
||||
Steps,
|
||||
Descriptions,
|
||||
Divider
|
||||
} from 'antd'
|
||||
import { useMessageContext } from '../../context/MessageContext'
|
||||
|
||||
import config from '../../../../config'
|
||||
|
||||
@ -27,7 +27,7 @@ const initialNewUserForm = {
|
||||
}
|
||||
|
||||
const NewUser = ({ onOk, reset }) => {
|
||||
const { showError } = useMessageContext()
|
||||
const [messageApi, contextHolder] = message.useMessage()
|
||||
const [newUserLoading, setNewUserLoading] = useState(false)
|
||||
const [currentStep, setCurrentStep] = useState(0)
|
||||
const [nextEnabled, setNextEnabled] = useState(false)
|
||||
@ -88,7 +88,7 @@ const NewUser = ({ onOk, reset }) => {
|
||||
})
|
||||
onOk()
|
||||
} catch (error) {
|
||||
showError('Error creating new user: ' + error.message)
|
||||
messageApi.error('Error creating new user: ' + error.message)
|
||||
} finally {
|
||||
setNewUserLoading(false)
|
||||
}
|
||||
@ -181,6 +181,8 @@ const NewUser = ({ onOk, reset }) => {
|
||||
|
||||
return (
|
||||
<Flex gap='middle'>
|
||||
{contextHolder}
|
||||
|
||||
{!isMobile && (
|
||||
<div style={{ minWidth: '160px' }}>
|
||||
<Steps
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
import { useState, useRef } from 'react'
|
||||
import { Button, Flex, Space, Modal, Dropdown } from 'antd'
|
||||
import { Button, Flex, Space, Modal, Dropdown, message } from 'antd'
|
||||
import NewVendor from './Vendors/NewVendor'
|
||||
import ObjectTable from '../common/ObjectTable'
|
||||
import PlusIcon from '../../Icons/PlusIcon'
|
||||
@ -11,6 +11,7 @@ import useViewMode from '../hooks/useViewMode'
|
||||
import ColumnViewButton from '../common/ColumnViewButton'
|
||||
|
||||
const Vendors = () => {
|
||||
const [messageApi, contextHolder] = message.useMessage()
|
||||
const [newVendorOpen, setNewVendorOpen] = useState(false)
|
||||
const tableRef = useRef()
|
||||
|
||||
@ -44,6 +45,7 @@ const Vendors = () => {
|
||||
return (
|
||||
<>
|
||||
<Flex vertical={'true'} gap='large'>
|
||||
{contextHolder}
|
||||
<Flex justify={'space-between'}>
|
||||
<Space size='small'>
|
||||
<Dropdown menu={actionItems}>
|
||||
@ -82,6 +84,7 @@ const Vendors = () => {
|
||||
<NewVendor
|
||||
onOk={() => {
|
||||
setNewVendorOpen(false)
|
||||
messageApi.success('New vendor created successfully.')
|
||||
tableRef.current?.reload()
|
||||
}}
|
||||
reset={!newVendorOpen}
|
||||
|
||||
@ -64,11 +64,9 @@ const NewVendor = ({ onOk, defaultValues }) => {
|
||||
loading={submitLoading}
|
||||
formValid={formValid}
|
||||
title='New Vendor'
|
||||
onSubmit={async () => {
|
||||
const result = await handleSubmit()
|
||||
if (result) {
|
||||
onSubmit={() => {
|
||||
handleSubmit()
|
||||
onOk()
|
||||
}
|
||||
}}
|
||||
/>
|
||||
)
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
// src/gcodefiles.js
|
||||
|
||||
import { useState, useRef } from 'react'
|
||||
import { Button, Flex, Space, Modal, Dropdown } from 'antd'
|
||||
import { Button, Flex, Space, Modal, Dropdown, message } from 'antd'
|
||||
import NewGCodeFile from './GCodeFiles/NewGCodeFile'
|
||||
import useColumnVisibility from '../hooks/useColumnVisibility'
|
||||
import PlusIcon from '../../Icons/PlusIcon'
|
||||
@ -14,6 +14,7 @@ import useViewMode from '../hooks/useViewMode'
|
||||
import ColumnViewButton from '../common/ColumnViewButton'
|
||||
|
||||
const GCodeFiles = () => {
|
||||
const [messageApi, contextHolder] = message.useMessage()
|
||||
const [newGCodeFileOpen, setNewGCodeFileOpen] = useState(false)
|
||||
const tableRef = useRef()
|
||||
const [viewMode, setViewMode] = useViewMode('gcodeFile')
|
||||
@ -47,6 +48,7 @@ const GCodeFiles = () => {
|
||||
return (
|
||||
<>
|
||||
<Flex vertical={'true'} gap='large'>
|
||||
{contextHolder}
|
||||
<Flex justify={'space-between'}>
|
||||
<Space>
|
||||
<Dropdown menu={actionItems}>
|
||||
@ -87,6 +89,7 @@ const GCodeFiles = () => {
|
||||
<NewGCodeFile
|
||||
onOk={() => {
|
||||
setNewGCodeFileOpen(false)
|
||||
messageApi.success('Finished uploading GCode file!')
|
||||
tableRef.current?.reload()
|
||||
}}
|
||||
reset={newGCodeFileOpen}
|
||||
|
||||
@ -1,11 +1,9 @@
|
||||
import PropTypes from 'prop-types'
|
||||
import { useMessageContext } from '../../context/MessageContext'
|
||||
import ObjectInfo from '../../common/ObjectInfo'
|
||||
import NewObjectForm from '../../common/NewObjectForm'
|
||||
import WizardView from '../../common/WizardView'
|
||||
|
||||
const NewGCodeFile = ({ onOk, defaultValues }) => {
|
||||
const { showSuccess } = useMessageContext()
|
||||
return (
|
||||
<NewObjectForm
|
||||
type={'gcodeFile'}
|
||||
@ -73,12 +71,9 @@ const NewGCodeFile = ({ onOk, defaultValues }) => {
|
||||
loading={submitLoading}
|
||||
formValid={formValid}
|
||||
title='New GCode File'
|
||||
onSubmit={async () => {
|
||||
const result = await handleSubmit()
|
||||
if (result) {
|
||||
showSuccess('Finished uploading GCode file!')
|
||||
onSubmit={() => {
|
||||
handleSubmit()
|
||||
onOk()
|
||||
}
|
||||
}}
|
||||
/>
|
||||
)
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
// src/Jobs.js
|
||||
|
||||
import { useState, useRef } from 'react'
|
||||
import { Button, Flex, Space, Modal, Dropdown } from 'antd'
|
||||
import { Button, Flex, Space, Modal, Dropdown, message } from 'antd'
|
||||
import NewJob from './Jobs/NewJob.jsx'
|
||||
import useColumnVisibility from '../hooks/useColumnVisibility.js'
|
||||
import PlusIcon from '../../Icons/PlusIcon.jsx'
|
||||
@ -13,6 +13,7 @@ import useViewMode from '../hooks/useViewMode.js'
|
||||
import ColumnViewButton from '../common/ColumnViewButton.jsx'
|
||||
|
||||
const Jobs = () => {
|
||||
const [messageApi, contextHolder] = message.useMessage()
|
||||
const [newJobOpen, setNewJobOpen] = useState(false)
|
||||
const tableRef = useRef()
|
||||
const [viewMode, setViewMode] = useViewMode('job')
|
||||
@ -49,6 +50,7 @@ const Jobs = () => {
|
||||
return (
|
||||
<>
|
||||
<Flex vertical={'true'} gap='large' style={{ height: '100%' }}>
|
||||
{contextHolder}
|
||||
<Flex justify={'space-between'}>
|
||||
<Space size='small'>
|
||||
<Dropdown menu={actionItems}>
|
||||
@ -91,6 +93,7 @@ const Jobs = () => {
|
||||
<NewJob
|
||||
onOk={() => {
|
||||
setNewJobOpen(false)
|
||||
messageApi.success('New print job created successfully.')
|
||||
tableRef.current?.reload()
|
||||
}}
|
||||
reset={newJobOpen}
|
||||
|
||||
@ -1,11 +1,9 @@
|
||||
import PropTypes from 'prop-types'
|
||||
import { useMessageContext } from '../../context/MessageContext'
|
||||
import ObjectInfo from '../../common/ObjectInfo'
|
||||
import NewObjectForm from '../../common/NewObjectForm'
|
||||
import WizardView from '../../common/WizardView'
|
||||
|
||||
const NewJob = ({ onOk, defaultValues }) => {
|
||||
const { showSuccess } = useMessageContext()
|
||||
return (
|
||||
<NewObjectForm
|
||||
type={'job'}
|
||||
@ -60,12 +58,9 @@ const NewJob = ({ onOk, defaultValues }) => {
|
||||
loading={submitLoading}
|
||||
formValid={formValid}
|
||||
title='New Job'
|
||||
onSubmit={async () => {
|
||||
const result = await handleSubmit()
|
||||
if (result) {
|
||||
showSuccess('New job created successfully.')
|
||||
onSubmit={() => {
|
||||
handleSubmit()
|
||||
onOk()
|
||||
}
|
||||
}}
|
||||
/>
|
||||
)
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
// src/Printers.js
|
||||
|
||||
import { useState, useRef } from 'react'
|
||||
import { Button, Dropdown, Space, Flex, Modal } from 'antd'
|
||||
import { Button, message, Dropdown, Space, Flex, Modal } from 'antd'
|
||||
import NewPrinter from './Printers/NewPrinter'
|
||||
import PlusIcon from '../../Icons/PlusIcon'
|
||||
import ReloadIcon from '../../Icons/ReloadIcon'
|
||||
@ -14,6 +14,7 @@ import useViewMode from '../hooks/useViewMode'
|
||||
import useColumnVisibility from '../hooks/useColumnVisibility'
|
||||
|
||||
const Printers = () => {
|
||||
const [messageApi, contextHolder] = message.useMessage()
|
||||
const [newPrinterOpen, setNewPrinterOpen] = useState(false)
|
||||
const tableRef = useRef()
|
||||
|
||||
@ -49,6 +50,7 @@ const Printers = () => {
|
||||
return (
|
||||
<>
|
||||
<Flex vertical={'true'} gap='large'>
|
||||
{contextHolder}
|
||||
<Flex justify={'space-between'}>
|
||||
<Space>
|
||||
<Dropdown menu={actionItems}>
|
||||
@ -90,6 +92,7 @@ const Printers = () => {
|
||||
<NewPrinter
|
||||
onOk={() => {
|
||||
setNewPrinterOpen(false)
|
||||
messageApi.success('New printer added successfully.')
|
||||
tableRef.current?.reload()
|
||||
}}
|
||||
reset={newPrinterOpen}
|
||||
|
||||
@ -1,11 +1,9 @@
|
||||
import PropTypes from 'prop-types'
|
||||
import { useMessageContext } from '../../context/MessageContext'
|
||||
import ObjectInfo from '../../common/ObjectInfo'
|
||||
import NewObjectForm from '../../common/NewObjectForm'
|
||||
import WizardView from '../../common/WizardView'
|
||||
|
||||
const NewPrinter = ({ onOk, defaultValues }) => {
|
||||
const { showSuccess } = useMessageContext()
|
||||
return (
|
||||
<NewObjectForm
|
||||
type={'printer'}
|
||||
@ -95,12 +93,9 @@ const NewPrinter = ({ onOk, defaultValues }) => {
|
||||
loading={submitLoading}
|
||||
formValid={formValid}
|
||||
title='New Printer'
|
||||
onSubmit={async () => {
|
||||
const result = await handleSubmit()
|
||||
if (result) {
|
||||
showSuccess('New printer added successfully.')
|
||||
onSubmit={() => {
|
||||
handleSubmit()
|
||||
onOk()
|
||||
}
|
||||
}}
|
||||
/>
|
||||
)
|
||||
|
||||
@ -1,6 +1,5 @@
|
||||
import PropTypes from 'prop-types'
|
||||
import { Button, Tooltip } from 'antd'
|
||||
import { useMessageContext } from '../context/MessageContext'
|
||||
import { Button, Tooltip, message } from 'antd'
|
||||
import CopyIcon from '../../Icons/CopyIcon'
|
||||
|
||||
const CopyButton = ({
|
||||
@ -9,17 +8,17 @@ const CopyButton = ({
|
||||
size = 'small',
|
||||
type = 'text'
|
||||
}) => {
|
||||
const { showSuccess, showError } = useMessageContext()
|
||||
const [messageApi, contextHolder] = message.useMessage()
|
||||
|
||||
const doCopy = (copyText) => {
|
||||
if (navigator && navigator.clipboard && navigator.clipboard.writeText) {
|
||||
navigator.clipboard
|
||||
.writeText(copyText)
|
||||
.then(() => {
|
||||
showSuccess('Copied to clipboard')
|
||||
messageApi.success('Copied to clipboard')
|
||||
})
|
||||
.catch(() => {
|
||||
showError('Failed to copy')
|
||||
messageApi.error('Failed to copy')
|
||||
})
|
||||
} else if (
|
||||
document.queryCommandSupported &&
|
||||
@ -35,20 +34,21 @@ const CopyButton = ({
|
||||
textarea.select()
|
||||
try {
|
||||
document.execCommand('copy')
|
||||
showSuccess('Copied to clipboard')
|
||||
messageApi.success('Copied to clipboard')
|
||||
} catch (err) {
|
||||
console.error(err)
|
||||
console.error(err)
|
||||
showError('Failed to copy')
|
||||
messageApi.error('Failed to copy')
|
||||
}
|
||||
document.body.removeChild(textarea)
|
||||
} else {
|
||||
showError('Copy not supported in this browser')
|
||||
messageApi.error('Copy not supported in this browser')
|
||||
}
|
||||
}
|
||||
|
||||
return (
|
||||
<>
|
||||
{contextHolder}
|
||||
<Tooltip title={tooltip} arrow={false}>
|
||||
<Button
|
||||
icon={<CopyIcon />}
|
||||
|
||||
@ -6,6 +6,7 @@ import { Button, Dropdown, Modal } from 'antd'
|
||||
import { ApiServerContext } from '../context/ApiServerContext'
|
||||
import DocumentTemplateIcon from '../../Icons/DocumentTemplateIcon'
|
||||
import NewDocumentJob from '../Management/DocumentJobs/NewDocumentJob'
|
||||
import { message } from 'antd'
|
||||
import { AuthContext } from '../context/AuthContext'
|
||||
|
||||
const DocumentPrintButton = ({
|
||||
@ -18,6 +19,7 @@ const DocumentPrintButton = ({
|
||||
const [documentTemplates, setDocumentTemplates] = useState([])
|
||||
const [currentDocumentTemplate, setCurrentDocumentTemplate] = useState(null)
|
||||
const [loading, setLoading] = useState(false)
|
||||
const [messageApi, contextHolder] = message.useMessage()
|
||||
const [newDocumentJobOpen, setNewDocumentJobOpen] = useState(false)
|
||||
|
||||
const { token } = useContext(AuthContext)
|
||||
@ -84,6 +86,7 @@ const DocumentPrintButton = ({
|
||||
|
||||
return (
|
||||
<>
|
||||
{contextHolder}
|
||||
<Dropdown
|
||||
menu={{
|
||||
items: menuItems,
|
||||
@ -117,6 +120,7 @@ const DocumentPrintButton = ({
|
||||
<NewDocumentJob
|
||||
onOk={() => {
|
||||
setNewDocumentJobOpen(false)
|
||||
messageApi.success('New document job created successfully.')
|
||||
}}
|
||||
reset={!newDocumentJobOpen}
|
||||
defaultValues={{
|
||||
|
||||
@ -1,7 +1,6 @@
|
||||
import { useState, useEffect, useContext, useCallback } from 'react'
|
||||
import { Form } from 'antd'
|
||||
import { Form, message } from 'antd'
|
||||
import { ApiServerContext } from '../context/ApiServerContext'
|
||||
import { useMessageContext } from '../context/MessageContext'
|
||||
import PropTypes from 'prop-types'
|
||||
import merge from 'lodash/merge'
|
||||
import set from 'lodash/set'
|
||||
@ -36,7 +35,7 @@ const NewObjectForm = ({ type, style, defaultValues = {}, children }) => {
|
||||
const [formValid, setFormValid] = useState(false)
|
||||
const [form] = Form.useForm()
|
||||
const formUpdateValues = Form.useWatch([], form)
|
||||
const { showSuccess, showError: showMessageError } = useMessageContext()
|
||||
const [messageApi, contextHolder] = message.useMessage()
|
||||
const { createObject, showError } = useContext(ApiServerContext)
|
||||
|
||||
// Get the model definition for this object type
|
||||
@ -157,14 +156,14 @@ const NewObjectForm = ({ type, style, defaultValues = {}, children }) => {
|
||||
const computedValuesObject = buildObjectFromEntries(computedEntries)
|
||||
const computedObjectData = merge({}, objectData, computedValuesObject)
|
||||
const newObject = await createObject(type, computedObjectData)
|
||||
showSuccess('Object created successfully')
|
||||
messageApi.success('Object created successfully')
|
||||
return newObject
|
||||
} catch (err) {
|
||||
console.error(err)
|
||||
if (err.errorFields) {
|
||||
return
|
||||
}
|
||||
showMessageError('Failed to create object')
|
||||
messageApi.error('Failed to create object')
|
||||
showError(
|
||||
`Failed to create object. Message: ${err.message}. Code: ${err.code}`,
|
||||
() => handleSubmit()
|
||||
@ -209,6 +208,7 @@ const NewObjectForm = ({ type, style, defaultValues = {}, children }) => {
|
||||
})
|
||||
}}
|
||||
>
|
||||
{contextHolder}
|
||||
{children({
|
||||
submitLoading: submitLoading,
|
||||
handleSubmit,
|
||||
|
||||
@ -9,6 +9,7 @@ import {
|
||||
Modal,
|
||||
Spin,
|
||||
Alert,
|
||||
message,
|
||||
Dropdown
|
||||
} from 'antd'
|
||||
import { LoadingOutlined } from '@ant-design/icons'
|
||||
@ -26,6 +27,7 @@ const NotesPanel = ({ _id, type }) => {
|
||||
const [newNoteOpen, setNewNoteOpen] = useState(false)
|
||||
const [loading, setLoading] = useState(true)
|
||||
const [initialized, setInitialized] = useState(false)
|
||||
const [messageApi, contextHolder] = message.useMessage()
|
||||
const [error, setError] = useState(null)
|
||||
const [notes, setNotes] = useState(null)
|
||||
const [expandedNotes, setExpandedNotes] = useState({})
|
||||
@ -143,6 +145,7 @@ const NotesPanel = ({ _id, type }) => {
|
||||
|
||||
return (
|
||||
<Flex vertical gap='large' style={{ width: '100%' }}>
|
||||
{contextHolder}
|
||||
<Flex justify='space-between'>
|
||||
<Space size={'small'}>
|
||||
<Dropdown menu={actionItems} disabled={loading}>
|
||||
@ -185,6 +188,7 @@ const NotesPanel = ({ _id, type }) => {
|
||||
<NewNote
|
||||
onOk={() => {
|
||||
setNewNoteOpen(false)
|
||||
messageApi.success('New note added.')
|
||||
}}
|
||||
reset={newNoteOpen}
|
||||
defaultValues={{
|
||||
|
||||
@ -5,12 +5,12 @@ import {
|
||||
Button,
|
||||
Empty,
|
||||
Spin,
|
||||
message,
|
||||
Popconfirm,
|
||||
Flex,
|
||||
Badge,
|
||||
Dropdown
|
||||
} from 'antd'
|
||||
import { useMessageContext } from '../context/MessageContext'
|
||||
import {
|
||||
BellOutlined,
|
||||
DeleteOutlined,
|
||||
@ -29,7 +29,7 @@ const NotificationCenter = ({ visible }) => {
|
||||
const [notifications, setNotifications] = useState([])
|
||||
const [loading, setLoading] = useState(false)
|
||||
const [showDeleteConfirm, setShowDeleteConfirm] = useState(false)
|
||||
const { showSuccess, showError } = useMessageContext()
|
||||
const [messageApi, contextHolder] = message.useMessage()
|
||||
|
||||
const { authenticated } = useContext(AuthContext)
|
||||
|
||||
@ -47,11 +47,11 @@ const NotificationCenter = ({ visible }) => {
|
||||
setNotifications(response.data)
|
||||
} catch (error) {
|
||||
console.error('Error fetching notifications:', error)
|
||||
showError('Failed to fetch notifications')
|
||||
messageApi.error('Failed to fetch notifications')
|
||||
} finally {
|
||||
setLoading(false)
|
||||
}
|
||||
}, [authenticated, showError])
|
||||
}, [authenticated, messageApi])
|
||||
|
||||
const markAsRead = useCallback(
|
||||
async (notificationId) => {
|
||||
@ -77,13 +77,13 @@ const NotificationCenter = ({ visible }) => {
|
||||
})
|
||||
)
|
||||
|
||||
showSuccess('Notification marked as read')
|
||||
messageApi.success('Notification marked as read')
|
||||
} catch (error) {
|
||||
console.error('Error marking notification as read:', error)
|
||||
showError('Failed to mark notification as read')
|
||||
messageApi.error('Failed to mark notification as read')
|
||||
}
|
||||
},
|
||||
[showSuccess, showError]
|
||||
[messageApi]
|
||||
)
|
||||
|
||||
const markAllAsRead = useCallback(async () => {
|
||||
@ -104,12 +104,12 @@ const NotificationCenter = ({ visible }) => {
|
||||
prev.map((notification) => ({ ...notification, read: true }))
|
||||
)
|
||||
|
||||
showSuccess('All notifications marked as read')
|
||||
messageApi.success('All notifications marked as read')
|
||||
} catch (error) {
|
||||
console.error('Error marking all notifications as read:', error)
|
||||
showError('Failed to mark all notifications as read')
|
||||
messageApi.error('Failed to mark all notifications as read')
|
||||
}
|
||||
}, [showSuccess, showError])
|
||||
}, [messageApi])
|
||||
|
||||
const deleteAllNotifications = useCallback(async () => {
|
||||
try {
|
||||
@ -121,14 +121,14 @@ const NotificationCenter = ({ visible }) => {
|
||||
})
|
||||
|
||||
setNotifications([])
|
||||
showSuccess('All notifications deleted')
|
||||
messageApi.success('All notifications deleted')
|
||||
} catch (error) {
|
||||
console.error('Error deleting all notifications:', error)
|
||||
showError('Failed to delete all notifications')
|
||||
messageApi.error('Failed to delete all notifications')
|
||||
} finally {
|
||||
setShowDeleteConfirm(false)
|
||||
}
|
||||
}, [showSuccess, showError])
|
||||
}, [messageApi])
|
||||
|
||||
useEffect(() => {
|
||||
if (visible && authenticated) {
|
||||
@ -179,6 +179,7 @@ const NotificationCenter = ({ visible }) => {
|
||||
|
||||
return (
|
||||
<>
|
||||
{contextHolder}
|
||||
<Flex justify='space-between' align='center'>
|
||||
<Space size='middle'>
|
||||
<Dropdown menu={actionItems}>
|
||||
|
||||
@ -7,10 +7,9 @@ import {
|
||||
useImperativeHandle,
|
||||
useRef
|
||||
} from 'react'
|
||||
import { Form } from 'antd'
|
||||
import { Form, message } from 'antd'
|
||||
import { ApiServerContext } from '../context/ApiServerContext'
|
||||
import { AuthContext } from '../context/AuthContext'
|
||||
import { useMessageContext } from '../context/MessageContext'
|
||||
import PropTypes from 'prop-types'
|
||||
import DeleteObjectModal from './DeleteObjectModal'
|
||||
import merge from 'lodash/merge'
|
||||
@ -55,7 +54,7 @@ const ObjectForm = forwardRef(
|
||||
|
||||
const [form] = Form.useForm()
|
||||
const formUpdateValues = Form.useWatch([], form)
|
||||
const { showSuccess, showError: showMessageError } = useMessageContext()
|
||||
const [messageApi, contextHolder] = message.useMessage()
|
||||
const [deleteModalOpen, setDeleteModalOpen] = useState(false)
|
||||
const [deleteLoading, setDeleteLoading] = useState(false)
|
||||
const {
|
||||
@ -297,7 +296,7 @@ const ObjectForm = forwardRef(
|
||||
onStateChangeRef.current({ loading: false })
|
||||
} catch (err) {
|
||||
console.error(err)
|
||||
showMessageError('Failed to fetch object info')
|
||||
messageApi.error('Failed to fetch object info')
|
||||
showError(
|
||||
`Failed to fetch object information. Message: ${err.message}. Code: ${err.code}`,
|
||||
fetchObject
|
||||
@ -309,7 +308,7 @@ const ObjectForm = forwardRef(
|
||||
id,
|
||||
type,
|
||||
form,
|
||||
showMessageError,
|
||||
messageApi,
|
||||
showError,
|
||||
calculateComputedValues,
|
||||
model
|
||||
@ -434,13 +433,13 @@ const ObjectForm = forwardRef(
|
||||
...currentFormData,
|
||||
_isEditing: isEditingRef.current
|
||||
})
|
||||
showSuccess('Information updated successfully')
|
||||
messageApi.success('Information updated successfully')
|
||||
} catch (err) {
|
||||
console.error(err)
|
||||
if (err.errorFields) {
|
||||
return
|
||||
}
|
||||
showMessageError('Failed to update information')
|
||||
messageApi.error('Failed to update information')
|
||||
showError(
|
||||
`Failed to update information. Message: ${err.message}. Code: ${err.code}`,
|
||||
() => handleUpdate()
|
||||
@ -461,11 +460,11 @@ const ObjectForm = forwardRef(
|
||||
try {
|
||||
await deleteObject(id, type)
|
||||
setDeleteModalOpen(false)
|
||||
showSuccess('Deleted successfully')
|
||||
messageApi.success('Deleted successfully')
|
||||
// Optionally: trigger a callback to parent to remove this object from view
|
||||
} catch (err) {
|
||||
console.error(err)
|
||||
showMessageError('Failed to delete')
|
||||
messageApi.error('Failed to delete')
|
||||
showError(
|
||||
`Failed to delete. Message: ${err.message}. Code: ${err.code}`,
|
||||
confirmDelete
|
||||
@ -551,6 +550,7 @@ const ObjectForm = forwardRef(
|
||||
})
|
||||
}}
|
||||
>
|
||||
{contextHolder}
|
||||
{children({
|
||||
loading: fetchLoading,
|
||||
isEditing,
|
||||
|
||||
@ -9,6 +9,7 @@ import {
|
||||
} from 'react'
|
||||
import {
|
||||
Table,
|
||||
message,
|
||||
Skeleton,
|
||||
Card,
|
||||
Row,
|
||||
@ -84,6 +85,7 @@ const ObjectTable = forwardRef(
|
||||
if (cards && isElectron) {
|
||||
adjustedScrollHeight = 'calc(var(--unit-100vh) - 260px)'
|
||||
}
|
||||
const [, contextHolder] = message.useMessage()
|
||||
const tableRef = useRef(null)
|
||||
const model = getModelByName(type)
|
||||
const tableFilterRef = useRef({})
|
||||
@ -779,6 +781,7 @@ const ObjectTable = forwardRef(
|
||||
|
||||
return (
|
||||
<>
|
||||
{contextHolder}
|
||||
<Flex gap={'middle'} vertical>
|
||||
<Table
|
||||
ref={tableRef}
|
||||
|
||||
@ -1,9 +1,8 @@
|
||||
import PropTypes from 'prop-types'
|
||||
import { Card, Tree, Spin, Space, Button } from 'antd'
|
||||
import { Card, Tree, Spin, Space, Button, message } from 'antd'
|
||||
import { LoadingOutlined } from '@ant-design/icons'
|
||||
import { useState, useEffect, useContext } from 'react'
|
||||
import { useNavigate } from 'react-router-dom'
|
||||
import { useMessageContext } from '../context/MessageContext'
|
||||
import { PrintServerContext } from '../context/PrintServerContext'
|
||||
import axios from 'axios'
|
||||
import JobIcon from '../../Icons/JobIcon'
|
||||
@ -21,7 +20,7 @@ const PrinterJobsTree = ({
|
||||
const [treeLoading, setTreeLoading] = useState(initialLoading)
|
||||
const [error, setError] = useState(null)
|
||||
const { printServer } = useContext(PrintServerContext)
|
||||
const { showError } = useMessageContext()
|
||||
const [messageApi] = message.useMessage()
|
||||
const [expandedKeys, setExpandedKeys] = useState([])
|
||||
const [treeData, setTreeData] = useState([])
|
||||
const navigate = useNavigate()
|
||||
@ -106,7 +105,7 @@ const PrinterJobsTree = ({
|
||||
} catch (err) {
|
||||
console.error(err)
|
||||
setError('Failed to fetch sub jobs')
|
||||
showError('Failed to fetch sub jobs')
|
||||
messageApi.error('Failed to fetch sub jobs')
|
||||
} finally {
|
||||
setTreeLoading(false)
|
||||
}
|
||||
|
||||
@ -1,10 +1,9 @@
|
||||
// PrinterSelect.js
|
||||
import PropTypes from 'prop-types'
|
||||
import { Tree, Card, Spin, Space, Button, Typography } from 'antd'
|
||||
import { Tree, Card, Spin, Space, Button, message, Typography } from 'antd'
|
||||
import { LoadingOutlined } from '@ant-design/icons'
|
||||
import { useState, useEffect, useContext, useCallback } from 'react'
|
||||
import { useNavigate } from 'react-router-dom'
|
||||
import { useMessageContext } from '../context/MessageContext'
|
||||
import PrinterState from './PrinterState'
|
||||
import axios from 'axios'
|
||||
import { PrintServerContext } from '../context/PrintServerContext'
|
||||
@ -23,7 +22,7 @@ const SubJobsTree = ({ jobData, loading }) => {
|
||||
const [treeLoading, setTreeLoading] = useState(loading)
|
||||
const [error, setError] = useState(null)
|
||||
const { printServer } = useContext(PrintServerContext)
|
||||
const { showError } = useMessageContext()
|
||||
const [messageApi] = message.useMessage()
|
||||
const [expandedKeys, setExpandedKeys] = useState([])
|
||||
const [currentJobData, setCurrentJobData] = useState(null)
|
||||
const navigate = useNavigate()
|
||||
@ -105,7 +104,7 @@ const SubJobsTree = ({ jobData, loading }) => {
|
||||
} catch (err) {
|
||||
console.error(err)
|
||||
setError('Failed to fetch print job details')
|
||||
showError('Failed to fetch print job details')
|
||||
messageApi.error('Failed to fetch print job details')
|
||||
} finally {
|
||||
setTreeLoading(false)
|
||||
}
|
||||
|
||||
@ -9,7 +9,6 @@ import PauseCircleIcon from '../../components/Icons/PauseCircleIcon'
|
||||
import StopCircleIcon from '../../components/Icons/StopCircleIcon'
|
||||
import FilamentStockIcon from '../../components/Icons/FilamentStockIcon'
|
||||
import ControlIcon from '../../components/Icons/ControlIcon'
|
||||
import JobIcon from '../../components/Icons/JobIcon'
|
||||
|
||||
export const Printer = {
|
||||
name: 'printer',
|
||||
@ -115,9 +114,9 @@ export const Printer = {
|
||||
]
|
||||
},
|
||||
{
|
||||
name: 'job',
|
||||
label: 'Job',
|
||||
icon: JobIcon,
|
||||
name: 'queue',
|
||||
label: 'Queue',
|
||||
icon: PlayCircleIcon,
|
||||
disabled: (objectData) => {
|
||||
return objectData?.online == false
|
||||
},
|
||||
|
||||
@ -26,7 +26,7 @@ export default defineConfig({
|
||||
server: {
|
||||
allowedHosts: ['dev.tombutcher.work'],
|
||||
host: '0.0.0.0',
|
||||
port: 5173,
|
||||
port: 5780,
|
||||
open: false
|
||||
}
|
||||
})
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user