mirror of
https://github.com/inventree/InvenTree.git
synced 2025-06-16 20:15:44 +00:00
Reporting: Build line label fix (#6717)
* Fix "BuildLine" label in PUI - Point to "buildline" not "build" * Prevent escape closing template ediror * Update report docs * Fix for format_number - Prevent number from being represented as scientific notation
This commit is contained in:
@ -27,6 +27,7 @@ export interface DrawerProps {
|
||||
renderContent: (id?: string) => React.ReactNode;
|
||||
urlPrefix?: string;
|
||||
size?: MantineNumberSize;
|
||||
closeOnEscape?: boolean;
|
||||
}
|
||||
|
||||
const useStyles = createStyles(() => ({
|
||||
@ -40,6 +41,7 @@ function DetailDrawerComponent({
|
||||
title,
|
||||
position = 'right',
|
||||
size,
|
||||
closeOnEscape = true,
|
||||
renderContent
|
||||
}: DrawerProps) {
|
||||
const navigate = useNavigate();
|
||||
@ -62,6 +64,7 @@ function DetailDrawerComponent({
|
||||
addDetailDrawer(false);
|
||||
}}
|
||||
position={position}
|
||||
closeOnEscape={closeOnEscape}
|
||||
size={size}
|
||||
classNames={{ root: classes.flex, body: classes.flex }}
|
||||
scrollAreaComponent={Stack}
|
||||
|
@ -20,3 +20,20 @@ export function RenderBuildOrder({ instance }: { instance: any }): ReactNode {
|
||||
/>
|
||||
);
|
||||
}
|
||||
|
||||
/*
|
||||
* Inline rendering of a single BuildLine instance
|
||||
*/
|
||||
export function RenderBuildLine({ instance }: { instance: any }): ReactNode {
|
||||
return (
|
||||
<RenderInlineModel
|
||||
primary={instance.part_detail.full_name}
|
||||
secondary={instance.quantity}
|
||||
suffix={StatusRenderer({
|
||||
status: instance.status,
|
||||
type: ModelType.build
|
||||
})}
|
||||
image={instance.part_detail.thumbnail || instance.part_detail.image}
|
||||
/>
|
||||
);
|
||||
}
|
||||
|
@ -5,7 +5,7 @@ import { ReactNode } from 'react';
|
||||
|
||||
import { ModelType } from '../../enums/ModelType';
|
||||
import { Thumbnail } from '../images/Thumbnail';
|
||||
import { RenderBuildOrder } from './Build';
|
||||
import { RenderBuildLine, RenderBuildOrder } from './Build';
|
||||
import {
|
||||
RenderAddress,
|
||||
RenderCompany,
|
||||
@ -42,6 +42,7 @@ const RendererLookup: EnumDictionary<
|
||||
> = {
|
||||
[ModelType.address]: RenderAddress,
|
||||
[ModelType.build]: RenderBuildOrder,
|
||||
[ModelType.buildline]: RenderBuildLine,
|
||||
[ModelType.company]: RenderCompany,
|
||||
[ModelType.contact]: RenderContact,
|
||||
[ModelType.manufacturerpart]: RenderManufacturerPart,
|
||||
|
@ -92,6 +92,14 @@ export const ModelInformationDict: ModelDict = {
|
||||
cui_detail: '/build/:pk/',
|
||||
api_endpoint: ApiEndpoints.build_order_list
|
||||
},
|
||||
buildline: {
|
||||
label: t`Build Line`,
|
||||
label_multiple: t`Build Lines`,
|
||||
url_overview: '/build/line',
|
||||
url_detail: '/build/line/:pk/',
|
||||
cui_detail: '/build/line/:pk/',
|
||||
api_endpoint: ApiEndpoints.build_line_list
|
||||
},
|
||||
company: {
|
||||
label: t`Company`,
|
||||
label_multiple: t`Companies`,
|
||||
|
@ -13,6 +13,7 @@ export enum ModelType {
|
||||
stocklocation = 'stocklocation',
|
||||
stockhistory = 'stockhistory',
|
||||
build = 'build',
|
||||
buildline = 'buildline',
|
||||
company = 'company',
|
||||
purchaseorder = 'purchaseorder',
|
||||
purchaseorderline = 'purchaseorderline',
|
||||
|
@ -64,7 +64,7 @@ export default function TemplateManagementPanel() {
|
||||
}
|
||||
},
|
||||
{
|
||||
name: t`Stock item`,
|
||||
name: t`Stock Item`,
|
||||
key: 'stock',
|
||||
icon: 'stock',
|
||||
preview: {
|
||||
@ -73,12 +73,12 @@ export default function TemplateManagementPanel() {
|
||||
}
|
||||
},
|
||||
{
|
||||
name: t`Build line`,
|
||||
name: t`Build Line`,
|
||||
key: 'buildline',
|
||||
icon: 'builds',
|
||||
preview: {
|
||||
itemKey: 'line',
|
||||
model: ModelType.build
|
||||
model: ModelType.buildline
|
||||
}
|
||||
}
|
||||
]
|
||||
@ -96,7 +96,7 @@ export default function TemplateManagementPanel() {
|
||||
defaultTemplate: defaultReportTemplate,
|
||||
variants: [
|
||||
{
|
||||
name: t`Purchase order`,
|
||||
name: t`Purchase Order`,
|
||||
key: 'po',
|
||||
icon: 'purchase_orders',
|
||||
preview: {
|
||||
@ -105,7 +105,7 @@ export default function TemplateManagementPanel() {
|
||||
}
|
||||
},
|
||||
{
|
||||
name: t`Sales order`,
|
||||
name: t`Sales Order`,
|
||||
key: 'so',
|
||||
icon: 'sales_orders',
|
||||
preview: {
|
||||
@ -114,7 +114,7 @@ export default function TemplateManagementPanel() {
|
||||
}
|
||||
},
|
||||
{
|
||||
name: t`Return order`,
|
||||
name: t`Return Order`,
|
||||
key: 'ro',
|
||||
icon: 'return_orders',
|
||||
preview: {
|
||||
@ -151,7 +151,7 @@ export default function TemplateManagementPanel() {
|
||||
}
|
||||
},
|
||||
{
|
||||
name: t`Stock location`,
|
||||
name: t`Stock Location`,
|
||||
key: 'slr',
|
||||
icon: 'default_location',
|
||||
preview: {
|
||||
|
@ -286,6 +286,7 @@ export function TemplateTable({
|
||||
<DetailDrawer
|
||||
title={t`Edit` + ' ' + templateTypeTranslation}
|
||||
size={'90%'}
|
||||
closeOnEscape={false}
|
||||
renderContent={(id) => {
|
||||
return (
|
||||
<TemplateDrawer
|
||||
|
Reference in New Issue
Block a user