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
FEATURE: Introduce icon configuration for nodetypes #3042
FEATURE: Introduce icon configuration for nodetypes #3042
Conversation
const label = $get('label', ui); | ||
const useLargeIcon = ('largeIcon' in ui); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
what's the difference between ('largeIcon' in ui);
and $get('icon', ui)
? Why not use the same method?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This checks if we have the largeIcon
property in the options.
And then we use the icon
or the largeIcon
What I'm missing is the documentation part… |
@jonnitto We have no documentation in Code... so when we merge this we need to adjust the docs in the neos/neos package. |
Question: I did not use all possible scaling values from font-awesome because I thought it looks ugly when you scale higher than 3 times. And they support up to 10x. Is that ok? Or should we also support the others. |
Then we should call the parameter not |
TBH, I had also issued to name the property. My goal was to have an extra icon for the select node dialog and choose As we have an 8.0 we can maybe change the whole naming. Make something like
We, of course need to keep the old icon for compatibility reasons, as we did not deprecate the icon before. |
then how about introducing |
So, just |
i like that the 'normal' config for icon is flat like the name I at first thought the |
How about naming the config key "preview" and use this for the creation dialog with a fallback to "icon" if no preview exists. |
That would have the advantage that the integrator would know what they are defining in yaml. |
Ok so we use the |
Maybe display previews larger and allow icon names in there aswell as svg resources. That way we get away with a single configuration option. |
Hmm the icon name and SVG is already possible, but the in the dialog the scaling is at the moment always 2x. With SVG the scaling is not adjustable. Therefore the idea to have a second configuration for the size. |
So the name would be |
Would leave the size setting for now and just assume that previews are larger than icons. If no preview is configured the previous size is used. If a preview is set a bigger size is used even if the preview is an icon. |
But having a bigger size for the preview is maybe irritating to the users. But if this is not the most wanted feature I will skip that and start with the extra preview icon 🙃 |
I would like to have the option for the size. I would have a current use case for this… |
Fine if there is an actual useCase ... i was just against adding things that might be useful one day. |
If you use custom icons, you want to use detailed icons, which describes the use case better, in the node type model. But then the detailed icon is not the best choice for the document or content tree. So, this feature will bring a new configuration to have a different icon for the node type dialog tiles. We can now configure a icon and a largeIcon setting for the node type.
To be able to configure the scaling of the largeIcon option we also introduce the largeIconSize.
ed91154
to
3f97635
Compare
Renamed it now so we have something like this.
|
Naming things… Why it is called |
Can also name it like this. Named it preview as it was a suggestion and had two likes ;) |
So now we have something like this :)
|
Thanks for the feedback and reviews 💙 |
The neos-ui introduces a new NodeType setting called previewIcon and previewIconSize. As the neos-ui does not contain documentation, the PR will add the new options here. The change also adjust the icon description, as we are now able to use custom SVG icons. Related PR: neos/neos-ui#3042
The neos-ui introduces a new NodeType setting called previewIcon and previewIconSize. As the neos-ui does not contain documentation, the PR will add the new options here. The change also adjust the icon description, as we are now able to use custom SVG icons. Related PR: neos/neos-ui#3042
The neos-ui introduces a new NodeType setting called previewIcon and previewIconSize. As the neos-ui does not contain documentation, the PR will add the new options here. The change also adjust the icon description, as we are now able to use custom SVG icons. Related PR: neos/neos-ui#3042
What I did
Added a new option
largeIcon
and the node type item component checks if we configure a larger icon and render this instead if the regular icon. The larger icon also uses the doubled size if we don't configure alargeIconSize
, which allows values like['xs', 'sm', 'lg', '2x', '3x']
.The regular icon will be used in the trees, sidebars and so on.
The large icon is detailed and for the dialog with the tiles and as the detailed icon probably look inappropriate for the tree and so on we use the regular icon here.
How to verify it
Configure a node type with the property
largeIcon
and check the select node type dialog after that.resolves: #3041