-
Notifications
You must be signed in to change notification settings - Fork 135
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
setPageMetadata metadata on first page load #2040
Comments
The reason for this is that the route change and thus page event is fired before the JS module is loaded and can customize the page load event. We have an option to leverage the module first page vent via the module definition in cloud service config (and frontend operator). The issue with this approach is that the module will not have total freedom in what data we pass to the page event. Anything static is good. But any dynamic data has to be restricted. Do we know the nature of the data we want to send via the page event? Is this something dynamic? (requires async request etc.) |
Generally, once the route is mounted in OCM we send some additional metadata like:
This information is available after a route change. Using react-router-dom we send additional information like this:
No async call is needed as of now, as the redux store is updated with the information we need before the route mounts |
Do you think it would be possible to create a route-based static specification of the data? Something like {
"eventConfig": {
"routes": {
"/foo/bar": {
"ocm_resource_type": "something",
...
},
...
}
}
} |
That could work for the |
We can use the router match notation to get the correct value. |
setPageMetadata does not currently send out additional metadata on first page load. This is also already called out here:
http://front-end-docs-insights.apps.ocp4.prod.psi.redhat.com/analytics
I'm creating this issue primarily for QE to reference since this has come up in our project testing (OCM). But it would be great to work on a fix!
The text was updated successfully, but these errors were encountered: