mirror of
https://github.com/inventree/InvenTree.git
synced 2026-11-24 00:36:39 +00:00
refactor(frontend): use generic features for actions (#13343)
* remove hardcoded support fields * add generic lookup hook * use new generic modelfeature * remove redundant permission * fix memo * remove enabled -> add labels to company
This commit is contained in:
1 parent
629a411612
commit
adfd393c92
17 files changed
+272
-197
No files matched your search
@@ -9,5 +9,6 @@ export enum ModelFeature {
|
||||
tags = 'org.inventree.i.modelfeatures.tags',
|
||||
image = 'org.inventree.i.modelfeatures.image',
|
||||
report = 'org.inventree.i.modelfeatures.report',
|
||||
label = 'org.inventree.i.modelfeatures.label', // for now this is frontend only for overrides
|
||||
history = 'org.inventree.i.modelfeatures.history'
|
||||
}
|
||||
@@ -12,7 +12,6 @@ export interface ModelInformationInterface {
|
||||
api_endpoint: ApiEndpoints;
|
||||
admin_url?: string;
|
||||
pk_field?: string;
|
||||
supports_barcode?: boolean;
|
||||
icon: keyof InvenTreeIconType;
|
||||
preview?: (props: { instance: any; modelId: number }) => any;
|
||||
render?: (props: Readonly<InstanceRenderInterface>) => any;
|
||||
@@ -64,7 +63,6 @@ export const ModelInformationDict: ModelDict = {
|
||||
url_detail: '/part/:pk/',
|
||||
api_endpoint: ApiEndpoints.part_list,
|
||||
admin_url: '/part/part/',
|
||||
supports_barcode: true,
|
||||
icon: 'part'
|
||||
},
|
||||
parameter: {
|
||||
@@ -93,7 +91,6 @@ export const ModelInformationDict: ModelDict = {
|
||||
url_detail: '/purchasing/supplier-part/:pk/',
|
||||
api_endpoint: ApiEndpoints.supplier_part_list,
|
||||
admin_url: '/company/supplierpart/',
|
||||
supports_barcode: true,
|
||||
icon: 'supplier_part',
|
||||
default_query_params: {
|
||||
part_detail: true,
|
||||
@@ -108,7 +105,6 @@ export const ModelInformationDict: ModelDict = {
|
||||
url_detail: '/purchasing/manufacturer-part/:pk/',
|
||||
api_endpoint: ApiEndpoints.manufacturer_part_list,
|
||||
admin_url: '/company/manufacturerpart/',
|
||||
supports_barcode: true,
|
||||
icon: 'manufacturers',
|
||||
default_query_params: { part_detail: true, manufacturer_detail: true }
|
||||
},
|
||||
@@ -128,7 +124,6 @@ export const ModelInformationDict: ModelDict = {
|
||||
url_detail: '/stock/item/:pk/',
|
||||
api_endpoint: ApiEndpoints.stock_item_list,
|
||||
admin_url: '/stock/stockitem/',
|
||||
supports_barcode: true,
|
||||
icon: 'stock',
|
||||
default_query_params: { part_detail: true }
|
||||
},
|
||||
@@ -139,7 +134,6 @@ export const ModelInformationDict: ModelDict = {
|
||||
url_detail: '/stock/location/:pk/',
|
||||
api_endpoint: ApiEndpoints.stock_location_list,
|
||||
admin_url: '/stock/stocklocation/',
|
||||
supports_barcode: true,
|
||||
icon: 'location'
|
||||
},
|
||||
stocklocationtype: {
|
||||
@@ -163,7 +157,6 @@ export const ModelInformationDict: ModelDict = {
|
||||
url_detail: '/manufacturing/build-order/:pk/',
|
||||
api_endpoint: ApiEndpoints.build_order_list,
|
||||
admin_url: '/build/build/',
|
||||
supports_barcode: true,
|
||||
icon: 'build_order',
|
||||
default_query_params: { part_detail: true }
|
||||
},
|
||||
@@ -201,7 +194,6 @@ export const ModelInformationDict: ModelDict = {
|
||||
url_detail: '/purchasing/purchase-order/:pk/',
|
||||
api_endpoint: ApiEndpoints.purchase_order_list,
|
||||
admin_url: '/order/purchaseorder/',
|
||||
supports_barcode: true,
|
||||
icon: 'purchase_orders',
|
||||
default_query_params: { supplier_detail: true }
|
||||
},
|
||||
@@ -218,7 +210,6 @@ export const ModelInformationDict: ModelDict = {
|
||||
url_detail: '/sales/sales-order/:pk/',
|
||||
api_endpoint: ApiEndpoints.sales_order_list,
|
||||
admin_url: '/order/salesorder/',
|
||||
supports_barcode: true,
|
||||
icon: 'sales_orders',
|
||||
default_query_params: { customer_detail: true }
|
||||
},
|
||||
@@ -229,7 +220,6 @@ export const ModelInformationDict: ModelDict = {
|
||||
url_detail: '/sales/shipment/:pk/',
|
||||
admin_url: '/order/salesordershipment/',
|
||||
api_endpoint: ApiEndpoints.sales_order_shipment_list,
|
||||
supports_barcode: true,
|
||||
icon: 'shipment',
|
||||
default_query_params: { order_detail: true }
|
||||
},
|
||||
@@ -240,7 +230,6 @@ export const ModelInformationDict: ModelDict = {
|
||||
url_detail: '/sales/return-order/:pk/',
|
||||
api_endpoint: ApiEndpoints.return_order_list,
|
||||
admin_url: '/order/returnorder/',
|
||||
supports_barcode: true,
|
||||
icon: 'return_orders',
|
||||
default_query_params: { customer_detail: true }
|
||||
},
|
||||
@@ -257,7 +246,6 @@ export const ModelInformationDict: ModelDict = {
|
||||
url_detail: '/stock/transfer-order/:pk/',
|
||||
api_endpoint: ApiEndpoints.transfer_order_list,
|
||||
admin_url: '/order/transferorder/',
|
||||
supports_barcode: true,
|
||||
icon: 'transfer_orders'
|
||||
},
|
||||
transferorderlineitem: {
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
import { ModelFeature } from '@lib/enums/ModelFeature';
|
||||
import { t } from '@lingui/core/macro';
|
||||
import {
|
||||
Group,
|
||||
@@ -36,6 +37,7 @@ import { IconPlus } from '@tabler/icons-react';
|
||||
import type { NavigateFunction } from 'react-router-dom';
|
||||
import { useApi } from '../../../contexts/ApiContext';
|
||||
import { useCreateApiFormModal } from '../../../hooks/UseForm';
|
||||
import { useModelFeatures } from '../../../states/ModelFeatureState';
|
||||
import {
|
||||
useGlobalSettingsState,
|
||||
useUserSettingsState
|
||||
@@ -173,9 +175,11 @@ function RelatedModelFieldComponent({
|
||||
return false;
|
||||
}, [definition.addCreateFields, modelInfo]);
|
||||
|
||||
const modelFeatures = useModelFeatures(definition.model);
|
||||
|
||||
// Determine whether a barcode field should be added
|
||||
const addBarcodeField: boolean = useMemo(() => {
|
||||
if (!modelInfo || !modelInfo.supports_barcode) {
|
||||
if (!modelInfo || !modelFeatures.includes(ModelFeature.barcode)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -188,7 +192,7 @@ function RelatedModelFieldComponent({
|
||||
}
|
||||
|
||||
return true;
|
||||
}, [globalSettings, userSettings, modelInfo]);
|
||||
}, [modelFeatures, globalSettings, userSettings, modelInfo]);
|
||||
|
||||
// Callback function to handle barcode scan results
|
||||
const onBarcodeScan = useCallback(
|
||||
|
||||
@@ -20,6 +20,7 @@ import type { FieldValues, UseControllerReturn } from 'react-hook-form';
|
||||
import type { NavigateFunction } from 'react-router-dom';
|
||||
|
||||
import type { ApiEndpoints } from '@lib/enums/ApiEndpoints';
|
||||
import { ModelFeature } from '@lib/enums/ModelFeature';
|
||||
import { ModelInformationDict } from '@lib/enums/ModelInformation';
|
||||
import type { ModelType } from '@lib/enums/ModelType';
|
||||
import { apiUrl } from '@lib/functions/Api';
|
||||
@@ -27,6 +28,7 @@ import { cancelEvent } from '@lib/functions/Events';
|
||||
import { getDetailUrl, navigateToLink } from '@lib/functions/Navigation';
|
||||
import type { ApiFormFieldType } from '@lib/types/Forms';
|
||||
import { useApi } from '../../../contexts/ApiContext';
|
||||
import { useModelFeatures } from '../../../states/ModelFeatureState';
|
||||
import {
|
||||
useGlobalSettingsState,
|
||||
useUserSettingsState
|
||||
@@ -341,12 +343,15 @@ function TreeFieldComponent({
|
||||
[model]
|
||||
);
|
||||
|
||||
const modelFeatures = useModelFeatures(model);
|
||||
|
||||
const addBarcodeField = useMemo(() => {
|
||||
if (!modelInfo?.supports_barcode) return false;
|
||||
if (!modelInfo || !modelFeatures.includes(ModelFeature.barcode))
|
||||
return false;
|
||||
if (!globalSettings.isSet('BARCODE_ENABLE')) return false;
|
||||
if (!userSettings.isSet('BARCODE_IN_FORM_FIELDS')) return false;
|
||||
return true;
|
||||
}, [modelInfo, globalSettings, userSettings]);
|
||||
}, [modelInfo, modelFeatures, globalSettings, userSettings]);
|
||||
|
||||
const onBarcodeScan = useCallback(
|
||||
(_barcode: string, response: any) => {
|
||||
|
||||
@@ -0,0 +1,109 @@
|
||||
import { ModelFeature } from '@lib/enums/ModelFeature';
|
||||
import type { ModelType } from '@lib/enums/ModelType';
|
||||
import type { UserStateProps } from '@lib/types/User';
|
||||
import { type ReactNode, useMemo } from 'react';
|
||||
import { PrintingActions } from '../components/buttons/PrintingActions';
|
||||
import {
|
||||
type ActionDropdownItem,
|
||||
BarcodeActionDropdown
|
||||
} from '../components/items/ActionDropdown';
|
||||
import { useModelFeatures } from '../states/ModelFeatureState';
|
||||
import { useUserState } from '../states/UserState';
|
||||
|
||||
type FeatureOverrides<T> = Partial<Record<ModelFeature, T>>;
|
||||
type ModelFeatureActionFactory = (context: {
|
||||
model: ModelType;
|
||||
pk: number;
|
||||
instance: any;
|
||||
user: UserStateProps;
|
||||
permission?: boolean;
|
||||
actions?: ActionDropdownItem[];
|
||||
}) => ReactNode | null;
|
||||
|
||||
const modelFeatureActionLookup: Partial<
|
||||
Record<ModelFeature, ModelFeatureActionFactory>
|
||||
> = {
|
||||
[ModelFeature.barcode]: ({
|
||||
model,
|
||||
pk,
|
||||
instance,
|
||||
user,
|
||||
permission,
|
||||
actions
|
||||
}) => (
|
||||
<BarcodeActionDropdown
|
||||
key='barcode-actions'
|
||||
model={model}
|
||||
pk={pk}
|
||||
hash={instance.barcode_hash}
|
||||
perm={permission ?? user.hasChangePermission(model)}
|
||||
actions={actions}
|
||||
/>
|
||||
),
|
||||
[ModelFeature.report]: ({ model, pk }) => {
|
||||
return (
|
||||
<PrintingActions
|
||||
key='printing-actions'
|
||||
modelType={model}
|
||||
items={[pk]}
|
||||
enableLabels={true}
|
||||
enableReports={true}
|
||||
/>
|
||||
);
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* use generic modelfeature detection to render model feature actions (e.g. barcode and printing actions)
|
||||
*
|
||||
* @param model - The model type
|
||||
* @param instance - The model instance
|
||||
* @param actions - Additional actions keyed by model feature
|
||||
* @param permission - Permission overrides keyed by model feature
|
||||
*/
|
||||
export function useModelFeatureActions({
|
||||
model,
|
||||
instance,
|
||||
actions: extraActions,
|
||||
permission
|
||||
}: {
|
||||
model: ModelType;
|
||||
instance: any;
|
||||
actions?: FeatureOverrides<ActionDropdownItem[]>;
|
||||
permission?: FeatureOverrides<boolean>;
|
||||
}): ReactNode[] {
|
||||
const user = useUserState();
|
||||
const features = useModelFeatures(model);
|
||||
const permissionKey = JSON.stringify(permission ?? {});
|
||||
|
||||
// eslint-disable-next-line react-hooks/exhaustive-deps
|
||||
return useMemo(() => {
|
||||
const pk: number | undefined = instance?.pk;
|
||||
|
||||
if (!pk) {
|
||||
return [];
|
||||
}
|
||||
|
||||
return Object.values(ModelFeature).flatMap((feature) => {
|
||||
if (!features.includes(feature)) {
|
||||
return [];
|
||||
}
|
||||
|
||||
const constAction = modelFeatureActionLookup[feature];
|
||||
if (!constAction) {
|
||||
return [];
|
||||
}
|
||||
|
||||
const action = constAction({
|
||||
model,
|
||||
pk,
|
||||
instance,
|
||||
user,
|
||||
permission: permission?.[feature],
|
||||
actions: extraActions?.[feature]
|
||||
});
|
||||
|
||||
return action === null ? [] : [action];
|
||||
});
|
||||
}, [model, instance, features, user, extraActions, permissionKey]);
|
||||
}
|
||||
@@ -25,10 +25,8 @@ import type { ApiFormFieldSet } from '@lib/types/Forms';
|
||||
import type { PanelType } from '@lib/types/Panel';
|
||||
import AdminButton from '../../components/buttons/AdminButton';
|
||||
import PrimaryActionButton from '../../components/buttons/PrimaryActionButton';
|
||||
import { PrintingActions } from '../../components/buttons/PrintingActions';
|
||||
import DetailsBadge from '../../components/details/DetailsBadge';
|
||||
import {
|
||||
BarcodeActionDropdown,
|
||||
CancelItemAction,
|
||||
DuplicateItemAction,
|
||||
EditItemAction,
|
||||
@@ -46,6 +44,7 @@ import {
|
||||
useEditApiFormModal
|
||||
} from '../../hooks/UseForm';
|
||||
import { useInstance } from '../../hooks/UseInstance';
|
||||
import { useModelFeatureActions } from '../../hooks/UseModelFeatureActions';
|
||||
import useStatusCodes from '../../hooks/UseStatusCodes';
|
||||
import { useGlobalSettingsState } from '../../states/SettingsStates';
|
||||
import { useUserState } from '../../states/UserState';
|
||||
@@ -461,6 +460,11 @@ export default function BuildDetail() {
|
||||
fields: completeOrderFields
|
||||
});
|
||||
|
||||
const featureActions = useModelFeatureActions({
|
||||
model: ModelType.build,
|
||||
instance: build
|
||||
});
|
||||
|
||||
const buildActions = useMemo(() => {
|
||||
const canEdit = user.hasChangeRole(UserRoles.build);
|
||||
|
||||
@@ -498,17 +502,7 @@ export default function BuildDetail() {
|
||||
onClick={completeOrder.open}
|
||||
/>,
|
||||
<AdminButton model={ModelType.build} id={build.pk} />,
|
||||
<BarcodeActionDropdown
|
||||
model={ModelType.build}
|
||||
pk={build.pk}
|
||||
hash={build?.barcode_hash}
|
||||
/>,
|
||||
<PrintingActions
|
||||
modelType={ModelType.build}
|
||||
items={[build.pk]}
|
||||
enableLabels
|
||||
enableReports
|
||||
/>,
|
||||
...featureActions,
|
||||
<OptionsActionDropdown
|
||||
tooltip={t`Build Order Actions`}
|
||||
actions={[
|
||||
@@ -535,7 +529,7 @@ export default function BuildDetail() {
|
||||
]}
|
||||
/>
|
||||
];
|
||||
}, [id, build, user, buildStatus]);
|
||||
}, [featureActions, id, build, user, buildStatus]);
|
||||
|
||||
const buildBadges = useMemo(() => {
|
||||
return instanceQuery.isFetching
|
||||
|
||||
@@ -19,7 +19,6 @@ import { ModelType } from '@lib/enums/ModelType';
|
||||
import { UserRoles } from '@lib/enums/Roles';
|
||||
import type { PanelType } from '@lib/types/Panel';
|
||||
import AdminButton from '../../components/buttons/AdminButton';
|
||||
import { PrintingActions } from '../../components/buttons/PrintingActions';
|
||||
import DetailsBadge from '../../components/details/DetailsBadge';
|
||||
import {
|
||||
DeleteItemAction,
|
||||
@@ -38,6 +37,7 @@ import {
|
||||
useEditApiFormModal
|
||||
} from '../../hooks/UseForm';
|
||||
import { useInstance } from '../../hooks/UseInstance';
|
||||
import { useModelFeatureActions } from '../../hooks/UseModelFeatureActions';
|
||||
import { useUserState } from '../../states/UserState';
|
||||
import { AddressTable } from '../../tables/company/AddressTable';
|
||||
import { ContactTable } from '../../tables/company/ContactTable';
|
||||
@@ -220,14 +220,15 @@ export default function CompanyDetail(props: Readonly<CompanyDetailProps>) {
|
||||
}
|
||||
});
|
||||
|
||||
const featureActions = useModelFeatureActions({
|
||||
model: ModelType.company,
|
||||
instance: company
|
||||
});
|
||||
|
||||
const companyActions = useMemo(() => {
|
||||
return [
|
||||
<AdminButton model={ModelType.company} id={company.pk} />,
|
||||
<PrintingActions
|
||||
modelType={ModelType.company}
|
||||
items={[company.pk]}
|
||||
enableReports
|
||||
/>,
|
||||
...featureActions,
|
||||
<OptionsActionDropdown
|
||||
tooltip={t`Company Actions`}
|
||||
actions={[
|
||||
@@ -246,7 +247,7 @@ export default function CompanyDetail(props: Readonly<CompanyDetailProps>) {
|
||||
]}
|
||||
/>
|
||||
];
|
||||
}, [id, company, user]);
|
||||
}, [featureActions, id, company, user]);
|
||||
|
||||
const badges: ReactNode[] = useMemo(() => {
|
||||
return [
|
||||
|
||||
@@ -9,13 +9,13 @@ import { useMemo } from 'react';
|
||||
import { useNavigate, useParams } from 'react-router-dom';
|
||||
|
||||
import { ApiEndpoints } from '@lib/enums/ApiEndpoints';
|
||||
import { ModelFeature } from '@lib/enums/ModelFeature';
|
||||
import { ModelType } from '@lib/enums/ModelType';
|
||||
import { UserRoles } from '@lib/enums/Roles';
|
||||
import { getDetailUrl } from '@lib/functions/Navigation';
|
||||
import type { PanelType } from '@lib/types/Panel';
|
||||
import AdminButton from '../../components/buttons/AdminButton';
|
||||
import {
|
||||
BarcodeActionDropdown,
|
||||
DeleteItemAction,
|
||||
DuplicateItemAction,
|
||||
EditItemAction,
|
||||
@@ -31,6 +31,7 @@ import {
|
||||
useEditApiFormModal
|
||||
} from '../../hooks/UseForm';
|
||||
import { useInstance } from '../../hooks/UseInstance';
|
||||
import { useModelFeatureActions } from '../../hooks/UseModelFeatureActions';
|
||||
import { useUserState } from '../../states/UserState';
|
||||
import { SupplierPartTable } from '../../tables/purchasing/SupplierPartTable';
|
||||
import { StockItemTable } from '../../tables/stock/StockItemTable';
|
||||
@@ -135,6 +136,14 @@ export default function ManufacturerPartDetail() {
|
||||
}
|
||||
});
|
||||
|
||||
const featureActions = useModelFeatureActions({
|
||||
model: ModelType.manufacturerpart,
|
||||
instance: manufacturerPart,
|
||||
permission: {
|
||||
[ModelFeature.barcode]: user.hasChangeRole(UserRoles.purchase_order)
|
||||
}
|
||||
});
|
||||
|
||||
const manufacturerPartActions = useMemo(() => {
|
||||
return [
|
||||
<AdminButton
|
||||
@@ -142,13 +151,7 @@ export default function ManufacturerPartDetail() {
|
||||
model={ModelType.manufacturerpart}
|
||||
id={manufacturerPart.pk}
|
||||
/>,
|
||||
<BarcodeActionDropdown
|
||||
key='barcode'
|
||||
model={ModelType.manufacturerpart}
|
||||
pk={manufacturerPart.pk}
|
||||
hash={manufacturerPart.barcode_hash}
|
||||
perm={user.hasChangeRole(UserRoles.purchase_order)}
|
||||
/>,
|
||||
...featureActions,
|
||||
<OptionsActionDropdown
|
||||
key='options'
|
||||
tooltip={t`Manufacturer Part Actions`}
|
||||
@@ -168,7 +171,7 @@ export default function ManufacturerPartDetail() {
|
||||
]}
|
||||
/>
|
||||
];
|
||||
}, [user, manufacturerPart]);
|
||||
}, [featureActions, user, manufacturerPart]);
|
||||
|
||||
const breadcrumbs = useMemo(() => {
|
||||
return [
|
||||
|
||||
@@ -10,6 +10,7 @@ import { type ReactNode, useMemo } from 'react';
|
||||
import { useNavigate, useParams } from 'react-router-dom';
|
||||
|
||||
import { ApiEndpoints } from '@lib/enums/ApiEndpoints';
|
||||
import { ModelFeature } from '@lib/enums/ModelFeature';
|
||||
import { ModelType } from '@lib/enums/ModelType';
|
||||
import { UserRoles } from '@lib/enums/Roles';
|
||||
import { formatDecimal } from '@lib/functions/Formatting';
|
||||
@@ -18,7 +19,6 @@ import type { PanelType } from '@lib/types/Panel';
|
||||
import AdminButton from '../../components/buttons/AdminButton';
|
||||
import DetailsBadge from '../../components/details/DetailsBadge';
|
||||
import {
|
||||
BarcodeActionDropdown,
|
||||
DeleteItemAction,
|
||||
DuplicateItemAction,
|
||||
EditItemAction,
|
||||
@@ -34,6 +34,7 @@ import {
|
||||
useEditApiFormModal
|
||||
} from '../../hooks/UseForm';
|
||||
import { useInstance } from '../../hooks/UseInstance';
|
||||
import { useModelFeatureActions } from '../../hooks/UseModelFeatureActions';
|
||||
import { useUserState } from '../../states/UserState';
|
||||
import { PurchaseOrderTable } from '../../tables/purchasing/PurchaseOrderTable';
|
||||
import SupplierPriceBreakTable from '../../tables/purchasing/SupplierPriceBreakTable';
|
||||
@@ -117,15 +118,18 @@ export default function SupplierPartDetail() {
|
||||
];
|
||||
}, [supplierPart]);
|
||||
|
||||
const featureActions = useModelFeatureActions({
|
||||
model: ModelType.supplierpart,
|
||||
instance: supplierPart,
|
||||
permission: {
|
||||
[ModelFeature.barcode]: user.hasChangeRole(UserRoles.purchase_order)
|
||||
}
|
||||
});
|
||||
|
||||
const supplierPartActions = useMemo(() => {
|
||||
return [
|
||||
<AdminButton model={ModelType.supplierpart} id={supplierPart.pk} />,
|
||||
<BarcodeActionDropdown
|
||||
model={ModelType.supplierpart}
|
||||
pk={supplierPart.pk}
|
||||
hash={supplierPart.barcode_hash}
|
||||
perm={user.hasChangeRole(UserRoles.purchase_order)}
|
||||
/>,
|
||||
...featureActions,
|
||||
<OptionsActionDropdown
|
||||
tooltip={t`Supplier Part Actions`}
|
||||
actions={[
|
||||
@@ -144,7 +148,7 @@ export default function SupplierPartDetail() {
|
||||
]}
|
||||
/>
|
||||
];
|
||||
}, [user, supplierPart]);
|
||||
}, [featureActions, user, supplierPart]);
|
||||
|
||||
const supplierPartFields = useSupplierPartFields({});
|
||||
|
||||
|
||||
@@ -48,13 +48,11 @@ import { getDetailUrl } from '@lib/functions/Navigation';
|
||||
import type { StockOperationProps } from '@lib/types/Forms';
|
||||
import type { PanelType } from '@lib/types/Panel';
|
||||
import AdminButton from '../../components/buttons/AdminButton';
|
||||
import { PrintingActions } from '../../components/buttons/PrintingActions';
|
||||
import StarredToggleButton from '../../components/buttons/StarredToggleButton';
|
||||
import DetailsBadge from '../../components/details/DetailsBadge';
|
||||
import { Thumbnail } from '../../components/images/Thumbnail';
|
||||
import {
|
||||
ActionDropdown,
|
||||
BarcodeActionDropdown,
|
||||
DeleteItemAction,
|
||||
DuplicateItemAction,
|
||||
EditItemAction,
|
||||
@@ -77,6 +75,7 @@ import {
|
||||
} from '../../hooks/UseForm';
|
||||
import { useInstance } from '../../hooks/UseInstance';
|
||||
import { useInstanceInfo } from '../../hooks/UseInstanceInfo';
|
||||
import { useModelFeatureActions } from '../../hooks/UseModelFeatureActions';
|
||||
import { useStockAdjustActions } from '../../hooks/UseStockAdjustActions';
|
||||
import {
|
||||
useGlobalSettingsState,
|
||||
@@ -715,6 +714,11 @@ export default function PartDetail() {
|
||||
|
||||
const findBySerialNumber = useFindSerialNumberForm({ partId: part.pk });
|
||||
|
||||
const featureActions = useModelFeatureActions({
|
||||
model: ModelType.part,
|
||||
instance: part
|
||||
});
|
||||
|
||||
const partActions = useMemo(() => {
|
||||
return [
|
||||
<AdminButton model={ModelType.part} id={part.pk} />,
|
||||
@@ -726,19 +730,7 @@ export default function PartDetail() {
|
||||
refreshInstance();
|
||||
}}
|
||||
/>,
|
||||
<BarcodeActionDropdown
|
||||
model={ModelType.part}
|
||||
pk={part.pk}
|
||||
hash={part?.barcode_hash}
|
||||
perm={user.hasChangeRole(UserRoles.part)}
|
||||
key='action_dropdown'
|
||||
/>,
|
||||
<PrintingActions
|
||||
modelType={ModelType.part}
|
||||
items={[part.pk]}
|
||||
enableReports
|
||||
enableLabels
|
||||
/>,
|
||||
...featureActions,
|
||||
<ActionDropdown
|
||||
tooltip={t`Stock Actions`}
|
||||
icon={<IconPackages />}
|
||||
@@ -785,7 +777,7 @@ export default function PartDetail() {
|
||||
]}
|
||||
/>
|
||||
];
|
||||
}, [id, part, user, stockAdjustActions.menuActions]);
|
||||
}, [featureActions, id, part, user, stockAdjustActions.menuActions]);
|
||||
|
||||
return (
|
||||
<>
|
||||
|
||||
@@ -12,9 +12,7 @@ import { apiUrl } from '@lib/functions/Api';
|
||||
import type { PanelType } from '@lib/types/Panel';
|
||||
import AdminButton from '../../components/buttons/AdminButton';
|
||||
import PrimaryActionButton from '../../components/buttons/PrimaryActionButton';
|
||||
import { PrintingActions } from '../../components/buttons/PrintingActions';
|
||||
import {
|
||||
BarcodeActionDropdown,
|
||||
CancelItemAction,
|
||||
DuplicateItemAction,
|
||||
EditItemAction,
|
||||
@@ -31,6 +29,7 @@ import {
|
||||
useEditApiFormModal
|
||||
} from '../../hooks/UseForm';
|
||||
import { useInstance } from '../../hooks/UseInstance';
|
||||
import { useModelFeatureActions } from '../../hooks/UseModelFeatureActions';
|
||||
import useStatusCodes from '../../hooks/UseStatusCodes';
|
||||
import { useGlobalSettingsState } from '../../states/SettingsStates';
|
||||
import { useUserState } from '../../states/UserState';
|
||||
@@ -232,6 +231,11 @@ export default function PurchaseOrderDetail() {
|
||||
preFormWarning: t`Mark this order as complete`
|
||||
});
|
||||
|
||||
const featureActions = useModelFeatureActions({
|
||||
model: ModelType.purchaseorder,
|
||||
instance: order
|
||||
});
|
||||
|
||||
const poActions = useMemo(() => {
|
||||
const canEdit: boolean = user.hasChangeRole(UserRoles.purchase_order);
|
||||
|
||||
@@ -266,17 +270,7 @@ export default function PurchaseOrderDetail() {
|
||||
onClick={completeOrder.open}
|
||||
/>,
|
||||
<AdminButton model={ModelType.purchaseorder} id={order.pk} />,
|
||||
<BarcodeActionDropdown
|
||||
model={ModelType.purchaseorder}
|
||||
pk={order.pk}
|
||||
hash={order?.barcode_hash}
|
||||
/>,
|
||||
<PrintingActions
|
||||
modelType={ModelType.purchaseorder}
|
||||
items={[order.pk]}
|
||||
enableLabels
|
||||
enableReports
|
||||
/>,
|
||||
...featureActions,
|
||||
<OptionsActionDropdown
|
||||
tooltip={t`Order Actions`}
|
||||
actions={[
|
||||
@@ -305,7 +299,7 @@ export default function PurchaseOrderDetail() {
|
||||
]}
|
||||
/>
|
||||
];
|
||||
}, [id, order, user, poStatus]);
|
||||
}, [featureActions, id, order, user, poStatus]);
|
||||
|
||||
const orderBadges: ReactNode[] = useMemo(() => {
|
||||
return instanceQuery.isLoading
|
||||
|
||||
@@ -12,9 +12,7 @@ import { apiUrl } from '@lib/functions/Api';
|
||||
import type { PanelType } from '@lib/types/Panel';
|
||||
import AdminButton from '../../components/buttons/AdminButton';
|
||||
import PrimaryActionButton from '../../components/buttons/PrimaryActionButton';
|
||||
import { PrintingActions } from '../../components/buttons/PrintingActions';
|
||||
import {
|
||||
BarcodeActionDropdown,
|
||||
CancelItemAction,
|
||||
DuplicateItemAction,
|
||||
EditItemAction,
|
||||
@@ -31,6 +29,7 @@ import {
|
||||
useEditApiFormModal
|
||||
} from '../../hooks/UseForm';
|
||||
import { useInstance } from '../../hooks/UseInstance';
|
||||
import { useModelFeatureActions } from '../../hooks/UseModelFeatureActions';
|
||||
import useStatusCodes from '../../hooks/UseStatusCodes';
|
||||
import { useGlobalSettingsState } from '../../states/SettingsStates';
|
||||
import { useUserState } from '../../states/UserState';
|
||||
@@ -226,6 +225,11 @@ export default function ReturnOrderDetail() {
|
||||
successMessage: t`Order completed`
|
||||
});
|
||||
|
||||
const featureActions = useModelFeatureActions({
|
||||
model: ModelType.returnorder,
|
||||
instance: order
|
||||
});
|
||||
|
||||
const orderActions = useMemo(() => {
|
||||
const canEdit: boolean = user.hasChangeRole(UserRoles.return_order);
|
||||
|
||||
@@ -264,17 +268,7 @@ export default function ReturnOrderDetail() {
|
||||
onClick={() => completeOrder.open()}
|
||||
/>,
|
||||
<AdminButton model={ModelType.returnorder} id={order.pk} />,
|
||||
<BarcodeActionDropdown
|
||||
model={ModelType.returnorder}
|
||||
pk={order.pk}
|
||||
hash={order?.barcode_hash}
|
||||
/>,
|
||||
<PrintingActions
|
||||
modelType={ModelType.returnorder}
|
||||
items={[order.pk]}
|
||||
enableReports
|
||||
enableLabels
|
||||
/>,
|
||||
...featureActions,
|
||||
<OptionsActionDropdown
|
||||
tooltip={t`Order Actions`}
|
||||
actions={[
|
||||
@@ -303,7 +297,7 @@ export default function ReturnOrderDetail() {
|
||||
]}
|
||||
/>
|
||||
];
|
||||
}, [user, order, orderOpen, roStatus]);
|
||||
}, [featureActions, user, order, orderOpen, roStatus]);
|
||||
|
||||
const subtitle: string = useMemo(() => {
|
||||
let t = order.customer_detail?.name || '';
|
||||
|
||||
@@ -18,9 +18,7 @@ import { apiUrl } from '@lib/functions/Api';
|
||||
import type { PanelType } from '@lib/types/Panel';
|
||||
import AdminButton from '../../components/buttons/AdminButton';
|
||||
import PrimaryActionButton from '../../components/buttons/PrimaryActionButton';
|
||||
import { PrintingActions } from '../../components/buttons/PrintingActions';
|
||||
import {
|
||||
BarcodeActionDropdown,
|
||||
CancelItemAction,
|
||||
DuplicateItemAction,
|
||||
EditItemAction,
|
||||
@@ -37,6 +35,7 @@ import {
|
||||
useEditApiFormModal
|
||||
} from '../../hooks/UseForm';
|
||||
import { useInstance } from '../../hooks/UseInstance';
|
||||
import { useModelFeatureActions } from '../../hooks/UseModelFeatureActions';
|
||||
import useStatusCodes from '../../hooks/UseStatusCodes';
|
||||
import { useGlobalSettingsState } from '../../states/SettingsStates';
|
||||
import { useUserState } from '../../states/UserState';
|
||||
@@ -266,6 +265,11 @@ export default function SalesOrderDetail() {
|
||||
}
|
||||
});
|
||||
|
||||
const featureActions = useModelFeatureActions({
|
||||
model: ModelType.salesorder,
|
||||
instance: order
|
||||
});
|
||||
|
||||
const soActions = useMemo(() => {
|
||||
const canEdit: boolean = user.hasChangeRole(UserRoles.sales_order);
|
||||
|
||||
@@ -316,17 +320,7 @@ export default function SalesOrderDetail() {
|
||||
onClick={completeOrder.open}
|
||||
/>,
|
||||
<AdminButton model={ModelType.salesorder} id={order.pk} />,
|
||||
<BarcodeActionDropdown
|
||||
model={ModelType.salesorder}
|
||||
pk={order.pk}
|
||||
hash={order?.barcode_hash}
|
||||
/>,
|
||||
<PrintingActions
|
||||
modelType={ModelType.salesorder}
|
||||
items={[order.pk]}
|
||||
enableReports
|
||||
enableLabels
|
||||
/>,
|
||||
...featureActions,
|
||||
<OptionsActionDropdown
|
||||
tooltip={t`Order Actions`}
|
||||
actions={[
|
||||
@@ -353,7 +347,7 @@ export default function SalesOrderDetail() {
|
||||
]}
|
||||
/>
|
||||
];
|
||||
}, [user, order, soStatus, globalSettings]);
|
||||
}, [featureActions, user, order, soStatus, globalSettings]);
|
||||
|
||||
const orderBadges: ReactNode[] = useMemo(() => {
|
||||
return instanceQuery.isLoading
|
||||
|
||||
@@ -16,10 +16,8 @@ import { getDetailUrl } from '@lib/functions/Navigation';
|
||||
import type { PanelType } from '@lib/types/Panel';
|
||||
import AdminButton from '../../components/buttons/AdminButton';
|
||||
import PrimaryActionButton from '../../components/buttons/PrimaryActionButton';
|
||||
import { PrintingActions } from '../../components/buttons/PrintingActions';
|
||||
import DetailsBadge from '../../components/details/DetailsBadge';
|
||||
import {
|
||||
BarcodeActionDropdown,
|
||||
CancelItemAction,
|
||||
EditItemAction,
|
||||
OptionsActionDropdown
|
||||
@@ -38,6 +36,7 @@ import {
|
||||
useEditApiFormModal
|
||||
} from '../../hooks/UseForm';
|
||||
import { useInstance } from '../../hooks/UseInstance';
|
||||
import { useModelFeatureActions } from '../../hooks/UseModelFeatureActions';
|
||||
import { useUserState } from '../../states/UserState';
|
||||
import SalesOrderAllocationTable from '../../tables/sales/SalesOrderAllocationTable';
|
||||
import { SalesOrderShipmentDetailsPanel } from './SalesOrderShipmentDetailsPanel';
|
||||
@@ -178,6 +177,11 @@ export default function SalesOrderShipmentDetail() {
|
||||
];
|
||||
}, [isPending, isChecked, shipment.deliveryDate, shipmentQuery.isFetching]);
|
||||
|
||||
const featureActions = useModelFeatureActions({
|
||||
model: ModelType.salesordershipment,
|
||||
instance: shipment
|
||||
});
|
||||
|
||||
const shipmentActions = useMemo(() => {
|
||||
const canEdit: boolean = user.hasChangePermission(
|
||||
ModelType.salesordershipment
|
||||
@@ -195,19 +199,7 @@ export default function SalesOrderShipmentDetail() {
|
||||
}}
|
||||
/>,
|
||||
<AdminButton model={ModelType.salesordershipment} id={shipment.pk} />,
|
||||
<BarcodeActionDropdown
|
||||
key='barcode'
|
||||
model={ModelType.salesordershipment}
|
||||
pk={shipment.pk}
|
||||
hash={shipment?.barcode_hash}
|
||||
/>,
|
||||
<PrintingActions
|
||||
key='print'
|
||||
modelType={ModelType.salesordershipment}
|
||||
items={[shipment.pk]}
|
||||
enableLabels
|
||||
enableReports
|
||||
/>,
|
||||
...featureActions,
|
||||
<OptionsActionDropdown
|
||||
key='actions'
|
||||
tooltip={t`Shipment Actions`}
|
||||
@@ -239,7 +231,7 @@ export default function SalesOrderShipmentDetail() {
|
||||
]}
|
||||
/>
|
||||
];
|
||||
}, [isChecked, isPending, user, shipment]);
|
||||
}, [featureActions, isChecked, isPending, user, shipment]);
|
||||
|
||||
return (
|
||||
<>
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
import { ApiEndpoints } from '@lib/enums/ApiEndpoints';
|
||||
import { ModelFeature } from '@lib/enums/ModelFeature';
|
||||
import { ModelType } from '@lib/enums/ModelType';
|
||||
import { UserRoles } from '@lib/enums/Roles';
|
||||
import { apiUrl } from '@lib/functions/Api';
|
||||
@@ -22,10 +23,8 @@ import { useNavigate, useParams } from 'react-router-dom';
|
||||
import { api } from '../../App';
|
||||
import { useBarcodeScanDialog } from '../../components/barcodes/BarcodeScanDialog';
|
||||
import AdminButton from '../../components/buttons/AdminButton';
|
||||
import { PrintingActions } from '../../components/buttons/PrintingActions';
|
||||
import OrderCalendar from '../../components/calendar/OrderCalendar';
|
||||
import {
|
||||
BarcodeActionDropdown,
|
||||
DeleteItemAction,
|
||||
EditItemAction,
|
||||
OptionsActionDropdown
|
||||
@@ -44,6 +43,7 @@ import {
|
||||
useEditApiFormModal
|
||||
} from '../../hooks/UseForm';
|
||||
import { useInstance } from '../../hooks/UseInstance';
|
||||
import { useModelFeatureActions } from '../../hooks/UseModelFeatureActions';
|
||||
import { useStockAdjustActions } from '../../hooks/UseStockAdjustActions';
|
||||
import { useUserSettingsState } from '../../states/SettingsStates';
|
||||
import { useGlobalSettingsState } from '../../states/SettingsStates';
|
||||
@@ -330,39 +330,37 @@ export default function Stock() {
|
||||
}
|
||||
});
|
||||
|
||||
const featureActionOverrides = useMemo(
|
||||
() => ({
|
||||
[ModelFeature.barcode]: [
|
||||
{
|
||||
name: t`Scan in stock items`,
|
||||
icon: <InvenTreeIcon icon='stock' />,
|
||||
tooltip: t`Scan item into this location`,
|
||||
onClick: scanInStockItem.open
|
||||
},
|
||||
{
|
||||
name: t`Scan in container`,
|
||||
icon: <InvenTreeIcon icon='unallocated_stock' />,
|
||||
tooltip: t`Scan container into this location`,
|
||||
onClick: scanInStockLocation.open
|
||||
}
|
||||
]
|
||||
}),
|
||||
[scanInStockItem.open, scanInStockLocation.open]
|
||||
);
|
||||
|
||||
const featureActions = useModelFeatureActions({
|
||||
model: ModelType.stocklocation,
|
||||
instance: location,
|
||||
actions: featureActionOverrides
|
||||
});
|
||||
|
||||
const locationActions = useMemo(
|
||||
() => [
|
||||
<AdminButton model={ModelType.stocklocation} id={location.pk} />,
|
||||
<LocateItemButton locationId={location.pk} />,
|
||||
location.pk ? (
|
||||
<BarcodeActionDropdown
|
||||
model={ModelType.stocklocation}
|
||||
pk={location.pk}
|
||||
hash={location?.barcode_hash}
|
||||
perm={user.hasChangeRole(UserRoles.stock_location)}
|
||||
actions={[
|
||||
{
|
||||
name: t`Scan in stock items`,
|
||||
icon: <InvenTreeIcon icon='stock' />,
|
||||
tooltip: t`Scan item into this location`,
|
||||
onClick: scanInStockItem.open
|
||||
},
|
||||
{
|
||||
name: t`Scan in container`,
|
||||
icon: <InvenTreeIcon icon='unallocated_stock' />,
|
||||
tooltip: t`Scan container into this location`,
|
||||
onClick: scanInStockLocation.open
|
||||
}
|
||||
]}
|
||||
/>
|
||||
) : null,
|
||||
<PrintingActions
|
||||
modelType={ModelType.stocklocation}
|
||||
items={[location.pk ?? 0]}
|
||||
hidden={!location?.pk}
|
||||
enableLabels
|
||||
enableReports
|
||||
/>,
|
||||
...featureActions,
|
||||
stockAdjustActions.dropdown,
|
||||
<OptionsActionDropdown
|
||||
tooltip={t`Location Actions`}
|
||||
@@ -380,7 +378,7 @@ export default function Stock() {
|
||||
]}
|
||||
/>
|
||||
],
|
||||
[location, id, user, stockAdjustActions.dropdown]
|
||||
[featureActions, location, id, user, stockAdjustActions.dropdown]
|
||||
);
|
||||
|
||||
const breadcrumbs = useMemo(
|
||||
|
||||
@@ -17,6 +17,7 @@ import { useNavigate, useParams } from 'react-router-dom';
|
||||
|
||||
import { StylishText } from '@lib/components/StylishText';
|
||||
import { ApiEndpoints } from '@lib/enums/ApiEndpoints';
|
||||
import { ModelFeature } from '@lib/enums/ModelFeature';
|
||||
import { ModelType } from '@lib/enums/ModelType';
|
||||
import { UserRoles } from '@lib/enums/Roles';
|
||||
import { apiUrl } from '@lib/functions/Api';
|
||||
@@ -26,11 +27,9 @@ import type { PanelType } from '@lib/types/Panel';
|
||||
import { notifications } from '@mantine/notifications';
|
||||
import { useBarcodeScanDialog } from '../../components/barcodes/BarcodeScanDialog';
|
||||
import AdminButton from '../../components/buttons/AdminButton';
|
||||
import { PrintingActions } from '../../components/buttons/PrintingActions';
|
||||
import DetailsBadge from '../../components/details/DetailsBadge';
|
||||
import {
|
||||
ActionDropdown,
|
||||
BarcodeActionDropdown,
|
||||
DeleteItemAction,
|
||||
DuplicateItemAction,
|
||||
EditItemAction,
|
||||
@@ -57,6 +56,7 @@ import {
|
||||
useEditApiFormModal
|
||||
} from '../../hooks/UseForm';
|
||||
import { useInstance } from '../../hooks/UseInstance';
|
||||
import { useModelFeatureActions } from '../../hooks/UseModelFeatureActions';
|
||||
import { useStockAdjustActions } from '../../hooks/UseStockAdjustActions';
|
||||
import { useGlobalSettingsState } from '../../states/SettingsStates';
|
||||
import { useUserState } from '../../states/UserState';
|
||||
@@ -516,6 +516,26 @@ export default function StockDetail() {
|
||||
}
|
||||
});
|
||||
|
||||
const featureActionOverrides = useMemo(
|
||||
() => ({
|
||||
[ModelFeature.barcode]: [
|
||||
{
|
||||
name: t`Scan into location`,
|
||||
icon: <InvenTreeIcon icon='location' />,
|
||||
tooltip: t`Scan this item into a location`,
|
||||
onClick: scanIntoLocation.open
|
||||
}
|
||||
]
|
||||
}),
|
||||
[scanIntoLocation.open]
|
||||
);
|
||||
|
||||
const featureActions = useModelFeatureActions({
|
||||
model: ModelType.stockitem,
|
||||
instance: stockitem,
|
||||
actions: featureActionOverrides
|
||||
});
|
||||
|
||||
const stockActions = useMemo(() => {
|
||||
const serial = stockitem.serial;
|
||||
const serialized =
|
||||
@@ -530,26 +550,7 @@ export default function StockDetail() {
|
||||
return [
|
||||
<AdminButton model={ModelType.stockitem} id={stockitem.pk} />,
|
||||
<LocateItemButton stockId={stockitem.pk} />,
|
||||
<BarcodeActionDropdown
|
||||
model={ModelType.stockitem}
|
||||
pk={stockitem.pk}
|
||||
hash={stockitem?.barcode_hash}
|
||||
perm={user.hasChangeRole(UserRoles.stock)}
|
||||
actions={[
|
||||
{
|
||||
name: t`Scan into location`,
|
||||
icon: <InvenTreeIcon icon='location' />,
|
||||
tooltip: t`Scan this item into a location`,
|
||||
onClick: scanIntoLocation.open
|
||||
}
|
||||
]}
|
||||
/>,
|
||||
<PrintingActions
|
||||
modelType={ModelType.stockitem}
|
||||
items={[stockitem.pk]}
|
||||
enableReports
|
||||
enableLabels
|
||||
/>,
|
||||
...featureActions,
|
||||
<ActionDropdown
|
||||
tooltip={t`Stock Operations`}
|
||||
icon={<IconPackages />}
|
||||
@@ -618,7 +619,14 @@ export default function StockDetail() {
|
||||
]}
|
||||
/>
|
||||
];
|
||||
}, [id, stockitem, part, user, stockAdjustActions.menuActions]);
|
||||
}, [
|
||||
featureActions,
|
||||
id,
|
||||
stockitem,
|
||||
part,
|
||||
user,
|
||||
stockAdjustActions.menuActions
|
||||
]);
|
||||
|
||||
const stockBadges: ReactNode[] = useMemo(() => {
|
||||
const quantity: number = stockitem?.quantity ?? 0;
|
||||
|
||||
@@ -15,9 +15,7 @@ import {
|
||||
} from '@tabler/icons-react';
|
||||
import AdminButton from '../../components/buttons/AdminButton';
|
||||
import PrimaryActionButton from '../../components/buttons/PrimaryActionButton';
|
||||
import { PrintingActions } from '../../components/buttons/PrintingActions';
|
||||
import {
|
||||
BarcodeActionDropdown,
|
||||
CancelItemAction,
|
||||
DuplicateItemAction,
|
||||
EditItemAction,
|
||||
@@ -34,6 +32,7 @@ import {
|
||||
useEditApiFormModal
|
||||
} from '../../hooks/UseForm';
|
||||
import { useInstance } from '../../hooks/UseInstance';
|
||||
import { useModelFeatureActions } from '../../hooks/UseModelFeatureActions';
|
||||
import useStatusCodes from '../../hooks/UseStatusCodes';
|
||||
import { useGlobalSettingsState } from '../../states/SettingsStates';
|
||||
import { useUserState } from '../../states/UserState';
|
||||
@@ -253,6 +252,11 @@ export default function TransferOrderDetail() {
|
||||
}
|
||||
});
|
||||
|
||||
const featureActions = useModelFeatureActions({
|
||||
model: ModelType.transferorder,
|
||||
instance: order
|
||||
});
|
||||
|
||||
const orderActions = useMemo(() => {
|
||||
const canEdit: boolean = user.hasChangeRole(UserRoles.transfer_order);
|
||||
|
||||
@@ -286,17 +290,7 @@ export default function TransferOrderDetail() {
|
||||
onClick={() => completeOrder.open()}
|
||||
/>,
|
||||
<AdminButton model={ModelType.transferorder} id={order.pk} />,
|
||||
<BarcodeActionDropdown
|
||||
model={ModelType.transferorder}
|
||||
pk={order.pk}
|
||||
hash={order?.barcode_hash}
|
||||
/>,
|
||||
<PrintingActions
|
||||
modelType={ModelType.transferorder}
|
||||
items={[order.pk]}
|
||||
enableReports
|
||||
enableLabels
|
||||
/>,
|
||||
...featureActions,
|
||||
<OptionsActionDropdown
|
||||
tooltip={t`Order Actions`}
|
||||
actions={[
|
||||
@@ -325,7 +319,7 @@ export default function TransferOrderDetail() {
|
||||
]}
|
||||
/>
|
||||
];
|
||||
}, [user, order, orderOpen, toStatus]);
|
||||
}, [featureActions, user, order, orderOpen, toStatus]);
|
||||
|
||||
const subtitle: string = useMemo(() => {
|
||||
const t = order.take_from_detail?.pathstring || '';
|
||||
|
||||
Reference in new issue
Block a user