Skip to content

BUG: View DataSource should Update on base workspace change #3760

Open
@rolandschuetz

Description

@rolandschuetz

Description

A Inspector View can use a datasource. Here's a very simple example of this: https://github.com/flownative/neos-workspace-preview/blob/main/Configuration/NodeTypes.yaml#L9-L11

Now when a user changes it's base workspace, the datasource is not reloaded: https://github.com/neos/neos-ui/blob/8.4/packages/neos-ui-views/src/Data/DataLoader/index.js#L53-L56

In most cases, reloading the datasoure, when the selectors.CR.Workspaces.baseWorkspaceSelector(state),changes would be expected. As an integrator you can't even force a reload, because the arguments only support ClientEval, and in ClientEval only the node is available, and it's workspace is always the user workspace.

Steps to Reproduce

  1. Install e.g. https://github.com/flownative/neos-workspace-preview or any Inspector View that uses a datasource
  2. Open the dev tools to monitor ajax requests
  3. Changte the base workspace

Expected behavior

Datasource is updated.

Actual behavior

Outdated data.

Affected Versions

Neos: *

UI: 5.0 - 9.0

Possible solution

In the neosContextConnector add baseWorkspace: selectors.CR.Workspaces.baseWorkspaceSelector(state), and in componentDidUpdate reload if the workspace changes.

Metadata

Metadata

Assignees

No one assigned

    Labels

    8.39.0BugLabel to mark the change as bugfixUI & UX

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions