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

Access panel contentComponent via the panel API #542

Closed
michael1997 opened this issue Mar 5, 2024 · 0 comments · Fixed by #549
Closed

Access panel contentComponent via the panel API #542

michael1997 opened this issue Mar 5, 2024 · 0 comments · Fixed by #549
Labels
enhancement New feature or request
Milestone

Comments

@michael1997
Copy link

michael1997 commented Mar 5, 2024

Is your feature request related to a problem? Please describe.
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]

In my app we have a component library where its possible to clone an existing component but getting the component used by a panel can only be accessed via the toJSON api.

Example working code:

api.addPanel({
  id: crypto.randomUUID(),
  component: api.toJSON().panels[existingPanel.id]
    .contentComponent as string,
  title: `${existingPanel.title} clone`,
})

I also may be missing something in the API.

Describe the solution you'd like
A clear and concise description of what you want to happen.

I'd like to be able to do the above without needing to go via the toJSON api. Potentially just adding the component to the public api of the panel? panel.component?

Describe alternatives you've considered
A clear and concise description of any alternative solutions or features you've considered.

Additional context
Add any other context or screenshots about the feature request here.

@mathuo mathuo linked a pull request Mar 11, 2024 that will close this issue
@mathuo mathuo added the enhancement New feature or request label Mar 11, 2024
@mathuo mathuo added this to the v1.10.2 milestone Mar 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants