Compare commits
No commits in common. "ed4f1c7505adc9c1a7323fcb3e9bb09f00b7a04b" and "1192d56027837e6c3ee8c35be692b76891812ba3" have entirely different histories.
ed4f1c7505
...
1192d56027
@ -26,7 +26,10 @@ import InfoCollapsePlaceholder from '../../common/InfoCollapsePlaceholder.jsx'
|
|||||||
import DocumentPrintButton from '../../common/DocumentPrintButton.jsx'
|
import DocumentPrintButton from '../../common/DocumentPrintButton.jsx'
|
||||||
import UserNotifierToggle from '../../common/UserNotifierToggle.jsx'
|
import UserNotifierToggle from '../../common/UserNotifierToggle.jsx'
|
||||||
import ScrollBox from '../../common/ScrollBox.jsx'
|
import ScrollBox from '../../common/ScrollBox.jsx'
|
||||||
import { getModelProperty } from '../../../../database/ObjectModels.js'
|
import {
|
||||||
|
getModelByName,
|
||||||
|
getModelProperty
|
||||||
|
} from '../../../../database/ObjectModels.js'
|
||||||
import OrderItemIcon from '../../../Icons/OrderItemIcon.jsx'
|
import OrderItemIcon from '../../../Icons/OrderItemIcon.jsx'
|
||||||
import ShipmentIcon from '../../../Icons/ShipmentIcon.jsx'
|
import ShipmentIcon from '../../../Icons/ShipmentIcon.jsx'
|
||||||
|
|
||||||
@ -62,7 +65,6 @@ const InvoiceInfo = () => {
|
|||||||
formValid: false,
|
formValid: false,
|
||||||
lock: null,
|
lock: null,
|
||||||
loading: false,
|
loading: false,
|
||||||
editDisabled: false,
|
|
||||||
objectData: {}
|
objectData: {}
|
||||||
})
|
})
|
||||||
|
|
||||||
@ -85,6 +87,11 @@ const InvoiceInfo = () => {
|
|||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const editDisabled =
|
||||||
|
getModelByName('invoice')
|
||||||
|
?.actions?.find((action) => action.name === 'edit')
|
||||||
|
?.disabled(objectFormState.objectData) ?? false
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Flex
|
<Flex
|
||||||
gap='large'
|
gap='large'
|
||||||
@ -149,7 +156,7 @@ const InvoiceInfo = () => {
|
|||||||
disabled={
|
disabled={
|
||||||
objectFormState.beingEditedByOther ||
|
objectFormState.beingEditedByOther ||
|
||||||
objectFormState.loading ||
|
objectFormState.loading ||
|
||||||
objectFormState.editDisabled
|
editDisabled
|
||||||
}
|
}
|
||||||
loading={objectFormState.editLoading}
|
loading={objectFormState.editLoading}
|
||||||
/>
|
/>
|
||||||
|
|||||||
@ -24,6 +24,7 @@ import InfoCollapsePlaceholder from '../../common/InfoCollapsePlaceholder.jsx'
|
|||||||
import DocumentPrintButton from '../../common/DocumentPrintButton.jsx'
|
import DocumentPrintButton from '../../common/DocumentPrintButton.jsx'
|
||||||
import UserNotifierToggle from '../../common/UserNotifierToggle.jsx'
|
import UserNotifierToggle from '../../common/UserNotifierToggle.jsx'
|
||||||
import ScrollBox from '../../common/ScrollBox.jsx'
|
import ScrollBox from '../../common/ScrollBox.jsx'
|
||||||
|
import { getModelByName } from '../../../../database/ObjectModels.js'
|
||||||
|
|
||||||
const log = loglevel.getLogger('PaymentInfo')
|
const log = loglevel.getLogger('PaymentInfo')
|
||||||
log.setLevel(config.logLevel)
|
log.setLevel(config.logLevel)
|
||||||
@ -54,7 +55,6 @@ const PaymentInfo = () => {
|
|||||||
formValid: false,
|
formValid: false,
|
||||||
lock: null,
|
lock: null,
|
||||||
loading: false,
|
loading: false,
|
||||||
editDisabled: false,
|
|
||||||
objectData: {}
|
objectData: {}
|
||||||
})
|
})
|
||||||
|
|
||||||
@ -77,6 +77,11 @@ const PaymentInfo = () => {
|
|||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const editDisabled =
|
||||||
|
getModelByName('payment')
|
||||||
|
?.actions?.find((action) => action.name === 'edit')
|
||||||
|
?.disabled(objectFormState.objectData) ?? false
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Flex
|
<Flex
|
||||||
gap='large'
|
gap='large'
|
||||||
@ -138,7 +143,7 @@ const PaymentInfo = () => {
|
|||||||
disabled={
|
disabled={
|
||||||
objectFormState.beingEditedByOther ||
|
objectFormState.beingEditedByOther ||
|
||||||
objectFormState.loading ||
|
objectFormState.loading ||
|
||||||
objectFormState.editDisabled
|
editDisabled
|
||||||
}
|
}
|
||||||
loading={objectFormState.editLoading}
|
loading={objectFormState.editLoading}
|
||||||
/>
|
/>
|
||||||
|
|||||||
@ -45,7 +45,6 @@ const TaxRecordInfo = () => {
|
|||||||
formValid: false,
|
formValid: false,
|
||||||
lock: null,
|
lock: null,
|
||||||
loading: false,
|
loading: false,
|
||||||
editDisabled: false,
|
|
||||||
objectData: {}
|
objectData: {}
|
||||||
})
|
})
|
||||||
|
|
||||||
@ -125,9 +124,7 @@ const TaxRecordInfo = () => {
|
|||||||
editLoading={objectFormState.editLoading}
|
editLoading={objectFormState.editLoading}
|
||||||
formValid={objectFormState.formValid}
|
formValid={objectFormState.formValid}
|
||||||
disabled={
|
disabled={
|
||||||
objectFormState.beingEditedByOther ||
|
objectFormState.beingEditedByOther || objectFormState.loading
|
||||||
objectFormState.loading ||
|
|
||||||
objectFormState.editDisabled
|
|
||||||
}
|
}
|
||||||
loading={objectFormState.editLoading}
|
loading={objectFormState.editLoading}
|
||||||
/>
|
/>
|
||||||
|
|||||||
@ -47,7 +47,6 @@ const FilamentStockInfo = () => {
|
|||||||
formValid: false,
|
formValid: false,
|
||||||
lock: null,
|
lock: null,
|
||||||
loading: false,
|
loading: false,
|
||||||
editDisabled: false,
|
|
||||||
objectData: {}
|
objectData: {}
|
||||||
})
|
})
|
||||||
|
|
||||||
@ -124,11 +123,7 @@ const FilamentStockInfo = () => {
|
|||||||
}}
|
}}
|
||||||
editLoading={objectFormState.editLoading}
|
editLoading={objectFormState.editLoading}
|
||||||
formValid={objectFormState.formValid}
|
formValid={objectFormState.formValid}
|
||||||
disabled={
|
disabled={true}
|
||||||
objectFormState.beingEditedByOther ||
|
|
||||||
objectFormState.loading ||
|
|
||||||
objectFormState.editDisabled
|
|
||||||
}
|
|
||||||
loading={objectFormState.editLoading}
|
loading={objectFormState.editLoading}
|
||||||
/>
|
/>
|
||||||
<ObjectTableNavigationButtons
|
<ObjectTableNavigationButtons
|
||||||
|
|||||||
@ -46,7 +46,6 @@ const OrderItemInfo = () => {
|
|||||||
formValid: false,
|
formValid: false,
|
||||||
lock: null,
|
lock: null,
|
||||||
loading: false,
|
loading: false,
|
||||||
editDisabled: false,
|
|
||||||
objectData: {}
|
objectData: {}
|
||||||
})
|
})
|
||||||
|
|
||||||
@ -124,9 +123,7 @@ const OrderItemInfo = () => {
|
|||||||
editLoading={objectFormState.editLoading}
|
editLoading={objectFormState.editLoading}
|
||||||
formValid={objectFormState.formValid}
|
formValid={objectFormState.formValid}
|
||||||
disabled={
|
disabled={
|
||||||
objectFormState.beingEditedByOther ||
|
objectFormState.beingEditedByOther || objectFormState.loading
|
||||||
objectFormState.loading ||
|
|
||||||
objectFormState.editDisabled
|
|
||||||
}
|
}
|
||||||
loading={objectFormState.editLoading}
|
loading={objectFormState.editLoading}
|
||||||
/>
|
/>
|
||||||
|
|||||||
@ -52,7 +52,6 @@ const PartStockInfo = () => {
|
|||||||
formValid: false,
|
formValid: false,
|
||||||
activities: [],
|
activities: [],
|
||||||
loading: false,
|
loading: false,
|
||||||
editDisabled: false,
|
|
||||||
objectData: {}
|
objectData: {}
|
||||||
})
|
})
|
||||||
|
|
||||||
@ -133,9 +132,7 @@ const PartStockInfo = () => {
|
|||||||
editLoading={objectFormState.editLoading}
|
editLoading={objectFormState.editLoading}
|
||||||
formValid={objectFormState.formValid}
|
formValid={objectFormState.formValid}
|
||||||
disabled={
|
disabled={
|
||||||
objectFormState.beingEditedByOther ||
|
objectFormState.beingEditedByOther || objectFormState.loading
|
||||||
objectFormState.loading ||
|
|
||||||
objectFormState.editDisabled
|
|
||||||
}
|
}
|
||||||
loading={objectFormState.editLoading}
|
loading={objectFormState.editLoading}
|
||||||
/>
|
/>
|
||||||
|
|||||||
@ -10,7 +10,10 @@ import InfoCollapse from '../../common/InfoCollapse.jsx'
|
|||||||
import ObjectInfo from '../../common/ObjectInfo.jsx'
|
import ObjectInfo from '../../common/ObjectInfo.jsx'
|
||||||
import ObjectProperty from '../../common/ObjectProperty.jsx'
|
import ObjectProperty from '../../common/ObjectProperty.jsx'
|
||||||
import ViewButton from '../../common/ViewButton.jsx'
|
import ViewButton from '../../common/ViewButton.jsx'
|
||||||
import { getModelProperty } from '../../../../database/ObjectModels.js'
|
import {
|
||||||
|
getModelProperty,
|
||||||
|
getModelByName
|
||||||
|
} from '../../../../database/ObjectModels.js'
|
||||||
import InfoCircleIcon from '../../../Icons/InfoCircleIcon.jsx'
|
import InfoCircleIcon from '../../../Icons/InfoCircleIcon.jsx'
|
||||||
import NoteIcon from '../../../Icons/NoteIcon.jsx'
|
import NoteIcon from '../../../Icons/NoteIcon.jsx'
|
||||||
import AuditLogIcon from '../../../Icons/AuditLogIcon.jsx'
|
import AuditLogIcon from '../../../Icons/AuditLogIcon.jsx'
|
||||||
@ -68,7 +71,6 @@ const ProductStockInfo = () => {
|
|||||||
formValid: false,
|
formValid: false,
|
||||||
activities: [],
|
activities: [],
|
||||||
loading: false,
|
loading: false,
|
||||||
editDisabled: false,
|
|
||||||
objectData: {}
|
objectData: {}
|
||||||
})
|
})
|
||||||
|
|
||||||
@ -91,6 +93,11 @@ const ProductStockInfo = () => {
|
|||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const editDisabled =
|
||||||
|
getModelByName('productStock')
|
||||||
|
?.actions?.find((action) => action.name === 'edit')
|
||||||
|
?.disabled(objectFormState.objectData) ?? false
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Flex
|
<Flex
|
||||||
gap='large'
|
gap='large'
|
||||||
@ -155,7 +162,7 @@ const ProductStockInfo = () => {
|
|||||||
disabled={
|
disabled={
|
||||||
objectFormState.beingEditedByOther ||
|
objectFormState.beingEditedByOther ||
|
||||||
objectFormState.loading ||
|
objectFormState.loading ||
|
||||||
objectFormState.editDisabled
|
editDisabled
|
||||||
}
|
}
|
||||||
loading={objectFormState.editLoading}
|
loading={objectFormState.editLoading}
|
||||||
/>
|
/>
|
||||||
|
|||||||
@ -28,6 +28,7 @@ import OrderItemsIcon from '../../../Icons/OrderItemIcon.jsx'
|
|||||||
import ShipmentIcon from '../../../Icons/ShipmentIcon.jsx'
|
import ShipmentIcon from '../../../Icons/ShipmentIcon.jsx'
|
||||||
import InvoiceIcon from '../../../Icons/InvoiceIcon.jsx'
|
import InvoiceIcon from '../../../Icons/InvoiceIcon.jsx'
|
||||||
import StockEventIcon from '../../../Icons/StockEventIcon.jsx'
|
import StockEventIcon from '../../../Icons/StockEventIcon.jsx'
|
||||||
|
import { getModelByName } from '../../../../database/ObjectModels.js'
|
||||||
|
|
||||||
const log = loglevel.getLogger('PurchaseOrderInfo')
|
const log = loglevel.getLogger('PurchaseOrderInfo')
|
||||||
log.setLevel(config.logLevel)
|
log.setLevel(config.logLevel)
|
||||||
@ -69,7 +70,6 @@ const PurchaseOrderInfo = () => {
|
|||||||
formValid: false,
|
formValid: false,
|
||||||
lock: null,
|
lock: null,
|
||||||
loading: false,
|
loading: false,
|
||||||
editDisabled: false,
|
|
||||||
objectData: {}
|
objectData: {}
|
||||||
})
|
})
|
||||||
|
|
||||||
@ -95,6 +95,10 @@ const PurchaseOrderInfo = () => {
|
|||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const editDisabled = getModelByName('purchaseOrder')
|
||||||
|
.actions.find((action) => action.name === 'edit')
|
||||||
|
.disabled(objectFormState.objectData)
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Flex
|
<Flex
|
||||||
gap='large'
|
gap='large'
|
||||||
@ -160,7 +164,7 @@ const PurchaseOrderInfo = () => {
|
|||||||
disabled={
|
disabled={
|
||||||
objectFormState.beingEditedByOther ||
|
objectFormState.beingEditedByOther ||
|
||||||
objectFormState.loading ||
|
objectFormState.loading ||
|
||||||
objectFormState.editDisabled
|
editDisabled
|
||||||
}
|
}
|
||||||
loading={objectFormState.editLoading}
|
loading={objectFormState.editLoading}
|
||||||
/>
|
/>
|
||||||
|
|||||||
@ -61,7 +61,6 @@ const PurchaseOrderInfo = () => {
|
|||||||
formValid: false,
|
formValid: false,
|
||||||
lock: null,
|
lock: null,
|
||||||
loading: false,
|
loading: false,
|
||||||
editDisabled: false,
|
|
||||||
objectData: {}
|
objectData: {}
|
||||||
})
|
})
|
||||||
|
|
||||||
@ -160,9 +159,7 @@ const PurchaseOrderInfo = () => {
|
|||||||
editLoading={objectFormState.editLoading}
|
editLoading={objectFormState.editLoading}
|
||||||
formValid={objectFormState.formValid}
|
formValid={objectFormState.formValid}
|
||||||
disabled={
|
disabled={
|
||||||
objectFormState.beingEditedByOther ||
|
objectFormState.beingEditedByOther || objectFormState.loading
|
||||||
objectFormState.loading ||
|
|
||||||
objectFormState.editDisabled
|
|
||||||
}
|
}
|
||||||
loading={objectFormState.editLoading}
|
loading={objectFormState.editLoading}
|
||||||
/>
|
/>
|
||||||
|
|||||||
@ -58,7 +58,6 @@ const ShipmentInfo = () => {
|
|||||||
formValid: false,
|
formValid: false,
|
||||||
lock: null,
|
lock: null,
|
||||||
loading: false,
|
loading: false,
|
||||||
editDisabled: false,
|
|
||||||
objectData: {}
|
objectData: {}
|
||||||
})
|
})
|
||||||
const actions = {
|
const actions = {
|
||||||
@ -139,9 +138,7 @@ const ShipmentInfo = () => {
|
|||||||
editLoading={objectFormState.editLoading}
|
editLoading={objectFormState.editLoading}
|
||||||
formValid={objectFormState.formValid}
|
formValid={objectFormState.formValid}
|
||||||
disabled={
|
disabled={
|
||||||
objectFormState.beingEditedByOther ||
|
objectFormState.beingEditedByOther || objectFormState.loading
|
||||||
objectFormState.loading ||
|
|
||||||
objectFormState.editDisabled
|
|
||||||
}
|
}
|
||||||
loading={objectFormState.editLoading}
|
loading={objectFormState.editLoading}
|
||||||
/>
|
/>
|
||||||
|
|||||||
@ -48,7 +48,6 @@ const StockAuditInfo = () => {
|
|||||||
formValid: false,
|
formValid: false,
|
||||||
activities: [],
|
activities: [],
|
||||||
loading: false,
|
loading: false,
|
||||||
editDisabled: false,
|
|
||||||
objectData: {}
|
objectData: {}
|
||||||
})
|
})
|
||||||
|
|
||||||
@ -127,9 +126,7 @@ const StockAuditInfo = () => {
|
|||||||
editLoading={objectFormState.editLoading}
|
editLoading={objectFormState.editLoading}
|
||||||
formValid={objectFormState.formValid}
|
formValid={objectFormState.formValid}
|
||||||
disabled={
|
disabled={
|
||||||
objectFormState.beingEditedByOther ||
|
objectFormState.beingEditedByOther || objectFormState.loading
|
||||||
objectFormState.loading ||
|
|
||||||
objectFormState.editDisabled
|
|
||||||
}
|
}
|
||||||
loading={objectFormState.editLoading}
|
loading={objectFormState.editLoading}
|
||||||
/>
|
/>
|
||||||
|
|||||||
@ -49,7 +49,6 @@ const StockLocationInfo = () => {
|
|||||||
formValid: false,
|
formValid: false,
|
||||||
activities: [],
|
activities: [],
|
||||||
loading: false,
|
loading: false,
|
||||||
editDisabled: false,
|
|
||||||
objectData: {}
|
objectData: {}
|
||||||
})
|
})
|
||||||
|
|
||||||
@ -128,9 +127,7 @@ const StockLocationInfo = () => {
|
|||||||
editLoading={objectFormState.editLoading}
|
editLoading={objectFormState.editLoading}
|
||||||
formValid={objectFormState.formValid}
|
formValid={objectFormState.formValid}
|
||||||
disabled={
|
disabled={
|
||||||
objectFormState.beingEditedByOther ||
|
objectFormState.beingEditedByOther || objectFormState.loading
|
||||||
objectFormState.loading ||
|
|
||||||
objectFormState.editDisabled
|
|
||||||
}
|
}
|
||||||
loading={objectFormState.editLoading}
|
loading={objectFormState.editLoading}
|
||||||
/>
|
/>
|
||||||
|
|||||||
@ -8,7 +8,10 @@ import InfoCollapse from '../../common/InfoCollapse.jsx'
|
|||||||
import ObjectInfo from '../../common/ObjectInfo.jsx'
|
import ObjectInfo from '../../common/ObjectInfo.jsx'
|
||||||
import ObjectProperty from '../../common/ObjectProperty.jsx'
|
import ObjectProperty from '../../common/ObjectProperty.jsx'
|
||||||
import ViewButton from '../../common/ViewButton.jsx'
|
import ViewButton from '../../common/ViewButton.jsx'
|
||||||
import { getModelProperty } from '../../../../database/ObjectModels.js'
|
import {
|
||||||
|
getModelProperty,
|
||||||
|
getModelByName
|
||||||
|
} from '../../../../database/ObjectModels.js'
|
||||||
import InfoCircleIcon from '../../../Icons/InfoCircleIcon.jsx'
|
import InfoCircleIcon from '../../../Icons/InfoCircleIcon.jsx'
|
||||||
import NoteIcon from '../../../Icons/NoteIcon.jsx'
|
import NoteIcon from '../../../Icons/NoteIcon.jsx'
|
||||||
import AuditLogIcon from '../../../Icons/AuditLogIcon.jsx'
|
import AuditLogIcon from '../../../Icons/AuditLogIcon.jsx'
|
||||||
@ -58,7 +61,6 @@ const StockTransferInfo = () => {
|
|||||||
formValid: false,
|
formValid: false,
|
||||||
activities: [],
|
activities: [],
|
||||||
loading: false,
|
loading: false,
|
||||||
editDisabled: false,
|
|
||||||
objectData: {}
|
objectData: {}
|
||||||
})
|
})
|
||||||
|
|
||||||
@ -81,6 +83,11 @@ const StockTransferInfo = () => {
|
|||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const editDisabled =
|
||||||
|
getModelByName('stockTransfer')
|
||||||
|
?.actions?.find((action) => action.name === 'edit')
|
||||||
|
?.disabled(objectFormState.objectData) ?? false
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Flex
|
<Flex
|
||||||
gap='large'
|
gap='large'
|
||||||
@ -143,7 +150,7 @@ const StockTransferInfo = () => {
|
|||||||
disabled={
|
disabled={
|
||||||
objectFormState.beingEditedByOther ||
|
objectFormState.beingEditedByOther ||
|
||||||
objectFormState.loading ||
|
objectFormState.loading ||
|
||||||
objectFormState.editDisabled
|
editDisabled
|
||||||
}
|
}
|
||||||
loading={objectFormState.editLoading}
|
loading={objectFormState.editLoading}
|
||||||
/>
|
/>
|
||||||
|
|||||||
@ -1,4 +1,4 @@
|
|||||||
import { useRef, useState, useEffect } from 'react'
|
import { useRef, useState, useEffect, useContext } from 'react'
|
||||||
import { useLocation } from 'react-router-dom'
|
import { useLocation } from 'react-router-dom'
|
||||||
import { Flex, Space } from 'antd'
|
import { Flex, Space } from 'antd'
|
||||||
import { LoadingOutlined } from '@ant-design/icons'
|
import { LoadingOutlined } from '@ant-design/icons'
|
||||||
@ -20,6 +20,8 @@ import InfoCollapsePlaceholder from '../../common/InfoCollapsePlaceholder.jsx'
|
|||||||
import DocumentPrintButton from '../../common/DocumentPrintButton.jsx'
|
import DocumentPrintButton from '../../common/DocumentPrintButton.jsx'
|
||||||
import UserNotifierToggle from '../../common/UserNotifierToggle.jsx'
|
import UserNotifierToggle from '../../common/UserNotifierToggle.jsx'
|
||||||
import ScrollBox from '../../common/ScrollBox.jsx'
|
import ScrollBox from '../../common/ScrollBox.jsx'
|
||||||
|
import { getModelByName } from '../../../../database/ObjectModels.js'
|
||||||
|
import { AuthContext } from '../../context/AuthContext.jsx'
|
||||||
|
|
||||||
const AppPasswordInfo = () => {
|
const AppPasswordInfo = () => {
|
||||||
const location = useLocation()
|
const location = useLocation()
|
||||||
@ -34,6 +36,7 @@ const AppPasswordInfo = () => {
|
|||||||
})
|
})
|
||||||
return () => setOnModalOk(null)
|
return () => setOnModalOk(null)
|
||||||
}, [setOnModalOk])
|
}, [setOnModalOk])
|
||||||
|
const { userProfile } = useContext(AuthContext)
|
||||||
const appPasswordId = new URLSearchParams(location.search).get(
|
const appPasswordId = new URLSearchParams(location.search).get(
|
||||||
'appPasswordId'
|
'appPasswordId'
|
||||||
)
|
)
|
||||||
@ -50,7 +53,6 @@ const AppPasswordInfo = () => {
|
|||||||
formValid: false,
|
formValid: false,
|
||||||
lock: null,
|
lock: null,
|
||||||
loading: false,
|
loading: false,
|
||||||
editDisabled: false,
|
|
||||||
objectData: {}
|
objectData: {}
|
||||||
})
|
})
|
||||||
|
|
||||||
@ -69,6 +71,10 @@ const AppPasswordInfo = () => {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const editDisabled = getModelByName('appPassword')
|
||||||
|
.actions.find((action) => action.name === 'edit')
|
||||||
|
.disabled({ ...objectFormState.objectData, _user: userProfile })
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Flex
|
<Flex
|
||||||
gap='large'
|
gap='large'
|
||||||
@ -126,7 +132,7 @@ const AppPasswordInfo = () => {
|
|||||||
disabled={
|
disabled={
|
||||||
objectFormState.beingEditedByOther ||
|
objectFormState.beingEditedByOther ||
|
||||||
objectFormState.loading ||
|
objectFormState.loading ||
|
||||||
objectFormState.editDisabled
|
editDisabled
|
||||||
}
|
}
|
||||||
loading={objectFormState.editLoading}
|
loading={objectFormState.editLoading}
|
||||||
/>
|
/>
|
||||||
|
|||||||
@ -47,7 +47,6 @@ const CourierServiceInfo = () => {
|
|||||||
formValid: false,
|
formValid: false,
|
||||||
lock: null,
|
lock: null,
|
||||||
loading: false,
|
loading: false,
|
||||||
editDisabled: false,
|
|
||||||
objectData: {}
|
objectData: {}
|
||||||
})
|
})
|
||||||
|
|
||||||
@ -127,9 +126,7 @@ const CourierServiceInfo = () => {
|
|||||||
editLoading={objectFormState.editLoading}
|
editLoading={objectFormState.editLoading}
|
||||||
formValid={objectFormState.formValid}
|
formValid={objectFormState.formValid}
|
||||||
disabled={
|
disabled={
|
||||||
objectFormState.beingEditedByOther ||
|
objectFormState.beingEditedByOther || objectFormState.loading
|
||||||
objectFormState.loading ||
|
|
||||||
objectFormState.editDisabled
|
|
||||||
}
|
}
|
||||||
loading={objectFormState.editLoading}
|
loading={objectFormState.editLoading}
|
||||||
/>
|
/>
|
||||||
|
|||||||
@ -43,7 +43,6 @@ const CourierInfo = () => {
|
|||||||
formValid: false,
|
formValid: false,
|
||||||
lock: null,
|
lock: null,
|
||||||
loading: false,
|
loading: false,
|
||||||
editDisabled: false,
|
|
||||||
objectData: {}
|
objectData: {}
|
||||||
})
|
})
|
||||||
|
|
||||||
@ -123,9 +122,7 @@ const CourierInfo = () => {
|
|||||||
editLoading={objectFormState.editLoading}
|
editLoading={objectFormState.editLoading}
|
||||||
formValid={objectFormState.formValid}
|
formValid={objectFormState.formValid}
|
||||||
disabled={
|
disabled={
|
||||||
objectFormState.beingEditedByOther ||
|
objectFormState.beingEditedByOther || objectFormState.loading
|
||||||
objectFormState.loading ||
|
|
||||||
objectFormState.editDisabled
|
|
||||||
}
|
}
|
||||||
loading={objectFormState.editLoading}
|
loading={objectFormState.editLoading}
|
||||||
/>
|
/>
|
||||||
|
|||||||
@ -48,7 +48,6 @@ const DocumentJobInfo = () => {
|
|||||||
formValid: false,
|
formValid: false,
|
||||||
lock: null,
|
lock: null,
|
||||||
loading: false,
|
loading: false,
|
||||||
editDisabled: false,
|
|
||||||
objectData: {}
|
objectData: {}
|
||||||
})
|
})
|
||||||
|
|
||||||
@ -124,9 +123,7 @@ const DocumentJobInfo = () => {
|
|||||||
editLoading={objectFormState.editLoading}
|
editLoading={objectFormState.editLoading}
|
||||||
formValid={objectFormState.formValid}
|
formValid={objectFormState.formValid}
|
||||||
disabled={
|
disabled={
|
||||||
objectFormState.beingEditedByOther ||
|
objectFormState.beingEditedByOther || objectFormState.loading
|
||||||
objectFormState.loading ||
|
|
||||||
objectFormState.editDisabled
|
|
||||||
}
|
}
|
||||||
loading={objectFormState.editLoading}
|
loading={objectFormState.editLoading}
|
||||||
/>
|
/>
|
||||||
|
|||||||
@ -50,7 +50,6 @@ const DocumentPrinterInfo = () => {
|
|||||||
formValid: false,
|
formValid: false,
|
||||||
activities: [],
|
activities: [],
|
||||||
loading: false,
|
loading: false,
|
||||||
editDisabled: false,
|
|
||||||
objectData: {}
|
objectData: {}
|
||||||
})
|
})
|
||||||
|
|
||||||
@ -132,9 +131,7 @@ const DocumentPrinterInfo = () => {
|
|||||||
editLoading={objectFormState.editLoading}
|
editLoading={objectFormState.editLoading}
|
||||||
formValid={objectFormState.formValid}
|
formValid={objectFormState.formValid}
|
||||||
disabled={
|
disabled={
|
||||||
objectFormState.beingEditedByOther ||
|
objectFormState.beingEditedByOther || objectFormState.loading
|
||||||
objectFormState.loading ||
|
|
||||||
objectFormState.editDisabled
|
|
||||||
}
|
}
|
||||||
loading={objectFormState.editLoading}
|
loading={objectFormState.editLoading}
|
||||||
/>
|
/>
|
||||||
|
|||||||
@ -48,7 +48,6 @@ const DocumentSizeInfo = () => {
|
|||||||
formValid: false,
|
formValid: false,
|
||||||
lock: null,
|
lock: null,
|
||||||
loading: false,
|
loading: false,
|
||||||
editDisabled: false,
|
|
||||||
objectData: {}
|
objectData: {}
|
||||||
})
|
})
|
||||||
|
|
||||||
@ -124,9 +123,7 @@ const DocumentSizeInfo = () => {
|
|||||||
editLoading={objectFormState.editLoading}
|
editLoading={objectFormState.editLoading}
|
||||||
formValid={objectFormState.formValid}
|
formValid={objectFormState.formValid}
|
||||||
disabled={
|
disabled={
|
||||||
objectFormState.beingEditedByOther ||
|
objectFormState.beingEditedByOther || objectFormState.loading
|
||||||
objectFormState.loading ||
|
|
||||||
objectFormState.editDisabled
|
|
||||||
}
|
}
|
||||||
loading={objectFormState.editLoading}
|
loading={objectFormState.editLoading}
|
||||||
/>
|
/>
|
||||||
|
|||||||
@ -50,7 +50,6 @@ const DocumentTemplateInfo = () => {
|
|||||||
formValid: false,
|
formValid: false,
|
||||||
activities: [],
|
activities: [],
|
||||||
loading: false,
|
loading: false,
|
||||||
editDisabled: false,
|
|
||||||
objectData: {}
|
objectData: {}
|
||||||
})
|
})
|
||||||
|
|
||||||
@ -129,9 +128,7 @@ const DocumentTemplateInfo = () => {
|
|||||||
editLoading={objectFormState.editLoading}
|
editLoading={objectFormState.editLoading}
|
||||||
formValid={objectFormState.formValid}
|
formValid={objectFormState.formValid}
|
||||||
disabled={
|
disabled={
|
||||||
objectFormState.beingEditedByOther ||
|
objectFormState.beingEditedByOther || objectFormState.loading
|
||||||
objectFormState.loading ||
|
|
||||||
objectFormState.editDisabled
|
|
||||||
}
|
}
|
||||||
loading={objectFormState.editLoading}
|
loading={objectFormState.editLoading}
|
||||||
/>
|
/>
|
||||||
|
|||||||
@ -42,7 +42,6 @@ const FilamentSkuInfo = () => {
|
|||||||
formValid: false,
|
formValid: false,
|
||||||
lock: null,
|
lock: null,
|
||||||
loading: false,
|
loading: false,
|
||||||
editDisabled: false,
|
|
||||||
objectData: {}
|
objectData: {}
|
||||||
})
|
})
|
||||||
|
|
||||||
@ -122,9 +121,7 @@ const FilamentSkuInfo = () => {
|
|||||||
editLoading={objectFormState.editLoading}
|
editLoading={objectFormState.editLoading}
|
||||||
formValid={objectFormState.formValid}
|
formValid={objectFormState.formValid}
|
||||||
disabled={
|
disabled={
|
||||||
objectFormState.beingEditedByOther ||
|
objectFormState.beingEditedByOther || objectFormState.loading
|
||||||
objectFormState.loading ||
|
|
||||||
objectFormState.editDisabled
|
|
||||||
}
|
}
|
||||||
loading={objectFormState.editLoading}
|
loading={objectFormState.editLoading}
|
||||||
/>
|
/>
|
||||||
|
|||||||
@ -61,7 +61,6 @@ const FilamentInfo = () => {
|
|||||||
formValid: false,
|
formValid: false,
|
||||||
lock: null,
|
lock: null,
|
||||||
loading: false,
|
loading: false,
|
||||||
editDisabled: false,
|
|
||||||
objectData: {}
|
objectData: {}
|
||||||
})
|
})
|
||||||
|
|
||||||
@ -145,9 +144,7 @@ const FilamentInfo = () => {
|
|||||||
editLoading={objectFormState.editLoading}
|
editLoading={objectFormState.editLoading}
|
||||||
formValid={objectFormState.formValid}
|
formValid={objectFormState.formValid}
|
||||||
disabled={
|
disabled={
|
||||||
objectFormState.beingEditedByOther ||
|
objectFormState.beingEditedByOther || objectFormState.loading
|
||||||
objectFormState.loading ||
|
|
||||||
objectFormState.editDisabled
|
|
||||||
}
|
}
|
||||||
loading={objectFormState.editLoading}
|
loading={objectFormState.editLoading}
|
||||||
/>
|
/>
|
||||||
|
|||||||
@ -49,7 +49,6 @@ const FileInfo = () => {
|
|||||||
formValid: false,
|
formValid: false,
|
||||||
lock: null,
|
lock: null,
|
||||||
loading: true,
|
loading: true,
|
||||||
editDisabled: false
|
|
||||||
objectData: {
|
objectData: {
|
||||||
_id: fileId
|
_id: fileId
|
||||||
}
|
}
|
||||||
@ -138,9 +137,7 @@ const FileInfo = () => {
|
|||||||
editLoading={objectFormState.editLoading}
|
editLoading={objectFormState.editLoading}
|
||||||
formValid={objectFormState.formValid}
|
formValid={objectFormState.formValid}
|
||||||
disabled={
|
disabled={
|
||||||
objectFormState.beingEditedByOther ||
|
objectFormState.beingEditedByOther || objectFormState.loading
|
||||||
objectFormState.loading ||
|
|
||||||
objectFormState.editDisabled
|
|
||||||
}
|
}
|
||||||
loading={objectFormState.editLoading}
|
loading={objectFormState.editLoading}
|
||||||
/>
|
/>
|
||||||
|
|||||||
@ -57,7 +57,6 @@ const HostInfo = () => {
|
|||||||
formValid: false,
|
formValid: false,
|
||||||
activities: [],
|
activities: [],
|
||||||
loading: false,
|
loading: false,
|
||||||
editDisabled: false,
|
|
||||||
objectData: {}
|
objectData: {}
|
||||||
})
|
})
|
||||||
|
|
||||||
@ -141,9 +140,7 @@ const HostInfo = () => {
|
|||||||
editLoading={objectFormState.editLoading}
|
editLoading={objectFormState.editLoading}
|
||||||
formValid={objectFormState.formValid}
|
formValid={objectFormState.formValid}
|
||||||
disabled={
|
disabled={
|
||||||
objectFormState.beingEditedByOther ||
|
objectFormState.beingEditedByOther || objectFormState.loading
|
||||||
objectFormState.loading ||
|
|
||||||
objectFormState.editDisabled
|
|
||||||
}
|
}
|
||||||
loading={objectFormState.editLoading}
|
loading={objectFormState.editLoading}
|
||||||
/>
|
/>
|
||||||
|
|||||||
@ -45,7 +45,6 @@ const MaterialInfo = () => {
|
|||||||
formValid: false,
|
formValid: false,
|
||||||
lock: null,
|
lock: null,
|
||||||
loading: false,
|
loading: false,
|
||||||
editDisabled: false,
|
|
||||||
objectData: {}
|
objectData: {}
|
||||||
})
|
})
|
||||||
|
|
||||||
@ -125,9 +124,7 @@ const MaterialInfo = () => {
|
|||||||
editLoading={objectFormState.editLoading}
|
editLoading={objectFormState.editLoading}
|
||||||
formValid={objectFormState.formValid}
|
formValid={objectFormState.formValid}
|
||||||
disabled={
|
disabled={
|
||||||
objectFormState.beingEditedByOther ||
|
objectFormState.beingEditedByOther || objectFormState.loading
|
||||||
objectFormState.loading ||
|
|
||||||
objectFormState.editDisabled
|
|
||||||
}
|
}
|
||||||
loading={objectFormState.editLoading}
|
loading={objectFormState.editLoading}
|
||||||
/>
|
/>
|
||||||
|
|||||||
@ -38,7 +38,6 @@ const NoteTypeInfo = () => {
|
|||||||
formValid: false,
|
formValid: false,
|
||||||
lock: null,
|
lock: null,
|
||||||
loading: false,
|
loading: false,
|
||||||
editDisabled: false,
|
|
||||||
objectData: {}
|
objectData: {}
|
||||||
})
|
})
|
||||||
|
|
||||||
@ -113,9 +112,7 @@ const NoteTypeInfo = () => {
|
|||||||
editLoading={objectFormState.editLoading}
|
editLoading={objectFormState.editLoading}
|
||||||
formValid={objectFormState.formValid}
|
formValid={objectFormState.formValid}
|
||||||
disabled={
|
disabled={
|
||||||
objectFormState.beingEditedByOther ||
|
objectFormState.beingEditedByOther || objectFormState.loading
|
||||||
objectFormState.loading ||
|
|
||||||
objectFormState.editDisabled
|
|
||||||
}
|
}
|
||||||
loading={objectFormState.editLoading}
|
loading={objectFormState.editLoading}
|
||||||
/>
|
/>
|
||||||
|
|||||||
@ -47,7 +47,6 @@ const NoteInfo = () => {
|
|||||||
formValid: false,
|
formValid: false,
|
||||||
lock: null,
|
lock: null,
|
||||||
loading: false,
|
loading: false,
|
||||||
editDisabled: false,
|
|
||||||
objectData: {}
|
objectData: {}
|
||||||
})
|
})
|
||||||
|
|
||||||
@ -128,9 +127,7 @@ const NoteInfo = () => {
|
|||||||
editLoading={objectFormState.editLoading}
|
editLoading={objectFormState.editLoading}
|
||||||
formValid={objectFormState.formValid}
|
formValid={objectFormState.formValid}
|
||||||
disabled={
|
disabled={
|
||||||
objectFormState.beingEditedByOther ||
|
objectFormState.beingEditedByOther || objectFormState.loading
|
||||||
objectFormState.loading ||
|
|
||||||
objectFormState.editDisabled
|
|
||||||
}
|
}
|
||||||
loading={objectFormState.editLoading}
|
loading={objectFormState.editLoading}
|
||||||
/>
|
/>
|
||||||
|
|||||||
@ -37,7 +37,6 @@ const PartSkuInfo = () => {
|
|||||||
formValid: false,
|
formValid: false,
|
||||||
lock: null,
|
lock: null,
|
||||||
loading: false,
|
loading: false,
|
||||||
editDisabled: false,
|
|
||||||
objectData: {}
|
objectData: {}
|
||||||
})
|
})
|
||||||
|
|
||||||
@ -117,9 +116,7 @@ const PartSkuInfo = () => {
|
|||||||
editLoading={objectFormState.editLoading}
|
editLoading={objectFormState.editLoading}
|
||||||
formValid={objectFormState.formValid}
|
formValid={objectFormState.formValid}
|
||||||
disabled={
|
disabled={
|
||||||
objectFormState.beingEditedByOther ||
|
objectFormState.beingEditedByOther || objectFormState.loading
|
||||||
objectFormState.loading ||
|
|
||||||
objectFormState.editDisabled
|
|
||||||
}
|
}
|
||||||
loading={objectFormState.editLoading}
|
loading={objectFormState.editLoading}
|
||||||
/>
|
/>
|
||||||
|
|||||||
@ -50,7 +50,6 @@ const PartInfo = () => {
|
|||||||
formValid: false,
|
formValid: false,
|
||||||
lock: null,
|
lock: null,
|
||||||
loading: false,
|
loading: false,
|
||||||
editDisabled: false,
|
|
||||||
objectData: {}
|
objectData: {}
|
||||||
})
|
})
|
||||||
|
|
||||||
@ -126,9 +125,7 @@ const PartInfo = () => {
|
|||||||
editLoading={objectFormState.editLoading}
|
editLoading={objectFormState.editLoading}
|
||||||
formValid={objectFormState.formValid}
|
formValid={objectFormState.formValid}
|
||||||
disabled={
|
disabled={
|
||||||
objectFormState.beingEditedByOther ||
|
objectFormState.beingEditedByOther || objectFormState.loading
|
||||||
objectFormState.loading ||
|
|
||||||
objectFormState.editDisabled
|
|
||||||
}
|
}
|
||||||
loading={objectFormState.editLoading}
|
loading={objectFormState.editLoading}
|
||||||
/>
|
/>
|
||||||
|
|||||||
@ -42,7 +42,6 @@ const ProductCategoryInfo = () => {
|
|||||||
formValid: false,
|
formValid: false,
|
||||||
lock: null,
|
lock: null,
|
||||||
loading: false,
|
loading: false,
|
||||||
editDisabled: false,
|
|
||||||
objectData: {}
|
objectData: {}
|
||||||
})
|
})
|
||||||
|
|
||||||
@ -122,9 +121,7 @@ const ProductCategoryInfo = () => {
|
|||||||
editLoading={objectFormState.editLoading}
|
editLoading={objectFormState.editLoading}
|
||||||
formValid={objectFormState.formValid}
|
formValid={objectFormState.formValid}
|
||||||
disabled={
|
disabled={
|
||||||
objectFormState.beingEditedByOther ||
|
objectFormState.beingEditedByOther || objectFormState.loading
|
||||||
objectFormState.loading ||
|
|
||||||
objectFormState.editDisabled
|
|
||||||
}
|
}
|
||||||
loading={objectFormState.editLoading}
|
loading={objectFormState.editLoading}
|
||||||
/>
|
/>
|
||||||
|
|||||||
@ -44,7 +44,6 @@ const ProductSkuInfo = () => {
|
|||||||
formValid: false,
|
formValid: false,
|
||||||
lock: null,
|
lock: null,
|
||||||
loading: false,
|
loading: false,
|
||||||
editDisabled: false,
|
|
||||||
objectData: {}
|
objectData: {}
|
||||||
})
|
})
|
||||||
|
|
||||||
@ -125,9 +124,7 @@ const ProductSkuInfo = () => {
|
|||||||
editLoading={objectFormState.editLoading}
|
editLoading={objectFormState.editLoading}
|
||||||
formValid={objectFormState.formValid}
|
formValid={objectFormState.formValid}
|
||||||
disabled={
|
disabled={
|
||||||
objectFormState.beingEditedByOther ||
|
objectFormState.beingEditedByOther || objectFormState.loading
|
||||||
objectFormState.loading ||
|
|
||||||
objectFormState.editDisabled
|
|
||||||
}
|
}
|
||||||
loading={objectFormState.editLoading}
|
loading={objectFormState.editLoading}
|
||||||
/>
|
/>
|
||||||
|
|||||||
@ -50,7 +50,6 @@ const ProductInfo = () => {
|
|||||||
formValid: false,
|
formValid: false,
|
||||||
lock: null,
|
lock: null,
|
||||||
loading: false,
|
loading: false,
|
||||||
editDisabled: false,
|
|
||||||
objectData: {}
|
objectData: {}
|
||||||
})
|
})
|
||||||
|
|
||||||
@ -126,9 +125,7 @@ const ProductInfo = () => {
|
|||||||
editLoading={objectFormState.editLoading}
|
editLoading={objectFormState.editLoading}
|
||||||
formValid={objectFormState.formValid}
|
formValid={objectFormState.formValid}
|
||||||
disabled={
|
disabled={
|
||||||
objectFormState.beingEditedByOther ||
|
objectFormState.beingEditedByOther || objectFormState.loading
|
||||||
objectFormState.loading ||
|
|
||||||
objectFormState.editDisabled
|
|
||||||
}
|
}
|
||||||
loading={objectFormState.editLoading}
|
loading={objectFormState.editLoading}
|
||||||
/>
|
/>
|
||||||
|
|||||||
@ -42,7 +42,6 @@ const TaxRateInfo = () => {
|
|||||||
formValid: false,
|
formValid: false,
|
||||||
lock: null,
|
lock: null,
|
||||||
loading: false,
|
loading: false,
|
||||||
editDisabled: false,
|
|
||||||
objectData: {}
|
objectData: {}
|
||||||
})
|
})
|
||||||
|
|
||||||
@ -122,9 +121,7 @@ const TaxRateInfo = () => {
|
|||||||
editLoading={objectFormState.editLoading}
|
editLoading={objectFormState.editLoading}
|
||||||
formValid={objectFormState.formValid}
|
formValid={objectFormState.formValid}
|
||||||
disabled={
|
disabled={
|
||||||
objectFormState.beingEditedByOther ||
|
objectFormState.beingEditedByOther || objectFormState.loading
|
||||||
objectFormState.loading ||
|
|
||||||
objectFormState.editDisabled
|
|
||||||
}
|
}
|
||||||
loading={objectFormState.editLoading}
|
loading={objectFormState.editLoading}
|
||||||
/>
|
/>
|
||||||
|
|||||||
@ -44,7 +44,6 @@ const UserInfo = () => {
|
|||||||
formValid: false,
|
formValid: false,
|
||||||
lock: null,
|
lock: null,
|
||||||
loading: false,
|
loading: false,
|
||||||
editDisabled: false,
|
|
||||||
objectData: {}
|
objectData: {}
|
||||||
})
|
})
|
||||||
const isMobile = useMediaQuery({ maxWidth: 768 })
|
const isMobile = useMediaQuery({ maxWidth: 768 })
|
||||||
@ -121,9 +120,7 @@ const UserInfo = () => {
|
|||||||
editLoading={objectFormState.editLoading}
|
editLoading={objectFormState.editLoading}
|
||||||
formValid={objectFormState.formValid}
|
formValid={objectFormState.formValid}
|
||||||
disabled={
|
disabled={
|
||||||
objectFormState.beingEditedByOther ||
|
objectFormState.beingEditedByOther || objectFormState.loading
|
||||||
objectFormState.loading ||
|
|
||||||
objectFormState.editDisabled
|
|
||||||
}
|
}
|
||||||
loading={objectFormState.editLoading}
|
loading={objectFormState.editLoading}
|
||||||
/>
|
/>
|
||||||
|
|||||||
@ -42,7 +42,6 @@ const VendorInfo = () => {
|
|||||||
formValid: false,
|
formValid: false,
|
||||||
lock: null,
|
lock: null,
|
||||||
loading: false,
|
loading: false,
|
||||||
editDisabled: false,
|
|
||||||
objectData: {}
|
objectData: {}
|
||||||
})
|
})
|
||||||
|
|
||||||
@ -122,9 +121,7 @@ const VendorInfo = () => {
|
|||||||
editLoading={objectFormState.editLoading}
|
editLoading={objectFormState.editLoading}
|
||||||
formValid={objectFormState.formValid}
|
formValid={objectFormState.formValid}
|
||||||
disabled={
|
disabled={
|
||||||
objectFormState.beingEditedByOther ||
|
objectFormState.beingEditedByOther || objectFormState.loading
|
||||||
objectFormState.loading ||
|
|
||||||
objectFormState.editDisabled
|
|
||||||
}
|
}
|
||||||
loading={objectFormState.editLoading}
|
loading={objectFormState.editLoading}
|
||||||
/>
|
/>
|
||||||
|
|||||||
@ -80,7 +80,6 @@ const FilamentProfileInfo = () => {
|
|||||||
formValid: false,
|
formValid: false,
|
||||||
lock: null,
|
lock: null,
|
||||||
loading: false,
|
loading: false,
|
||||||
editDisabled: false,
|
|
||||||
objectData: {}
|
objectData: {}
|
||||||
})
|
})
|
||||||
|
|
||||||
@ -167,11 +166,7 @@ const FilamentProfileInfo = () => {
|
|||||||
startEditing={() => actionHandlerRef.current.callAction('edit')}
|
startEditing={() => actionHandlerRef.current.callAction('edit')}
|
||||||
editLoading={objectFormState.editLoading}
|
editLoading={objectFormState.editLoading}
|
||||||
formValid={objectFormState.formValid}
|
formValid={objectFormState.formValid}
|
||||||
disabled={
|
disabled={objectFormState.beingEditedByOther || objectFormState.loading}
|
||||||
objectFormState.beingEditedByOther ||
|
|
||||||
objectFormState.loading ||
|
|
||||||
objectFormState.editDisabled
|
|
||||||
}
|
|
||||||
loading={objectFormState.editLoading}
|
loading={objectFormState.editLoading}
|
||||||
/>
|
/>
|
||||||
<ObjectTableNavigationButtons
|
<ObjectTableNavigationButtons
|
||||||
|
|||||||
@ -51,7 +51,6 @@ const GCodeFileInfo = () => {
|
|||||||
formValid: false,
|
formValid: false,
|
||||||
activities: [],
|
activities: [],
|
||||||
loading: false,
|
loading: false,
|
||||||
editDisabled: false,
|
|
||||||
objectData: {}
|
objectData: {}
|
||||||
})
|
})
|
||||||
|
|
||||||
@ -131,9 +130,7 @@ const GCodeFileInfo = () => {
|
|||||||
editLoading={objectFormState.editLoading}
|
editLoading={objectFormState.editLoading}
|
||||||
formValid={objectFormState.formValid}
|
formValid={objectFormState.formValid}
|
||||||
disabled={
|
disabled={
|
||||||
objectFormState.beingEditedByOther ||
|
objectFormState.beingEditedByOther || objectFormState.loading
|
||||||
objectFormState.loading ||
|
|
||||||
objectFormState.editDisabled
|
|
||||||
}
|
}
|
||||||
loading={objectFormState.editLoading}
|
loading={objectFormState.editLoading}
|
||||||
/>
|
/>
|
||||||
|
|||||||
@ -25,6 +25,7 @@ import JobIcon from '../../../Icons/JobIcon.jsx'
|
|||||||
import DocumentPrintButton from '../../common/DocumentPrintButton.jsx'
|
import DocumentPrintButton from '../../common/DocumentPrintButton.jsx'
|
||||||
import UserNotifierToggle from '../../common/UserNotifierToggle.jsx'
|
import UserNotifierToggle from '../../common/UserNotifierToggle.jsx'
|
||||||
import ScrollBox from '../../common/ScrollBox.jsx'
|
import ScrollBox from '../../common/ScrollBox.jsx'
|
||||||
|
import { getModelByName } from '../../../../database/ObjectModels.js'
|
||||||
|
|
||||||
const log = loglevel.getLogger('JobInfo')
|
const log = loglevel.getLogger('JobInfo')
|
||||||
log.setLevel(config.logLevel)
|
log.setLevel(config.logLevel)
|
||||||
@ -56,12 +57,16 @@ const JobInfo = () => {
|
|||||||
formValid: false,
|
formValid: false,
|
||||||
activities: [],
|
activities: [],
|
||||||
loading: false,
|
loading: false,
|
||||||
editDisabled: false,
|
|
||||||
objectData: {
|
objectData: {
|
||||||
_id: jobId
|
_id: jobId
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
|
const editDisabled =
|
||||||
|
getModelByName('job')
|
||||||
|
?.actions?.find((action) => action.name === 'edit')
|
||||||
|
?.disabled(objectFormState.objectData) ?? false
|
||||||
|
|
||||||
const actions = {
|
const actions = {
|
||||||
edit: () => {
|
edit: () => {
|
||||||
objectFormRef?.current.startEditing()
|
objectFormRef?.current.startEditing()
|
||||||
@ -139,7 +144,7 @@ const JobInfo = () => {
|
|||||||
disabled={
|
disabled={
|
||||||
objectFormState.beingEditedByOther ||
|
objectFormState.beingEditedByOther ||
|
||||||
objectFormState.loading ||
|
objectFormState.loading ||
|
||||||
objectFormState.editDisabled
|
editDisabled
|
||||||
}
|
}
|
||||||
loading={objectFormState.editLoading}
|
loading={objectFormState.editLoading}
|
||||||
/>
|
/>
|
||||||
|
|||||||
@ -59,7 +59,6 @@ const PrinterProfileInfo = () => {
|
|||||||
formValid: false,
|
formValid: false,
|
||||||
lock: null,
|
lock: null,
|
||||||
loading: false,
|
loading: false,
|
||||||
editDisabled: false,
|
|
||||||
objectData: {}
|
objectData: {}
|
||||||
})
|
})
|
||||||
|
|
||||||
@ -140,11 +139,7 @@ const PrinterProfileInfo = () => {
|
|||||||
startEditing={() => actionHandlerRef.current.callAction('edit')}
|
startEditing={() => actionHandlerRef.current.callAction('edit')}
|
||||||
editLoading={objectFormState.editLoading}
|
editLoading={objectFormState.editLoading}
|
||||||
formValid={objectFormState.formValid}
|
formValid={objectFormState.formValid}
|
||||||
disabled={
|
disabled={objectFormState.beingEditedByOther || objectFormState.loading}
|
||||||
objectFormState.beingEditedByOther ||
|
|
||||||
objectFormState.loading ||
|
|
||||||
objectFormState.editDisabled
|
|
||||||
}
|
|
||||||
loading={objectFormState.editLoading}
|
loading={objectFormState.editLoading}
|
||||||
/>
|
/>
|
||||||
<ObjectTableNavigationButtons
|
<ObjectTableNavigationButtons
|
||||||
|
|||||||
@ -51,7 +51,6 @@ const PrinterInfo = () => {
|
|||||||
formValid: false,
|
formValid: false,
|
||||||
activities: [],
|
activities: [],
|
||||||
loading: false,
|
loading: false,
|
||||||
editDisabled: false,
|
|
||||||
objectData: {}
|
objectData: {}
|
||||||
})
|
})
|
||||||
|
|
||||||
@ -138,9 +137,7 @@ const PrinterInfo = () => {
|
|||||||
editLoading={objectFormState.editLoading}
|
editLoading={objectFormState.editLoading}
|
||||||
formValid={objectFormState.formValid}
|
formValid={objectFormState.formValid}
|
||||||
disabled={
|
disabled={
|
||||||
objectFormState.beingEditedByOther ||
|
objectFormState.beingEditedByOther || objectFormState.loading
|
||||||
objectFormState.loading ||
|
|
||||||
objectFormState.editDisabled
|
|
||||||
}
|
}
|
||||||
loading={objectFormState.editLoading}
|
loading={objectFormState.editLoading}
|
||||||
/>
|
/>
|
||||||
|
|||||||
@ -42,7 +42,6 @@ const ClientInfo = () => {
|
|||||||
formValid: false,
|
formValid: false,
|
||||||
lock: null,
|
lock: null,
|
||||||
loading: false,
|
loading: false,
|
||||||
editDisabled: false,
|
|
||||||
objectData: {}
|
objectData: {}
|
||||||
})
|
})
|
||||||
|
|
||||||
@ -122,9 +121,7 @@ const ClientInfo = () => {
|
|||||||
editLoading={objectFormState.editLoading}
|
editLoading={objectFormState.editLoading}
|
||||||
formValid={objectFormState.formValid}
|
formValid={objectFormState.formValid}
|
||||||
disabled={
|
disabled={
|
||||||
objectFormState.beingEditedByOther ||
|
objectFormState.beingEditedByOther || objectFormState.loading
|
||||||
objectFormState.loading ||
|
|
||||||
objectFormState.editDisabled
|
|
||||||
}
|
}
|
||||||
loading={objectFormState.editLoading}
|
loading={objectFormState.editLoading}
|
||||||
/>
|
/>
|
||||||
|
|||||||
@ -57,7 +57,6 @@ const ListingVarientInfo = () => {
|
|||||||
formValid: false,
|
formValid: false,
|
||||||
lock: null,
|
lock: null,
|
||||||
loading: false,
|
loading: false,
|
||||||
editDisabled: false,
|
|
||||||
objectData: {}
|
objectData: {}
|
||||||
})
|
})
|
||||||
|
|
||||||
@ -136,9 +135,7 @@ const ListingVarientInfo = () => {
|
|||||||
editLoading={objectFormState.editLoading}
|
editLoading={objectFormState.editLoading}
|
||||||
formValid={objectFormState.formValid}
|
formValid={objectFormState.formValid}
|
||||||
disabled={
|
disabled={
|
||||||
objectFormState.beingEditedByOther ||
|
objectFormState.beingEditedByOther || objectFormState.loading
|
||||||
objectFormState.loading ||
|
|
||||||
objectFormState.editDisabled
|
|
||||||
}
|
}
|
||||||
loading={objectFormState.editLoading}
|
loading={objectFormState.editLoading}
|
||||||
/>
|
/>
|
||||||
|
|||||||
@ -55,7 +55,6 @@ const ListingInfo = () => {
|
|||||||
formValid: false,
|
formValid: false,
|
||||||
lock: null,
|
lock: null,
|
||||||
loading: false,
|
loading: false,
|
||||||
editDisabled: false,
|
|
||||||
objectData: {}
|
objectData: {}
|
||||||
})
|
})
|
||||||
|
|
||||||
@ -135,9 +134,7 @@ const ListingInfo = () => {
|
|||||||
editLoading={objectFormState.editLoading}
|
editLoading={objectFormState.editLoading}
|
||||||
formValid={objectFormState.formValid}
|
formValid={objectFormState.formValid}
|
||||||
disabled={
|
disabled={
|
||||||
objectFormState.beingEditedByOther ||
|
objectFormState.beingEditedByOther || objectFormState.loading
|
||||||
objectFormState.loading ||
|
|
||||||
objectFormState.editDisabled
|
|
||||||
}
|
}
|
||||||
loading={objectFormState.editLoading}
|
loading={objectFormState.editLoading}
|
||||||
/>
|
/>
|
||||||
|
|||||||
@ -66,7 +66,6 @@ const MarketplaceInfo = () => {
|
|||||||
formValid: false,
|
formValid: false,
|
||||||
lock: null,
|
lock: null,
|
||||||
loading: false,
|
loading: false,
|
||||||
editDisabled: false,
|
|
||||||
objectData: {}
|
objectData: {}
|
||||||
})
|
})
|
||||||
|
|
||||||
@ -203,9 +202,7 @@ const MarketplaceInfo = () => {
|
|||||||
editLoading={objectFormState.editLoading}
|
editLoading={objectFormState.editLoading}
|
||||||
formValid={objectFormState.formValid}
|
formValid={objectFormState.formValid}
|
||||||
disabled={
|
disabled={
|
||||||
objectFormState.beingEditedByOther ||
|
objectFormState.beingEditedByOther || objectFormState.loading
|
||||||
objectFormState.loading ||
|
|
||||||
objectFormState.editDisabled
|
|
||||||
}
|
}
|
||||||
loading={objectFormState.editLoading}
|
loading={objectFormState.editLoading}
|
||||||
/>
|
/>
|
||||||
|
|||||||
@ -28,6 +28,7 @@ import OrderItemsIcon from '../../../Icons/OrderItemIcon.jsx'
|
|||||||
import ShipmentIcon from '../../../Icons/ShipmentIcon.jsx'
|
import ShipmentIcon from '../../../Icons/ShipmentIcon.jsx'
|
||||||
import InvoiceIcon from '../../../Icons/InvoiceIcon.jsx'
|
import InvoiceIcon from '../../../Icons/InvoiceIcon.jsx'
|
||||||
import StockEventIcon from '../../../Icons/StockEventIcon.jsx'
|
import StockEventIcon from '../../../Icons/StockEventIcon.jsx'
|
||||||
|
import { getModelByName } from '../../../../database/ObjectModels.js'
|
||||||
|
|
||||||
const log = loglevel.getLogger('SalesOrderInfo')
|
const log = loglevel.getLogger('SalesOrderInfo')
|
||||||
log.setLevel(config.logLevel)
|
log.setLevel(config.logLevel)
|
||||||
@ -67,7 +68,6 @@ const SalesOrderInfo = () => {
|
|||||||
formValid: false,
|
formValid: false,
|
||||||
lock: null,
|
lock: null,
|
||||||
loading: false,
|
loading: false,
|
||||||
editDisabled: false,
|
|
||||||
objectData: {}
|
objectData: {}
|
||||||
})
|
})
|
||||||
|
|
||||||
@ -93,6 +93,10 @@ const SalesOrderInfo = () => {
|
|||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const editDisabled = getModelByName('salesOrder')
|
||||||
|
.actions.find((action) => action.name === 'edit')
|
||||||
|
.disabled(objectFormState.objectData)
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Flex
|
<Flex
|
||||||
gap='large'
|
gap='large'
|
||||||
@ -158,7 +162,7 @@ const SalesOrderInfo = () => {
|
|||||||
disabled={
|
disabled={
|
||||||
objectFormState.beingEditedByOther ||
|
objectFormState.beingEditedByOther ||
|
||||||
objectFormState.loading ||
|
objectFormState.loading ||
|
||||||
objectFormState.editDisabled
|
editDisabled
|
||||||
}
|
}
|
||||||
loading={objectFormState.editLoading}
|
loading={objectFormState.editLoading}
|
||||||
/>
|
/>
|
||||||
|
|||||||
@ -6,10 +6,7 @@ import { useNavigate, useLocation } from 'react-router-dom'
|
|||||||
import { useActionsModal } from '../context/ActionsModalContext'
|
import { useActionsModal } from '../context/ActionsModalContext'
|
||||||
import KeyboardShortcut from './KeyboardShortcut'
|
import KeyboardShortcut from './KeyboardShortcut'
|
||||||
import { AuthContext } from '../context/AuthContext'
|
import { AuthContext } from '../context/AuthContext'
|
||||||
import {
|
import { buildActionUrl, stripPageActionParams } from '../../../utils/modelActions'
|
||||||
buildActionUrl,
|
|
||||||
stripPageActionParams
|
|
||||||
} from '../../../utils/modelActions'
|
|
||||||
|
|
||||||
// Recursively filter actions based on visibleActions
|
// Recursively filter actions based on visibleActions
|
||||||
function filterActionsByVisibility(actions, visibleActions) {
|
function filterActionsByVisibility(actions, visibleActions) {
|
||||||
@ -77,12 +74,12 @@ function isSameActionUrl(action, actionUrl, currentUrl, pathname, search) {
|
|||||||
if (action.type === 'modal') {
|
if (action.type === 'modal') {
|
||||||
return actionUrl === currentUrl
|
return actionUrl === currentUrl
|
||||||
}
|
}
|
||||||
// Compare the action URL to the current location with its action param
|
return (
|
||||||
// stripped. Default page actions (e.g. Info) match and stay hidden when
|
stripPageActionParams(
|
||||||
// already on that page. Actions that set their own action param (edit,
|
actionUrl.split('?')[0],
|
||||||
// cancelEdit, finishEdit, etc.) do not match and remain available —
|
actionUrl.includes('?') ? actionUrl.split('?')[1] : ''
|
||||||
// visibility is controlled by action.visible (e.g. _isEditing).
|
) === stripPageActionParams(pathname, search)
|
||||||
return actionUrl === stripPageActionParams(pathname, search)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
// Recursively map actions to AntD Dropdown items
|
// Recursively map actions to AntD Dropdown items
|
||||||
@ -241,7 +238,7 @@ const ObjectActions = ({
|
|||||||
<Dropdown menu={menu} {...dropdownProps}>
|
<Dropdown menu={menu} {...dropdownProps}>
|
||||||
<Button
|
<Button
|
||||||
{...buttonProps}
|
{...buttonProps}
|
||||||
disabled={disabled || filteredActions.length === 0}
|
disabled={disabled}
|
||||||
onClick={() => showActionsModal(id, type, objectData)}
|
onClick={() => showActionsModal(id, type, objectData)}
|
||||||
>
|
>
|
||||||
Actions
|
Actions
|
||||||
|
|||||||
@ -76,23 +76,6 @@ const buildObjectFromEntries = (entries = []) => {
|
|||||||
}, {})
|
}, {})
|
||||||
}
|
}
|
||||||
|
|
||||||
const getEditDisabled = (model, objectData, userProfile) => {
|
|
||||||
if (model?.readOnly === true) {
|
|
||||||
return true
|
|
||||||
}
|
|
||||||
|
|
||||||
const editAction = model?.actions?.find((action) => action.name === 'edit')
|
|
||||||
if (!editAction?.disabled) {
|
|
||||||
return false
|
|
||||||
}
|
|
||||||
if (typeof editAction.disabled === 'function') {
|
|
||||||
return (
|
|
||||||
editAction.disabled({ ...objectData, _user: userProfile }) ?? false
|
|
||||||
)
|
|
||||||
}
|
|
||||||
return !!editAction.disabled
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* ObjectForm is a reusable form component for editing any object type.
|
* ObjectForm is a reusable form component for editing any object type.
|
||||||
* It handles fetching, updating, locking, unlocking, and validation logic.
|
* It handles fetching, updating, locking, unlocking, and validation logic.
|
||||||
@ -102,10 +85,9 @@ const getEditDisabled = (model, objectData, userProfile) => {
|
|||||||
* - type: string (required)
|
* - type: string (required)
|
||||||
* - formItems: array (for ObjectInfo/ObjectProperty items)
|
* - formItems: array (for ObjectInfo/ObjectProperty items)
|
||||||
* - children: function({
|
* - children: function({
|
||||||
* loading, isEditing, startEditing, cancelEditing, handleUpdate, form, formValid, objectData, setIsEditing, setObjectData, editDisabled
|
* loading, isEditing, startEditing, cancelEditing, handleUpdate, form, formValid, objectData, setIsEditing, setObjectData
|
||||||
* }) => ReactNode
|
* }) => ReactNode
|
||||||
* - setCurrentObject: boolean (sync object data to ActionsContext)
|
* - setCurrentObject: boolean (sync object data to ActionsContext)
|
||||||
* - onStateChange: receives form state including editDisabled (from model edit action)
|
|
||||||
*/
|
*/
|
||||||
const ObjectForm = forwardRef(
|
const ObjectForm = forwardRef(
|
||||||
(
|
(
|
||||||
@ -406,22 +388,20 @@ const ObjectForm = forwardRef(
|
|||||||
setFormValid(true)
|
setFormValid(true)
|
||||||
onStateChangeRef.current({
|
onStateChangeRef.current({
|
||||||
formValid: true,
|
formValid: true,
|
||||||
objectData: mergedObjectData,
|
objectData: mergedObjectData
|
||||||
editDisabled: getEditDisabled(model, mergedObjectData, userProfile)
|
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
.catch(() => {
|
.catch(() => {
|
||||||
setFormValid(false)
|
setFormValid(false)
|
||||||
onStateChangeRef.current({
|
onStateChangeRef.current({
|
||||||
formValid: false,
|
formValid: false,
|
||||||
objectData: mergedObjectData,
|
objectData: mergedObjectData
|
||||||
editDisabled: getEditDisabled(model, mergedObjectData, userProfile)
|
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
}, 150)
|
}, 150)
|
||||||
|
|
||||||
return () => clearTimeout(timeoutId)
|
return () => clearTimeout(timeoutId)
|
||||||
}, [form, formUpdateValues, model, userProfile])
|
}, [form, formUpdateValues])
|
||||||
|
|
||||||
// Cleanup on unmount
|
// Cleanup on unmount
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
@ -612,13 +592,10 @@ const ObjectForm = forwardRef(
|
|||||||
// Debounce objectData updates sent to parent to limit re-renders
|
// Debounce objectData updates sent to parent to limit re-renders
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
const timeoutId = setTimeout(() => {
|
const timeoutId = setTimeout(() => {
|
||||||
onStateChangeRef.current({
|
onStateChangeRef.current({ objectData })
|
||||||
objectData,
|
|
||||||
editDisabled: getEditDisabled(model, objectData, userProfile)
|
|
||||||
})
|
|
||||||
}, 150)
|
}, 150)
|
||||||
return () => clearTimeout(timeoutId)
|
return () => clearTimeout(timeoutId)
|
||||||
}, [objectData, model, userProfile])
|
}, [objectData])
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
if (!setCurrentObject) {
|
if (!setCurrentObject) {
|
||||||
@ -674,15 +651,13 @@ const ObjectForm = forwardRef(
|
|||||||
...computedValuesObject,
|
...computedValuesObject,
|
||||||
_isEditing: true
|
_isEditing: true
|
||||||
}))
|
}))
|
||||||
const nextObjectData = {
|
onStateChangeRef.current({
|
||||||
|
isEditing: true,
|
||||||
|
objectData: {
|
||||||
...objectData,
|
...objectData,
|
||||||
...computedValuesObject,
|
...computedValuesObject,
|
||||||
_isEditing: true
|
_isEditing: true
|
||||||
}
|
}
|
||||||
onStateChangeRef.current({
|
|
||||||
isEditing: true,
|
|
||||||
objectData: nextObjectData,
|
|
||||||
editDisabled: getEditDisabled(model, nextObjectData, userProfile)
|
|
||||||
})
|
})
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
console.error(err)
|
console.error(err)
|
||||||
@ -856,7 +831,6 @@ const ObjectForm = forwardRef(
|
|||||||
setIsEditing,
|
setIsEditing,
|
||||||
setObjectData,
|
setObjectData,
|
||||||
editLoading,
|
editLoading,
|
||||||
editDisabled: getEditDisabled(model, objectData, userProfile),
|
|
||||||
activities,
|
activities,
|
||||||
handleFetchObject,
|
handleFetchObject,
|
||||||
handleDelete
|
handleDelete
|
||||||
|
|||||||
@ -37,8 +37,8 @@ export const DocumentJob = {
|
|||||||
visible: (objectData) => {
|
visible: (objectData) => {
|
||||||
return !(objectData?._isEditing && objectData?._isEditing == true)
|
return !(objectData?._isEditing && objectData?._isEditing == true)
|
||||||
}
|
}
|
||||||
},
|
}
|
||||||
{
|
, {
|
||||||
name: 'cancelEdit',
|
name: 'cancelEdit',
|
||||||
label: 'Cancel Edits',
|
label: 'Cancel Edits',
|
||||||
type: 'page',
|
type: 'page',
|
||||||
|
|||||||
@ -36,8 +36,8 @@ export const DocumentPrinter = {
|
|||||||
visible: (objectData) => {
|
visible: (objectData) => {
|
||||||
return !(objectData?._isEditing && objectData?._isEditing == true)
|
return !(objectData?._isEditing && objectData?._isEditing == true)
|
||||||
}
|
}
|
||||||
},
|
}
|
||||||
{
|
, {
|
||||||
name: 'cancelEdit',
|
name: 'cancelEdit',
|
||||||
label: 'Cancel Edits',
|
label: 'Cancel Edits',
|
||||||
type: 'page',
|
type: 'page',
|
||||||
|
|||||||
@ -36,8 +36,8 @@ export const DocumentSize = {
|
|||||||
visible: (objectData) => {
|
visible: (objectData) => {
|
||||||
return !(objectData?._isEditing && objectData?._isEditing == true)
|
return !(objectData?._isEditing && objectData?._isEditing == true)
|
||||||
}
|
}
|
||||||
},
|
}
|
||||||
{
|
, {
|
||||||
name: 'cancelEdit',
|
name: 'cancelEdit',
|
||||||
label: 'Cancel Edits',
|
label: 'Cancel Edits',
|
||||||
type: 'page',
|
type: 'page',
|
||||||
|
|||||||
@ -45,8 +45,8 @@ export const DocumentTemplate = {
|
|||||||
visible: (objectData) => {
|
visible: (objectData) => {
|
||||||
return !(objectData?._isEditing && objectData?._isEditing == true)
|
return !(objectData?._isEditing && objectData?._isEditing == true)
|
||||||
}
|
}
|
||||||
},
|
}
|
||||||
{
|
, {
|
||||||
name: 'cancelEdit',
|
name: 'cancelEdit',
|
||||||
label: 'Cancel Edits',
|
label: 'Cancel Edits',
|
||||||
type: 'page',
|
type: 'page',
|
||||||
|
|||||||
@ -34,9 +34,7 @@ export const FilamentProfile = {
|
|||||||
label: 'Edit',
|
label: 'Edit',
|
||||||
row: true,
|
row: true,
|
||||||
icon: EditIcon,
|
icon: EditIcon,
|
||||||
visible: (objectData) => {
|
visible: (objectData) => !objectData?._isEditing
|
||||||
return !(objectData?._isEditing && objectData?._isEditing == true)
|
|
||||||
}
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: 'cancelEdit',
|
name: 'cancelEdit',
|
||||||
|
|||||||
@ -1,8 +1,7 @@
|
|||||||
import { createElement, lazy } from 'react'
|
import { createElement, lazy } from 'react'
|
||||||
|
|
||||||
const FilamentStockInfo = lazy(
|
const FilamentStockInfo = lazy(
|
||||||
() =>
|
() => import('../../components/Dashboard/Inventory/FilamentStocks/FilamentStockInfo')
|
||||||
import('../../components/Dashboard/Inventory/FilamentStocks/FilamentStockInfo')
|
|
||||||
)
|
)
|
||||||
import FilamentStockIcon from '../../components/Icons/FilamentStockIcon'
|
import FilamentStockIcon from '../../components/Icons/FilamentStockIcon'
|
||||||
import InfoCircleIcon from '../../components/Icons/InfoCircleIcon'
|
import InfoCircleIcon from '../../components/Icons/InfoCircleIcon'
|
||||||
@ -13,7 +12,6 @@ export const FilamentStock = {
|
|||||||
labelPlural: 'Filament Stocks',
|
labelPlural: 'Filament Stocks',
|
||||||
url: '/dashboard/inventory/filamentstocks',
|
url: '/dashboard/inventory/filamentstocks',
|
||||||
prefix: 'FLS',
|
prefix: 'FLS',
|
||||||
readOnly: true,
|
|
||||||
icon: FilamentStockIcon,
|
icon: FilamentStockIcon,
|
||||||
actions: [
|
actions: [
|
||||||
{
|
{
|
||||||
@ -57,7 +55,13 @@ export const FilamentStock = {
|
|||||||
'updatedAt',
|
'updatedAt',
|
||||||
'_reference'
|
'_reference'
|
||||||
],
|
],
|
||||||
sorters: ['createdAt', 'updatedAt', 'filament', 'filamentSku', 'state'],
|
sorters: [
|
||||||
|
'createdAt',
|
||||||
|
'updatedAt',
|
||||||
|
'filament',
|
||||||
|
'filamentSku',
|
||||||
|
'state'
|
||||||
|
],
|
||||||
group: ['filament', 'filamentSku'],
|
group: ['filament', 'filamentSku'],
|
||||||
properties: [
|
properties: [
|
||||||
{
|
{
|
||||||
|
|||||||
@ -54,8 +54,8 @@ export const GCodeFile = {
|
|||||||
visible: (objectData) => {
|
visible: (objectData) => {
|
||||||
return !(objectData?._isEditing && objectData?._isEditing == true)
|
return !(objectData?._isEditing && objectData?._isEditing == true)
|
||||||
}
|
}
|
||||||
},
|
}
|
||||||
{
|
, {
|
||||||
name: 'cancelEdit',
|
name: 'cancelEdit',
|
||||||
label: 'Cancel Edits',
|
label: 'Cancel Edits',
|
||||||
type: 'page',
|
type: 'page',
|
||||||
|
|||||||
@ -42,7 +42,6 @@ export const Invoice = {
|
|||||||
type: 'page',
|
type: 'page',
|
||||||
pageName: 'info',
|
pageName: 'info',
|
||||||
label: 'Edit',
|
label: 'Edit',
|
||||||
row: true,
|
|
||||||
icon: EditIcon,
|
icon: EditIcon,
|
||||||
visible: (objectData) => {
|
visible: (objectData) => {
|
||||||
return !(objectData?._isEditing && objectData?._isEditing == true)
|
return !(objectData?._isEditing && objectData?._isEditing == true)
|
||||||
|
|||||||
@ -36,7 +36,6 @@ export const Job = {
|
|||||||
type: 'page',
|
type: 'page',
|
||||||
pageName: 'info',
|
pageName: 'info',
|
||||||
label: 'Edit',
|
label: 'Edit',
|
||||||
row: true,
|
|
||||||
icon: EditIcon,
|
icon: EditIcon,
|
||||||
visible: (objectData) => {
|
visible: (objectData) => {
|
||||||
return !(objectData?._isEditing && objectData?._isEditing == true)
|
return !(objectData?._isEditing && objectData?._isEditing == true)
|
||||||
|
|||||||
@ -1,8 +1,5 @@
|
|||||||
import NoteIcon from '../../components/Icons/NoteIcon'
|
import NoteIcon from '../../components/Icons/NoteIcon'
|
||||||
import InfoCircleIcon from '../../components/Icons/InfoCircleIcon'
|
import InfoCircleIcon from '../../components/Icons/InfoCircleIcon'
|
||||||
import EditIcon from '../../components/Icons/EditIcon'
|
|
||||||
import CheckIcon from '../../components/Icons/CheckIcon'
|
|
||||||
import XMarkIcon from '../../components/Icons/XMarkIcon'
|
|
||||||
|
|
||||||
export const Note = {
|
export const Note = {
|
||||||
name: 'note',
|
name: 'note',
|
||||||
@ -18,30 +15,6 @@ export const Note = {
|
|||||||
row: true,
|
row: true,
|
||||||
icon: InfoCircleIcon,
|
icon: InfoCircleIcon,
|
||||||
url: (_id) => `/dashboard/management/notes/info?noteId=${_id}`
|
url: (_id) => `/dashboard/management/notes/info?noteId=${_id}`
|
||||||
},
|
|
||||||
{
|
|
||||||
name: 'edit',
|
|
||||||
label: 'Edit',
|
|
||||||
icon: EditIcon,
|
|
||||||
visible: (objectData) => {
|
|
||||||
return !(objectData?._isEditing && objectData?._isEditing == true)
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: 'cancelEdit',
|
|
||||||
label: 'Cancel Edits',
|
|
||||||
icon: XMarkIcon,
|
|
||||||
visible: (objectData) => {
|
|
||||||
return objectData?._isEditing && objectData?._isEditing == true
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: 'finishEdit',
|
|
||||||
label: 'Save Edits',
|
|
||||||
icon: CheckIcon,
|
|
||||||
visible: (objectData) => {
|
|
||||||
return objectData?._isEditing && objectData?._isEditing == true
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
properties: [
|
properties: [
|
||||||
|
|||||||
@ -36,8 +36,8 @@ export const NoteType = {
|
|||||||
visible: (objectData) => {
|
visible: (objectData) => {
|
||||||
return !(objectData?._isEditing && objectData?._isEditing == true)
|
return !(objectData?._isEditing && objectData?._isEditing == true)
|
||||||
}
|
}
|
||||||
},
|
}
|
||||||
{
|
, {
|
||||||
name: 'cancelEdit',
|
name: 'cancelEdit',
|
||||||
label: 'Cancel Edits',
|
label: 'Cancel Edits',
|
||||||
type: 'page',
|
type: 'page',
|
||||||
|
|||||||
@ -32,7 +32,6 @@ export const OrderItem = {
|
|||||||
type: 'page',
|
type: 'page',
|
||||||
pageName: 'info',
|
pageName: 'info',
|
||||||
label: 'Edit',
|
label: 'Edit',
|
||||||
row: true,
|
|
||||||
icon: EditIcon,
|
icon: EditIcon,
|
||||||
visible: (objectData) => {
|
visible: (objectData) => {
|
||||||
return !(objectData?._isEditing && objectData?._isEditing == true)
|
return !(objectData?._isEditing && objectData?._isEditing == true)
|
||||||
|
|||||||
@ -12,7 +12,6 @@ export const PartStock = {
|
|||||||
labelPlural: 'Part Stocks',
|
labelPlural: 'Part Stocks',
|
||||||
url: '/dashboard/inventory/partstocks',
|
url: '/dashboard/inventory/partstocks',
|
||||||
prefix: 'PTS',
|
prefix: 'PTS',
|
||||||
readOnly: true,
|
|
||||||
icon: PartStockIcon,
|
icon: PartStockIcon,
|
||||||
actions: [
|
actions: [
|
||||||
{
|
{
|
||||||
|
|||||||
@ -44,7 +44,6 @@ export const Payment = {
|
|||||||
type: 'page',
|
type: 'page',
|
||||||
pageName: 'info',
|
pageName: 'info',
|
||||||
label: 'Edit',
|
label: 'Edit',
|
||||||
row: true,
|
|
||||||
icon: EditIcon,
|
icon: EditIcon,
|
||||||
visible: (objectData) => {
|
visible: (objectData) => {
|
||||||
return !(objectData?._isEditing && objectData?._isEditing == true)
|
return !(objectData?._isEditing && objectData?._isEditing == true)
|
||||||
|
|||||||
@ -299,9 +299,7 @@ export const PrinterProfile = {
|
|||||||
label: 'Edit',
|
label: 'Edit',
|
||||||
row: true,
|
row: true,
|
||||||
icon: EditIcon,
|
icon: EditIcon,
|
||||||
visible: (objectData) => {
|
visible: (objectData) => !objectData?._isEditing
|
||||||
return !(objectData?._isEditing && objectData?._isEditing == true)
|
|
||||||
}
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: 'cancelEdit',
|
name: 'cancelEdit',
|
||||||
|
|||||||
@ -35,7 +35,6 @@ export const ProductStock = {
|
|||||||
type: 'page',
|
type: 'page',
|
||||||
pageName: 'info',
|
pageName: 'info',
|
||||||
label: 'Edit',
|
label: 'Edit',
|
||||||
row: true,
|
|
||||||
icon: EditIcon,
|
icon: EditIcon,
|
||||||
visible: (objectData) => {
|
visible: (objectData) => {
|
||||||
return !(objectData?._isEditing && objectData?._isEditing == true)
|
return !(objectData?._isEditing && objectData?._isEditing == true)
|
||||||
|
|||||||
@ -51,7 +51,6 @@ export const PurchaseOrder = {
|
|||||||
type: 'page',
|
type: 'page',
|
||||||
pageName: 'info',
|
pageName: 'info',
|
||||||
label: 'Edit',
|
label: 'Edit',
|
||||||
row: true,
|
|
||||||
icon: EditIcon,
|
icon: EditIcon,
|
||||||
visible: (objectData) => {
|
visible: (objectData) => {
|
||||||
return !(objectData?._isEditing && objectData?._isEditing == true)
|
return !(objectData?._isEditing && objectData?._isEditing == true)
|
||||||
|
|||||||
@ -51,7 +51,6 @@ export const SalesOrder = {
|
|||||||
type: 'page',
|
type: 'page',
|
||||||
pageName: 'info',
|
pageName: 'info',
|
||||||
label: 'Edit',
|
label: 'Edit',
|
||||||
row: true,
|
|
||||||
icon: EditIcon,
|
icon: EditIcon,
|
||||||
visible: (objectData) => {
|
visible: (objectData) => {
|
||||||
return !(objectData?._isEditing && objectData?._isEditing == true)
|
return !(objectData?._isEditing && objectData?._isEditing == true)
|
||||||
|
|||||||
@ -41,7 +41,6 @@ export const Shipment = {
|
|||||||
type: 'page',
|
type: 'page',
|
||||||
pageName: 'info',
|
pageName: 'info',
|
||||||
label: 'Edit',
|
label: 'Edit',
|
||||||
row: true,
|
|
||||||
icon: EditIcon,
|
icon: EditIcon,
|
||||||
visible: (objectData) => {
|
visible: (objectData) => {
|
||||||
return !(objectData?._isEditing && objectData?._isEditing == true)
|
return !(objectData?._isEditing && objectData?._isEditing == true)
|
||||||
|
|||||||
@ -5,9 +5,6 @@ const StockAuditInfo = lazy(
|
|||||||
)
|
)
|
||||||
import StockAuditIcon from '../../components/Icons/StockAuditIcon'
|
import StockAuditIcon from '../../components/Icons/StockAuditIcon'
|
||||||
import InfoCircleIcon from '../../components/Icons/InfoCircleIcon'
|
import InfoCircleIcon from '../../components/Icons/InfoCircleIcon'
|
||||||
import EditIcon from '../../components/Icons/EditIcon'
|
|
||||||
import CheckIcon from '../../components/Icons/CheckIcon'
|
|
||||||
import XMarkIcon from '../../components/Icons/XMarkIcon'
|
|
||||||
|
|
||||||
export const StockAudit = {
|
export const StockAudit = {
|
||||||
name: 'stockAudit',
|
name: 'stockAudit',
|
||||||
@ -25,38 +22,7 @@ export const StockAudit = {
|
|||||||
default: true,
|
default: true,
|
||||||
row: true,
|
row: true,
|
||||||
icon: InfoCircleIcon
|
icon: InfoCircleIcon
|
||||||
},
|
|
||||||
{
|
|
||||||
name: 'edit',
|
|
||||||
type: 'page',
|
|
||||||
pageName: 'info',
|
|
||||||
label: 'Edit',
|
|
||||||
row: true,
|
|
||||||
icon: EditIcon,
|
|
||||||
visible: (objectData) => {
|
|
||||||
return !(objectData?._isEditing && objectData?._isEditing == true)
|
|
||||||
}
|
}
|
||||||
},
|
|
||||||
{
|
|
||||||
name: 'cancelEdit',
|
|
||||||
label: 'Cancel Edits',
|
|
||||||
type: 'page',
|
|
||||||
pageName: 'info',
|
|
||||||
icon: XMarkIcon,
|
|
||||||
visible: (objectData) => {
|
|
||||||
return objectData?._isEditing && objectData?._isEditing == true
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: 'finishEdit',
|
|
||||||
label: 'Save Edits',
|
|
||||||
type: 'page',
|
|
||||||
pageName: 'info',
|
|
||||||
icon: CheckIcon,
|
|
||||||
visible: (objectData) => {
|
|
||||||
return objectData?._isEditing && objectData?._isEditing == true
|
|
||||||
}
|
|
||||||
},
|
|
||||||
],
|
],
|
||||||
pages: [
|
pages: [
|
||||||
{
|
{
|
||||||
|
|||||||
@ -5,9 +5,6 @@ const StockLocationInfo = lazy(
|
|||||||
)
|
)
|
||||||
import StockLocationIcon from '../../components/Icons/StockLocationIcon'
|
import StockLocationIcon from '../../components/Icons/StockLocationIcon'
|
||||||
import InfoCircleIcon from '../../components/Icons/InfoCircleIcon'
|
import InfoCircleIcon from '../../components/Icons/InfoCircleIcon'
|
||||||
import EditIcon from '../../components/Icons/EditIcon'
|
|
||||||
import CheckIcon from '../../components/Icons/CheckIcon'
|
|
||||||
import XMarkIcon from '../../components/Icons/XMarkIcon'
|
|
||||||
|
|
||||||
export const StockLocation = {
|
export const StockLocation = {
|
||||||
name: 'stockLocation',
|
name: 'stockLocation',
|
||||||
@ -25,38 +22,7 @@ export const StockLocation = {
|
|||||||
default: true,
|
default: true,
|
||||||
row: true,
|
row: true,
|
||||||
icon: InfoCircleIcon
|
icon: InfoCircleIcon
|
||||||
},
|
|
||||||
{
|
|
||||||
name: 'edit',
|
|
||||||
type: 'page',
|
|
||||||
pageName: 'info',
|
|
||||||
label: 'Edit',
|
|
||||||
row: true,
|
|
||||||
icon: EditIcon,
|
|
||||||
visible: (objectData) => {
|
|
||||||
return !(objectData?._isEditing && objectData?._isEditing == true)
|
|
||||||
}
|
}
|
||||||
},
|
|
||||||
{
|
|
||||||
name: 'cancelEdit',
|
|
||||||
label: 'Cancel Edits',
|
|
||||||
type: 'page',
|
|
||||||
pageName: 'info',
|
|
||||||
icon: XMarkIcon,
|
|
||||||
visible: (objectData) => {
|
|
||||||
return objectData?._isEditing && objectData?._isEditing == true
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: 'finishEdit',
|
|
||||||
label: 'Save Edits',
|
|
||||||
type: 'page',
|
|
||||||
pageName: 'info',
|
|
||||||
icon: CheckIcon,
|
|
||||||
visible: (objectData) => {
|
|
||||||
return objectData?._isEditing && objectData?._isEditing == true
|
|
||||||
}
|
|
||||||
},
|
|
||||||
],
|
],
|
||||||
pages: [
|
pages: [
|
||||||
{
|
{
|
||||||
|
|||||||
@ -35,7 +35,6 @@ export const StockTransfer = {
|
|||||||
type: 'page',
|
type: 'page',
|
||||||
pageName: 'info',
|
pageName: 'info',
|
||||||
label: 'Edit',
|
label: 'Edit',
|
||||||
row: true,
|
|
||||||
icon: EditIcon,
|
icon: EditIcon,
|
||||||
visible: (objectData) => {
|
visible: (objectData) => {
|
||||||
return !(objectData?._isEditing && objectData?._isEditing == true)
|
return !(objectData?._isEditing && objectData?._isEditing == true)
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user