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

Invalid resolve_placement code in generated plugin skeleton #106

Open
gboeer opened this issue Jan 25, 2024 · 0 comments
Open

Invalid resolve_placement code in generated plugin skeleton #106

gboeer opened this issue Jan 25, 2024 · 0 comments

Comments

@gboeer
Copy link

gboeer commented Jan 25, 2024

The 'plugins' plugin has an operation to generate a plugin skeleton.
When selecting the 'Has Placement' option, the generated code (at least the one which can be previewed) does not contain valid code.

E.g., the preview code shows

def resolve_placement(self, ctx):
        return types.Placement(
            types.Places.SAMPLES-GRID-SECONDARY-ACTIONS,
            label="My placement label",
            icon="/path/to/icon.svg",
            prompt=False
        )

While it should be

def resolve_placement(self, ctx):
        return types.Placement(
            types.Places.SAMPLES_GRID_SECONDARY_ACTIONS,
            types.Button(
                label="My placement label",
                icon="/path/to/icon.svg",
                prompt=False,
            ),
        )

Note, the invalid type types.Places.SAMPLES-GRID-SECONDARY-ACTIONS
and also the returned type is a single tuple instead of a tuple of tuples, which in my case does not produce any icon at all.
Only when I change my plugin code to the second variant (tuple of tuples) an icon will be shown.

The cause of the error should be in the function
https://github.com/voxel51/fiftyone-plugins/blob/5c800f1ded53c285f8e17f37e1ad9b2472fa93e7/plugins/plugins/__init__.py#L1630C1-L1656C18

@gboeer gboeer changed the title Invalid resolve_placement code Generated plugins skeleton not Invalid resolve_placement code in plugin skeleton generated Jan 25, 2024
@gboeer gboeer changed the title Invalid resolve_placement code in plugin skeleton generated Invalid resolve_placement code in generated plugin skeleton Jan 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant