-
-
Notifications
You must be signed in to change notification settings - Fork 131
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: View DataSource should Update on base workspace change #3760
Comments
i noticed this problem when using The resolve method will create a cache identifier of all the passed options
And as the const baseWorkspaceName = useSelector(selectors.CR.Workspaces.baseWorkspaceSelector);
const dataSourcesDataLoader = neos.globalRegistry.get("dataLoaders").get("DataSources");
dataSourcesDataLoader.resolveValue({
contextNodePath: documentNode.contextPath,
dataSourceIdentifier: "vendor-site-data-source",
// to invalidate datasource cache
__baseWorkspaceName: baseWorkspaceName,
}).then((result) => {
console.log(result)
}); |
Sounds good, can we bring this in the neos-ui? |
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
Expected behavior
Datasource is updated.
Actual behavior
Outdated data.
Affected Versions
Neos: *
UI: 5.0 - 9.0
Possible solution
In the
neosContextConnector
addbaseWorkspace: selectors.CR.Workspaces.baseWorkspaceSelector(state),
and incomponentDidUpdate
reload if the workspace changes.The text was updated successfully, but these errors were encountered: