diff --git a/src/frontend/src/components/buttons/PrimaryActionButton.tsx b/src/frontend/src/components/buttons/PrimaryActionButton.tsx
index 8d30b3fd36..c4c61d2e89 100644
--- a/src/frontend/src/components/buttons/PrimaryActionButton.tsx
+++ b/src/frontend/src/components/buttons/PrimaryActionButton.tsx
@@ -1,7 +1,6 @@
import { Button, Tooltip } from '@mantine/core';
import { InvenTreeIcon, InvenTreeIconType } from '../../functions/icons';
-import { notYetImplemented } from '../../functions/notifications';
/**
* A "primary action" button for display on a page detail, (for example)
@@ -19,7 +18,7 @@ export default function PrimaryActionButton({
icon?: InvenTreeIconType;
color?: string;
hidden?: boolean;
- onClick?: () => void;
+ onClick: () => void;
}) {
if (hidden) {
return null;
@@ -32,7 +31,7 @@ export default function PrimaryActionButton({
color={color}
radius="sm"
p="xs"
- onClick={onClick ?? notYetImplemented}
+ onClick={onClick}
>
{title}
diff --git a/src/frontend/src/components/buttons/PrintingActions.tsx b/src/frontend/src/components/buttons/PrintingActions.tsx
index fbeb5deab1..43dce5b3bd 100644
--- a/src/frontend/src/components/buttons/PrintingActions.tsx
+++ b/src/frontend/src/components/buttons/PrintingActions.tsx
@@ -92,7 +92,7 @@ export function PrintingActions({
url: apiUrl(ApiEndpoints.label_print),
title: t`Print Label`,
fields: labelFields,
- timeout: (items.length + 1) * 1000,
+ timeout: (items.length + 1) * 5000,
onClose: () => {
setPluginKey('');
},
@@ -121,7 +121,7 @@ export function PrintingActions({
const reportModal = useCreateApiFormModal({
title: t`Print Report`,
url: apiUrl(ApiEndpoints.report_print),
- timeout: (items.length + 1) * 1000,
+ timeout: (items.length + 1) * 5000,
fields: {
template: {
filters: {
diff --git a/src/frontend/src/components/details/Details.tsx b/src/frontend/src/components/details/Details.tsx
index f58136d628..b266bd47e1 100644
--- a/src/frontend/src/components/details/Details.tsx
+++ b/src/frontend/src/components/details/Details.tsx
@@ -2,15 +2,16 @@ import { t } from '@lingui/macro';
import {
Anchor,
Badge,
+ Group,
Paper,
Skeleton,
Stack,
Table,
Text
} from '@mantine/core';
-import { useSuspenseQuery } from '@tanstack/react-query';
+import { useQuery } from '@tanstack/react-query';
import { getValueAtPath } from 'mantine-datatable';
-import { Suspense, useCallback, useMemo } from 'react';
+import { useCallback, useMemo } from 'react';
import { useNavigate } from 'react-router-dom';
import { api } from '../../App';
@@ -96,7 +97,7 @@ type FieldProps = {
* Badge appends icon to describe type of Owner
*/
function NameBadge({ pk, type }: { pk: string | number; type: BadgeType }) {
- const { data } = useSuspenseQuery({
+ const { data } = useQuery({
queryKey: ['badge', type, pk],
queryFn: async () => {
let path: string = '';
@@ -111,6 +112,8 @@ function NameBadge({ pk, type }: { pk: string | number; type: BadgeType }) {
case 'group':
path = ApiEndpoints.group_list;
break;
+ default:
+ return {};
}
const url = apiUrl(path, pk);
@@ -133,9 +136,13 @@ function NameBadge({ pk, type }: { pk: string | number; type: BadgeType }) {
const settings = useGlobalSettingsState();
+ if (!data || data.isLoading || data.isFetching) {
+ return ;
+ }
+
// Rendering a user's rame for the badge
function _render_name() {
- if (!data) {
+ if (!data || !data.pk) {
return '';
} else if (type === 'user' && settings.isSet('DISPLAY_FULL_NAMES')) {
if (data.first_name || data.last_name) {
@@ -151,18 +158,16 @@ function NameBadge({ pk, type }: { pk: string | number; type: BadgeType }) {
}
return (
- }>
-
-
- {data?.name ?? _render_name()}
-
-
-
-
+
+
+ {data?.name ?? _render_name()}
+
+
+
);
}
@@ -195,15 +200,15 @@ function TableStringValue(props: Readonly) {
alignItems: 'flex-start'
}}
>
- }>
-
+
+
{value ? value : props.field_data?.unit && '0'}{' '}
{props.field_data.unit == true && props.unit}
-
-
- {props.field_data.user && (
-
- )}
+
+ {props.field_data.user && (
+