What is missing now for this to be merge-ready? ... - ui integrated plugin installing? ... _Originally posted by @matmair in https://github.com/inventree/InvenTree/issues/2074#issuecomment-969349728_
Activity
matmair commentedon Nov 17, 2021
This is easy to implement via subprocess 'pip install '... but there needs to be some infrastructure in place to get that package name.
Also there should be support for third party sources and signature verification.
matmair commentedon Nov 18, 2021
@SchrodingersGat any pointers for turning an API endpoint into a form? Struggling with adding helper texts atm
InvenTree/InvenTree/plugin/api.py
Lines 60 to 76 in bff4623
SchrodingersGat commentedon Nov 18, 2021
@matmair the API forms implementation is pretty complex, I must admit.
The client side stuff is all found in
forms.jsIf you want to add data about a field, it should be done either in the model, or in the serializer.
The API should automatically report (to the client) some metadata about the available fields, for example:
e.g.
The "metadata" is read out by performing an OPTIONS request to the API endpoint, e.g.
This provides the client (i.e. javascript) all the information it needs to render the forms.
Read the code here to see how the metadata is constructed:
https://github.com/inventree/InvenTree/blob/master/InvenTree/InvenTree/metadata.py
That should be sufficient background - let me know if you have any specific questions!
matmair commentedon Nov 18, 2021
@SchrodingersGat is the confirm button on the forms not submitted to the api?
PEP fixes
SchrodingersGat commentedon Nov 18, 2021
Correct, it only enables the "submit" button