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

Draft
wants to merge 58 commits into
base: master
Choose a base branch
from
Draft

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 ready!

Name Link
🔨 Latest commit c65e34b
🔍 Latest deploy log https://app.netlify.com/sites/inventree-web-pui-preview/deploys/671ff280b9d8af0008f7c34d
😎 Deploy Preview https://deploy-preview-8054--inventree-web-pui-preview.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.
Lighthouse
Lighthouse
1 paths audited
Performance: 100 (no change from production)
Accessibility: 86 (no change from production)
Best Practices: 100 (no change from production)
SEO: 78 (no change from production)
PWA: -
View the detailed breakdown and full score reports

To edit notification comments on pull requests, go to your Netlify site configuration.

Copy link

codecov bot commented Sep 2, 2024

Codecov Report

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

Project coverage is 84.42%. Comparing base (89946ae) to head (c65e34b).

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.40%   84.42%   +0.02%     
==========================================
  Files        1167     1171       +4     
  Lines       53057    53138      +81     
  Branches     1947     1951       +4     
==========================================
+ Hits        44782    44861      +79     
- Misses       7791     7794       +3     
+ Partials      484      483       -1     

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

@SchrodingersGat
Copy link
Member

@matmair looks like a couple of conflicts have snuck in here

@SchrodingersGat
Copy link
Member

@matmair a couple of questions here:

  1. What does the "source string" in the selection model do?
  2. Where does one edit the "entries" for each list?
  3. Should we move the "selection lists" to their own panel in the admin section? I can see that this concept might be extended to beyond just "part parameter" in the future?

@matmair
Copy link
Member Author

matmair commented Sep 14, 2024

  • What does the "source string" in the selection model do?

It can be used to identify the source with a string (with a version, a uuid or something similar). Implementing or respecting that mechanism (or not) is left to plugin implementers.

  • Where does one edit the "entries" for each list?

I seem to have forgotten that, will add soon

  • Should we move the "selection lists" to their own panel in the admin section? I can see that this concept might be extended to beyond just "part parameter" in the future?

We have a lot of sections in the Admin Center already so I thought it makes sense to keep it in the section that supports it. I can move it out if you want

@matmair matmair marked this pull request as draft September 14, 2024 12:06
@SchrodingersGat
Copy link
Member

@matmair happy to review this again if you can fix the conflicts :)

@SchrodingersGat
Copy link
Member

@matmair still some conflicts here when you are ready :)

@SchrodingersGat
Copy link
Member

@matmair what's still to go on this one?

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 Platform UI Related to the React based User Interface
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants