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

FEATURE: Support preview uris in datasource selectboxeditor #2930

Merged
merged 1 commit into from
Jul 28, 2021

Conversation

Sebobo
Copy link
Member

@Sebobo Sebobo commented Jul 27, 2021

What I did

Options returned from a datasource can now contain a preview with an absolute image uri which will then be shown in the dropdown.

How I did it

Use new option component supporting previews for data source based selectboxeditor.
Works almost identically to the AssetOption of the AssetEditor.

How to verify it

Bildschirmfoto 2021-07-27 um 08 42 42

Also added a test.

Resolves: #2914

Copy link
Member

@markusguenther markusguenther left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Works pretty fine and is a great improvement for the UI.

Copy link
Member

@jonnitto jonnitto left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Really nice addition, like always ❤️

@JPLudin
Copy link

JPLudin commented Jul 3, 2023

In contrast to your plugin Shel.Neos.PreviewSelectBox this seems to works only for data sources, not for manually defined values, is that on purpose?

            'iconName':
              type: string
              ui:
                label: Icon
                inspector:
                  group: general
                  editor: 'Neos.Neos/Inspector/Editors/SelectBoxEditor'
                  editorOptions:
                    values:
                      activity:
                        preview: /Resources/Private/Fusion/Presentation/Atom/Icon/Assets/activity.svg
                        label: activity
                      ..

@mhsdesign
Copy link
Member

I guess it should be a in the format of a flow resource stream wrapper: resource://My.Package/Public/lol.svg but you might need to (wrongly) leave out the public part see #2092 (comment)

@rolandschuetz
Copy link
Contributor

No, neither version works

@Sebobo Sebobo deleted the feature/select-box-previews branch September 25, 2023 18:23
@Sebobo
Copy link
Member Author

Sebobo commented Sep 25, 2023

Hi @JPLudin, both my plugin and this change do the same, and both mention that you should absolute URIs, as relative URIs are not reliable.
If one works for you I think this must be a coincidence depending on the environment.

You can check in the dev tools which uri it tries to open and then adjust your uri. Or use a datasource and properly resolve it to absolute Uris to have no problem with environments/hosting, etc.

@rolandschuetz
Copy link
Contributor

@Sebobo As described above, exactly this code works with your plugin, but not with the code.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Allow custom previews in selectboxes
6 participants