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

[Bug] instance.UI.setActiveLeftPanel not working in modular UI #1069

Open
Olliwehr opened this issue Jul 2, 2024 · 1 comment · May be fixed by #1070
Open

[Bug] instance.UI.setActiveLeftPanel not working in modular UI #1069

Olliwehr opened this issue Jul 2, 2024 · 1 comment · May be fixed by #1070
Assignees
Labels
bug Something isn't working

Comments

@Olliwehr
Copy link

Olliwehr commented Jul 2, 2024

When calling instance.UI.setActiveLeftPanel in combination with the modular UI, I encountered some strange behaviour.

WebViewer version

  • 10.10.1 both UI and Core
  • Modular UI (ui set to "beta")

The current behavior
There are no changes in regard to the active panel, not just when calling it with "thumbnailsPanel" but any other (valid) panel of yours.

Also, the browser console shows the following warning:

image

The expected behavior

  • No console warning
  • the panel that is supposed to be set is actually set to active

Steps to reproduce
Call instance.UI.setActiveLeftPanel("thumbnailsPanel") and take a look at the browser console

Solution Idea
I had a look at the code (./src/helpers/isDataElementLeftPanel.js) and noticed that it would probably only require the following change:

  if (customizableUI) {
    return state.viewer.genericPanels
      .filter((item) => item.location === PLACEMENT.LEFT)
      .map((item) => item.dataElement);
  }

instead of

  if (customizableUI) {
    return state.viewer.genericPanels.filter((item) => item.location === PLACEMENT.LEFT);
  }

as you filter for inclusion of concrete data-elements afterwards.

@bollain
Copy link
Collaborator

bollain commented Jul 5, 2024

Hi @Olliwehr!

Thanks for submitting this issue with a corresponding PR. We have a ticket in our backlog to fix this; with the new modular UI the tab panel can live either on the left side, or the right side, so we are creating a new API specific to the new abstraction of the modular Tab Panel.

We will also review your solution in the open PR, as it may provide a stop-gap solution while we roll out the new API. I'll update this ticket when we have a closer look.

Thanks for submitting this and testing out the new modular UI!

@bollain bollain self-assigned this Jul 5, 2024
@bollain bollain added the bug Something isn't working label Jul 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants