let icons be settable by loading from server endpoint #4391
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 test
to verify the unit tests pass