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 53 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 4c1c66c
🔍 Latest deploy log https://app.netlify.com/sites/inventree-web-pui-preview/deploys/66f540cb9273680008f5159d
😎 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: 99 (🔴 down 1 from production)
Accessibility: 86 (no change from production)
Best Practices: 92 (no change from production)
SEO: 70 (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 85.96491% with 32 lines in your changes missing coverage. Please review.

Project coverage is 84.43%. Comparing base (194640f) to head (4c1c66c).

Files with missing lines Patch % Lines
src/frontend/src/forms/selectionListFields.tsx 19.04% 17 Missing ⚠️
...rontend/src/components/forms/fields/TableField.tsx 28.57% 9 Missing and 1 partial ⚠️
src/frontend/src/components/render/ModelType.tsx 0.00% 2 Missing ⚠️
...rc/frontend/src/tables/part/SelectionListTable.tsx 90.00% 2 Missing ⚠️
src/frontend/src/forms/PartForms.tsx 80.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #8054      +/-   ##
==========================================
- Coverage   84.53%   84.43%   -0.10%     
==========================================
  Files        1161     1154       -7     
  Lines       52068    51464     -604     
  Branches     1869     1810      -59     
==========================================
- Hits        44016    43456     -560     
+ Misses       7834     7799      -35     
+ Partials      218      209       -9     

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

@matmair matmair closed this Sep 9, 2024
@matmair matmair reopened this Sep 9, 2024
@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 :)

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