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

[FR] PUI & Category / Location / ... icons #7237

Open
1 of 2 tasks
wolflu05 opened this issue May 15, 2024 · 3 comments
Open
1 of 2 tasks

[FR] PUI & Category / Location / ... icons #7237

wolflu05 opened this issue May 15, 2024 · 3 comments
Labels
enhancement This is an suggested enhancement or new feature part Related to Part models Platform UI Related to the React based User Interface stock Related to Stock models triage:not-checked Item was not checked by the core team

Comments

@wolflu05
Copy link
Contributor

wolflu05 commented May 15, 2024

Please verify that this feature request has NOT been suggested before.

  • I checked and didn't find a similar feature request

Problem statement

PUI doesn't show any defined icons, neither on e.g. stock location edit icon field nor the icon on the details pages, breadcrumbs, ...

Suggested solution

Because we are now using tabler icons in PUI, the old fontawesome icons are not that easily integratabtle. In this FR I would start to suggest, that we should build our own, per instance, icon library into inventree where:

  1. all icons can be get via a single url in json format
  2. maybe the server can generate a custom sprite image with all icons available on a single picture where the icon position is sent in the json endpoint referenced in point 1
  3. per default we should make the tabler icons available? But maybe add the font awesome icons as opt-in function?
  4. admins can upload custom icons (not all icons users want are available on the tabler/FA icons package)
  5. clients can the use this information to provide consistent icons across systems (PUI, App, reports, ...) with no differences between icon package dependency versions

Of course we would need some migration from front awesome icons to the new icon system, but that is TBD.

Currently icons are integrated in:

  • location icon
  • location type icon
  • category icon
    But that could be later extended, if we build this generic, and maybe add an icon field type to the PUI form framework.

Describe alternatives you've considered

Just add the font awesome icons to PUI too, but I think that's not a very clean solution, and users also are not able to define custom icons. Because that's also a big point for me, not all icons are available in the font awesome icons package.

Examples of other systems

No response

Do you want to develop this?

  • I want to develop this.
@wolflu05 wolflu05 added enhancement This is an suggested enhancement or new feature part Related to Part models stock Related to Stock models triage:not-checked Item was not checked by the core team Platform UI Related to the React based User Interface labels May 15, 2024
@SchrodingersGat
Copy link
Member

I personally don't see the benefit of this - the tabler.io icons are very extensive, and we (@LavissaWoW mostly) have already been working on a framework to map a string value to rendering an actual icon.

All we have to do is expose an API where we can list the available icons. But uploading custom icons, etc, feels like a lot of extra work

@wolflu05
Copy link
Contributor Author

Im not sure if you understand correctly what I meant. I'm not talking about icons used in PUI through the UI for a better user experience. I'm talking about the icons an InvenTree user can define for a location or a part category he created (the icons introduced by #3542).

Currently this feature is completely missing from PUI, and only works in CUI and the app. To support this, we would need to include fontawesome in PUI too, which feels wrong because:

  • it drastically will increase build size
  • there is no way it's guaranteed that an icon looks the same on all clients (font awesome version differences)
  • custom icons which are not in the fa library are not possible

Hope this clarifies my issue.

@SchrodingersGat
Copy link
Member

Ok, so my vision for icon support in PUI is:

  • We allow any icons which are mapped to "strings" in this file
  • We allow the icons to be selected from a custom drop-down item (where the "choices" are extracted from that file)
  • Support for existing font-awesome icons is dropped
  • Users can re-map icons from the old font-awesome set to our new tabler set
  • We document this (breaking) change in the release notes

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement This is an suggested enhancement or new feature part Related to Part models Platform UI Related to the React based User Interface stock Related to Stock models triage:not-checked Item was not checked by the core team
Projects
None yet
Development

No branches or pull requests

2 participants