Skip to content

[pull] master from inventree:master - #148

Merged
pull[bot] merged 4 commits into
Latitudes-Dev:masterfrom
inventree:master
Apr 26, 2026
Merged

pull[bot] merged 4 commits into
Latitudes-Dev:masterfrom
inventree:master

Conversation

@pull

@pull pull Bot commented Apr 26, 2026 •

Copy link
Copy Markdown

See Commits and Changes for more details.


Created by pull[bot] (v2.0.0-alpha.4)

Can you help keep this open source service alive? 💖 Please sponsor : )

Greptile Summary

This PR syncs upstream InvenTree changes, introducing multi-level BOM subassembly row expansion, a new BOM edit-mode toggle, a reorganised System Settings tab layout, and a bug fix for the test-result refresh callback in StockItemTestResultTable. All changes are accompanied by updated Playwright tests and documentation.

Confidence Score: 4/5

Safe to merge — all findings are P2; no data loss, security, or runtime-crash risks identified.

Only P2 findings: a React hooks naming convention violation in BomSubassemblyTable, a UX regression (cell-click navigation removed), and a settings UI misclassification (SIGNUP_GROUP under SSO). No P0/P1 issues found.

src/frontend/src/tables/bom/BomSubassemblyTable.tsx (hooks naming) and src/frontend/src/pages/Index/Settings/SystemSettings.tsx (SIGNUP_GROUP placement).

Important Files Changed

Filename Overview
src/frontend/src/tables/bom/BomSubassemblyTable.tsx New component implementing recursive BOM sub-assembly expansion; exports subassemblyRowExpansion which calls React hooks but is not named with the use prefix, violating the Rules of Hooks naming convention.
src/frontend/src/tables/bom/BomTable.tsx Adds edit-mode toggle, row expansion for sub-assemblies, fixes typo (editSubstitues → editSubstitutes), and adds Math.max(0, ...) guard for can_build; onCellClick: () => {} disables previous cell-click-to-navigate behaviour for all BOM rows.
src/frontend/src/pages/Index/Settings/SystemSettings.tsx Consolidates settings tabs (Labels→Reporting, separate order tabs→grouped, renamed icons); SIGNUP_GROUP relocated to SSO section despite applying to all registration flows.
src/frontend/src/tables/stock/StockItemTestResultTable.tsx Bug fix: replaces the incorrectly wrapped onFormSuccess: () => table.refreshTable (which returned the function without calling it) with table: table so the refresh fires correctly after editing a test result.
src/backend/InvenTree/common/setting/user.py Adds SHOW_BOM_SUBASSEMBLY_LEVELS user setting (bool, default True) for the new sub-assembly display mode.

Flowchart

%%{init: {'theme': 'neutral'}}%%
flowchart TD
    A[BomTable] -->|view mode| B{SHOW_BOM_SUBASSEMBLY_LEVELS?}
    B -->|true| C[subassemblyRowExpansion returns config]
    B -->|false| D[rowExpansion = undefined]
    C --> E[Row expanded?]
    E -->|yes| F[BomSubassemblyTable partId=sub_part]
    F --> G{SHOW_BOM_SUBASSEMBLY_LEVELS?}
    G -->|true| H[Nested subassemblyRowExpansion]
    H --> E
    G -->|false| I[No further expansion]
    A -->|edit mode| J[rowExpansion disabled, rowActions enabled, selection enabled]
Loading

Comments Outside Diff (3)

  1. src/frontend/src/tables/bom/BomSubassemblyTable.tsx, line 435-459 (link)

    Custom hook missing use prefix

    subassemblyRowExpansion internally calls useUserSettingsState() and useMemo(), making it a custom hook by React's rules. Without the use prefix, the ESLint react-hooks plugin will not apply Rules of Hooks enforcement inside it — meaning a future caller could accidentally invoke it conditionally (e.g., inside a useMemo or an if branch) and the linter won't catch the violation.

    All call sites (BomTable and BomSubassemblyTable) would need to be updated to useSubassemblyRowExpansion(...) as well.

  2. src/frontend/src/pages/Index/Settings/SystemSettings.tsx, line 128-141 (link)

    SIGNUP_GROUP misclassified under SSO settings

    SIGNUP_GROUP ("Group to which new users are assigned on registration") applies to all registration flows, not just SSO. Its backend description even notes "If SSO group sync is enabled, this group is only set if no group can be assigned from the IdP" — confirming it is primarily a general-registration setting. Moving it under the "Single Sign-On (SSO) Settings" heading will make it invisible to admins who use standard (non-SSO) registration, potentially causing accidental misconfiguration.

    Consider keeping SIGNUP_GROUP (and LOGIN_SIGNUP_MAIL_RESTRICTION) in the general login/signup group above the SSO heading. Was moving SIGNUP_GROUP into the SSO section intentional? It applies to all new-user registrations, not only SSO-based ones.

  3. src/frontend/src/tables/bom/BomTable.tsx, line 730 (link)

    Cell-click navigation disabled for all BOM rows

    Setting onCellClick: () => {} short-circuits the InvenTreeTable handler: when onCellClick is provided the table never falls through to the modelType-based navigation (see InvenTreeTable.tsx line 669-682). This removes the existing behaviour where clicking any BOM row navigated to the sub-part's detail page — even for non-assembly leaf parts that have no row expansion.

    The same pattern is used in BuildLineTable, so this appears intentional, but it is a user-facing regression worth calling out explicitly.

Prompt To Fix All With AI
This is a comment left during a code review.
Path: src/frontend/src/tables/bom/BomSubassemblyTable.tsx
Line: 435-459

Comment:
**Custom hook missing `use` prefix**

`subassemblyRowExpansion` internally calls `useUserSettingsState()` and `useMemo()`, making it a custom hook by React's rules. Without the `use` prefix, the ESLint `react-hooks` plugin will not apply Rules of Hooks enforcement inside it — meaning a future caller could accidentally invoke it conditionally (e.g., inside a `useMemo` or an `if` branch) and the linter won't catch the violation.

All call sites (`BomTable` and `BomSubassemblyTable`) would need to be updated to `useSubassemblyRowExpansion(...)` as well.

```suggestion
export function useSubassemblyRowExpansion({
  table
}: {
  table: TableState;
}) {
```

How can I resolve this? If you propose a fix, please make it concise.

---

This is a comment left during a code review.
Path: src/frontend/src/pages/Index/Settings/SystemSettings.tsx
Line: 128-141

Comment:
**`SIGNUP_GROUP` misclassified under SSO settings**

`SIGNUP_GROUP` ("Group to which new users are assigned on registration") applies to **all** registration flows, not just SSO. Its backend description even notes "If SSO group sync is enabled, this group is only set if no group can be assigned from the IdP" — confirming it is primarily a general-registration setting. Moving it under the "Single Sign-On (SSO) Settings" heading will make it invisible to admins who use standard (non-SSO) registration, potentially causing accidental misconfiguration.

Consider keeping `SIGNUP_GROUP` (and `LOGIN_SIGNUP_MAIL_RESTRICTION`) in the general login/signup group above the SSO heading.

How can I resolve this? If you propose a fix, please make it concise.

---

This is a comment left during a code review.
Path: src/frontend/src/tables/bom/BomTable.tsx
Line: 730

Comment:
**Cell-click navigation disabled for all BOM rows**

Setting `onCellClick: () => {}` short-circuits the `InvenTreeTable` handler: when `onCellClick` is provided the table never falls through to the `modelType`-based navigation (see `InvenTreeTable.tsx` line 669-682). This removes the existing behaviour where clicking any BOM row navigated to the sub-part's detail page — even for non-assembly leaf parts that have no row expansion.

The same pattern is used in `BuildLineTable`, so this appears intentional, but it is a user-facing regression worth calling out explicitly.

How can I resolve this? If you propose a fix, please make it concise.

Reviews (1): Last reviewed commit: "[UI] BOM row expand (#11809)" | Re-trigger Greptile

SchrodingersGat and others added 4 commits April 26, 2026 12:49
* Support minimum column width

* Adjust DescriptionColumn and StatusColumn

* Column refactoring

* Refactor PartColumn

* Refactor LineItemsProgerssColumn

* Tweaks

* Ensure "can_build" value is not negative

* Render row expansion icon

* Add subassembly table for BOM

* Add controls for BOM editing

* Fix row click context

* Improve rendering for BOM sub-rows

* Hide BOM actions unless editing

* Disable row expansion for now

* Revert gitleaks changes

* Remove gitleaks tags

* Remove dead code

* Remove commented code

* Adjust playwright tests

Co-authored-by: Copilot <copilot@github.com>

* Update docs

Co-authored-by: Copilot <copilot@github.com>

* Further playwright fixes

---------

Co-authored-by: Copilot <copilot@github.com>
* Adjust system settings

- Rearrange settings to match major menu groups
- Split long settings panels into separate lists

Co-authored-by: Copilot <copilot@github.com>

* Adjust playwright tests

---------

Co-authored-by: Copilot <copilot@github.com>
* Add subassembly expansion

Co-authored-by: Copilot <copilot@github.com>

* Enable multi-level subassembly display

Co-authored-by: Copilot <copilot@github.com>

* Adjust padding

* Adds user setting to enable / disable subassembly view

Co-authored-by: Copilot <copilot@github.com>

* Add icon

* Additional playwright tests

Co-authored-by: Copilot <copilot@github.com>

---------

Co-authored-by: Copilot <copilot@github.com>
@pull pull Bot locked and limited conversation to collaborators Apr 26, 2026
@pull pull Bot added the ⤵️ pull label Apr 26, 2026
@pull
pull Bot merged commit f271725 into Latitudes-Dev:master Apr 26, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant