2
0
mirror of https://github.com/inventree/InvenTree.git synced 2025-06-13 18:45:40 +00:00

Table col fix (#9762)

* Update mantine-datatable

* Improve table hook

* Fix for table name

- Table names must be unique
- Otherwise stored column data gets corrupted

* Click through on table

* Tweak unit tests
This commit is contained in:
Oliver
2025-06-12 12:18:14 +10:00
committed by GitHub
parent a3c3c142f7
commit c81d0eb628
6 changed files with 24 additions and 13 deletions

View File

@ -88,7 +88,7 @@
"fuse.js": "^7.0.0",
"html5-qrcode": "^2.3.8",
"mantine-contextmenu": "^7.15.3",
"mantine-datatable": "^7.15.1",
"mantine-datatable": "^7.17.1",
"qrcode": "^1.5.4",
"react": "^18.3.1",
"react-dom": "^18.3.1",

View File

@ -311,7 +311,7 @@ export default function BuildDetail() {
content: (
<StockItemTable
allowAdd={false}
tableName='build-outputs'
tableName='completed-build-outputs'
params={{
build: id,
is_building: false

View File

@ -559,13 +559,22 @@ export function InvenTreeTable<T extends Record<string, any>>({
}, [tableState.queryFilters]);
useEffect(() => {
tableState.setIsLoading(
const loading: boolean =
isFetching ||
isLoading ||
tableOptionQuery.isFetching ||
tableOptionQuery.isLoading
);
}, [isFetching, isLoading, tableOptionQuery]);
isLoading ||
tableOptionQuery.isFetching ||
tableOptionQuery.isLoading;
if (loading != tableState.isLoading) {
tableState.setIsLoading(loading);
}
}, [
isFetching,
isLoading,
tableOptionQuery.isFetching,
tableOptionQuery.isLoading,
tableState.isLoading
]);
// Update tableState.records when new data received
useEffect(() => {

View File

@ -12,6 +12,7 @@ import {
import { ApiEndpoints } from '@lib/enums/ApiEndpoints';
import { apiUrl } from '@lib/functions/Api';
import { ModelType } from '@lib/index';
import type { TableFilter } from '@lib/types/Filters';
import type { ApiFormFieldSet } from '@lib/types/Forms';
import { PassFailButton } from '../../components/buttons/YesNoButton';
@ -257,7 +258,8 @@ export default function BuildOrderTestTable({
},
rowActions: rowActions,
tableFilters: tableFilters,
tableActions: tableActions
tableActions: tableActions,
modelType: ModelType.stockitem
}}
/>
</>

View File

@ -15,7 +15,7 @@ test('Core User/Group/Contact', async ({ browser }) => {
// users
await loadTab(page, 'Users');
await page.getByRole('cell', { name: 'admin' }).click();
await page.getByRole('cell', { name: 'admin', exact: true }).click();
await page.getByText('User: admin', { exact: true }).waitFor();
await page.getByLabel('User Details').waitFor();
await page.getByLabel('breadcrumb-1-users').click();

View File

@ -3540,9 +3540,9 @@ mantine-contextmenu@^7.15.3:
integrity sha512-qbkbumlcxvUDavqnBZHLhskXxF9mhTD3F+mQjDc2JEqGZbPr4XHRTxFw0BAc34yKOY04Iv8WGHVwastdJHOO/A==
mantine-datatable@^7.15.1:
version "7.15.1"
resolved "https://registry.yarnpkg.com/mantine-datatable/-/mantine-datatable-7.15.1.tgz#c89d55c290e3d65ed7fde777a8db938122663d5f"
integrity sha512-MwehjtkdT6FQfuPgTXmGA2Y3DmHdCdLzcl4G4LoccSpG2ul2RwEdCO/dQmrPBsNo4mMepNN9dE3/1vSuYsU+7Q==
version "7.17.1"
resolved "https://registry.yarnpkg.com/mantine-datatable/-/mantine-datatable-7.17.1.tgz#155373bfa318d5463f1aa8468b8117f97b033a2e"
integrity sha512-5GBpSTZyvVGqe2TqEaBYrZQyQjLgHuMqkb2wry+wPvwalRY0oFKG1kdFd43bxch9FOG0K0CREEa6+cYIDby55Q==
marked@^4.1.0:
version "4.3.0"