Shahenshah Malik
02/13/2025, 11:03 AMsetContext({
backend: factory()
.onHostname("<https://abc.cloud.gooddata.com>")
.withAuthentication(new TigerTokenAuthProvider(token)),
workspaceId,
});
now what I'm trying to do is change the workspace id and reset the context, but it's saying Context is already set
my question is, is there a way to clear previous context without reloading the page ?
Appreciate any helpRadek Novacek
02/13/2025, 4:03 PMShahenshah Malik
02/13/2025, 4:04 PMShahenshah Malik
02/14/2025, 4:23 PMlocation.reload()
or `window.location.href=`path``
Let me know if there's any other way, I've tried everything I could think ofRadek Novacek
02/18/2025, 8:53 AMRadek Novacek
02/21/2025, 5:06 PMexport type CustomElementContext = {
backend: IAnalyticalBackend;
workspaceId?: string;
mapboxToken?: string;
};
(https://github.com/gooddata/gooddata-ui-sdk/blob/32c38de65a1572c029244e2431e0c5c8396467bb/libs/sdk-ui-web-components/src/context.ts#L45)Shahenshah Malik
03/03/2025, 6:24 PMCustomElementAdapter.ts:50 Failed to load dependencies for the visualization Invariant Violation: Workspace must be provided either through script URL or directly in HTML.
Radek Novacek
03/12/2025, 4:21 PMShahenshah Malik
03/12/2025, 4:22 PMShahenshah Malik
06/26/2025, 1:05 PMRadek Novacek
06/26/2025, 2:39 PMShahenshah Malik
06/26/2025, 2:41 PMShahenshah Malik
06/26/2025, 4:00 PM// Create the script content with imports and context setup
script.textContent = `
import { setContext } from "<https://someDomain.cloud.gooddata.com/components/${workspaceId}.js>";
import factory, { TigerTokenAuthProvider } from "<https://someDomain.cloud.gooddata.com/components/tigerBackend.js>";
try {
setContext({
backend: factory()
.onHostname("<https://innerspace.cloud.gooddata.com>")
.withAuthentication(new TigerTokenAuthProvider("${token}")),
workspaceId: "${workspaceId}",
});
} catch(e) {
// console.log('Context set');
}
`;
Shahenshah Malik
06/26/2025, 4:01 PMSameer Hasan
06/26/2025, 4:10 PM