Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add SelectionList concept #8054

Merged
merged 82 commits into from
Nov 27, 2024
Merged

Conversation

matmair
Copy link
Member

@matmair matmair commented Sep 2, 2024

This PR adds the concept of SelectionLists - a way to define reusable choices for parameters (optionally controllable by plugins).

This is helpful to load and sync a list of choices into multiple instances. The usage of SelectionLists could be extended in the future.

Screenshots

CUI

grafik

grafik

grafik

PUI

grafik

grafik

grafik

grafik

ToDo:

  • PUI unit testing
  • locking SelectionList
  • list deactivation logic

@matmair matmair added enhancement This is an suggested enhancement or new feature api Relates to the API Platform UI Related to the React based User Interface labels Sep 2, 2024
@matmair matmair added this to the 0.17.0 milestone Sep 2, 2024
@matmair matmair self-assigned this Sep 2, 2024
Copy link

netlify bot commented Sep 2, 2024

Deploy Preview for inventree-web-pui-preview canceled.

Name Link
🔨 Latest commit 58e321f
🔍 Latest deploy log https://app.netlify.com/sites/inventree-web-pui-preview/deploys/67466b444019620008d8ad67

Copy link

codecov bot commented Sep 2, 2024

Codecov Report

Attention: Patch coverage is 89.32384% with 30 lines in your changes missing coverage. Please review.

Project coverage is 84.59%. Comparing base (20fb125) to head (58e321f).
Report is 1 commits behind head on master.

Files with missing lines Patch % Lines
src/frontend/src/forms/selectionListFields.tsx 19.04% 17 Missing ⚠️
...rontend/src/components/forms/fields/TableField.tsx 33.33% 6 Missing ⚠️
src/frontend/src/components/render/ModelType.tsx 0.00% 2 Missing ⚠️
src/frontend/src/forms/PartForms.tsx 60.00% 1 Missing and 1 partial ⚠️
...rc/frontend/src/tables/part/SelectionListTable.tsx 90.00% 2 Missing ⚠️
...end/src/pages/Index/Settings/AdminCenter/Index.tsx 75.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #8054      +/-   ##
==========================================
+ Coverage   84.56%   84.59%   +0.03%     
==========================================
  Files        1178     1183       +5     
  Lines       53727    54000     +273     
  Branches     2027     2032       +5     
==========================================
+ Hits        45432    45682     +250     
- Misses       7789     7815      +26     
+ Partials      506      503       -3     
Flag Coverage Δ
backend 86.02% <100.00%> (+0.08%) ⬆️
migrations 42.67% <42.38%> (-0.01%) ⬇️
pui 68.98% <57.74%> (-0.09%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@matmair matmair marked this pull request as ready for review November 22, 2024 17:10
@matmair matmair closed this Nov 23, 2024
@matmair matmair reopened this Nov 23, 2024
@matmair matmair added the full-run Always do a full QC CI run label Nov 23, 2024
@matmair matmair closed this Nov 23, 2024
@matmair matmair reopened this Nov 23, 2024
@SchrodingersGat
Copy link
Member

@matmair this is looking pretty good in general. A few small notes below as I review:

Admin Center

I like the sub-table addition within the form:

image

Can we add a "number of items" column to the table? There is no way to see if a given selection list has any items until you click to edit it:

image

- Move parameter table to default accordion
@matmair
Copy link
Member Author

matmair commented Nov 25, 2024

@SchrodingersGat I have addressed all open requests

@SchrodingersGat
Copy link
Member

Can you please bump the API version? I will review again :)

@matmair
Copy link
Member Author

matmair commented Nov 25, 2024

@SchrodingersGat done

@SchrodingersGat
Copy link
Member

@matmair this is all looking nice, thanks for the good work on this!

@SchrodingersGat SchrodingersGat merged commit af39189 into inventree:master Nov 27, 2024
26 checks passed
@SchrodingersGat SchrodingersGat deleted the add-selectionList branch November 27, 2024 02:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api Relates to the API enhancement This is an suggested enhancement or new feature full-run Always do a full QC CI run Platform UI Related to the React based User Interface
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants