Repository navigation
Conversation
Member
Author
|
I'd still like to get this into 4.0 if possible, |
Member
|
I'm okay with the principle... just want to think about the implementation a bit and how this sits with existing ways a node can provide icons and our general API structure. We already provide a way for a node to expose additional resources to the editor (https://nodered.org/docs/creating-nodes/resources) which get exposed under We also track what static icons a node provides and they get exposed under I'd like to find an api design that feels part of this structure - just not sure what that is yet. Will have a poke at how the existing routes are managed. |
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.
Proposed changes
This PR lets editor node icons be createable (eg from a library) rather than purely static. They are only created at load time (so not fully dynamic... it's not a dashboard after all :-) .
They can then be set in the html file by creating an admin endpoint eg (using th feather-icons package
and then called by something like
In this PR the server side does expect the node.type (in the lines above = example) and to end with .svg - but this can be discussed changed in the PR... eg it could also be extended to allow .png - but creating dynamic png would be harder...
NOTE: it does mean that the get function above must return an SVG of suitable size - ie about 35-40px wide.
Checklist
npm run testto verify the unit tests pass