Add support for external icon libraries#969
Draft
arnaudvergnet wants to merge 5 commits intomasterfrom
Draft
Conversation
5339812 to
417b18f
Compare
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## develop #969 +/- ##
===========================================
- Coverage 95.93% 95.91% -0.02%
===========================================
Files 85 85
Lines 3910 3892 -18
===========================================
- Hits 3751 3733 -18
Misses 159 159
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Based on #948. Only the last 2 commits are from this PR.
Adds a new script
icon_libraries.pyinside of atoolsdirectory. This script allows users to clone an icon library such as https://pictogrammers.com/library/mdi/ inside of a static files directory in the backend. The frontend will then be able to fetch those icons without any change in the schema.The script takes a single argument telling it which icon library to clone. For now only mdi is supported.
Example usage:
This script can also be invoked from the Makefile to generate all known libraries:
The script executes the following steps for MDI:
/tmp/mdidirectorypublic/media/icon-libraries/mdiusingcairosvgmeta.jsonfrom the repo is adapted to create the filepublic/media/icon-libraries/mdi/icons.json, listing all available icons, their possible aliases and tags (to implement a nice search feature in the frontend)public/media/icon-libraries/index.jsonis updated/created to list all available icon libraries, listing their internal id and display name.This script was designed with adding support for new icon libraries in mind.
The last commit updates the Django schema to add a new
sourceproperty in theStyleImagemodel. This property will be used by the frontend to save from which icon library it was originally from.