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 · 4 comments
Open

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

Olliwehr opened this issue Jul 2, 2024 · 4 comments
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
@bollain
Copy link
Collaborator

bollain commented Nov 22, 2024

Hey @Olliwehr - just wanted to let you know we have completed this task and it will be out in 11.1 which is due next week. When it is out I'll post the new docs here so you can see how the new API will work.

@bollain
Copy link
Collaborator

bollain commented Dec 5, 2024

The release is now live and it has this brand new API:
https://sdk.apryse.com/api/web/UI.html#.setActiveTabInPanel

This allows you to set an active tab in a modular tab panel.

If you are just using the default modular UI with no modifications, we also made setActiveLeftPanel backwards compatible. Let me know if this works for you @Olliwehr!

@Olliwehr
Copy link
Author

Olliwehr commented Dec 6, 2024

That sounds great! @bollain
Will definitely try that out 👍

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