-
Notifications
You must be signed in to change notification settings - Fork 30
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
Support hierarchical categories #87
Comments
Hi there @exp Thanks for your feedback, and yes you are completely right, the full tree implementation is missing... your patch would be a welcome addition! The reason I implemented the automatic matching between suppliers categories and InvenTree categories was to make the process of adding a part to InvenTree faster than manual one, either by recalling a previous relationship (stored in yaml files) or by partial word matching between the two category names. While you may consider those as "nice-to-have" features, I personally do enjoy their convenience. I haven't had anybody not wanting them so I would prefer keeping those. If your PR keeps those fully functional I wouldn't mind merging. If you need more in-depth explanation about the automatic match feature, let me know. Thanks! |
Hello @exp Did you have more questions regarding the use of categories in Ki-nTree? |
Hi @eeintech no that's fine, I am just trying to find time to get this coded. I'm having troubles receiving from Digikey and I would like to add a search results box too. I'll break the commits up appropriately. I should have time to work on it this week, but I have to finish the actual PCBs first ☺ |
Ok sounds good, good luck with the PCBs! |
Hi @exp How are the PCBs doing? Are you still planning to support this issue with a PR? |
Hi @eeintech I will get to this issue as soon as possible. I've had issues with getting any results at all from Digikey which makes it quite difficult to test and I've had to jump to other projects. Sorry for the delay. |
No problem, thanks for the update! |
@exp Any progress? 😄 |
Hi folks, Once upon a time I was thinking about making a 'supplier API' -> Inventree conversion program, but luckily I found Kin-tree before starting the actual coding. My original idea was to provide an Inventree category tree selector to the user in the part add dialog. When a part is added to a specific category in Inventree from a supplier category then the match would be saved to a database (SQLite for e.g.). If a category match found in this db for a new part the Inventree category would have been already selected in the new part dialog. |
@martonmiklos I have implemented some kind of automatic matching process in the category selection, either by:
Check out the
|
@exp What implementation scheme did you have in mind? How would you improve the categories window? |
Just my two cents, but how about copying the category dialog from Inventree? Instead of two seperate dropdowns for category and subcategory, have one dropdown which lists all available categories, subcategories, sub-subcategories, etc. Only problem is the custom category name option. You could again copy Inventree, and have a dedicated 'Add category' form, or just let the user type their own full category path. Eg, |
Hi All, @eeintech I planned to make the application a single unified window where possible, with a drop-down as Weissnix suggests. My inventree has quite extensive categorisation so I want to make sure they're fully supported as deep as possible, it's the matching of supplier categories I need to take a bit of time to do. Sorry again for the delay, |
Ha, I like this idea! So simple and efficient, no reinventing the wheel. @exp Let me know where can I can give you a hand, I would like to get this implemented soon 😄 |
@eeintech I ideally need to address the Inventree issue I opened regarding part boxes and storage first but I appreciate I've delayed you plenty on this. If you want to take the lead I'd really appreciate that but if not I'll try and contribute some examples in the next day. |
@exp I picked up some workload recently and have to prioritize this, as soon as I am done I wish to look into this, if you haven't already 😃 |
It's probably obvious to @eeintech but I just want to note that for proper hierarchical category support the structure of both categories.yaml and supplier_parameters.yaml would need some changes.
CATEGORIES:
Passive Components: # Level 0
Capacitors: # Level 1
Ceramic: # Level 2
Electrolytic: # Level 2
Inductors: # Level 1
Resistors: # Level 1 Of course this mixes values and keys depending on context so there are probably better solutions. I'm no yaml guru unfortunately.
|
@Fivefold There is indeed a little bit of thinking for deeper category trees.
That's correct and if user picks a sub-category, the code used is from its parent.
Right, it could be updated to a dictionary based on InvenTree categories.
Indeed to lower the complexity, parameters are shared across top-level categories, and not sub-categories. Here are some thoughts, dreaming a tiny bit bigger:
|
@martonmiklos Nice work! Any chance you could share your implementation with us? |
@eeintech The code lives here: It is above a TME support branch, but I plan to rebase to master when I am done. |
@martonmiklos Thanks, I'll try to take a look soon 😃 |
Okay just for sync up here is my vision on how should it look like (in the case if InvenTree export is selected): Ki-n-tree has an InvenTree PK - supplier category identifier lookup In the case if no mapping found this line shall be hidden and when the user hits the submit the category selection dialog shall be shown next. |
That's a good idea actually, I haven't thought of merging the part form window with category window.
If I'm not mistaken, that would be two ways to select categories with two different flows (first is nested inside the part form window and second is after the part form window, as it is now). I'm not sure why you want those two flows... I would prefer to stick to your original idea and, when there is no match, using the edit button would be the only way to select the category. The Edit category window you showed looks cool, is it functional? |
@martonmiklos I'm thinking to first merge and cut the |
The improved category selection is heavily WIP, and I have no idea when will I find some time to finish. So my recommendation is to go ahead, I will handle the rebase on my fork. |
I apologize I forgot to reply to this one.
You might misunderstood me. My plan is to make a single window to select the category, and it would allow two way for category selection: tree based approach from InvenTree and selection from the recent list. The current flow is : In the case if there is category match it is reduced to: If there is no category match then the current flow is being executed.
The tree selection side is functional the recent list is not yet. From my side this week is quite busy, if you can move things forward on my work feel free to do so. I can catch up with it next week. |
Hello @martonmiklos @exp I have gotten feedback on the category selector and have found multiple issue with old code which I want to fix now and release in a newer version of Ki-nTree (thinking |
Hey, Uhm yes. I messed up that branch a bit as I used to...
Before moving forward I need to separate these things, preferably rebase the TME and merge that first. |
@martonmiklos What is TME? Happy to discuss it 👍 If you do some clean-up let me know! |
Hi @eeintech , |
Hello @hvraven Actually I was thinking to deprecate the Supplier category lookups for The Also do you mind sharing a overall glimpse at your category mapping (you don't have to share the full file, just let me know the structure so I can try to reproduce)? Thanks! |
Ki-nTree is designed with the idea of a top level parent category, and then a subcategory. This is a little restrictive and doesn't match how my categories are set up in Inventree.
I've prepared a patch to implement hierarchical categories for the setup function and the user category select screen, but before proposing a PR I thought I'd open an Issue for discussion.
I don't understand why Digikey's categories are merged with the user's category list in this screen, nor the rationale behind integration of categories with Kicad. I think there are a few valid options for how these could be handled, so if you are open to adding this feature could you let me know how you'd like it integrated best?
Thanks.
The text was updated successfully, but these errors were encountered: