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

Document Handler - Active drawer content bug #1420

Open
OlofSvahnVbg opened this issue Oct 20, 2023 · 1 comment
Open

Document Handler - Active drawer content bug #1420

OlofSvahnVbg opened this issue Oct 20, 2023 · 1 comment
Labels

Comments

@OlofSvahnVbg
Copy link
Collaborator

OlofSvahnVbg commented Oct 20, 2023

There seems to be a problem with the client reading certain settings. In admin, these settings in "Inställningar"...

image

do not get set properly in app.js. This is because of logic in the functions isDrawerPermanent, isDrawerVisible and isDrawerStatic. In these functions there is a separate if-statement like this:

    if (drawerProps.activeDrawerContentState === null) {
      return false;
    }

The problem is that when loading the site for the first time (without local storage, or cookies etc...) the activeDrawerContentState is null.

This, in in turn, is because it gets set to null in the constructor here:

    const activeDrawerContentState = canRenderCustomDrawer
      ? activeDrawerContentFromLocalStorage !== null &&
        activeDrawerContentFromLocalStorage !== "plugins"
        ? activeDrawerContentFromLocalStorage
        : this.props.config.mapConfig.map.activeDrawerOnStart
      : canRenderDefaultDrawer
      ? "plugins"
      : null;

BUT! It seems this only happens if the "Aktiv drawer innehåll" is set to "plugins" or nothing (empty):

image

If the field is set to "documenthandler", the activeDrawerContentState gets set to this.props.config.mapConfig.map.activeDrawerOnStart.

I don't know if this is intentional or something. But it seems a bit strange.
Please comment if you know why this happens, and/or why it happens.

The bug doesn't seem to be browser specific.

@Hallbergs
Copy link
Member

Sounds like a bug to me. Not surprised since the logic around the active drawer content is a bit.... intricate.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Status: Approved ideas
Development

No branches or pull requests

2 participants